feat: add inline notification component#301
Open
jz5426 wants to merge 35 commits into
Open
Conversation
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
👷 Deploy request for carbon-components-builder pending review.Visit the deploys page to approve it
|
added 5 commits
February 29, 2024 14:45
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
Contributor
Author
|
Verified that the component features and export works. |
added 4 commits
April 18, 2024 12:40
…notification_clean
jz5426
force-pushed
the
notification_clean
branch
from
May 10, 2024 14:08
699b295 to
b297629
Compare
…on-ui-builder into notification_clean
zvonimirfras
requested changes
Jul 16, 2024
zvonimirfras
left a comment
Member
There was a problem hiding this comment.
-
notification and toast are separate components in both implementations, why stuff them into the same component here?
-
styling with the ternary operators is all over the place
| id: string; | ||
| type: string; | ||
| lowContrast?: boolean; | ||
| hideCloseButton?: boolean; |
Member
There was a problem hiding this comment.
property name that sounds like a function
| ...commonSlots, | ||
| ...slotsDisabled, | ||
| lowContrast: 'boolean', | ||
| isLowContrast: (state: NotificationState) => ({ |
Comment on lines
+62
to
+64
| link: 'string', | ||
| subtitleText: 'string', | ||
| linkText: 'string', |
Member
There was a problem hiding this comment.
link vs linkText... might need clearer naming
| linkText: 'string', | ||
| title: 'string', | ||
| iconDescription: 'string', | ||
| captionText: 'string' |
Comment on lines
+83
to
+105
| state.variant === 'toastNotification' | ||
| ? <ToastNotification | ||
| className={state.cssClasses?.map((cc: any) => cc.id).join(' ')} | ||
| onClick={() => { | ||
| sendSignal(state.id, 'click'); | ||
| }} | ||
| onChange={(event: any) => { | ||
| sendSignal(state.id, 'valueChange', [event.value], { ...state, value: event.value }); | ||
| }} | ||
| caption={state.captionText} | ||
| iconDescription={state.iconDescription} | ||
| hideCloseButton={state.hideCloseButton} | ||
| lowContrast={state.lowContrast} | ||
| kind={state.kind} | ||
| subtitle={state.subtitleText} | ||
| timeout={0} | ||
| title={state.title} /> | ||
| : <InlineNotification | ||
| className={state.cssClasses?.map((cc: any) => cc.id).join(' ')} | ||
| kind={state.kind} | ||
| iconDescription={state.iconDescription} | ||
| subtitle= {state.subtitleText} | ||
| title={state.title} /> |
Comment on lines
+100
to
+107
| selectedComponent.variant === 'toastNotification' && <TextInput | ||
| light | ||
| value={selectedComponent.captionText} | ||
| labelText='Caption text' | ||
| onChange={(event: any) => setComponent({ | ||
| ...selectedComponent, | ||
| captionText: event.currentTarget.value | ||
| })} /> |
Comment on lines
+139
to
+155
| componentObj.variant === 'toastNotification' | ||
| ? <ToastNotification | ||
| className={cx(preventCheckEventStyle, componentObj.cssClasses?.map((cc: any) => cc.id).join(' '))} | ||
| caption={componentObj.captionText} | ||
| hideCloseButton={componentObj.hideCloseButton} | ||
| lowContrast={componentObj.lowContrast} | ||
| kind={componentObj.kind} | ||
| subtitle={componentObj.subtitleText} | ||
| timeout={0} | ||
| title={componentObj.title} /> | ||
| : <InlineNotification | ||
| className={cx(preventCheckEventStyle, componentObj.cssClasses?.map((cc: any) => cc.id).join(' '))} | ||
| kind={componentObj.kind} | ||
| hideCloseButton={componentObj.hideCloseButton} | ||
| lowContrast={componentObj.lowContrast} | ||
| subtitle={componentObj.subtitleText} | ||
| title={componentObj.title} /> |
Comment on lines
+191
to
+198
| ? `<cds-toast | ||
| ${angularClassNamesFromComponentObj(json)} | ||
| [notificationObj]="${nameStringToVariableString(json.codeContext?.name)}notificationObj"> | ||
| </cds-toast>` | ||
| : `<cds-inline-notification | ||
| ${angularClassNamesFromComponentObj(json)} | ||
| [notificationObj]="${nameStringToVariableString(json.codeContext?.name)}notificationObj"> | ||
| </cds-inline-notification>` |
Comment on lines
+208
to
+211
| ${json.variant === 'toastNotification' ? | ||
| `caption: "${json.captionText ? json.captionText : ''}",` : `message: "${json.captionText ? json.captionText : ''}",`} | ||
| lowContrast:${json.lowContrast ? json.lowContrast : false}, | ||
| showClose: ${!json.hideCloseButton} |
Co-authored-by: Zvonimir Fras <zvonimir.fras@gmail.com>
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
…on-ui-builder into notification_clean
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
added 2 commits
July 25, 2024 13:05
added 3 commits
July 25, 2024 13:07
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
zvonimirfras
requested changes
Aug 1, 2024
zvonimirfras
left a comment
Member
There was a problem hiding this comment.
Should it be notification instead of inline-notification? 🤔
cc: @Akshat55
Co-authored-by: Zvonimir Fras <zvonimir.fras@gmail.com>
…on-ui-builder into notification_clean
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
zvonimirfras
requested changes
Aug 8, 2024
zvonimirfras
left a comment
Member
There was a problem hiding this comment.
Should subtitle be caption?
zvonimirfras
reviewed
Aug 8, 2024
Co-authored-by: Zvonimir Fras <zvonimir.fras@gmail.com>
Co-authored-by: Zvonimir Fras <zvonimir.fras@gmail.com>
Contributor
Author
no |
Signed-off-by: Max You <JianzhongMax.You@ibm.com>
Member
please explain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for #159