@czi-sds/mcp 0.16.0 → 0.18.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.
Files changed (167) hide show
  1. package/README.md +2 -1
  2. package/data/component-docs/Accordion.md +291 -0
  3. package/data/component-docs/Autocomplete.md +525 -0
  4. package/data/component-docs/Banner.md +231 -0
  5. package/data/component-docs/Button.md +224 -0
  6. package/data/component-docs/ButtonDropdown.md +256 -0
  7. package/data/component-docs/ButtonGroup.md +320 -0
  8. package/data/component-docs/ButtonToggle.md +397 -0
  9. package/data/component-docs/Callout.md +268 -0
  10. package/data/component-docs/CellBasic.md +122 -0
  11. package/data/component-docs/CellComponent.md +63 -0
  12. package/data/component-docs/CellHeader.md +128 -0
  13. package/data/component-docs/ComplexFilter.md +294 -0
  14. package/data/component-docs/ContentCard.md +406 -0
  15. package/data/component-docs/Dialog.md +651 -0
  16. package/data/component-docs/Dropdown.md +155 -0
  17. package/data/component-docs/DropdownMenu.md +949 -0
  18. package/data/component-docs/HeatmapChart.md +782 -0
  19. package/data/component-docs/Hero.md +363 -0
  20. package/data/component-docs/Icon.md +283 -0
  21. package/data/component-docs/InputCheckbox.md +205 -0
  22. package/data/component-docs/InputDropdown.md +482 -0
  23. package/data/component-docs/InputRadio.md +173 -0
  24. package/data/component-docs/InputSearch.md +81 -0
  25. package/data/component-docs/InputSlider.md +189 -0
  26. package/data/component-docs/InputText.md +110 -0
  27. package/data/component-docs/InputToggle.md +141 -0
  28. package/data/component-docs/IntentMessage.md +293 -0
  29. package/data/component-docs/Legend.md +442 -0
  30. package/data/component-docs/Link.md +23 -0
  31. package/data/component-docs/List.md +300 -0
  32. package/data/component-docs/LoadingIndicator.md +198 -0
  33. package/data/component-docs/Menu.md +298 -0
  34. package/data/component-docs/MenuItem.md +100 -0
  35. package/data/component-docs/NavigationFooter.md +165 -0
  36. package/data/component-docs/NavigationHeader.md +500 -0
  37. package/data/component-docs/NavigationJumpTo.md +414 -0
  38. package/data/component-docs/Notification.md +288 -0
  39. package/data/component-docs/Pagination.md +67 -0
  40. package/data/component-docs/Panel.md +636 -0
  41. package/data/component-docs/Popover.md +448 -0
  42. package/data/component-docs/PreComposedTable.md +2947 -0
  43. package/data/component-docs/ProteinStructureViewer.md +1044 -0
  44. package/data/component-docs/SegmentedControl.md +396 -0
  45. package/data/component-docs/StackedBarChart.md +475 -0
  46. package/data/component-docs/Table.md +2000 -0
  47. package/data/component-docs/TableHeader.md +53 -0
  48. package/data/component-docs/TableRow.md +74 -0
  49. package/data/component-docs/Tabs.md +455 -0
  50. package/data/component-docs/Tag.md +647 -0
  51. package/data/component-docs/TagFilter.md +131 -0
  52. package/data/component-docs/Tooltip.md +561 -0
  53. package/data/component-docs/TooltipCondensed.md +203 -0
  54. package/data/component-docs/TooltipTable.md +145 -0
  55. package/data/component-docs/index.json +267 -0
  56. package/data/component-list.json +2 -5
  57. package/data/component-props/Accordion.json +31 -11
  58. package/data/component-props/Alert.json +3 -3
  59. package/data/component-props/Autocomplete.json +150 -15
  60. package/data/component-props/Banner.json +31 -17
  61. package/data/component-props/Button.json +45 -20
  62. package/data/component-props/ButtonDropdown.json +36 -17
  63. package/data/component-props/ButtonDropdownLegacy.json +11 -11
  64. package/data/component-props/ButtonGroup.json +32 -11
  65. package/data/component-props/ButtonIcon.json +10 -10
  66. package/data/component-props/ButtonLegacy.json +19 -19
  67. package/data/component-props/ButtonToggle.json +32 -19
  68. package/data/component-props/ButtonToggleLegacy.json +11 -11
  69. package/data/component-props/Callout.json +58 -17
  70. package/data/component-props/CellBasic.json +94 -41
  71. package/data/component-props/CellComponent.json +23 -7
  72. package/data/component-props/CellHeader.json +62 -19
  73. package/data/component-props/ComplexFilter.json +52 -21
  74. package/data/component-props/ContentCard.json +70 -47
  75. package/data/component-props/Dialog.json +47 -14
  76. package/data/component-props/Dropdown.json +68 -31
  77. package/data/component-props/DropdownMenu.json +128 -23
  78. package/data/component-props/HeatmapChart.json +88 -12
  79. package/data/component-props/Hero.json +80 -39
  80. package/data/component-props/Icon.json +20 -9
  81. package/data/component-props/InputCheckbox.json +36 -14
  82. package/data/component-props/InputDropdown.json +75 -27
  83. package/data/component-props/InputRadio.json +31 -13
  84. package/data/component-props/InputSearch.json +41 -18
  85. package/data/component-props/InputSlider.json +46 -19
  86. package/data/component-props/InputText.json +26 -19
  87. package/data/component-props/InputToggle.json +26 -9
  88. package/data/component-props/IntentMessage.json +38 -9
  89. package/data/component-props/Link.json +13 -7
  90. package/data/component-props/LoadingIndicator.json +11 -3
  91. package/data/component-props/MenuItem.json +38 -19
  92. package/data/component-props/MenuSelect.json +8 -8
  93. package/data/component-props/NavigationFooter.json +49 -19
  94. package/data/component-props/NavigationHeader.json +150 -37
  95. package/data/component-props/NavigationJumpTo.json +33 -7
  96. package/data/component-props/Notification.json +39 -21
  97. package/data/component-props/Pagination.json +39 -11
  98. package/data/component-props/Panel.json +62 -9
  99. package/data/component-props/Popover.json +80 -7
  100. package/data/component-props/PreComposedTable.json +99 -27
  101. package/data/component-props/ProteinStructureViewer.json +117 -0
  102. package/data/component-props/SegmentedControl.json +42 -3
  103. package/data/component-props/StackedBarChart.json +116 -42
  104. package/data/component-props/TableRow.json +38 -19
  105. package/data/component-props/Tabs.json +66 -9
  106. package/data/component-props/Tag.json +34 -17
  107. package/data/component-props/TagFilter.json +10 -3
  108. package/data/component-props/Tooltip.json +49 -18
  109. package/data/component-props/TooltipCondensed.json +18 -9
  110. package/data/component-props/TooltipTable.json +17 -7
  111. package/data/resources/{zeroheight-rules.md → documentation-rules.md} +43 -30
  112. package/data/resources/figma-rules.md +2 -2
  113. package/data/tailwind.json +20 -14
  114. package/dist/stdio.js +112 -208
  115. package/package.json +9 -5
  116. package/data/component-props/ButtonDropdownV2.json +0 -34
  117. package/data/component-props/ButtonNew.json +0 -47
  118. package/data/component-props/ButtonToggleV2.json +0 -44
  119. package/data/component-props/ButtonV2.json +0 -43
  120. package/data/zeroheight-cache.json +0 -10259
  121. package/data/zeroheight-exports/Accordion.md +0 -774
  122. package/data/zeroheight-exports/Banner.md +0 -691
  123. package/data/zeroheight-exports/Borders.md +0 -117
  124. package/data/zeroheight-exports/Buttons.md +0 -1854
  125. package/data/zeroheight-exports/Callout.md +0 -931
  126. package/data/zeroheight-exports/Colors.md +0 -1755
  127. package/data/zeroheight-exports/Content-Card.md +0 -309
  128. package/data/zeroheight-exports/Contributing-to-SDS.md +0 -98
  129. package/data/zeroheight-exports/Control-Inputs.md +0 -2818
  130. package/data/zeroheight-exports/Corners.md +0 -104
  131. package/data/zeroheight-exports/Cover-page.md +0 -3
  132. package/data/zeroheight-exports/Dialog.md +0 -1367
  133. package/data/zeroheight-exports/Downloads.md +0 -236
  134. package/data/zeroheight-exports/Drop-Shadows.md +0 -79
  135. package/data/zeroheight-exports/Dropdown-Input.md +0 -1776
  136. package/data/zeroheight-exports/Dropdown-Menus.md +0 -913
  137. package/data/zeroheight-exports/Element-Status-Tracker.md +0 -267
  138. package/data/zeroheight-exports/Field-Inputs.md +0 -1405
  139. package/data/zeroheight-exports/Filters.md +0 -1111
  140. package/data/zeroheight-exports/Getting-Started.md +0 -1157
  141. package/data/zeroheight-exports/Hero.md +0 -414
  142. package/data/zeroheight-exports/Icons.md +0 -2067
  143. package/data/zeroheight-exports/Intent.md +0 -86
  144. package/data/zeroheight-exports/Introduction-to-Bases.md +0 -35
  145. package/data/zeroheight-exports/Introduction-to-Cells.md +0 -35
  146. package/data/zeroheight-exports/Introduction-to-DNA.md +0 -35
  147. package/data/zeroheight-exports/Introduction-to-Genes.md +0 -35
  148. package/data/zeroheight-exports/Introduction.md +0 -115
  149. package/data/zeroheight-exports/Link.md +0 -432
  150. package/data/zeroheight-exports/Lists.md +0 -986
  151. package/data/zeroheight-exports/Loading-Indicator.md +0 -41
  152. package/data/zeroheight-exports/Navigation.md +0 -1190
  153. package/data/zeroheight-exports/Notification.md +0 -1038
  154. package/data/zeroheight-exports/Panel.md +0 -1030
  155. package/data/zeroheight-exports/README.md +0 -122
  156. package/data/zeroheight-exports/Responsive-Design.md +0 -330
  157. package/data/zeroheight-exports/Search-Input.md +0 -91
  158. package/data/zeroheight-exports/Search.md +0 -822
  159. package/data/zeroheight-exports/Segmented-Control.md +0 -609
  160. package/data/zeroheight-exports/Spacing.md +0 -297
  161. package/data/zeroheight-exports/Table.md +0 -5345
  162. package/data/zeroheight-exports/Tabs.md +0 -1324
  163. package/data/zeroheight-exports/Tags.md +0 -1545
  164. package/data/zeroheight-exports/Text-Link.md +0 -268
  165. package/data/zeroheight-exports/Theming.md +0 -362
  166. package/data/zeroheight-exports/Tooltips.md +0 -2015
  167. package/data/zeroheight-exports/Typography.md +0 -800
@@ -1,1038 +0,0 @@
1
- # Notifications
2
-
3
- Notifications appear outside of the flow of the page to highlight information to the user whether in response to an action they have completed or to bring their attention to important details.
4
-
5
- ## Overview
6
-
7
- ## Notification Variants
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). 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
-
12
- ---
13
-
14
- ## Notification
15
-
16
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
17
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
18
-
19
- ### Persistent Notification
20
-
21
- Use when communicating information that is intended to remain persistent on the screen and is not manually dismissible by the user. It can be set to automatically dismiss after a designated period of time using the `autoDismiss` prop; when set to `true`, the automatic dismissal will occur after 8 milliseconds by default, but can be set to a custom length of time by entering a millisecond value into the prop.
22
-
23
- A Minimal Button or Text Link can be added to the Notification if additional action from the user is possible or necessary. Most commonly, a Minimal Button with the label "Dismiss" is included to allow users to close out of the Notification. Text Links take users to pages related to the content on the Notification; for example when a user begins building a new tree, a Notification appears alerting them this work has begun that includes a Text Link that navigates them to the tree page for them to view their newly created tree.
24
-
25
- Relevant components such as Tables (documentation coming soon) or Charts (documentation coming soon), or additional text can be included in the content module block as necessary.
26
-
27
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
28
-
29
- **Default**
30
-
31
- ---
32
-
33
- ---
34
-
35
- **Default + Child Node (content module)**
36
-
37
- ---
38
-
39
- ---
40
-
41
- **Default + Button**
42
-
43
- ---
44
-
45
- ---
46
-
47
- **Default + Child Node (content module) + Button**
48
-
49
- ---
50
-
51
- ### Dismissible Notification
52
-
53
- Use when communicating information that is manually dismissible by the user and does not need to remain persistent on the screen. It can be set to automatically dismiss after a designated period of time using the `autoDismiss` prop; when set to `true`, the automatic dismissal will occur after 8 milliseconds by default, but can be set to a custom length of time by entering a millisecond value into the prop.
54
-
55
- A Minimal Button can be added to the Notification if additional action from the user is possible or necessary. Relevant components such as Tables (documentation coming soon) or Charts (documentation coming soon), or additional text can be included in the content module block as necessary.
56
-
57
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
58
-
59
- **Notification/Notification**
60
-
61
- ---
62
-
63
- ---
64
-
65
- **Notification**
66
-
67
- ---
68
-
69
- ---
70
-
71
- **Notification**
72
-
73
- ---
74
-
75
- ---
76
-
77
- **Notification**
78
-
79
- ---
80
-
81
- ---
82
-
83
- ### Notification Spacing
84
-
85
- These rules establish how much margin should exist between and around elements. Because Notifications are positioned in the top-right corner of the UI on top of other elements, the top and right spacing rules below indicate the distance between the component and the edges of the browser window.
86
-
87
- **Notification spacing**
88
-
89
- ---
90
-
91
- ---
92
-
93
- ### Intent Variations
94
-
95
- There are four different intents that all Notification variants can communicate—Info, Error, Success, and Warning—indicated with the use of color and iconography and selected using the `intent` prop.
96
-
97
- Each intent is demonstrated below using the Persistent Notification for reference. Regardless of variant, the colors and icons used are the same:
98
-
99
- | **Error** | **Info** |
100
- | --------- | -------- |
101
-
102
- **Notification**
103
-
104
- ---
105
-
106
- **Notification**
107
-
108
- ---
109
-
110
- | **Success** | **Warning** |
111
- | ----------- | ----------- |
112
-
113
- **Notification**
114
-
115
- ---
116
-
117
- **Notification**
118
-
119
- ---
120
-
121
- ## Code
122
-
123
- ## Notification Component
124
-
125
- | 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 |
126
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
127
-
128
- ---
129
-
130
- > 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.
131
-
132
- ### Notification
133
-
134
- Storybook
135
-
136
- ---
137
-
138
- Notifications appear outside of the flow of the page to highlight information to the user whether in response to an action they have completed or to bring their attention to important details.
139
-
140
- ## Overview
141
-
142
- ## Notification Variants
143
-
144
- | 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 |
145
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------- |
146
-
147
- ---
148
-
149
- ## Notification
150
-
151
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
152
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
153
-
154
- ### Persistent Notification
155
-
156
- Use when communicating information that is intended to remain persistent on the screen and is not manually dismissible by the user. It can be set to automatically dismiss after a designated period of time using the `autoDismiss` prop; when set to `true`, the automatic dismissal will occur after 8 milliseconds by default, but can be set to a custom length of time by entering a millisecond value into the prop.
157
-
158
- A Minimal Button can be added to the Notification if additional action from the user is possible or necessary. Relevant components such as Tables (documentation coming soon) or Charts (documentation coming soon), or additional text can be included in the content module block as necessary.
159
-
160
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
161
-
162
- **Default**
163
-
164
- ---
165
-
166
- ---
167
-
168
- **Default + Child Node (content module)**
169
-
170
- ---
171
-
172
- ---
173
-
174
- **Default + Button**
175
-
176
- ---
177
-
178
- ---
179
-
180
- **Default + Child Node (content module) + Button**
181
-
182
- ---
183
-
184
- ### Dismissible Notification
185
-
186
- Use when communicating information that is manually dismissible by the user and does not need to remain persistent on the screen. It can be set to automatically dismiss after a designated period of time using the `autoDismiss` prop; when set to `true`, the automatic dismissal will occur after 8 milliseconds by default, but can be set to a custom length of time by entering a millisecond value into the prop.
187
-
188
- A Minimal Button can be added to the Notification if additional action from the user is possible or necessary. Relevant components such as Tables (documentation coming soon) or Charts (documentation coming soon), or additional text can be included in the content module block as necessary.
189
-
190
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
191
-
192
- **Default**
193
-
194
- ---
195
-
196
- ---
197
-
198
- **Default + Child Node (content module)**
199
-
200
- ---
201
-
202
- ---
203
-
204
- **Default + Button**
205
-
206
- ---
207
-
208
- ---
209
-
210
- **Default + Child Node (content module) + Button**
211
-
212
- ---
213
-
214
- ---
215
-
216
- ### Notification Spacing
217
-
218
- These rules establish how much margin should exist between and around elements. Because Notifications are positioned in the top-right corner of the UI on top of other elements, the top and right spacing rules below indicate the distance between the component and the edges of the browser window.
219
-
220
- **Notification spacing**
221
-
222
- ---
223
-
224
- ---
225
-
226
- ### Intent Variations
227
-
228
- There are four different intents that all Notification variants can communicate—Info, Error, Success, and Warning—indicated with the use of color and iconography and selected using the `intent` prop.
229
-
230
- Each intent is demonstrated below using the Persistent Notification for reference. Regardless of variant, the colors and icons used are the same:
231
-
232
- | **Error** | **Info** |
233
- | --------- | -------- |
234
-
235
- **Notification**
236
-
237
- ---
238
-
239
- **Notification**
240
-
241
- ---
242
-
243
- | **Success** | **Warning** |
244
- | ----------- | ----------- |
245
-
246
- **Notification**
247
-
248
- ---
249
-
250
- **Notification**
251
-
252
- ---
253
-
254
- ## Code
255
-
256
- ## Notification Component
257
-
258
- | 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 |
259
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
260
-
261
- ---
262
-
263
- ### Notification
264
-
265
- Storybook
266
-
267
- ---
268
-
269
- Notifications appear outside of the flow of the page to highlight information to the user whether in response to an action they have completed or to bring their attention to important details.
270
-
271
- ## Guidelines
272
-
273
- ## Overview
274
-
275
- | | In Figma | | | Meets Accessibility | | | In Code |
276
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
277
-
278
- ### Notification Variants
279
-
280
- Notifications come in two different variants distinguished by whether users 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).
281
-
282
- 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.
283
-
284
- **Preview_Guidelines_Notification_persistent**
285
-
286
- ---
287
-
288
- **Preview_Guidelines_Notification_dismissible**
289
-
290
- ---
291
-
292
- ---
293
-
294
- ### Live Instance
295
-
296
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
297
-
298
- Default
299
-
300
- ---
301
-
302
- ### Notification – Persistent
303
-
304
- Use when communicating information that is intended to remain persistent on the screen and is not manually dismissible by the user.
305
-
306
- 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.
307
-
308
- | Default | Default + Button | Default + Content Module | Default + Content Module + Button |
309
- | ------- | ---------------- | ------------------------ | --------------------------------- |
310
-
311
- **Notification_persistent_default**
312
-
313
- ---
314
-
315
- **Notification_persistent_button**
316
-
317
- ---
318
-
319
- **Notification_persistent_content slot**
320
-
321
- ---
322
-
323
- **Notification_persistent_button + content slot**
324
-
325
- ---
326
-
327
- ---
328
-
329
- ### Notification – Dismissible
330
-
331
- Use when communicating information that is manually dismissible by the user and does not need to remain persistent on the screen.
332
-
333
- 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.
334
-
335
- | Default | Default + Button | Default + Content Module | Default + Content Module + Button |
336
- | ------- | ---------------- | ------------------------ | --------------------------------- |
337
-
338
- **Notification_dismissible_default**
339
-
340
- ---
341
-
342
- **Notification_dismissible_button**
343
-
344
- ---
345
-
346
- **Notification_dismissible_content slot**
347
-
348
- ---
349
-
350
- **Notification_dismissible_button + content slot**
351
-
352
- ---
353
-
354
- ---
355
-
356
- ### Notification Spacing
357
-
358
- These rules establish how much margin should exist between and around elements.
359
-
360
- **Notification spacing**
361
-
362
- ---
363
-
364
- ---
365
-
366
- ### Intent Variations
367
-
368
- There are four different intents that all Notifications can communicate—Info, Negative, Notice, and Positive—indicated with the use of color and iconography.
369
-
370
- Each intent is demonstrated below using the Persistent variant for reference. Regardless of variant, the colors and icons used are the same:
371
-
372
- | Info | Negative | Notice | Positive |
373
- | ---- | -------- | ------ | -------- |
374
-
375
- **Notification_intent_info**
376
-
377
- ---
378
-
379
- **Notification_intent_error**
380
-
381
- ---
382
-
383
- **Notification_intent_warning**
384
-
385
- ---
386
-
387
- **Notification_intent_success**
388
-
389
- ---
390
-
391
- ## Code
392
-
393
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
394
-
395
- ## Notification
396
-
397
- ### SDS Source Code
398
-
399
- The component's source code in the SDS codebase can be found here.
400
-
401
- ### SDS vs MUI
402
-
403
- The SDS `Notification` component is built upon the MUI `Alert` component (as is the SDS `Callout` component), but has some notable differences:
404
-
405
- - **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)
406
- - **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
407
- - **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
408
- - **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:
409
-
410
- `icon={<Icon sdsSize="l" sdsIcon="download"` `sdsType="static"` `/>`
411
-
412
- Additionally, the `iconMapping` prop does not work to change icons associated to `intent` or `severity` for SDS's `Notification`.
413
-
414
- - **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)
415
-
416
- ### MUI Documentation
417
-
418
- Documentation for the underlying MUI `Alert` component can be found here.
419
-
420
- ### Props
421
-
422
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
423
-
424
- | Name | Type | Default | Description |
425
- | ---------------- | ----------------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------- |
426
- | `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. |
427
- | `buttonOnClick` | `(event: React.SyntheticEvent) => void` | `-` | A callback function to be executed when the button within the notification is clicked. |
428
- | `buttonText` | `string` | `-` | The text displayed on the button within the notification. |
429
- | `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. |
430
- | `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. |
431
- | `slideDirection` | `"left" | "right"` | `"left"` | Specifies the direction from which the notification will slide into view when it appears. |
432
- | `intent` | `"info"` ` | "negative"` ` | "positive"` ` | "notice"` | `"positive"` | Defines the intent or purpose of the notification. |
433
- | `icon` | `ReactNode | Partial<SdsIconProps>` | `-` | icon displayed to the left of the `Notification` title. |
434
- | `sdsIconProps` | `Partial<SdsIconProps>` | `-` | The props for the icon if an SDS icon is used. |
435
-
436
- ### Code examples
437
-
438
- #### Default Notification
439
-
440
- This example demonstrates the most basic usage of the `Notification` component with default props.
441
-
442
- **/styles.css**
443
-
444
- ```css
445
- body {
446
- font-size: 13px;
447
- font-weight: 400;
448
- letter-spacing: 0.08px;
449
- line-height: 20px;
450
- text-transform: none;
451
- font-family: "Inter", sans-serif;
452
- }
453
-
454
- h1 {
455
- font-size: 1.5rem;
456
- }
457
-
458
- .app {
459
- padding: 20px;
460
- }
461
- ```
462
-
463
- **tsconfig.json**
464
-
465
- ```json
466
- {
467
- "include": ["./**/*"],
468
- "compilerOptions": {
469
- "strict": true,
470
- "esModuleInterop": true,
471
- "lib": ["dom", "es2015"],
472
- "jsx": "react-jsx"
473
- }
474
- }
475
- ```
476
-
477
- **/App.tsx**
478
-
479
- ```tsx
480
- // Most minimal Notification (just has the basic requirements)
481
-
482
- import { Notification } from "@czi-sds/components";
483
- import "./styles.css";
484
-
485
- function App() {
486
- return (
487
- <div className="app">
488
- <Notification>
489
- The Notification component has been rendered successfully!
490
- </Notification>
491
- </div>
492
- );
493
- }
494
-
495
- export default App;
496
- ```
497
-
498
- **/index.tsx**
499
-
500
- ```tsx
501
- import React from "react";
502
- import { createRoot } from "react-dom/client";
503
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
504
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
505
- import { Theme } from "@czi-sds/components";
506
- import CssBaseline from "@mui/material/CssBaseline";
507
- import useMediaQuery from "@mui/material/useMediaQuery";
508
-
509
- import App from "./App";
510
-
511
- const container = document.getElementById("root");
512
- const root = createRoot(container!);
513
-
514
- const RootApp = () => {
515
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
516
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
517
-
518
- return (
519
- <StyledEngineProvider injectFirst>
520
- <ThemeProvider theme={theme}>
521
- <EmotionThemeProvider theme={theme}>
522
- <CssBaseline />
523
- <App />
524
- </EmotionThemeProvider>
525
- </ThemeProvider>
526
- </StyledEngineProvider>
527
- );
528
- };
529
-
530
- root.render(
531
- <React.StrictMode>
532
- <RootApp />
533
- </React.StrictMode>
534
- );
535
- ```
536
-
537
- **/public/index.html**
538
-
539
- ```html
540
- <!doctype html>
541
- <html lang="en">
542
- <head>
543
- <meta charset="UTF-8" />
544
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
545
- <link rel="preconnect" href="https://fonts.googleapis.com" />
546
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
547
- <link
548
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
549
- rel="stylesheet"
550
- />
551
- <link
552
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
553
- rel="stylesheet"
554
- />
555
- </head>
556
- <body>
557
- <div id="root"></div>
558
- </body>
559
- </html>
560
- ```
561
-
562
- **/package.json**
563
-
564
- ```json
565
- {
566
- "dependencies": {
567
- "react": "^18.0.0",
568
- "react-dom": "^18.0.0",
569
- "react-scripts": "^4.0.0"
570
- },
571
- "devDependencies": {
572
- "@types/react": "^18.0.0",
573
- "@types/react-dom": "^18.0.0",
574
- "typescript": "^4.0.0"
575
- },
576
- "main": "/index.tsx"
577
- }
578
- ```
579
-
580
- ---
581
-
582
- #### Notification component with additional text beyond the title
583
-
584
- In this example, the `Notification` component is utilized to display more information than just a title. It illustrates how to include additional text content within the notification to provide users with more context or details about the notification's purpose.
585
-
586
- **/styles.css**
587
-
588
- ```css
589
- body {
590
- font-size: 13px;
591
- font-weight: 400;
592
- letter-spacing: 0.08px;
593
- line-height: 20px;
594
- text-transform: none;
595
- font-family: "Inter", sans-serif;
596
- }
597
-
598
- h1 {
599
- font-size: 1.5rem;
600
- }
601
-
602
- .app {
603
- padding: 20px;
604
- }
605
- ```
606
-
607
- **tsconfig.json**
608
-
609
- ```json
610
- {
611
- "include": ["./**/*"],
612
- "compilerOptions": {
613
- "strict": true,
614
- "esModuleInterop": true,
615
- "lib": ["dom", "es2015"],
616
- "jsx": "react-jsx"
617
- }
618
- }
619
- ```
620
-
621
- **/App.tsx**
622
-
623
- ```tsx
624
- import { Notification } from "@czi-sds/components";
625
- import "./styles.css";
626
-
627
- function App() {
628
- return (
629
- <div className="app">
630
- <Notification>
631
- Notification Title
632
- <div>
633
- Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet eveniet
634
- sapiente, officiis aut possimus suscipit assumenda non?
635
- </div>
636
- </Notification>
637
- </div>
638
- );
639
- }
640
-
641
- export default App;
642
- ```
643
-
644
- **/index.tsx**
645
-
646
- ```tsx
647
- import React from "react";
648
- import { createRoot } from "react-dom/client";
649
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
650
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
651
- import { Theme } from "@czi-sds/components";
652
- import CssBaseline from "@mui/material/CssBaseline";
653
- import useMediaQuery from "@mui/material/useMediaQuery";
654
-
655
- import App from "./App";
656
-
657
- const container = document.getElementById("root");
658
- const root = createRoot(container!);
659
-
660
- const RootApp = () => {
661
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
662
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
663
-
664
- return (
665
- <StyledEngineProvider injectFirst>
666
- <ThemeProvider theme={theme}>
667
- <EmotionThemeProvider theme={theme}>
668
- <CssBaseline />
669
- <App />
670
- </EmotionThemeProvider>
671
- </ThemeProvider>
672
- </StyledEngineProvider>
673
- );
674
- };
675
-
676
- root.render(
677
- <React.StrictMode>
678
- <RootApp />
679
- </React.StrictMode>
680
- );
681
- ```
682
-
683
- **/public/index.html**
684
-
685
- ```html
686
- <!doctype html>
687
- <html lang="en">
688
- <head>
689
- <meta charset="UTF-8" />
690
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
691
- <link rel="preconnect" href="https://fonts.googleapis.com" />
692
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
693
- <link
694
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
695
- rel="stylesheet"
696
- />
697
- <link
698
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
699
- rel="stylesheet"
700
- />
701
- </head>
702
- <body>
703
- <div id="root"></div>
704
- </body>
705
- </html>
706
- ```
707
-
708
- **/package.json**
709
-
710
- ```json
711
- {
712
- "dependencies": {
713
- "react": "^18.0.0",
714
- "react-dom": "^18.0.0",
715
- "react-scripts": "^4.0.0"
716
- },
717
- "devDependencies": {
718
- "@types/react": "^18.0.0",
719
- "@types/react-dom": "^18.0.0",
720
- "typescript": "^4.0.0"
721
- },
722
- "main": "/index.tsx"
723
- }
724
- ```
725
-
726
- ---
727
-
728
- #### Dismissible Notification
729
-
730
- The dismissible `Notification` component grants users the convenience of dismissing it on their terms. It features a close `ButtonIcon` positioned in the upper-right corner, delivering a familiar interaction pattern for users to effortlessly remove the notification from view. Furthermore, the `onClose` prop empowers developers to define custom actions triggered when the notification is closed.
731
-
732
- **/styles.css**
733
-
734
- ```css
735
- body {
736
- font-size: 13px;
737
- font-weight: 400;
738
- letter-spacing: 0.08px;
739
- line-height: 20px;
740
- text-transform: none;
741
- font-family: "Inter", sans-serif;
742
- }
743
-
744
- h1 {
745
- font-size: 1.5rem;
746
- }
747
-
748
- .app {
749
- padding: 20px;
750
- }
751
- ```
752
-
753
- **tsconfig.json**
754
-
755
- ```json
756
- {
757
- "include": ["./**/*"],
758
- "compilerOptions": {
759
- "strict": true,
760
- "esModuleInterop": true,
761
- "lib": ["dom", "es2015"],
762
- "jsx": "react-jsx"
763
- }
764
- }
765
- ```
766
-
767
- **/App.tsx**
768
-
769
- ```tsx
770
- import { Notification } from "@czi-sds/components";
771
- import "./styles.css";
772
-
773
- function App() {
774
- return (
775
- <div className="app">
776
- <Notification
777
- onClose={(event) => {
778
- console.log("Notification closed!");
779
- }}
780
- >
781
- Notification Title
782
- <div>
783
- Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet eveniet
784
- sapiente, officiis aut possimus suscipit assumenda non?
785
- </div>
786
- </Notification>
787
- </div>
788
- );
789
- }
790
-
791
- export default App;
792
- ```
793
-
794
- **/index.tsx**
795
-
796
- ```tsx
797
- import React from "react";
798
- import { createRoot } from "react-dom/client";
799
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
800
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
801
- import { Theme } from "@czi-sds/components";
802
- import CssBaseline from "@mui/material/CssBaseline";
803
- import useMediaQuery from "@mui/material/useMediaQuery";
804
-
805
- import App from "./App";
806
-
807
- const container = document.getElementById("root");
808
- const root = createRoot(container!);
809
-
810
- const RootApp = () => {
811
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
812
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
813
-
814
- return (
815
- <StyledEngineProvider injectFirst>
816
- <ThemeProvider theme={theme}>
817
- <EmotionThemeProvider theme={theme}>
818
- <CssBaseline />
819
- <App />
820
- </EmotionThemeProvider>
821
- </ThemeProvider>
822
- </StyledEngineProvider>
823
- );
824
- };
825
-
826
- root.render(
827
- <React.StrictMode>
828
- <RootApp />
829
- </React.StrictMode>
830
- );
831
- ```
832
-
833
- **/public/index.html**
834
-
835
- ```html
836
- <!doctype html>
837
- <html lang="en">
838
- <head>
839
- <meta charset="UTF-8" />
840
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
841
- <link rel="preconnect" href="https://fonts.googleapis.com" />
842
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
843
- <link
844
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
845
- rel="stylesheet"
846
- />
847
- <link
848
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
849
- rel="stylesheet"
850
- />
851
- </head>
852
- <body>
853
- <div id="root"></div>
854
- </body>
855
- </html>
856
- ```
857
-
858
- **/package.json**
859
-
860
- ```json
861
- {
862
- "dependencies": {
863
- "react": "^18.0.0",
864
- "react-dom": "^18.0.0",
865
- "react-scripts": "^4.0.0"
866
- },
867
- "devDependencies": {
868
- "@types/react": "^18.0.0",
869
- "@types/react-dom": "^18.0.0",
870
- "typescript": "^4.0.0"
871
- },
872
- "main": "/index.tsx"
873
- }
874
- ```
875
-
876
- ---
877
-
878
- #### Notification with Embedded Button
879
-
880
- A `Notification` component that has an integrated `Button` that closes the notification when clicked.
881
-
882
- **/styles.css**
883
-
884
- ```css
885
- body {
886
- font-size: 13px;
887
- font-weight: 400;
888
- letter-spacing: 0.08px;
889
- line-height: 20px;
890
- text-transform: none;
891
- font-family: "Inter", sans-serif;
892
- }
893
-
894
- h1 {
895
- font-size: 1.5rem;
896
- }
897
-
898
- .app {
899
- padding: 20px;
900
- }
901
- ```
902
-
903
- **tsconfig.json**
904
-
905
- ```json
906
- {
907
- "include": ["./**/*"],
908
- "compilerOptions": {
909
- "strict": true,
910
- "esModuleInterop": true,
911
- "lib": ["dom", "es2015"],
912
- "jsx": "react-jsx"
913
- }
914
- }
915
- ```
916
-
917
- **/App.tsx**
918
-
919
- ```tsx
920
- import { useState } from "react";
921
- import { Notification, Button } from "@czi-sds/components";
922
- import "./styles.css";
923
-
924
- function App() {
925
- const [dismissed, setDismissed] = useState(false);
926
- const handleClick = () => {
927
- setDismissed((prev) => !prev);
928
- };
929
- return (
930
- <div className="app">
931
- {!dismissed ? (
932
- <Notification
933
- buttonText="Close"
934
- buttonOnClick={(event) => setDismissed(true)}
935
- dismissed={dismissed}
936
- intent="notice"
937
- >
938
- Notification Title
939
- <div>
940
- Lorem ipsum, dolor sit amet consectetur adipisicing elit. Amet
941
- eveniet sapiente, officiis aut possimus suscipit assumenda non?
942
- </div>
943
- </Notification>
944
- ) : (
945
- <Button onClick={handleClick} sdsType="primary" sdsStyle="rounded">
946
- Reset Notification
947
- </Button>
948
- )}
949
- </div>
950
- );
951
- }
952
-
953
- export default App;
954
- ```
955
-
956
- **/index.tsx**
957
-
958
- ```tsx
959
- import React from "react";
960
- import { createRoot } from "react-dom/client";
961
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
962
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
963
- import { Theme } from "@czi-sds/components";
964
- import CssBaseline from "@mui/material/CssBaseline";
965
- import useMediaQuery from "@mui/material/useMediaQuery";
966
-
967
- import App from "./App";
968
-
969
- const container = document.getElementById("root");
970
- const root = createRoot(container!);
971
-
972
- const RootApp = () => {
973
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
974
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
975
-
976
- return (
977
- <StyledEngineProvider injectFirst>
978
- <ThemeProvider theme={theme}>
979
- <EmotionThemeProvider theme={theme}>
980
- <CssBaseline />
981
- <App />
982
- </EmotionThemeProvider>
983
- </ThemeProvider>
984
- </StyledEngineProvider>
985
- );
986
- };
987
-
988
- root.render(
989
- <React.StrictMode>
990
- <RootApp />
991
- </React.StrictMode>
992
- );
993
- ```
994
-
995
- **/public/index.html**
996
-
997
- ```html
998
- <!doctype html>
999
- <html lang="en">
1000
- <head>
1001
- <meta charset="UTF-8" />
1002
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1003
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1004
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1005
- <link
1006
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1007
- rel="stylesheet"
1008
- />
1009
- <link
1010
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1011
- rel="stylesheet"
1012
- />
1013
- </head>
1014
- <body>
1015
- <div id="root"></div>
1016
- </body>
1017
- </html>
1018
- ```
1019
-
1020
- **/package.json**
1021
-
1022
- ```json
1023
- {
1024
- "dependencies": {
1025
- "react": "^18.0.0",
1026
- "react-dom": "^18.0.0",
1027
- "react-scripts": "^4.0.0"
1028
- },
1029
- "devDependencies": {
1030
- "@types/react": "^18.0.0",
1031
- "@types/react-dom": "^18.0.0",
1032
- "typescript": "^4.0.0"
1033
- },
1034
- "main": "/index.tsx"
1035
- }
1036
- ```
1037
-
1038
- ---