@czi-sds/mcp 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/component-props/Accordion.json +14 -15
- package/data/component-props/Alert.json +2 -44
- package/data/component-props/Autocomplete.json +14 -32
- package/data/component-props/Banner.json +11 -12
- package/data/component-props/Button.json +17 -82
- package/data/component-props/ButtonDropdown.json +26 -0
- package/data/component-props/ButtonIcon.json +4 -60
- package/data/component-props/ButtonToggle.json +2 -66
- package/data/component-props/Callout.json +11 -65
- package/data/component-props/CellBasic.json +28 -56
- package/data/component-props/CellComponent.json +4 -32
- package/data/component-props/CellHeader.json +13 -49
- package/data/component-props/ComplexFilter.json +24 -4
- package/data/component-props/ContentCard.json +66 -2
- package/data/component-props/Dialog.json +26 -0
- package/data/component-props/Dropdown.json +29 -67
- package/data/component-props/DropdownMenu.json +16 -56
- package/data/component-props/HeatmapChart.json +6 -87
- package/data/component-props/Icon.json +3 -8
- package/data/component-props/InputCheckbox.json +5 -53
- package/data/component-props/InputDropdown.json +11 -33
- package/data/component-props/InputRadio.json +5 -53
- package/data/component-props/InputSearch.json +6 -70
- package/data/component-props/InputSlider.json +21 -35
- package/data/component-props/InputText.json +7 -63
- package/data/component-props/InputToggle.json +5 -54
- package/data/component-props/Link.json +18 -0
- package/data/component-props/LoadingIndicator.json +1 -2
- package/data/component-props/MenuItem.json +11 -41
- package/data/component-props/MenuSelect.json +4 -67
- package/data/component-props/NavigationFooter.json +0 -8
- package/data/component-props/NavigationHeader.json +14 -65
- package/data/component-props/NavigationJumpTo.json +0 -40
- package/data/component-props/Notification.json +14 -58
- package/data/component-props/Pagination.json +8 -33
- package/data/component-props/Panel.json +4 -54
- package/data/component-props/SegmentedControl.json +0 -55
- package/data/component-props/TableRow.json +10 -38
- package/data/component-props/Tabs.json +18 -0
- package/data/component-props/Tag.json +10 -56
- package/data/component-props/TagFilter.json +0 -47
- package/data/component-props/Tooltip.json +12 -61
- package/data/component-props/TooltipCondensed.json +18 -0
- package/data/component-props/TooltipTable.json +0 -4
- package/data/zeroheight-exports/Accordion.md +167 -125
- package/data/zeroheight-exports/Banner.md +71 -48
- package/data/zeroheight-exports/Borders.md +72 -73
- package/data/zeroheight-exports/Buttons.md +375 -330
- package/data/zeroheight-exports/Callout.md +138 -116
- package/data/zeroheight-exports/Colors.md +254 -255
- package/data/zeroheight-exports/Content-Card.md +36 -37
- package/data/zeroheight-exports/Contributing-to-SDS.md +34 -35
- package/data/zeroheight-exports/Control-Inputs.md +289 -234
- package/data/zeroheight-exports/Corners.md +63 -64
- package/data/zeroheight-exports/Cover-page.md +0 -1
- package/data/zeroheight-exports/Dialog.md +237 -179
- package/data/zeroheight-exports/Downloads.md +10 -11
- package/data/zeroheight-exports/Drop-Shadows.md +40 -41
- package/data/zeroheight-exports/Dropdown-Input.md +158 -127
- package/data/zeroheight-exports/Dropdown-Menu.md +814 -718
- package/data/zeroheight-exports/Element-Status-Tracker.md +191 -192
- package/data/zeroheight-exports/Field-Inputs.md +149 -130
- package/data/zeroheight-exports/Filters.md +114 -94
- package/data/zeroheight-exports/Getting-Started.md +112 -249
- package/data/zeroheight-exports/Hero.md +43 -37
- package/data/zeroheight-exports/Icons.md +205 -206
- package/data/zeroheight-exports/Intent.md +6 -7
- package/data/zeroheight-exports/Introduction-to-Bases.md +8 -9
- package/data/zeroheight-exports/Introduction-to-Cells.md +11 -12
- package/data/zeroheight-exports/Introduction-to-DNA.md +8 -9
- package/data/zeroheight-exports/Introduction-to-Genes.md +8 -9
- package/data/zeroheight-exports/Introduction.md +52 -53
- package/data/zeroheight-exports/Link.md +50 -37
- package/data/zeroheight-exports/Lists.md +78 -63
- package/data/zeroheight-exports/Loading-Indicator.md +7 -8
- package/data/zeroheight-exports/Navigation.md +163 -142
- package/data/zeroheight-exports/Notification.md +132 -102
- package/data/zeroheight-exports/Panel.md +231 -115
- package/data/zeroheight-exports/Responsive-Design.md +35 -32
- package/data/zeroheight-exports/Search-Input.md +9 -10
- package/data/zeroheight-exports/Search.md +87 -104
- package/data/zeroheight-exports/Segmented-Control.md +68 -45
- package/data/zeroheight-exports/Spacing.md +210 -211
- package/data/zeroheight-exports/Table.md +414 -302
- package/data/zeroheight-exports/Tabs.md +126 -98
- package/data/zeroheight-exports/Tags.md +148 -118
- package/data/zeroheight-exports/Text-Link.md +32 -33
- package/data/zeroheight-exports/Theming.md +48 -29
- package/data/zeroheight-exports/Tooltips.md +253 -237
- package/data/zeroheight-exports/Typography.md +463 -464
- package/dist/stdio.js +44 -132
- package/package.json +3 -4
- package/data/component-props/Chip.json +0 -73
- package/data/component-props/List.json +0 -43
- package/data/component-props/Menu.json +0 -48
- package/data/component-props/Table.json +0 -26
- package/data/component-props-storybook/Accordion-storybook.json +0 -45
- package/data/component-props-storybook/Alert-storybook.json +0 -30
- package/data/component-props-storybook/Autocomplete-storybook.json +0 -67
- package/data/component-props-storybook/Banner-storybook.json +0 -78
- package/data/component-props-storybook/Button-storybook.json +0 -115
- package/data/component-props-storybook/ButtonDropdown-storybook.json +0 -73
- package/data/component-props-storybook/ButtonIcon-storybook.json +0 -60
- package/data/component-props-storybook/ButtonToggle-storybook.json +0 -68
- package/data/component-props-storybook/Callout-storybook.json +0 -90
- package/data/component-props-storybook/CellBasic-storybook.json +0 -138
- package/data/component-props-storybook/CellComponent-storybook.json +0 -48
- package/data/component-props-storybook/CellHeader-storybook.json +0 -71
- package/data/component-props-storybook/Chip-storybook.json +0 -26
- package/data/component-props-storybook/ComplexFilter-storybook.json +0 -60
- package/data/component-props-storybook/ContentCard-storybook.json +0 -175
- package/data/component-props-storybook/Dialog-storybook.json +0 -56
- package/data/component-props-storybook/Dropdown-storybook.json +0 -93
- package/data/component-props-storybook/DropdownMenu-storybook.json +0 -73
- package/data/component-props-storybook/HeatmapChart-storybook.json +0 -55
- package/data/component-props-storybook/Icon-storybook.json +0 -75
- package/data/component-props-storybook/InputCheckbox-storybook.json +0 -57
- package/data/component-props-storybook/InputDropdown-storybook.json +0 -80
- package/data/component-props-storybook/InputRadio-storybook.json +0 -56
- package/data/component-props-storybook/InputSearch-storybook.json +0 -55
- package/data/component-props-storybook/InputSlider-storybook.json +0 -55
- package/data/component-props-storybook/InputText-storybook.json +0 -59
- package/data/component-props-storybook/InputToggle-storybook.json +0 -42
- package/data/component-props-storybook/Link-storybook.json +0 -50
- package/data/component-props-storybook/List-storybook.json +0 -26
- package/data/component-props-storybook/LoadingIndicator-storybook.json +0 -34
- package/data/component-props-storybook/Menu-storybook.json +0 -26
- package/data/component-props-storybook/MenuItem-storybook.json +0 -74
- package/data/component-props-storybook/MenuSelect-storybook.json +0 -38
- package/data/component-props-storybook/NavigationFooter-storybook.json +0 -67
- package/data/component-props-storybook/NavigationHeader-storybook.json +0 -115
- package/data/component-props-storybook/NavigationJumpTo-storybook.json +0 -41
- package/data/component-props-storybook/Notification-storybook.json +0 -89
- package/data/component-props-storybook/Pagination-storybook.json +0 -50
- package/data/component-props-storybook/Panel-storybook.json +0 -52
- package/data/component-props-storybook/SegmentedControl-storybook.json +0 -30
- package/data/component-props-storybook/Table-storybook.json +0 -26
- package/data/component-props-storybook/TableHeader-storybook.json +0 -26
- package/data/component-props-storybook/TableRow-storybook.json +0 -62
- package/data/component-props-storybook/Tabs-storybook.json +0 -45
- package/data/component-props-storybook/Tag-storybook.json +0 -78
- package/data/component-props-storybook/TagFilter-storybook.json +0 -30
- package/data/component-props-storybook/Tooltip-storybook.json +0 -85
- package/data/component-props-storybook/TooltipCondensed-storybook.json +0 -38
- package/data/component-props-storybook/TooltipTable-storybook.json +0 -47
|
@@ -6,15 +6,15 @@ Notifications appear outside of the flow of the page to highlight information to
|
|
|
6
6
|
|
|
7
7
|
## Notification Variants
|
|
8
8
|
|
|
9
|
-
| Notifications come in two different variants for designers to use depending on the type of information they need to display and whether they want the user to have the ability to manually dismiss them or not. All Notification variants can be set to automatically dismiss after a designated period of time (8 seconds by default).
|
|
10
|
-
|
|
|
9
|
+
| Notifications come in two different variants for designers to use depending on the type of information they need to display and whether they want the user to have the ability to manually dismiss them or not. All Notification variants can be set to automatically dismiss after a designated period of time (8 seconds by default). Notifications appear outside of the flow of the page on top of other elements as opposed to Callouts which appear within the page's flow. Follow the usage criteria accompanying each variant as a guide for selecting the correct Notification for any given use case. | | **Jump to variant:** Persistent Dismissible Intent Variations |
|
|
10
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------- |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
## Notification
|
|
15
15
|
|
|
16
|
-
|
|
|
17
|
-
| --- |
|
|
16
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
17
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
|
|
18
18
|
|
|
19
19
|
### Persistent Notification
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ A Minimal Button can be added to the Notification if additional action from the
|
|
|
40
40
|
|
|
41
41
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
@@ -63,27 +63,27 @@ There are four different intents that all Notification variants can communicate
|
|
|
63
63
|
Each intent is demonstrated below using the Persistent Notification for reference. Regardless of variant, the colors and icons used are the same:
|
|
64
64
|
|
|
65
65
|
| **Error** | **Info** |
|
|
66
|
-
|
|
|
66
|
+
| --------- | -------- |
|
|
67
67
|
|
|
68
68
|
| **Success** | **Warning** |
|
|
69
|
-
|
|
|
69
|
+
| ----------- | ----------- |
|
|
70
70
|
|
|
71
71
|
## Code
|
|
72
72
|
|
|
73
73
|
## Notification Component
|
|
74
74
|
|
|
75
|
-
| Below you will find an interactive Storybook iframe for Notifications.
|
|
76
|
-
|
|
|
75
|
+
| Below you will find an interactive Storybook iframe for Notifications. Tabs within each iframe provide a different set of tools: The Controls tab allows you to see and adjust all available props. The Actions tab shows you data displayed by event handler arguments. | | **Jump to component:** Notification |
|
|
76
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
80
|
-
>This component appears as it is in the default SDS codebase. Once imported into the CZ GEN EPI codebase, use a theme file to enable the CZ GEN EPI visual appearance customization.
|
|
80
|
+
> This component appears as it is in the default SDS codebase. Once imported into the CZ GEN EPI codebase, use a theme file to enable the CZ GEN EPI visual appearance customization.
|
|
81
81
|
|
|
82
82
|
### Notification
|
|
83
83
|
|
|
84
84
|
Storybook
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
@@ -93,15 +93,15 @@ Notifications appear outside of the flow of the page to highlight information to
|
|
|
93
93
|
|
|
94
94
|
## Notification Variants
|
|
95
95
|
|
|
96
|
-
| Notifications come in two different variants for designers to use depending on the type of information they need to display and whether they want the user to have the ability to manually dismiss them or not. All Notification variants can be set to automatically dismiss after a designated period of time (8 seconds by default).
|
|
97
|
-
|
|
|
96
|
+
| Notifications come in two different variants for designers to use depending on the type of information they need to display and whether they want the user to have the ability to manually dismiss them or not. All Notification variants can be set to automatically dismiss after a designated period of time (8 seconds by default). Notifications appear outside of the flow of the page on top of other elements as opposed to Callouts which appear within the page's flow. Follow the usage criteria accompanying each variant as a guide for selecting the correct Notification for any given use case. | | **Jump to variant:** Persistent Dismissible Intent Variations |
|
|
97
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------- |
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
101
|
## Notification
|
|
102
102
|
|
|
103
|
-
|
|
|
104
|
-
| --- |
|
|
103
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
104
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
|
|
105
105
|
|
|
106
106
|
### Persistent Notification
|
|
107
107
|
|
|
@@ -117,7 +117,7 @@ Click on each state below to enter inspect view and get details on its code attr
|
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
|
|
121
121
|
|
|
122
122
|
### Dismissible Notification
|
|
123
123
|
|
|
@@ -127,7 +127,7 @@ A Minimal Button can be added to the Notification if additional action from the
|
|
|
127
127
|
|
|
128
128
|
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
@@ -150,17 +150,17 @@ There are four different intents that all Notification variants can communicate
|
|
|
150
150
|
Each intent is demonstrated below using the Persistent Notification for reference. Regardless of variant, the colors and icons used are the same:
|
|
151
151
|
|
|
152
152
|
| **Error** | **Info** |
|
|
153
|
-
|
|
|
153
|
+
| --------- | -------- |
|
|
154
154
|
|
|
155
155
|
| **Success** | **Warning** |
|
|
156
|
-
|
|
|
156
|
+
| ----------- | ----------- |
|
|
157
157
|
|
|
158
158
|
## Code
|
|
159
159
|
|
|
160
160
|
## Notification Component
|
|
161
161
|
|
|
162
|
-
| Below you will find an interactive Storybook iframe for Notifications.
|
|
163
|
-
|
|
|
162
|
+
| Below you will find an interactive Storybook iframe for Notifications. Tabs within each iframe provide a different set of tools: The Controls tab allows you to see and adjust all available props. The Actions tab shows you data displayed by event handler arguments. | | **Jump to component:** Notification |
|
|
163
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
|
|
164
164
|
|
|
165
165
|
---
|
|
166
166
|
|
|
@@ -168,7 +168,7 @@ Each intent is demonstrated below using the Persistent Notification for referenc
|
|
|
168
168
|
|
|
169
169
|
Storybook
|
|
170
170
|
|
|
171
|
-
|
|
171
|
+
|
|
172
172
|
|
|
173
173
|
---
|
|
174
174
|
|
|
@@ -178,8 +178,8 @@ Notifications appear outside of the flow of the page to highlight information to
|
|
|
178
178
|
|
|
179
179
|
## Overview
|
|
180
180
|
|
|
181
|
-
|
|
|
182
|
-
| --- |
|
|
181
|
+
| | In Figma | | | Meets Accessibility | | | In Code |
|
|
182
|
+
| --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
|
|
183
183
|
|
|
184
184
|
### Notification Variants
|
|
185
185
|
|
|
@@ -204,7 +204,7 @@ Use when communicating information that is intended to remain persistent on the
|
|
|
204
204
|
A Minimal Button can be added to the Notification if additional action from the user is possible or necessary; the Button is positioned to the right by default, but can optionally be positioned to the left. Relevant components or additional text can be included in the content module block as necessary.
|
|
205
205
|
|
|
206
206
|
| Default | Default + Button | Default + Content Module | Default + Content Module + Button |
|
|
207
|
-
|
|
|
207
|
+
| ------- | ---------------- | ------------------------ | --------------------------------- |
|
|
208
208
|
|
|
209
209
|
---
|
|
210
210
|
|
|
@@ -215,7 +215,7 @@ Use when communicating information that is manually dismissible by the user and
|
|
|
215
215
|
A Minimal Button can be added to the Notification if additional action from the user is possible or necessary; the Button is positioned to the right by default, but can optionally be positioned to the left. Relevant components or additional text can be included in the content module block as necessary.
|
|
216
216
|
|
|
217
217
|
| Default | Default + Button | Default + Content Module | Default + Content Module + Button |
|
|
218
|
-
|
|
|
218
|
+
| ------- | ---------------- | ------------------------ | --------------------------------- |
|
|
219
219
|
|
|
220
220
|
---
|
|
221
221
|
|
|
@@ -232,11 +232,11 @@ There are four different intents that all Notifications can communicate—Info,
|
|
|
232
232
|
Each intent is demonstrated below using the Persistent variant for reference. Regardless of variant, the colors and icons used are the same:
|
|
233
233
|
|
|
234
234
|
| Info | Negative | Notice | Positive |
|
|
235
|
-
|
|
|
235
|
+
| ---- | -------- | ------ | -------- |
|
|
236
236
|
|
|
237
237
|
## Code
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
> **Note:** The code examples below must install dependencies before displaying and may take extra time to load
|
|
240
240
|
|
|
241
241
|
## Notification
|
|
242
242
|
|
|
@@ -246,40 +246,38 @@ The component's source code in the SDS codebase can be found here.
|
|
|
246
246
|
|
|
247
247
|
### SDS vs MUI
|
|
248
248
|
|
|
249
|
-
The SDS `Notification` component is built upon the MUI `Alert`
|
|
250
|
-
|
|
251
|
-
* **Color:** SDS's `Notification` component has its own `intent` prop designed for setting both the color and default icon, and takes the values of `"info"`, `"error"`, `"success"`, or `"warning"`. MUI's `Alert` instead uses the `severity` prop for this purpose (although `severity` can also be used for SDS's `Notification`, and will take the same values as `intent`, this is not recommended)
|
|
252
|
-
* **Title:** In MUI's `Alert` component, an `AlertTitle` component (that holds the title text) is added within the `Alert` component. However, SDS's `Notification` doesn't need the `AlertTitle` component, although it can take one; doing so won't change the style of the text it wraps. Instead of setting the `Notification`'s title with `AlertTitle`, wrap the title text directly within the `Notification` component, and append any additional (non-title) text using the `extraContent` variable
|
|
253
|
-
* **Transition:** The SDS `Notification` component is set up by default to use the `Slide` component, with `"left"` as its default value; alternatively, it accepts `"right"` as a value
|
|
254
|
-
* **Icon:** Like with MUI's `Alert`, SDS's `Notification` also shows an icon to the left of the title text; this can be changed manually (it also changes automatically based on the `intent` setting; see first bullet). The format for setting the `icon` prop for SDS's `Notification` is slightly different than for MUI in that it invokes the `Icon` component:
|
|
249
|
+
The SDS `Notification` component is built upon the MUI `Alert` component (as is the SDS `Callout` component), but has some notable differences:
|
|
255
250
|
|
|
256
|
-
|
|
251
|
+
- **Color:** SDS's `Notification` component has its own `intent` prop designed for setting both the color and default icon, and takes the values of `"info"`, `"error"`, `"success"`, or `"warning"`. MUI's `Alert` instead uses the `severity` prop for this purpose (although `severity` can also be used for SDS's `Notification`, and will take the same values as `intent`, this is not recommended)
|
|
252
|
+
- **Title:** In MUI's `Alert` component, an `AlertTitle` component (that holds the title text) is added within the `Alert` component. However, SDS's `Notification` doesn't need the `AlertTitle` component, although it can take one; doing so won't change the style of the text it wraps. Instead of setting the `Notification`'s title with `AlertTitle`, wrap the title text directly within the `Notification` component, and append any additional (non-title) text using the `extraContent` variable
|
|
253
|
+
- **Transition:** The SDS `Notification` component is set up by default to use the `Slide` component, with `"left"` as its default value; alternatively, it accepts `"right"` as a value
|
|
254
|
+
- **Icon:** Like with MUI's `Alert`, SDS's `Notification` also shows an icon to the left of the title text; this can be changed manually (it also changes automatically based on the `intent` setting; see first bullet). The format for setting the `icon` prop for SDS's `Notification` is slightly different than for MUI in that it invokes the `Icon` component:
|
|
257
255
|
|
|
258
|
-
|
|
256
|
+
`icon={<Icon sdsSize="l" sdsIcon="download"` `sdsType="static"` `/>`
|
|
259
257
|
|
|
260
|
-
|
|
258
|
+
Additionally, the `iconMapping` prop does not work to change icons associated to `intent` or `severity` for SDS's `Notification`.
|
|
261
259
|
|
|
262
|
-
|
|
260
|
+
- **Variant\*\***:\*\* SDS does not support the `variant` prop. However, MUI's `Alert` does, and offers two options: `outlined`, which removes the background color but adds a colored border to the alert, and `filled`, which changes the background color to a more saturated color of the same hue. If the `variant` prop is used in SDS's `Notification` , only `variant="outline"` will have an affect (it will add the colored border, but will also maintain the original background color, whereas MUI's `Alert` removes the background color with this setting)
|
|
263
261
|
|
|
264
262
|
### MUI Documentation
|
|
265
263
|
|
|
266
|
-
Documentation for the underlying MUI `Alert`
|
|
264
|
+
Documentation for the underlying MUI `Alert` component can be found here.
|
|
267
265
|
|
|
268
266
|
### Props
|
|
269
267
|
|
|
270
268
|
Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
|
|
271
269
|
|
|
272
|
-
| Name
|
|
273
|
-
|
|
|
274
|
-
| `autoDismiss`
|
|
275
|
-
| `buttonOnClick`
|
|
276
|
-
| `buttonText`
|
|
277
|
-
| `dismissed`
|
|
278
|
-
| `onClose`
|
|
279
|
-
| `slideDirection` | `"left"
|
|
280
|
-
| `intent`
|
|
281
|
-
| `icon`
|
|
282
|
-
| `sdsIconProps`
|
|
270
|
+
| Name | Type | Default | Description |
|
|
271
|
+
| ---------------- | ----------------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------- |
|
|
272
|
+
| `autoDismiss` | `bool | number` | `8000 ms` | Determines the auto-dismiss behavior of the component. If set to `true`, the notification will automatically dismiss after `8000 ms`. If set to a number, it specifies the exact duration in milliseconds for auto-dismiss. If set to `false`, the notification will not auto-dismiss. |
|
|
273
|
+
| `buttonOnClick` | `(event: React.SyntheticEvent) => void` | `-` | A callback function to be executed when the button within the notification is clicked. |
|
|
274
|
+
| `buttonText` | `string` | `-` | The text displayed on the button within the notification. |
|
|
275
|
+
| `dismissed` | `bool` | `-` | Controls the dismissed state of the notification. When set to true, the notification will be hidden. You can use this prop to programmatically dismiss the notification. |
|
|
276
|
+
| `onClose` | `function(event: React.SyntheticEvent) => void` | `-` | Callback fired when the component requests to be closed. When provided and no action prop is set, a close icon button is displayed that triggers the callback when clicked. |
|
|
277
|
+
| `slideDirection` | `"left" | "right"` | `"left"` | Specifies the direction from which the notification will slide into view when it appears. |
|
|
278
|
+
| `intent` | `"info"` ` | "negative"` ` | "positive"` ` | "notice"` | `"positive"` | Defines the intent or purpose of the notification. |
|
|
279
|
+
| `icon` | `ReactNode | Partial<SdsIconProps>` | `-` | icon displayed to the left of the `Notification` title. |
|
|
280
|
+
| `sdsIconProps` | `Partial<SdsIconProps>` | `-` | The props for the icon if an SDS icon is used. |
|
|
283
281
|
|
|
284
282
|
### Code examples
|
|
285
283
|
|
|
@@ -312,13 +310,11 @@ h1 {
|
|
|
312
310
|
|
|
313
311
|
```json
|
|
314
312
|
{
|
|
315
|
-
"include": [
|
|
316
|
-
"./**/*"
|
|
317
|
-
],
|
|
313
|
+
"include": ["./**/*"],
|
|
318
314
|
"compilerOptions": {
|
|
319
315
|
"strict": true,
|
|
320
316
|
"esModuleInterop": true,
|
|
321
|
-
"lib": [
|
|
317
|
+
"lib": ["dom", "es2015"],
|
|
322
318
|
"jsx": "react-jsx"
|
|
323
319
|
}
|
|
324
320
|
}
|
|
@@ -328,7 +324,7 @@ h1 {
|
|
|
328
324
|
|
|
329
325
|
```tsx
|
|
330
326
|
// Most minimal Notification (just has the basic requirements)
|
|
331
|
-
|
|
327
|
+
|
|
332
328
|
import { Notification } from "@czi-sds/components";
|
|
333
329
|
import "./styles.css";
|
|
334
330
|
|
|
@@ -382,13 +378,12 @@ root.render(
|
|
|
382
378
|
<RootApp />
|
|
383
379
|
</React.StrictMode>
|
|
384
380
|
);
|
|
385
|
-
|
|
386
381
|
```
|
|
387
382
|
|
|
388
383
|
**/public/index.html**
|
|
389
384
|
|
|
390
385
|
```html
|
|
391
|
-
<!
|
|
386
|
+
<!doctype html>
|
|
392
387
|
<html lang="en">
|
|
393
388
|
<head>
|
|
394
389
|
<meta charset="UTF-8" />
|
|
@@ -409,13 +404,24 @@ root.render(
|
|
|
409
404
|
<div id="root"></div>
|
|
410
405
|
</body>
|
|
411
406
|
</html>
|
|
412
|
-
|
|
413
407
|
```
|
|
414
408
|
|
|
415
409
|
**/package.json**
|
|
416
410
|
|
|
417
411
|
```json
|
|
418
|
-
{
|
|
412
|
+
{
|
|
413
|
+
"dependencies": {
|
|
414
|
+
"react": "^18.0.0",
|
|
415
|
+
"react-dom": "^18.0.0",
|
|
416
|
+
"react-scripts": "^4.0.0"
|
|
417
|
+
},
|
|
418
|
+
"devDependencies": {
|
|
419
|
+
"@types/react": "^18.0.0",
|
|
420
|
+
"@types/react-dom": "^18.0.0",
|
|
421
|
+
"typescript": "^4.0.0"
|
|
422
|
+
},
|
|
423
|
+
"main": "/index.tsx"
|
|
424
|
+
}
|
|
419
425
|
```
|
|
420
426
|
|
|
421
427
|
---
|
|
@@ -449,13 +455,11 @@ h1 {
|
|
|
449
455
|
|
|
450
456
|
```json
|
|
451
457
|
{
|
|
452
|
-
"include": [
|
|
453
|
-
"./**/*"
|
|
454
|
-
],
|
|
458
|
+
"include": ["./**/*"],
|
|
455
459
|
"compilerOptions": {
|
|
456
460
|
"strict": true,
|
|
457
461
|
"esModuleInterop": true,
|
|
458
|
-
"lib": [
|
|
462
|
+
"lib": ["dom", "es2015"],
|
|
459
463
|
"jsx": "react-jsx"
|
|
460
464
|
}
|
|
461
465
|
}
|
|
@@ -473,9 +477,8 @@ function App() {
|
|
|
473
477
|
<Notification>
|
|
474
478
|
Notification Title
|
|
475
479
|
<div>
|
|
476
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
|
|
477
|
-
|
|
478
|
-
assumenda non?
|
|
480
|
+
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet eveniet
|
|
481
|
+
sapiente, officiis aut possimus suscipit assumenda non?
|
|
479
482
|
</div>
|
|
480
483
|
</Notification>
|
|
481
484
|
</div>
|
|
@@ -522,13 +525,12 @@ root.render(
|
|
|
522
525
|
<RootApp />
|
|
523
526
|
</React.StrictMode>
|
|
524
527
|
);
|
|
525
|
-
|
|
526
528
|
```
|
|
527
529
|
|
|
528
530
|
**/public/index.html**
|
|
529
531
|
|
|
530
532
|
```html
|
|
531
|
-
<!
|
|
533
|
+
<!doctype html>
|
|
532
534
|
<html lang="en">
|
|
533
535
|
<head>
|
|
534
536
|
<meta charset="UTF-8" />
|
|
@@ -549,13 +551,24 @@ root.render(
|
|
|
549
551
|
<div id="root"></div>
|
|
550
552
|
</body>
|
|
551
553
|
</html>
|
|
552
|
-
|
|
553
554
|
```
|
|
554
555
|
|
|
555
556
|
**/package.json**
|
|
556
557
|
|
|
557
558
|
```json
|
|
558
|
-
{
|
|
559
|
+
{
|
|
560
|
+
"dependencies": {
|
|
561
|
+
"react": "^18.0.0",
|
|
562
|
+
"react-dom": "^18.0.0",
|
|
563
|
+
"react-scripts": "^4.0.0"
|
|
564
|
+
},
|
|
565
|
+
"devDependencies": {
|
|
566
|
+
"@types/react": "^18.0.0",
|
|
567
|
+
"@types/react-dom": "^18.0.0",
|
|
568
|
+
"typescript": "^4.0.0"
|
|
569
|
+
},
|
|
570
|
+
"main": "/index.tsx"
|
|
571
|
+
}
|
|
559
572
|
```
|
|
560
573
|
|
|
561
574
|
---
|
|
@@ -589,13 +602,11 @@ h1 {
|
|
|
589
602
|
|
|
590
603
|
```json
|
|
591
604
|
{
|
|
592
|
-
"include": [
|
|
593
|
-
"./**/*"
|
|
594
|
-
],
|
|
605
|
+
"include": ["./**/*"],
|
|
595
606
|
"compilerOptions": {
|
|
596
607
|
"strict": true,
|
|
597
608
|
"esModuleInterop": true,
|
|
598
|
-
"lib": [
|
|
609
|
+
"lib": ["dom", "es2015"],
|
|
599
610
|
"jsx": "react-jsx"
|
|
600
611
|
}
|
|
601
612
|
}
|
|
@@ -611,13 +622,14 @@ function App() {
|
|
|
611
622
|
return (
|
|
612
623
|
<div className="app">
|
|
613
624
|
<Notification
|
|
614
|
-
onClose={(event) => {
|
|
625
|
+
onClose={(event) => {
|
|
626
|
+
console.log("Notification closed!");
|
|
627
|
+
}}
|
|
615
628
|
>
|
|
616
629
|
Notification Title
|
|
617
630
|
<div>
|
|
618
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
|
|
619
|
-
|
|
620
|
-
assumenda non?
|
|
631
|
+
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet eveniet
|
|
632
|
+
sapiente, officiis aut possimus suscipit assumenda non?
|
|
621
633
|
</div>
|
|
622
634
|
</Notification>
|
|
623
635
|
</div>
|
|
@@ -664,13 +676,12 @@ root.render(
|
|
|
664
676
|
<RootApp />
|
|
665
677
|
</React.StrictMode>
|
|
666
678
|
);
|
|
667
|
-
|
|
668
679
|
```
|
|
669
680
|
|
|
670
681
|
**/public/index.html**
|
|
671
682
|
|
|
672
683
|
```html
|
|
673
|
-
<!
|
|
684
|
+
<!doctype html>
|
|
674
685
|
<html lang="en">
|
|
675
686
|
<head>
|
|
676
687
|
<meta charset="UTF-8" />
|
|
@@ -691,18 +702,29 @@ root.render(
|
|
|
691
702
|
<div id="root"></div>
|
|
692
703
|
</body>
|
|
693
704
|
</html>
|
|
694
|
-
|
|
695
705
|
```
|
|
696
706
|
|
|
697
707
|
**/package.json**
|
|
698
708
|
|
|
699
709
|
```json
|
|
700
|
-
{
|
|
710
|
+
{
|
|
711
|
+
"dependencies": {
|
|
712
|
+
"react": "^18.0.0",
|
|
713
|
+
"react-dom": "^18.0.0",
|
|
714
|
+
"react-scripts": "^4.0.0"
|
|
715
|
+
},
|
|
716
|
+
"devDependencies": {
|
|
717
|
+
"@types/react": "^18.0.0",
|
|
718
|
+
"@types/react-dom": "^18.0.0",
|
|
719
|
+
"typescript": "^4.0.0"
|
|
720
|
+
},
|
|
721
|
+
"main": "/index.tsx"
|
|
722
|
+
}
|
|
701
723
|
```
|
|
702
724
|
|
|
703
725
|
---
|
|
704
726
|
|
|
705
|
-
#### Notification with Embedded Button
|
|
727
|
+
#### Notification with Embedded Button
|
|
706
728
|
|
|
707
729
|
A `Notification` component that has an integrated `Button` that closes the notification when clicked.
|
|
708
730
|
|
|
@@ -731,13 +753,11 @@ h1 {
|
|
|
731
753
|
|
|
732
754
|
```json
|
|
733
755
|
{
|
|
734
|
-
"include": [
|
|
735
|
-
"./**/*"
|
|
736
|
-
],
|
|
756
|
+
"include": ["./**/*"],
|
|
737
757
|
"compilerOptions": {
|
|
738
758
|
"strict": true,
|
|
739
759
|
"esModuleInterop": true,
|
|
740
|
-
"lib": [
|
|
760
|
+
"lib": ["dom", "es2015"],
|
|
741
761
|
"jsx": "react-jsx"
|
|
742
762
|
}
|
|
743
763
|
}
|
|
@@ -753,12 +773,11 @@ import "./styles.css";
|
|
|
753
773
|
function App() {
|
|
754
774
|
const [dismissed, setDismissed] = useState(false);
|
|
755
775
|
const handleClick = () => {
|
|
756
|
-
setDismissed(prev => !prev);
|
|
757
|
-
}
|
|
776
|
+
setDismissed((prev) => !prev);
|
|
777
|
+
};
|
|
758
778
|
return (
|
|
759
779
|
<div className="app">
|
|
760
|
-
{
|
|
761
|
-
!dismissed ?
|
|
780
|
+
{!dismissed ? (
|
|
762
781
|
<Notification
|
|
763
782
|
buttonText="Close"
|
|
764
783
|
buttonOnClick={(event) => setDismissed(true)}
|
|
@@ -767,13 +786,15 @@ function App() {
|
|
|
767
786
|
>
|
|
768
787
|
Notification Title
|
|
769
788
|
<div>
|
|
770
|
-
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
|
|
771
|
-
|
|
772
|
-
assumenda non?
|
|
789
|
+
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet
|
|
790
|
+
eveniet sapiente, officiis aut possimus suscipit assumenda non?
|
|
773
791
|
</div>
|
|
774
|
-
</Notification>
|
|
775
|
-
|
|
776
|
-
|
|
792
|
+
</Notification>
|
|
793
|
+
) : (
|
|
794
|
+
<Button onClick={handleClick} sdsType="primary" sdsStyle="rounded">
|
|
795
|
+
Reset Notification
|
|
796
|
+
</Button>
|
|
797
|
+
)}
|
|
777
798
|
</div>
|
|
778
799
|
);
|
|
779
800
|
}
|
|
@@ -818,13 +839,12 @@ root.render(
|
|
|
818
839
|
<RootApp />
|
|
819
840
|
</React.StrictMode>
|
|
820
841
|
);
|
|
821
|
-
|
|
822
842
|
```
|
|
823
843
|
|
|
824
844
|
**/public/index.html**
|
|
825
845
|
|
|
826
846
|
```html
|
|
827
|
-
<!
|
|
847
|
+
<!doctype html>
|
|
828
848
|
<html lang="en">
|
|
829
849
|
<head>
|
|
830
850
|
<meta charset="UTF-8" />
|
|
@@ -845,14 +865,24 @@ root.render(
|
|
|
845
865
|
<div id="root"></div>
|
|
846
866
|
</body>
|
|
847
867
|
</html>
|
|
848
|
-
|
|
849
868
|
```
|
|
850
869
|
|
|
851
870
|
**/package.json**
|
|
852
871
|
|
|
853
872
|
```json
|
|
854
|
-
{
|
|
873
|
+
{
|
|
874
|
+
"dependencies": {
|
|
875
|
+
"react": "^18.0.0",
|
|
876
|
+
"react-dom": "^18.0.0",
|
|
877
|
+
"react-scripts": "^4.0.0"
|
|
878
|
+
},
|
|
879
|
+
"devDependencies": {
|
|
880
|
+
"@types/react": "^18.0.0",
|
|
881
|
+
"@types/react-dom": "^18.0.0",
|
|
882
|
+
"typescript": "^4.0.0"
|
|
883
|
+
},
|
|
884
|
+
"main": "/index.tsx"
|
|
885
|
+
}
|
|
855
886
|
```
|
|
856
887
|
|
|
857
888
|
---
|
|
858
|
-
|