@czi-sds/mcp 0.2.2 → 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.
Files changed (147) hide show
  1. package/data/component-props/Accordion.json +14 -15
  2. package/data/component-props/Alert.json +2 -44
  3. package/data/component-props/Autocomplete.json +14 -32
  4. package/data/component-props/Banner.json +11 -12
  5. package/data/component-props/Button.json +17 -82
  6. package/data/component-props/ButtonDropdown.json +26 -0
  7. package/data/component-props/ButtonIcon.json +4 -60
  8. package/data/component-props/ButtonToggle.json +2 -66
  9. package/data/component-props/Callout.json +11 -65
  10. package/data/component-props/CellBasic.json +28 -56
  11. package/data/component-props/CellComponent.json +4 -32
  12. package/data/component-props/CellHeader.json +13 -49
  13. package/data/component-props/ComplexFilter.json +24 -4
  14. package/data/component-props/ContentCard.json +66 -2
  15. package/data/component-props/Dialog.json +26 -0
  16. package/data/component-props/Dropdown.json +29 -67
  17. package/data/component-props/DropdownMenu.json +16 -56
  18. package/data/component-props/HeatmapChart.json +6 -87
  19. package/data/component-props/Icon.json +3 -8
  20. package/data/component-props/InputCheckbox.json +5 -53
  21. package/data/component-props/InputDropdown.json +11 -33
  22. package/data/component-props/InputRadio.json +5 -53
  23. package/data/component-props/InputSearch.json +6 -70
  24. package/data/component-props/InputSlider.json +21 -35
  25. package/data/component-props/InputText.json +7 -63
  26. package/data/component-props/InputToggle.json +5 -54
  27. package/data/component-props/Link.json +18 -0
  28. package/data/component-props/LoadingIndicator.json +1 -2
  29. package/data/component-props/MenuItem.json +11 -41
  30. package/data/component-props/MenuSelect.json +4 -67
  31. package/data/component-props/NavigationFooter.json +0 -8
  32. package/data/component-props/NavigationHeader.json +14 -65
  33. package/data/component-props/NavigationJumpTo.json +0 -40
  34. package/data/component-props/Notification.json +14 -58
  35. package/data/component-props/Pagination.json +8 -33
  36. package/data/component-props/Panel.json +4 -54
  37. package/data/component-props/SegmentedControl.json +0 -55
  38. package/data/component-props/TableRow.json +10 -38
  39. package/data/component-props/Tabs.json +18 -0
  40. package/data/component-props/Tag.json +10 -56
  41. package/data/component-props/TagFilter.json +0 -47
  42. package/data/component-props/Tooltip.json +12 -61
  43. package/data/component-props/TooltipCondensed.json +18 -0
  44. package/data/component-props/TooltipTable.json +0 -4
  45. package/data/zeroheight-cache.json +5195 -0
  46. package/data/zeroheight-exports/Accordion.md +717 -0
  47. package/data/zeroheight-exports/Banner.md +599 -0
  48. package/data/zeroheight-exports/Borders.md +117 -0
  49. package/data/zeroheight-exports/Buttons.md +2305 -0
  50. package/data/zeroheight-exports/Callout.md +778 -0
  51. package/data/zeroheight-exports/Colors.md +632 -0
  52. package/data/zeroheight-exports/Content-Card.md +161 -0
  53. package/data/zeroheight-exports/Contributing-to-SDS.md +98 -0
  54. package/data/zeroheight-exports/Control-Inputs.md +2121 -0
  55. package/data/zeroheight-exports/Corners.md +111 -0
  56. package/data/zeroheight-exports/Cover-page.md +3 -0
  57. package/data/zeroheight-exports/Dialog.md +1191 -0
  58. package/data/zeroheight-exports/Downloads.md +120 -0
  59. package/data/zeroheight-exports/Drop-Shadows.md +79 -0
  60. package/data/zeroheight-exports/Dropdown-Input.md +1180 -0
  61. package/data/zeroheight-exports/Dropdown-Menu.md +3883 -0
  62. package/data/zeroheight-exports/Element-Status-Tracker.md +267 -0
  63. package/data/zeroheight-exports/Field-Inputs.md +984 -0
  64. package/data/zeroheight-exports/Filters.md +888 -0
  65. package/data/zeroheight-exports/Getting-Started.md +1159 -0
  66. package/data/zeroheight-exports/Hero.md +262 -0
  67. package/data/zeroheight-exports/Icons.md +431 -0
  68. package/data/zeroheight-exports/Intent.md +46 -0
  69. package/data/zeroheight-exports/Introduction-to-Bases.md +35 -0
  70. package/data/zeroheight-exports/Introduction-to-Cells.md +35 -0
  71. package/data/zeroheight-exports/Introduction-to-DNA.md +35 -0
  72. package/data/zeroheight-exports/Introduction-to-Genes.md +35 -0
  73. package/data/zeroheight-exports/Introduction.md +115 -0
  74. package/data/zeroheight-exports/Link.md +386 -0
  75. package/data/zeroheight-exports/Lists.md +632 -0
  76. package/data/zeroheight-exports/Loading-Indicator.md +37 -0
  77. package/data/zeroheight-exports/Navigation.md +874 -0
  78. package/data/zeroheight-exports/Notification.md +888 -0
  79. package/data/zeroheight-exports/Panel.md +978 -0
  80. package/data/zeroheight-exports/README.md +124 -0
  81. package/data/zeroheight-exports/Responsive-Design.md +278 -0
  82. package/data/zeroheight-exports/Search-Input.md +53 -0
  83. package/data/zeroheight-exports/Search.md +592 -0
  84. package/data/zeroheight-exports/Segmented-Control.md +584 -0
  85. package/data/zeroheight-exports/Spacing.md +297 -0
  86. package/data/zeroheight-exports/Table.md +4944 -0
  87. package/data/zeroheight-exports/Tabs.md +801 -0
  88. package/data/zeroheight-exports/Tags.md +1055 -0
  89. package/data/zeroheight-exports/Text-Link.md +184 -0
  90. package/data/zeroheight-exports/Theming.md +332 -0
  91. package/data/zeroheight-exports/Tooltips.md +1580 -0
  92. package/data/zeroheight-exports/Typography.md +768 -0
  93. package/dist/stdio.js +193 -93
  94. package/package.json +4 -4
  95. package/data/component-props/Chip.json +0 -73
  96. package/data/component-props/List.json +0 -43
  97. package/data/component-props/Menu.json +0 -48
  98. package/data/component-props/Table.json +0 -26
  99. package/data/component-props-storybook/Accordion-storybook.json +0 -45
  100. package/data/component-props-storybook/Alert-storybook.json +0 -30
  101. package/data/component-props-storybook/Autocomplete-storybook.json +0 -67
  102. package/data/component-props-storybook/Banner-storybook.json +0 -78
  103. package/data/component-props-storybook/Button-storybook.json +0 -115
  104. package/data/component-props-storybook/ButtonDropdown-storybook.json +0 -73
  105. package/data/component-props-storybook/ButtonIcon-storybook.json +0 -60
  106. package/data/component-props-storybook/ButtonToggle-storybook.json +0 -68
  107. package/data/component-props-storybook/Callout-storybook.json +0 -90
  108. package/data/component-props-storybook/CellBasic-storybook.json +0 -138
  109. package/data/component-props-storybook/CellComponent-storybook.json +0 -48
  110. package/data/component-props-storybook/CellHeader-storybook.json +0 -71
  111. package/data/component-props-storybook/Chip-storybook.json +0 -26
  112. package/data/component-props-storybook/ComplexFilter-storybook.json +0 -60
  113. package/data/component-props-storybook/ContentCard-storybook.json +0 -175
  114. package/data/component-props-storybook/Dialog-storybook.json +0 -56
  115. package/data/component-props-storybook/Dropdown-storybook.json +0 -93
  116. package/data/component-props-storybook/DropdownMenu-storybook.json +0 -73
  117. package/data/component-props-storybook/HeatmapChart-storybook.json +0 -55
  118. package/data/component-props-storybook/Icon-storybook.json +0 -75
  119. package/data/component-props-storybook/InputCheckbox-storybook.json +0 -57
  120. package/data/component-props-storybook/InputDropdown-storybook.json +0 -80
  121. package/data/component-props-storybook/InputRadio-storybook.json +0 -56
  122. package/data/component-props-storybook/InputSearch-storybook.json +0 -55
  123. package/data/component-props-storybook/InputSlider-storybook.json +0 -55
  124. package/data/component-props-storybook/InputText-storybook.json +0 -59
  125. package/data/component-props-storybook/InputToggle-storybook.json +0 -42
  126. package/data/component-props-storybook/Link-storybook.json +0 -50
  127. package/data/component-props-storybook/List-storybook.json +0 -26
  128. package/data/component-props-storybook/LoadingIndicator-storybook.json +0 -34
  129. package/data/component-props-storybook/Menu-storybook.json +0 -26
  130. package/data/component-props-storybook/MenuItem-storybook.json +0 -74
  131. package/data/component-props-storybook/MenuSelect-storybook.json +0 -38
  132. package/data/component-props-storybook/NavigationFooter-storybook.json +0 -67
  133. package/data/component-props-storybook/NavigationHeader-storybook.json +0 -115
  134. package/data/component-props-storybook/NavigationJumpTo-storybook.json +0 -41
  135. package/data/component-props-storybook/Notification-storybook.json +0 -89
  136. package/data/component-props-storybook/Pagination-storybook.json +0 -50
  137. package/data/component-props-storybook/Panel-storybook.json +0 -52
  138. package/data/component-props-storybook/SegmentedControl-storybook.json +0 -30
  139. package/data/component-props-storybook/Table-storybook.json +0 -26
  140. package/data/component-props-storybook/TableHeader-storybook.json +0 -26
  141. package/data/component-props-storybook/TableRow-storybook.json +0 -62
  142. package/data/component-props-storybook/Tabs-storybook.json +0 -45
  143. package/data/component-props-storybook/Tag-storybook.json +0 -78
  144. package/data/component-props-storybook/TagFilter-storybook.json +0 -30
  145. package/data/component-props-storybook/Tooltip-storybook.json +0 -85
  146. package/data/component-props-storybook/TooltipCondensed-storybook.json +0 -38
  147. package/data/component-props-storybook/TooltipTable-storybook.json +0 -47
@@ -0,0 +1,1191 @@
1
+ # Dialogs
2
+
3
+ A Dialog is a window element that appears on top of content to provide information or prompt the user for an action. When a Dialog is active, it disables all functionality of the page below and remains on the screen until it is either dismissed or action has been taken.
4
+
5
+ ## Overview
6
+
7
+ | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
8
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
9
+
10
+ Dialogs are highly customizable and designed to accommodate a range of product needs and can optionally include overline text above the title, subtitle text below the title, or both. The interior of a Dialog can be filled with any content needed, whether that is to communicate information to the user or collect data from them via a form.
11
+
12
+ There are five size options, each with a fixed width and minimum height (except for `xs` and `xxs` which have no minimum height):
13
+
14
+ - `xxs` — `width: 270px`
15
+ - `xs` —`width: 400px`
16
+ - `s` —`width: 600px`, `min-height: 400px`
17
+ - `m` —`width: 900px`, `min-height: 480px`
18
+ - `l` —`width: 1200px`, `min-height: 600px`
19
+
20
+ Dialogs are dismissible in a few different ways. Regardless of how a Dialog is dismissed, it will result in any selections the user has made within it being lost.
21
+
22
+ Dialogs may be dismissed by:
23
+
24
+ - Clicking an action Button that is configured to close, cancel, or complete an action occurring in the Dialog
25
+ - Pressing the keyboard Esc key
26
+ - Clicking the close Icon Button
27
+ - Clicking outside of the Dialog. Doing this will result in any selections the user has made being lost, so it is recommended that the `canOutsideClickClose` prop remain set to `false` (the default setting) in instances where losing entered information would be a significant burden to the user
28
+
29
+ ---
30
+
31
+ ### Dialog Spacing
32
+
33
+ In instances where the length of content contained in the Dialog results in the Dialog filling the entire height of the screen, there must be a minimum of `spaceXxl` margin above and below the Dialog window. The Dialog content scrolls when it exceeds the max-height of the dialog window; the title and any action Buttons are anchored to the top and bottom during scrolling.
34
+
35
+ ---
36
+
37
+ ### Dialog Backdrop
38
+
39
+ A backdrop appears behind the active Dialog to bring emphasis to it as well as indicate to users that they cannot interact with the content on the page behind it.
40
+
41
+ ## Code
42
+
43
+ ## Dialog Component
44
+
45
+ | Below you will find an interactive Storybook iframe for Dialogs. 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:** Dialog |
46
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------- |
47
+
48
+ ---
49
+
50
+ > This component appears as it is in the default SDS codebase. Once imported into the napari hub or napari.org codebases, use a theme file to enable the napari visual appearance customization.
51
+
52
+ ### Dialog
53
+
54
+ Storybook
55
+
56
+ ---
57
+
58
+ A Dialog is a window element that appears on top of content to provide information or prompt the user for an action. When a Dialog is active, it disables all functionality of the page below and remains on the screen until it is either dismissed or action has been taken.
59
+
60
+ ## Overview
61
+
62
+ ## Dialog Variants
63
+
64
+ | The interior of a Dialog can be filled with any content needed, whether that is to communicate information to the user or collect data from them via a form. They come in four different sizes, each of which can optionally include a close Tertiary Icon Button in the top right corner, artwork above the title, and action Button(s) if the Dialog is prompting the user to take an action. In addition to their title, Dialogs can include overline text above the title, a subtitle below the title, or both. Follow the usage criteria accompanying each variant as a guide for selecting the correct Dialog for any given use case. | | **Jump to variant:** Persistent Dismissible Use Cases |
65
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------- |
66
+
67
+ ---
68
+
69
+ ## Dialog
70
+
71
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
72
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
73
+
74
+ Dialogs are highly customizable and designed to accommodate a range of product needs; any combination of the following properties can be used:
75
+
76
+ - Overline text above the title, subtitle text below the title, or both
77
+ - Artwork above the title, whether a logo, icon, or illustration
78
+
79
+ There are four size options, each with a fixed width and minimum height (except for `xs` which has no minimum height):
80
+
81
+ - `xs` —`width: 400px`
82
+ - `s` —`width: 600px`, `min-height: 400px`
83
+ - `m` —`width: 900px`, `min-height: 480px`
84
+ - `l` —`width: 1200px`, `min-height: 600px`
85
+
86
+ Dialogs may be dismissed by:
87
+
88
+ - Clicking an action Button that is configured to close, cancel, or complete a multi-step workflow occurring in the Dialog
89
+ - Pressing the keyboard Esc key
90
+ - Clicking the close Tertiary Icon Button on Dismissible Dialogs
91
+ - Clicking outside of the Dialog. Doing this will result in any selections the user has made being lost, so it is recommended that the `canOutsideClickClose` prop remain set to `false` (the default setting) in instances where losing entered information would be a significant burden to the user
92
+
93
+ ### Persistent Dialog
94
+
95
+ Use this variant when the user is unable to dismiss the Dialog without making a selection from one of the action Button(s). Because there is no way for the user to manually dismiss the Dialog, this variant must contain at least one action Button.
96
+
97
+ Persistent Dialogs are generally used in multi-step workflows where dismissing the Dialog would result in a loss of progress or when there is a need for users to confirm they have read the content on the Dialog before proceeding, such as when they are being directed to an external site (see Dialog Use Cases section below for details).
98
+
99
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
100
+
101
+
102
+
103
+ ---
104
+
105
+ ---
106
+
107
+ ---
108
+
109
+ ### Dismissible Dialog
110
+
111
+ Use this variant to allow the user the ability to manually dismiss the Dialog by clicking the close Tertiary Icon Button in the Dialog's upper right corner. Dismissing the Dialog will result in any selections the user has made being lost. Dismissible Dialogs should not be used in multi-step workflows where closing the Dialog would result in a loss of progress.
112
+
113
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
114
+
115
+ ---
116
+
117
+ ---
118
+
119
+ ---
120
+
121
+ ---
122
+
123
+ ---
124
+
125
+ ### Dialog Spacing
126
+
127
+ In instances where the length of content contained in the Dialog results in the Dialog filling the entire height of the screen, there must be a minimum of `spaceXxl` margin above and below the Dialog window. The Dialog content scrolls when it exceeds the max-height of the dialog window; title, overline, subtitle, and any action Buttons are anchored to the top and bottom during scrolling.
128
+
129
+ ---
130
+
131
+ ### Dialog Backdrop
132
+
133
+ A backdrop appears behind the active Dialog to bring emphasis to it as well as indicate to users that they cannot interact with the content on the page behind it.
134
+
135
+ ---
136
+
137
+ ## Dialog Use Cases
138
+
139
+ Details and guidelines around complex Dialog use cases, such as nested Dialogs and multi-step Dialog workflows.
140
+
141
+ ### Nested Dialogs
142
+
143
+ Nested Dialogs should only be used in specific scenarios, most notably when a user is being directed to an external site and a final confirmation is needed.
144
+
145
+ Avoid using nested dialogs when possible because it introduces layers of complexity to pages and may make it more difficult for users to anticipate the results of their actions. It may also impede usability by making it more difficult for users to quickly exit a flow. Instead, explore utilizing a multi-step Dialog workflow (see below).
146
+
147
+
148
+
149
+ ### Multi-step Dialog Workflow
150
+
151
+ Dialog workflows should contain no more than three steps. Workflows that are more than three steps should be designed as a full-page experience.
152
+
153
+ For a flow that takes place inside a Dialog, all steps within that workflow should take place within the same size Dialog for a consistent user experience. Each step of the workflow should also be clearly communicated within the Dialog using the overline text.
154
+
155
+ The Dialog should not be dismissible and the `canOutsideClickClose` prop should be set to `false` to prevent any accidental loss of progress.
156
+
157
+ ## Code
158
+
159
+ ## Dialog Component
160
+
161
+ | Below you will find an interactive Storybook iframe for Dialogs. 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:** Dialog |
162
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------- |
163
+
164
+ ---
165
+
166
+ > 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.
167
+
168
+ ### Dialog
169
+
170
+ Storybook
171
+
172
+ ---
173
+
174
+ A Dialog is a window element that appears on top of content to provide information or prompt the user for an action. When a Dialog is active, it disables all functionality of the page below and remains on the screen until it is either dismissed or action has been taken.
175
+
176
+ ## Overview
177
+
178
+ ## Dialog Variants
179
+
180
+ | The interior of a Dialog can be filled with any content needed, whether that is to communicate information to the user or collect data from them via a form. They come in four different sizes, each of which can optionally include a close Tertiary Icon Button in the top right corner, artwork above the title, and action Button(s) if the Dialog is prompting the user to take an action. In addition to their title, Dialogs can include overline text above the title, a subtitle below the title, or both. Follow the usage criteria accompanying each variant as a guide for selecting the correct Dialog for any given use case. | | **Jump to variant:** Persistent Dismissible Use Cases |
181
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------- |
182
+
183
+ ---
184
+
185
+ ## Dialog
186
+
187
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
188
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
189
+
190
+ Dialogs are highly customizable and designed to accommodate a range of product needs; any combination of the following properties can be used:
191
+
192
+ - Overline text above the title, subtitle text below the title, or both
193
+ - Artwork above the title, whether a logo, icon, or illustration
194
+
195
+ There are four size options, each with a fixed width and minimum height (except for `xs` which has no minimum height):
196
+
197
+ - `xs` —`width: 400px`
198
+ - `s` —`width: 600px`, `min-height: 400px`
199
+ - `m` —`width: 900px`, `min-height: 480px`
200
+ - `l` —`width: 1200px`, `min-height: 600px`
201
+
202
+ Dialogs may be dismissed by:
203
+
204
+ - Clicking an action Button that is configured to close, cancel, or complete a multi-step workflow occurring in the Dialog
205
+ - Pressing the keyboard Esc key
206
+ - Clicking the close Tertiary Icon Button on Dismissible Dialogs
207
+ - Clicking outside of the Dialog. Doing this will result in any selections the user has made being lost, so it is recommended that the `canOutsideClickClose` prop remain set to `false` (the default setting) in instances where losing entered information would be a significant burden to the user
208
+
209
+ ### Persistent Dialog
210
+
211
+ Use this variant when the user is unable to dismiss the Dialog without making a selection from one of the action Button(s). Because there is no way for the user to manually dismiss the Dialog, this variant must contain at least one action Button.
212
+
213
+ Persistent Dialogs are generally used in multi-step workflows where dismissing the Dialog would result in a loss of progress or when there is a need for users to confirm they have read the content on the Dialog before proceeding, such as when they are being directed to an external site (see Dialog Use Cases section below for details).
214
+
215
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
216
+
217
+
218
+
219
+ ---
220
+
221
+ ---
222
+
223
+ ---
224
+
225
+ ### Dismissible Dialog
226
+
227
+ Use this variant to allow the user the ability to manually dismiss the Dialog by clicking the close Tertiary Icon Button in the Dialog's upper right corner. Dismissing the Dialog will result in any selections the user has made being lost. Dismissible Dialogs should not be used in multi-step workflows where closing the Dialog would result in a loss of progress.
228
+
229
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
230
+
231
+ ---
232
+
233
+ ---
234
+
235
+ ---
236
+
237
+ ---
238
+
239
+ ---
240
+
241
+ ### Dialog Spacing
242
+
243
+ In instances where the length of content contained in the Dialog results in the Dialog filling the entire height of the screen, there must be a minimum of `spaceXxl` margin above and below the Dialog window. The Dialog content scrolls when it exceeds the max-height of the dialog window; title, overline, subtitle, and any action Buttons are anchored to the top and bottom during scrolling.
244
+
245
+
246
+
247
+ ---
248
+
249
+ ### Dialog Backdrop
250
+
251
+ A backdrop appears behind the active Dialog to bring emphasis to it as well as indicate to users that they cannot interact with the content on the page behind it.
252
+
253
+ ---
254
+
255
+ ## Dialog Use Cases
256
+
257
+ Details and guidelines around complex Dialog use cases, such as nested Dialogs and multi-step Dialog workflows.
258
+
259
+ ### Nested Dialogs
260
+
261
+ Nested Dialogs should only be used in specific scenarios, most notably when a user is being directed to an external site and a final confirmation is needed.
262
+
263
+ Avoid using nested dialogs when possible because it introduces layers of complexity to pages and may make it more difficult for users to anticipate the results of their actions. It may also impede usability by making it more difficult for users to quickly exit a flow. Instead, explore utilizing a multi-step Dialog workflow (see below).
264
+
265
+
266
+
267
+ ### Multi-step Dialog Workflow
268
+
269
+ Dialog workflows should contain no more than three steps. Workflows that are more than three steps should be designed as a full-page experience.
270
+
271
+ For a flow that takes place inside a Dialog, all steps within that workflow should take place within the same size Dialog for a consistent user experience. Each step of the workflow should also be clearly communicated within the Dialog using the overline text.
272
+
273
+ The Dialog should not be dismissible and the `canOutsideClickClose` prop should be set to `false` to prevent any accidental loss of progress.
274
+
275
+ ## Code
276
+
277
+ ## Dialog Component
278
+
279
+ | Below you will find an interactive Storybook iframe for Dialogs. 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:** Dialog |
280
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------- |
281
+
282
+ ---
283
+
284
+ ### Dialog
285
+
286
+ Storybook
287
+
288
+
289
+
290
+ ---
291
+
292
+ A Dialog is a window element that appears on top of content to provide information or prompt the user for an action. When a Dialog is active, it disables all functionality of the page below and remains on the screen until it is either dismissed or an action has been taken.
293
+
294
+ ## Guidelines
295
+
296
+ ## Overview
297
+
298
+ | | In Figma | | | Meets Accessibility | | | In Code |
299
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
300
+
301
+ ### Dialog Variants
302
+
303
+ The interior of a Dialog can be filled with any content needed, whether that is to communicate information to the user or collect data from them via a form.
304
+
305
+ There are two Dialog variants available—Persistent and Dismissible. They are highly customizable and designed to accommodate a range of product needs.
306
+
307
+ Any combination of the following properties can be used:
308
+
309
+ - One or two Button(s), positioned to the right or left side of the dialog (positioned right by default)
310
+ - Overline text above the title
311
+ - Subtitle text below the title
312
+ - Artwork above the title (logo, icon, or illustration)
313
+
314
+ There are four size options, each with a fixed width and minimum height (except for `xs` which has no minimum height):
315
+
316
+ - `xs` —`width: 400px`
317
+ - `s` —`width: 600px`, `min-height: 400px`
318
+ - `m` —`width: 900px`, `min-height: 480px`
319
+ - `l` —`width: 1200px`, `min-height: 600px`
320
+
321
+ Users can dismiss them by:
322
+
323
+ - Clicking an action Button that is configured to close, cancel, or complete a multi-step workflow occurring in the Dialog
324
+ - Pressing the keyboard `Esc` key
325
+ - Clicking the close Tertiary Icon Button (Dismissible variant only)
326
+ - Clicking outside of the Dialog. Doing this will result in any selections the user has made being lost, so it is recommended that this be disabled in instances where losing entered information would be a significant burden to the user
327
+
328
+ ---
329
+
330
+ ### Live Instance
331
+
332
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
333
+
334
+ Default
335
+
336
+ ---
337
+
338
+ ### Dialog – Persistent
339
+
340
+ Use this variant when the user is unable to dismiss the Dialog without making a selection from one of the action Button(s). Because there is no way for the user to manually dismiss the Dialog, **this variant must contain at least one action Button**.
341
+
342
+ Persistent Dialogs are generally used:
343
+
344
+ - In multi-step workflows where dismissing the Dialog would result in a loss of progress
345
+ - When there is a need for users to confirm they have read the content on the Dialog before proceeding, such as when they are being directed to an external site (see Dialog Use Cases section below for details).
346
+
347
+ | 1 Button | 2 Buttons | 2 Buttons, left-aligned |
348
+ | -------- | --------- | ----------------------- |
349
+
350
+ | 2 Buttons, rounded | 2 Buttons + Overline + Subtitle | 2 Buttons + Artwork |
351
+ | ------------------ | ------------------------------- | ------------------- |
352
+
353
+ ---
354
+
355
+ ### Dialog – Dismissible
356
+
357
+ Use this variant to allow the user the ability to manually dismiss the Dialog by clicking the close Tertiary Icon Button in the Dialog's upper right corner. Dismissing the Dialog will result in any selections the user has made being lost. Dismissible Dialogs should not be used in multi-step workflows where closing the Dialog would result in a loss of progress (see Dialog Use Cases section below for details).
358
+
359
+ | 0 Buttons | 1 Button | 2 Buttons | 2 Buttons, left-aligned |
360
+ | --------- | -------- | --------- | ----------------------- |
361
+
362
+ | 2 Buttons, rounded | 2 Buttons + Overline + Subtitle | 2 Buttons + Artwork |
363
+ | ------------------ | ------------------------------- | ------------------- |
364
+
365
+ ---
366
+
367
+ ### Dialog Spacing
368
+
369
+ In instances where the length of content contained in the Dialog results in the Dialog filling the entire height of the screen, there must be a minimum of `spaceXxl` margin above and below the Dialog window. The Dialog content scrolls when it exceeds the max-height of the dialog window; title, overline, subtitle, and any action Buttons are anchored to the top and bottom during scrolling.
370
+
371
+ ---
372
+
373
+ ### Dialog Backdrop
374
+
375
+ A backdrop appears behind the active Dialog to bring emphasis to it as well as indicate to users that they cannot interact with the content on the page behind it.
376
+
377
+ The default backdrop is dark and customizable at the product level.
378
+
379
+ ---
380
+
381
+ ### Dialog Use Cases
382
+
383
+ Details and guidelines around complex Dialog use cases, such as nested Dialogs and multi-step Dialog workflows.
384
+
385
+ #### Nested Dialogs
386
+
387
+ Nested Dialogs should only be used in specific scenarios, most notably when a user is being directed to an external site and a final confirmation is needed.
388
+
389
+ Avoid using nested dialogs when possible because it introduces layers of complexity to pages and may make it more difficult for users to anticipate the results of their actions. It may also impede usability by making it more difficult for users to quickly exit a flow. Instead, explore utilizing a multi-step Dialog workflow (see below).
390
+
391
+ #### Multi-step Dialog Workflow
392
+
393
+ Dialog workflows should contain no more than three steps. Workflows that are more than three steps should be designed as a full-page experience.
394
+
395
+ For a flow that takes place inside a Dialog, all steps within that workflow should take place within the same size Dialog for a consistent user experience. Each step of the workflow should also be clearly communicated within the Dialog using the overline text.
396
+
397
+ The Dialog should not be dismissible to prevent any accidental loss of progress.
398
+
399
+ ## Code
400
+
401
+ > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
402
+
403
+ ## Dialog
404
+
405
+ ### SDS Source Code
406
+
407
+ The `Dialog` component's source code in the SDS codebase can be found here.
408
+
409
+ The `Dialog` component is accompanied by a number of other accessory components that can be used to help compose dialogs, but they are not required:
410
+
411
+ - Main `Dialog` component source code
412
+ - `DialogActions` source code
413
+ - `DialogContent` source code
414
+ - `DialogPaper` source code
415
+ - `DialogTitle` source code
416
+
417
+ ### SDS vs MUI
418
+
419
+ The SDS `Dialog` component is built on top of MUI's `Dialog` component. SDS's `Dialog` passes a styled version of the `Paper` component (`DialogPaper`) to the `PaperComponent` prop. You can further style this `DialogPaper` component and pass it to your SDS `Dialog` via the `PaperComponent` prop (a prop of SDS `Dialog`) if needed.
420
+
421
+ The SDS `Dialog` does **not** support the `fullScreen` prop that the MUI component has (which allows dialogs to overtake the full screen).
422
+
423
+ ### MUI Documentation
424
+
425
+ Documentation for the underlying MUI component can be found here.
426
+
427
+ ### Props
428
+
429
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
430
+
431
+ #### Dialog Props
432
+
433
+ Props table for the Dialog component.
434
+
435
+ | Name | Type | Default | Description |
436
+ | ---------------------- | -------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | --- | ------------------------------------------ |
437
+ | `canClickOutsideClose` | `bool` | `false` | A boolean prop that determines whether clicking outside of the Dialog should trigger its closure. |
438
+ | `onClose` | `func` | `function(event: object, reason: string) => void` | A callback function that is invoked when the Dialog is closed. It receives two parameters: `event`. The event source of the callback. `reason`. Can be: .`escapeKeyDown`., .`backdropClick`. |
439
+ | `sdsSize` | `"xs"` ` | "s"` ` | "m"` ` | "l"` | `m` | Controls the size of the Dialog component. |
440
+
441
+ #### DialogTitle Props
442
+
443
+ Props table for the DialogTitle component.
444
+
445
+ | Name | Type | Default | Description |
446
+ | ---------- | -------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
447
+ | `title` | `string` | `-` | This prop represents the title text to be displayed in the Dialog component. |
448
+ | `subtitle` | `string` | `-` | The subtitle prop allows you to include additional descriptive text beneath the title within the Dialog. |
449
+ | `onClose` | `func` | `function(event: object, reason: string) => void` | When the `onClose` prop is set, it results in the appearance of a small `x` icon in the top-right corner of the Dialog. This `x` icon provides users with a visual cue to close the Dialog, and clicking on it invokes the specified `onClose` function. |
450
+ | `open` | `bool` | `false` | If `true`, the component is shown. |
451
+
452
+ #### DialogActions Props
453
+
454
+ Props table for the DialogActions component.
455
+
456
+ | Name | Type | Default | Description |
457
+ | ---------------- | ------- | -------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
458
+ | `buttonPosition` | `"left" | "right"` | `left` | Specifies the position of action buttons within the Dialog component. It can be set to either `left` or `right` , allowing you to control the alignment of these buttons. |
459
+
460
+ ### Code examples
461
+
462
+ #### Default Dialog
463
+
464
+ This example has the minimum props needed for the `Dialog` component.
465
+
466
+ **/styles.css**
467
+
468
+ ```css
469
+ body {
470
+ font-size: 13px;
471
+ font-weight: 400;
472
+ letter-spacing: 0.08px;
473
+ line-height: 20px;
474
+ text-transform: none;
475
+ font-family: "Inter", sans-serif;
476
+ }
477
+
478
+ h1 {
479
+ font-size: 1.5rem;
480
+ }
481
+
482
+ .app {
483
+ padding: 20px;
484
+ }
485
+ ```
486
+
487
+ **tsconfig.json**
488
+
489
+ ```json
490
+ {
491
+ "include": ["./**/*"],
492
+ "compilerOptions": {
493
+ "strict": true,
494
+ "esModuleInterop": true,
495
+ "lib": ["dom", "es2015"],
496
+ "jsx": "react-jsx"
497
+ }
498
+ }
499
+ ```
500
+
501
+ **/App.tsx**
502
+
503
+ ```tsx
504
+ // Most minimal Dialog (just has the basic requirements)
505
+
506
+ import { useState } from "react";
507
+ import {
508
+ Button,
509
+ Dialog,
510
+ DialogTitle,
511
+ DialogContent,
512
+ DialogActions,
513
+ } from "@czi-sds/components";
514
+ import "./styles.css";
515
+
516
+ function App() {
517
+ const [isOpen, setIsOpen] = useState(true);
518
+
519
+ function handleClick() {
520
+ setIsOpen(true);
521
+ }
522
+
523
+ function handleClose() {
524
+ setIsOpen(false);
525
+ }
526
+
527
+ return (
528
+ <div className="app">
529
+ <Button sdsStyle="minimal" sdsType="primary" onClick={handleClick}>
530
+ Open Dialog
531
+ </Button>
532
+ <Dialog onClose={handleClose} open={isOpen} sdsSize="xs">
533
+ <DialogTitle
534
+ title="Learning"
535
+ subtitle="Learning Resources"
536
+ onClose={handleClose}
537
+ />
538
+ <DialogContent>
539
+ Embark on a journey of continuous improvement with our treasure trove
540
+ of learning materials. This section hosts an array of tutorials,
541
+ guides, and insightful articles designed to enhance your skills and
542
+ deepen your understanding.
543
+ </DialogContent>
544
+ </Dialog>
545
+ </div>
546
+ );
547
+ }
548
+
549
+ export default App;
550
+ ```
551
+
552
+ **/index.tsx**
553
+
554
+ ```tsx
555
+ import React from "react";
556
+ import { createRoot } from "react-dom/client";
557
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
558
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
559
+ import { Theme } from "@czi-sds/components";
560
+ import CssBaseline from "@mui/material/CssBaseline";
561
+ import useMediaQuery from "@mui/material/useMediaQuery";
562
+
563
+ import App from "./App";
564
+
565
+ const container = document.getElementById("root");
566
+ const root = createRoot(container!);
567
+
568
+ const RootApp = () => {
569
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
570
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
571
+
572
+ return (
573
+ <StyledEngineProvider injectFirst>
574
+ <ThemeProvider theme={theme}>
575
+ <EmotionThemeProvider theme={theme}>
576
+ <CssBaseline />
577
+ <App />
578
+ </EmotionThemeProvider>
579
+ </ThemeProvider>
580
+ </StyledEngineProvider>
581
+ );
582
+ };
583
+
584
+ root.render(
585
+ <React.StrictMode>
586
+ <RootApp />
587
+ </React.StrictMode>
588
+ );
589
+ ```
590
+
591
+ **/public/index.html**
592
+
593
+ ```html
594
+ <!doctype html>
595
+ <html lang="en">
596
+ <head>
597
+ <meta charset="UTF-8" />
598
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
599
+ <title>Dialog</title>
600
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
601
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
602
+ <link
603
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
604
+ rel="stylesheet"
605
+ />
606
+ <link
607
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
608
+ rel="stylesheet"
609
+ />
610
+ </head>
611
+ <body>
612
+ <div id="root"></div>
613
+ </body>
614
+ </html>
615
+ ```
616
+
617
+ **/package.json**
618
+
619
+ ```json
620
+ {
621
+ "dependencies": {
622
+ "react": "^18.0.0",
623
+ "react-dom": "^18.0.0",
624
+ "react-scripts": "^4.0.0"
625
+ },
626
+ "devDependencies": {
627
+ "@types/react": "^18.0.0",
628
+ "@types/react-dom": "^18.0.0",
629
+ "typescript": "^4.0.0"
630
+ },
631
+ "main": "/index.tsx"
632
+ }
633
+ ```
634
+
635
+ ---
636
+
637
+ #### Dialog with `canclickOutsideClose` set as `false`
638
+
639
+ This example demonstrates a `Dialog` component that remains open even when clicked outside of the `Dialog`.
640
+
641
+ **/styles.css**
642
+
643
+ ```css
644
+ body {
645
+ font-size: 13px;
646
+ font-weight: 400;
647
+ letter-spacing: 0.08px;
648
+ line-height: 20px;
649
+ text-transform: none;
650
+ font-family: "Inter", sans-serif;
651
+ }
652
+
653
+ h1 {
654
+ font-size: 1.5rem;
655
+ }
656
+
657
+ .app {
658
+ padding: 20px;
659
+ }
660
+ ```
661
+
662
+ **tsconfig.json**
663
+
664
+ ```json
665
+ {
666
+ "include": ["./**/*"],
667
+ "compilerOptions": {
668
+ "strict": true,
669
+ "esModuleInterop": true,
670
+ "lib": ["dom", "es2015"],
671
+ "jsx": "react-jsx"
672
+ }
673
+ }
674
+ ```
675
+
676
+ **/App.tsx**
677
+
678
+ ```tsx
679
+ import { useState } from "react";
680
+ import {
681
+ Button,
682
+ Dialog,
683
+ DialogTitle,
684
+ DialogContent,
685
+ DialogActions,
686
+ } from "@czi-sds/components";
687
+ import "./styles.css";
688
+
689
+ function App() {
690
+ const [isOpen, setIsOpen] = useState(true);
691
+
692
+ function handleClick() {
693
+ setIsOpen(true);
694
+ }
695
+
696
+ function handleClose() {
697
+ setIsOpen(false);
698
+ }
699
+
700
+ return (
701
+ <div className="app">
702
+ <Button sdsStyle="minimal" sdsType="primary" onClick={handleClick}>
703
+ Open Dialog
704
+ </Button>
705
+ <Dialog
706
+ onClose={handleClose}
707
+ open={isOpen}
708
+ sdsSize="xs"
709
+ canClickOutsideClose={false}
710
+ >
711
+ <DialogTitle
712
+ title="Welcome"
713
+ subtitle="New features showcase"
714
+ onClose={handleClose}
715
+ />
716
+ <DialogContent>
717
+ We are thrilled to introduce you to our latest enhancements and
718
+ features. In this interactive showcase, you'll have the opportunity to
719
+ explore a wide range of improvements designed to elevate your user
720
+ experience. Whether it's streamlined navigation, enhanced performance,
721
+ or delightful visual enhancements, we've got something for everyone.
722
+ Dive in and discover what's new!
723
+ </DialogContent>
724
+ </Dialog>
725
+ </div>
726
+ );
727
+ }
728
+
729
+ export default App;
730
+ ```
731
+
732
+ **/index.tsx**
733
+
734
+ ```tsx
735
+ import React from "react";
736
+ import { createRoot } from "react-dom/client";
737
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
738
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
739
+ import { Theme } from "@czi-sds/components";
740
+ import CssBaseline from "@mui/material/CssBaseline";
741
+ import useMediaQuery from "@mui/material/useMediaQuery";
742
+
743
+ import App from "./App";
744
+
745
+ const container = document.getElementById("root");
746
+ const root = createRoot(container!);
747
+
748
+ const RootApp = () => {
749
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
750
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
751
+
752
+ return (
753
+ <StyledEngineProvider injectFirst>
754
+ <ThemeProvider theme={theme}>
755
+ <EmotionThemeProvider theme={theme}>
756
+ <CssBaseline />
757
+ <App />
758
+ </EmotionThemeProvider>
759
+ </ThemeProvider>
760
+ </StyledEngineProvider>
761
+ );
762
+ };
763
+
764
+ root.render(
765
+ <React.StrictMode>
766
+ <RootApp />
767
+ </React.StrictMode>
768
+ );
769
+ ```
770
+
771
+ **/public/index.html**
772
+
773
+ ```html
774
+ <!doctype html>
775
+ <html lang="en">
776
+ <head>
777
+ <meta charset="UTF-8" />
778
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
779
+ <title>Dialog</title>
780
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
781
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
782
+ <link
783
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
784
+ rel="stylesheet"
785
+ />
786
+ <link
787
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
788
+ rel="stylesheet"
789
+ />
790
+ </head>
791
+ <body>
792
+ <div id="root"></div>
793
+ </body>
794
+ </html>
795
+ ```
796
+
797
+ **/package.json**
798
+
799
+ ```json
800
+ {
801
+ "dependencies": {
802
+ "react": "^18.0.0",
803
+ "react-dom": "^18.0.0",
804
+ "react-scripts": "^4.0.0"
805
+ },
806
+ "devDependencies": {
807
+ "@types/react": "^18.0.0",
808
+ "@types/react-dom": "^18.0.0",
809
+ "typescript": "^4.0.0"
810
+ },
811
+ "main": "/index.tsx"
812
+ }
813
+ ```
814
+
815
+ ---
816
+
817
+ #### Dialog with Action Buttons
818
+
819
+ This example demonstrates a `Dialog` component that features action `Buttons` located in the dialog's footer.
820
+
821
+ **/styles.css**
822
+
823
+ ```css
824
+ body {
825
+ font-size: 13px;
826
+ font-weight: 400;
827
+ letter-spacing: 0.08px;
828
+ line-height: 20px;
829
+ text-transform: none;
830
+ font-family: "Inter", sans-serif;
831
+ }
832
+
833
+ h1 {
834
+ font-size: 1.5rem;
835
+ }
836
+
837
+ .app {
838
+ padding: 20px;
839
+ }
840
+ ```
841
+
842
+ **tsconfig.json**
843
+
844
+ ```json
845
+ {
846
+ "include": ["./**/*"],
847
+ "compilerOptions": {
848
+ "strict": true,
849
+ "esModuleInterop": true,
850
+ "lib": ["dom", "es2015"],
851
+ "jsx": "react-jsx"
852
+ }
853
+ }
854
+ ```
855
+
856
+ **/App.tsx**
857
+
858
+ ```tsx
859
+ import { useState } from "react";
860
+ import {
861
+ Button,
862
+ Dialog,
863
+ DialogTitle,
864
+ DialogContent,
865
+ DialogActions,
866
+ } from "@czi-sds/components";
867
+ import "./styles.css";
868
+
869
+ function App() {
870
+ const [isOpen, setIsOpen] = useState(true);
871
+
872
+ function handleClick() {
873
+ setIsOpen(true);
874
+ }
875
+
876
+ function handleClose() {
877
+ setIsOpen(false);
878
+ }
879
+
880
+ return (
881
+ <div className="app">
882
+ <Button sdsStyle="minimal" sdsType="primary" onClick={handleClick}>
883
+ Open Dialog
884
+ </Button>
885
+ <Dialog onClose={handleClose} open={isOpen} sdsSize="xs">
886
+ <DialogTitle
887
+ title="Learning"
888
+ subtitle="Learning Resources"
889
+ onClose={handleClose}
890
+ />
891
+ <DialogContent>
892
+ Embark on a journey of continuous improvement with our treasure trove
893
+ of learning materials. This section hosts an array of tutorials,
894
+ guides, and insightful articles designed to enhance your skills and
895
+ deepen your understanding.
896
+ </DialogContent>
897
+ <DialogActions buttonPosition="right">
898
+ <Button sdsStyle="square" sdsType="secondary" onClick={handleClose}>
899
+ Secondary Action
900
+ </Button>
901
+ <Button sdsStyle="square" sdsType="primary" onClick={handleClose}>
902
+ Primary Action
903
+ </Button>
904
+ </DialogActions>
905
+ </Dialog>
906
+ </div>
907
+ );
908
+ }
909
+
910
+ export default App;
911
+ ```
912
+
913
+ **/index.tsx**
914
+
915
+ ```tsx
916
+ import React from "react";
917
+ import { createRoot } from "react-dom/client";
918
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
919
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
920
+ import { Theme } from "@czi-sds/components";
921
+ import CssBaseline from "@mui/material/CssBaseline";
922
+ import useMediaQuery from "@mui/material/useMediaQuery";
923
+
924
+ import App from "./App";
925
+
926
+ const container = document.getElementById("root");
927
+ const root = createRoot(container!);
928
+
929
+ const RootApp = () => {
930
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
931
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
932
+
933
+ return (
934
+ <StyledEngineProvider injectFirst>
935
+ <ThemeProvider theme={theme}>
936
+ <EmotionThemeProvider theme={theme}>
937
+ <CssBaseline />
938
+ <App />
939
+ </EmotionThemeProvider>
940
+ </ThemeProvider>
941
+ </StyledEngineProvider>
942
+ );
943
+ };
944
+
945
+ root.render(
946
+ <React.StrictMode>
947
+ <RootApp />
948
+ </React.StrictMode>
949
+ );
950
+ ```
951
+
952
+ **/public/index.html**
953
+
954
+ ```html
955
+ <!doctype html>
956
+ <html lang="en">
957
+ <head>
958
+ <meta charset="UTF-8" />
959
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
960
+ <title>Dialog</title>
961
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
962
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
963
+ <link
964
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
965
+ rel="stylesheet"
966
+ />
967
+ <link
968
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
969
+ rel="stylesheet"
970
+ />
971
+ </head>
972
+ <body>
973
+ <div id="root"></div>
974
+ </body>
975
+ </html>
976
+ ```
977
+
978
+ **/package.json**
979
+
980
+ ```json
981
+ {
982
+ "dependencies": {
983
+ "react": "^18.0.0",
984
+ "react-dom": "^18.0.0",
985
+ "react-scripts": "^4.0.0"
986
+ },
987
+ "devDependencies": {
988
+ "@types/react": "^18.0.0",
989
+ "@types/react-dom": "^18.0.0",
990
+ "typescript": "^4.0.0"
991
+ },
992
+ "main": "/index.tsx"
993
+ }
994
+ ```
995
+
996
+ ---
997
+
998
+ #### Dialog with a long content
999
+
1000
+ This example showcases a `Dialog` component with lengthy content. To manage the display of this extended content, SDS intelligently adds scroll functionality to the `dialogContent` area. This ensures that users can easily access any `Dialog` action buttons that may be present.
1001
+
1002
+ **/styles.css**
1003
+
1004
+ ```css
1005
+ body {
1006
+ font-size: 13px;
1007
+ font-weight: 400;
1008
+ letter-spacing: 0.08px;
1009
+ line-height: 20px;
1010
+ text-transform: none;
1011
+ font-family: "Inter", sans-serif;
1012
+ }
1013
+
1014
+ h1 {
1015
+ font-size: 1.5rem;
1016
+ }
1017
+
1018
+ .app {
1019
+ padding: 20px;
1020
+ }
1021
+ ```
1022
+
1023
+ **tsconfig.json**
1024
+
1025
+ ```json
1026
+ {
1027
+ "include": ["./**/*"],
1028
+ "compilerOptions": {
1029
+ "strict": true,
1030
+ "esModuleInterop": true,
1031
+ "lib": ["dom", "es2015"],
1032
+ "jsx": "react-jsx"
1033
+ }
1034
+ }
1035
+ ```
1036
+
1037
+ **/App.tsx**
1038
+
1039
+ ```tsx
1040
+ // Most minimal Dialog (just has the basic requirements)
1041
+
1042
+ import { useState } from "react";
1043
+ import {
1044
+ Button,
1045
+ Dialog,
1046
+ DialogTitle,
1047
+ DialogContent,
1048
+ DialogActions,
1049
+ } from "@czi-sds/components";
1050
+ import "./styles.css";
1051
+
1052
+ function App() {
1053
+ const [isOpen, setIsOpen] = useState(true);
1054
+
1055
+ function handleClick() {
1056
+ setIsOpen(true);
1057
+ }
1058
+
1059
+ function handleClose() {
1060
+ setIsOpen(false);
1061
+ }
1062
+
1063
+ return (
1064
+ <div className="app">
1065
+ <Button sdsStyle="minimal" sdsType="primary" onClick={handleClick}>
1066
+ Open Dialog
1067
+ </Button>
1068
+ <Dialog onClose={handleClose} open={isOpen} sdsSize="xs">
1069
+ <DialogTitle
1070
+ title="Learning"
1071
+ subtitle="Learning Resources"
1072
+ onClose={handleClose}
1073
+ />
1074
+ <DialogContent>
1075
+ Embark on a fulfilling journey of continuous improvement with our vast
1076
+ repository of valuable learning resources. Within this dedicated
1077
+ section, you'll find an extensive collection of meticulously crafted
1078
+ tutorials, comprehensive guides, and thought-provoking articles
1079
+ meticulously designed to enrich your skill set and provide profound
1080
+ insights into your field of interest. Explore a diverse range of
1081
+ topics, from fundamental principles to advanced techniques, as we aim
1082
+ to empower you with knowledge that transcends boundaries. Whether
1083
+ you're a novice eager to build a strong foundation or a seasoned
1084
+ professional seeking to stay at the forefront of your industry, our
1085
+ treasure trove of educational materials is your gateway to honing your
1086
+ expertise. Unlock your potential, expand your horizons, and stay ahead
1087
+ of the curve by immersing yourself in this wealth of knowledge. We
1088
+ believe that continuous learning is the key to personal and
1089
+ professional growth, and we're excited to accompany you on this
1090
+ educational journey, every step of the way.
1091
+ </DialogContent>
1092
+ <DialogActions buttonPosition="left">
1093
+ <Button sdsStyle="square" sdsType="primary" onClick={handleClose}>
1094
+ Primary Action
1095
+ </Button>
1096
+ <Button sdsStyle="square" sdsType="secondary" onClick={handleClose}>
1097
+ Secondary Action
1098
+ </Button>
1099
+ </DialogActions>
1100
+ </Dialog>
1101
+ </div>
1102
+ );
1103
+ }
1104
+
1105
+ export default App;
1106
+ ```
1107
+
1108
+ **/index.tsx**
1109
+
1110
+ ```tsx
1111
+ import React from "react";
1112
+ import { createRoot } from "react-dom/client";
1113
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1114
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1115
+ import { Theme } from "@czi-sds/components";
1116
+ import CssBaseline from "@mui/material/CssBaseline";
1117
+ import useMediaQuery from "@mui/material/useMediaQuery";
1118
+
1119
+ import App from "./App";
1120
+
1121
+ const container = document.getElementById("root");
1122
+ const root = createRoot(container!);
1123
+
1124
+ const RootApp = () => {
1125
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1126
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1127
+
1128
+ return (
1129
+ <StyledEngineProvider injectFirst>
1130
+ <ThemeProvider theme={theme}>
1131
+ <EmotionThemeProvider theme={theme}>
1132
+ <CssBaseline />
1133
+ <App />
1134
+ </EmotionThemeProvider>
1135
+ </ThemeProvider>
1136
+ </StyledEngineProvider>
1137
+ );
1138
+ };
1139
+
1140
+ root.render(
1141
+ <React.StrictMode>
1142
+ <RootApp />
1143
+ </React.StrictMode>
1144
+ );
1145
+ ```
1146
+
1147
+ **/public/index.html**
1148
+
1149
+ ```html
1150
+ <!doctype html>
1151
+ <html lang="en">
1152
+ <head>
1153
+ <meta charset="UTF-8" />
1154
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1155
+ <title>Dialog</title>
1156
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1157
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1158
+ <link
1159
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1160
+ rel="stylesheet"
1161
+ />
1162
+ <link
1163
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1164
+ rel="stylesheet"
1165
+ />
1166
+ </head>
1167
+ <body>
1168
+ <div id="root"></div>
1169
+ </body>
1170
+ </html>
1171
+ ```
1172
+
1173
+ **/package.json**
1174
+
1175
+ ```json
1176
+ {
1177
+ "dependencies": {
1178
+ "react": "^18.0.0",
1179
+ "react-dom": "^18.0.0",
1180
+ "react-scripts": "^4.0.0"
1181
+ },
1182
+ "devDependencies": {
1183
+ "@types/react": "^18.0.0",
1184
+ "@types/react-dom": "^18.0.0",
1185
+ "typescript": "^4.0.0"
1186
+ },
1187
+ "main": "/index.tsx"
1188
+ }
1189
+ ```
1190
+
1191
+ ---