@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,2818 +0,0 @@
1
- # Control Inputs
2
-
3
- Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
4
-
5
- ## Overview
6
-
7
- ## Control Input Variants
8
-
9
- | There are two Control Input components available for designers to use depending on the type of action or response they are needing to elicit from the user. Checkbox and Radio Inputs must always be accompanied by a label that communicates the result of the selection. Follow the usage criteria accompanying each variant as a guide for selecting the correct Control Input for any given use case. | | **Jump to variant:** Checkbox Radio |
10
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------- |
11
-
12
- ---
13
-
14
- ## Checkbox Input
15
-
16
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
17
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
18
-
19
- Use when the user can select multiple options from a group of choices. Each Checkbox must be coupled with a label to communicate the result of a selection.
20
-
21
- Use `sdsStage: indeterminate` to indicate a mixed selection; reserved for cases where "Select All" is an option as part of a group of checkboxes.
22
-
23
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
24
-
25
- | **Default** | **Hover** | **Disabled** |
26
- | ----------- | --------- | ------------ |
27
-
28
- **InputCheckbox**
29
-
30
- ---
31
-
32
- **InputCheckbox**
33
-
34
- ---
35
-
36
- **InputCheckbox**
37
-
38
- ---
39
-
40
- ---
41
-
42
- **InputCheckbox**
43
-
44
- ---
45
-
46
- **InputCheckbox**
47
-
48
- ---
49
-
50
- **InputCheckbox**
51
-
52
- ---
53
-
54
- ---
55
-
56
- **InputCheckbox**
57
-
58
- ---
59
-
60
- **InputCheckbox**
61
-
62
- ---
63
-
64
- **InputCheckbox**
65
-
66
- ---
67
-
68
- ### Checkbox Lockups
69
-
70
- Each Checkbox must be coupled with a label to communicate the result of a selection.
71
-
72
- **InputCheckbox Lockup**
73
-
74
- ---
75
-
76
- **InputCheckbox Lockup**
77
-
78
- ---
79
-
80
- ---
81
-
82
- ### Checkbox Spacing
83
-
84
- These rules establish how much margin should exist between and around elements.
85
-
86
- **Checkbox spacing**
87
-
88
- ---
89
-
90
- ---
91
-
92
- ## Radio Input
93
-
94
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
95
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
96
-
97
- Use when the user can select only one option from a group of choices. Each Radio Input must be coupled with a label to communicate the result of a selection.
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
- | **Default** | **Hover** | **Disabled** |
102
- | ----------- | --------- | ------------ |
103
-
104
- **InputRadio**
105
-
106
- ---
107
-
108
- **InputRadio**
109
-
110
- ---
111
-
112
- **InputRadio**
113
-
114
- ---
115
-
116
- ---
117
-
118
- **InputRadio**
119
-
120
- ---
121
-
122
- **InputRadio**
123
-
124
- ---
125
-
126
- **InputRadio**
127
-
128
- ---
129
-
130
- ### Radio Lockups
131
-
132
- Each Radio must be coupled with a label to communicate the result of a selection.
133
-
134
- **InputRadio Lockup**
135
-
136
- ---
137
-
138
- **InputRadio Lockup**
139
-
140
- ---
141
-
142
- ---
143
-
144
- ### Radio Spacing
145
-
146
- These rules establish how much margin should exist between and around elements.
147
-
148
- **Radio spacing**
149
-
150
- ---
151
-
152
- ## Code
153
-
154
- ## Control Input Components
155
-
156
- | Below you will find interactive Storybook iframes for each component within the Control Input element group. 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:** InputCheckbox InputRadio |
157
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------- |
158
-
159
- ---
160
-
161
- > These components appear as they are 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.
162
-
163
- ### InputCheckbox
164
-
165
- Storybook
166
-
167
- ---
168
-
169
- ### InputRadio
170
-
171
- Storybook
172
-
173
- ---
174
-
175
- Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
176
-
177
- ## Overview
178
-
179
- ## Control Input Variants
180
-
181
- | There is a range of Control Input variants available for designers to use depending on the type of action or response they are needing to elicit from the user. Checkbox and Radio Inputs must always be accompanied by a label that communicates the result of the selection. Follow the usage criteria accompanying each variant as a guide for selecting the correct Control Input for any given use case. | | **Jump to variant:** Checkbox Radio Toggle |
182
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------ |
183
-
184
- ### Visual Preview
185
-
186
- Use the links below to jump to information on a specific Control Input variant:
187
-
188
- **InputCheckbox Lockup**
189
-
190
- ---
191
-
192
- **InputRadio Lockup**
193
-
194
- ---
195
-
196
- **InputToggle**
197
-
198
- ---
199
-
200
- ---
201
-
202
- ## Checkbox Input
203
-
204
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
205
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
206
-
207
- Use when the user can select multiple options from a group of choices. Each Checkbox must be coupled with a label (and optional caption) to communicate the result of a selection.
208
-
209
- Use `sdsStage: indeterminate` to indicate a mixed selection; reserved for cases where "Select All" is an option as part of a group of checkboxes.
210
-
211
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
212
-
213
- | **Default** | **Hover** | **Disabled** |
214
- | ----------- | --------- | ------------ |
215
-
216
- **InputCheckbox**
217
-
218
- ---
219
-
220
- **InputCheckbox**
221
-
222
- ---
223
-
224
- **InputCheckbox**
225
-
226
- ---
227
-
228
- ---
229
-
230
- **InputCheckbox**
231
-
232
- ---
233
-
234
- **InputCheckbox**
235
-
236
- ---
237
-
238
- **InputCheckbox**
239
-
240
- ---
241
-
242
- ---
243
-
244
- **InputCheckbox**
245
-
246
- ---
247
-
248
- **InputCheckbox**
249
-
250
- ---
251
-
252
- **InputCheckbox**
253
-
254
- ---
255
-
256
- ### Checkbox Intent States
257
-
258
- Use `intent: default` to communicate that a user has yet to enter a response.
259
-
260
- Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
261
-
262
- Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
263
-
264
- | **Default** | **Error** | **Warning** |
265
- | ----------- | --------- | ----------- |
266
-
267
- **InputCheckbox**
268
-
269
- ---
270
-
271
- **InputCheckbox**
272
-
273
- ---
274
-
275
- **InputCheckbox**
276
-
277
- ---
278
-
279
- ### Checkbox Lockups
280
-
281
- Each Checkbox must be coupled with a label to communicate the result of a selection. If additional details about the selection need to be communicated, an optional caption can be included.
282
-
283
- **InputCheckbox Lockup_no caption_enabled**
284
-
285
- ---
286
-
287
- **InputCheckbox Lockup_no caption_disabled**
288
-
289
- ---
290
-
291
- **InputCheckbox Lockup_caption_disabled**
292
-
293
- ---
294
-
295
- **InputCheckbox Lockup_caption_disabled**
296
-
297
- ---
298
-
299
- ---
300
-
301
- ### Checkbox Spacing
302
-
303
- These rules establish how much margin should exist between and around elements.
304
-
305
- **Checkbox spacing**
306
-
307
- ---
308
-
309
- ---
310
-
311
- ## Radio Input
312
-
313
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
314
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
315
-
316
- Use when the user can select only one option from a group of choices. Each Radio must be coupled with a label (and optional caption) to communicate the result of a selection.
317
-
318
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
319
-
320
- | **Default** | **Hover** | **Disabled** |
321
- | ----------- | --------- | ------------ |
322
-
323
- **InputRadio**
324
-
325
- ---
326
-
327
- **InputRadio**
328
-
329
- ---
330
-
331
- **InputRadio**
332
-
333
- ---
334
-
335
- | **Default** | **Disabled** |
336
- | ----------- | ------------ |
337
-
338
- **InputRadio**
339
-
340
- ---
341
-
342
- **InputRadio**
343
-
344
- ---
345
-
346
- ### Radio Intent States
347
-
348
- Use `intent: default` to communicate that user has yet to enter a response.
349
-
350
- Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
351
-
352
- Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
353
-
354
- | **Default** | **Error** | **Warning** |
355
- | ----------- | --------- | ----------- |
356
-
357
- **InputRadio**
358
-
359
- ---
360
-
361
- **InputRadio**
362
-
363
- ---
364
-
365
- **InputRadio**
366
-
367
- ---
368
-
369
- ### Radio Lockups
370
-
371
- Each Radio must be coupled with a label to communicate the result of a selection. If additional details about the selection need to be communicated, an optional caption can be included.
372
-
373
- **InputRadio Lockup_no caption_enabled**
374
-
375
- ---
376
-
377
- **InputRadio Lockup_no caption_disabled**
378
-
379
- ---
380
-
381
- **InputRadio Lockup_caption_disabled**
382
-
383
- ---
384
-
385
- **InputRadio Lockup_caption_disabled**
386
-
387
- ---
388
-
389
- ---
390
-
391
- ### Radio Spacing
392
-
393
- These rules establish how much margin should exist between and around elements.
394
-
395
- **Radio spacing**
396
-
397
- ---
398
-
399
- ---
400
-
401
- ## Toggle
402
-
403
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
404
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
405
-
406
- Use to allow the user to flip a setting or option from off to on and vice versa.
407
-
408
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
409
-
410
- | **Default** | **Hover** | **Disabled** |
411
- | ----------- | --------- | ------------ |
412
-
413
- **InputToggle**
414
-
415
- ---
416
-
417
- **InputToggle**
418
-
419
- ---
420
-
421
- **InputToggle**
422
-
423
- ---
424
-
425
- ---
426
-
427
- **InputToggle**
428
-
429
- ---
430
-
431
- **InputToggle**
432
-
433
- ---
434
-
435
- **InputToggle**
436
-
437
- ---
438
-
439
- ---
440
-
441
- ### Toggle Spacing
442
-
443
- These rules establish how much margin should exist between and around elements.
444
-
445
- **Toggle spacing**
446
-
447
- ---
448
-
449
- ## Code
450
-
451
- ## Control Input Components
452
-
453
- | Below you will find interactive Storybook iframes for each component within the Control Input element group. 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:** InputCheckbox InputRadio InputToggle InputSlider |
454
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------- |
455
-
456
- ---
457
-
458
- > These components appear as they are 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.
459
-
460
- ### InputCheckbox
461
-
462
- Storybook
463
-
464
- ---
465
-
466
- ### InputRadio
467
-
468
- Storybook
469
-
470
- ---
471
-
472
- ### InputToggle
473
-
474
- Storybook
475
-
476
- ---
477
-
478
- Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
479
-
480
- ## Overview
481
-
482
- ## Control Input Variants
483
-
484
- | There is a range of Control Input variants available for designers to use depending on the type of action or response they are needing to elicit from the user. Checkbox and Radio Inputs must always be accompanied by a label that communicates the result of the selection. Follow the usage criteria accompanying each variant as a guide for selecting the correct Control Input for any given use case. | | **Jump to variant:** Checkbox Radio Toggle Slider |
485
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------- |
486
-
487
- ### Visual Preview
488
-
489
- Use the links below to jump to information on a specific Control Input variant:
490
-
491
- **InputCheckbox Lockup**
492
-
493
- ---
494
-
495
- **InputRadio Lockup**
496
-
497
- ---
498
-
499
- **InputToggle**
500
-
501
- ---
502
-
503
- **InputSlider**
504
-
505
- ---
506
-
507
- ---
508
-
509
- ## Checkbox Input
510
-
511
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
512
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
513
-
514
- Use when the user can select multiple options from a group of choices. Each Checkbox must be coupled with a label (and optional caption) to communicate the result of a selection.
515
-
516
- Use `sdsStage: indeterminate` to indicate a mixed selection; reserved for cases where "Select All" is an option as part of a group of checkboxes.
517
-
518
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
519
-
520
- | **Default** | **Hover** | **Disabled** |
521
- | ----------- | --------- | ------------ |
522
-
523
- **InputCheckbox**
524
-
525
- ---
526
-
527
- **InputCheckbox**
528
-
529
- ---
530
-
531
- **InputCheckbox**
532
-
533
- ---
534
-
535
- ---
536
-
537
- **InputCheckbox**
538
-
539
- ---
540
-
541
- **InputCheckbox**
542
-
543
- ---
544
-
545
- **InputCheckbox**
546
-
547
- ---
548
-
549
- ---
550
-
551
- **InputCheckbox**
552
-
553
- ---
554
-
555
- **InputCheckbox**
556
-
557
- ---
558
-
559
- **InputCheckbox**
560
-
561
- ---
562
-
563
- ### Checkbox Intent States
564
-
565
- Use `intent: default` to communicate that user has yet to enter a response.
566
-
567
- Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
568
-
569
- Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
570
-
571
- | **Default** | **Error** | **Warning** |
572
- | ----------- | --------- | ----------- |
573
-
574
- **InputCheckbox**
575
-
576
- ---
577
-
578
- **InputCheckbox**
579
-
580
- ---
581
-
582
- **InputCheckbox**
583
-
584
- ---
585
-
586
- ### Checkbox Lockups
587
-
588
- Each Checkbox must be coupled with a label to communicate the result of a selection. If additional details about the selection need to be communicated, an optional caption can be included.
589
-
590
- **InputCheckbox Lockup_no caption_enabled**
591
-
592
- ---
593
-
594
- **InputCheckbox Lockup_no caption_disabled**
595
-
596
- ---
597
-
598
- **InputCheckbox Lockup_caption_disabled**
599
-
600
- ---
601
-
602
- **InputCheckbox Lockup_caption_disabled**
603
-
604
- ---
605
-
606
- ---
607
-
608
- ### Checkbox Spacing
609
-
610
- These rules establish how much margin should exist between and around elements.
611
-
612
- **Checkbox spacing**
613
-
614
- ---
615
-
616
- ---
617
-
618
- ## Radio Input
619
-
620
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
621
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
622
-
623
- Use when the user can select only one option from a group of choices. Each Radio must be coupled with a label (and optional caption) to communicate the result of a selection.
624
-
625
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
626
-
627
- | **Default** | **Hover** | **Disabled** |
628
- | ----------- | --------- | ------------ |
629
-
630
- **InputRadio**
631
-
632
- ---
633
-
634
- **InputRadio**
635
-
636
- ---
637
-
638
- **InputRadio**
639
-
640
- ---
641
-
642
- | **Default** | **Disabled** |
643
- | ----------- | ------------ |
644
-
645
- **InputRadio**
646
-
647
- ---
648
-
649
- **InputRadio**
650
-
651
- ---
652
-
653
- ### Radio Intent States
654
-
655
- Use `intent: default` to communicate that user has yet to enter a response.
656
-
657
- Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
658
-
659
- Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
660
-
661
- | **Default** | **Error** | **Warning** |
662
- | ----------- | --------- | ----------- |
663
-
664
- **InputRadio**
665
-
666
- ---
667
-
668
- **InputRadio**
669
-
670
- ---
671
-
672
- **InputRadio**
673
-
674
- ---
675
-
676
- ### Radio Lockups
677
-
678
- Each Radio must be coupled with a label to communicate the result of a selection. If additional details about the selection need to be communicated, an optional caption can be included.
679
-
680
- **InputRadio Lockup_no caption_enabled**
681
-
682
- ---
683
-
684
- **InputRadio Lockup_no caption_disabled**
685
-
686
- ---
687
-
688
- **InputRadio Lockup_caption_disabled**
689
-
690
- ---
691
-
692
- **InputRadio Lockup_caption_disabled**
693
-
694
- ---
695
-
696
- ---
697
-
698
- ### Radio Spacing
699
-
700
- These rules establish how much margin should exist between and around elements.
701
-
702
- **Radio spacing**
703
-
704
- ---
705
-
706
- ---
707
-
708
- ## Toggle
709
-
710
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
711
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
712
-
713
- Use to allow the user to flip a setting or option from off to on and vice versa.
714
-
715
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
716
-
717
- | **Default** | **Hover** | **Disabled** |
718
- | ----------- | --------- | ------------ |
719
-
720
- **InputToggle**
721
-
722
- ---
723
-
724
- **InputToggle**
725
-
726
- ---
727
-
728
- **InputToggle**
729
-
730
- ---
731
-
732
- ---
733
-
734
- **InputToggle**
735
-
736
- ---
737
-
738
- **InputToggle**
739
-
740
- ---
741
-
742
- **InputToggle**
743
-
744
- ---
745
-
746
- ---
747
-
748
- ### Toggle Switch Spacing
749
-
750
- These rules establish how much margin should exist between and around elements.
751
-
752
- **Toggle spacing**
753
-
754
- ---
755
-
756
- ---
757
-
758
- ## Slider
759
-
760
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
761
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
762
-
763
- ### Single-sided Slider
764
-
765
- Use when there is a specific datapoint or value within a dataset that the user is able to select.
766
-
767
- **InputSlider**
768
-
769
- ---
770
-
771
- ---
772
-
773
- **InputSlider**
774
-
775
- ---
776
-
777
- ### Double-sided Slider
778
-
779
- Use when users need the ability to select a range between two values within a dataset.
780
-
781
- **InputSlider**
782
-
783
- ---
784
-
785
- ---
786
-
787
- **InputSlider**
788
-
789
- ---
790
-
791
- ---
792
-
793
- ### Slider Spacing
794
-
795
- These rules establish how much margin should exist between and around elements.
796
-
797
- **Slider spacing**
798
-
799
- ---
800
-
801
- ## Code
802
-
803
- ## Control Input Components
804
-
805
- | Below you will find interactive Storybook iframes for each component within the Control Input element group. 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:** InputCheckbox InputRadio InputToggle InputSlider |
806
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------- |
807
-
808
- ---
809
-
810
- ### InputCheckbox
811
-
812
- Storybook
813
-
814
- ---
815
-
816
- ### InputRadio
817
-
818
- Storybook
819
-
820
- ---
821
-
822
- ### InputToggle
823
-
824
- Storybook
825
-
826
- ---
827
-
828
- ### InputSlider
829
-
830
- Storybook
831
-
832
- ---
833
-
834
- Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
835
-
836
- ## Guidelines
837
-
838
- ## Control Input Components
839
-
840
- | There are a range of Control Input components available to use depending on the type of action or response the application needs from the user. | | **Jump to component:** Checkbox Radio Slider Toggle |
841
- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------- |
842
-
843
- ### Visual Preview
844
-
845
- **Preview_Guidelines_InputCheckbox**
846
-
847
- ---
848
-
849
- **Preview_Guidelines_InputRadio**
850
-
851
- ---
852
-
853
- **Preview_Guidelines_InputSlider**
854
-
855
- ---
856
-
857
- **Preview_Guidelines_InputToggle**
858
-
859
- ---
860
-
861
- ---
862
-
863
- ## Checkbox
864
-
865
- | | In Figma | | | Meets Accessibility | | | In Code |
866
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
867
-
868
- ### Live Instance
869
-
870
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
871
-
872
- Default
873
-
874
- ---
875
-
876
- ### Overview
877
-
878
- Use Checkboxes when the user can select multiple options from a group of choices. Each Checkbox should be coupled with a label or other indicator communicating what is being selected by checking the box.
879
-
880
- Use the indeterminate variant to indicate a mixed selection; reserved for cases where "Select All" is an option as part of a group of Checkboxes.
881
-
882
- #### Checkbox – No Label
883
-
884
- Use when Checkbox functionality is needed but a custom label is desired.
885
-
886
- | Default | Hover | Disabled |
887
- | ------- | ----- | -------- |
888
-
889
- **Checkbox_No label_Unselected_Default**
890
-
891
- ---
892
-
893
- **Checkbox_No label_Unselected_Hover**
894
-
895
- ---
896
-
897
- **Checkbox_No label_Unselected_Disabled**
898
-
899
- ---
900
-
901
- **Checkbox_No label_Indeterminate_Default**
902
-
903
- ---
904
-
905
- **Checkbox_No label_Indeterminate_Hover**
906
-
907
- ---
908
-
909
- **Checkbox_No label_Indeterminate_Disabled**
910
-
911
- ---
912
-
913
- **Checkbox_No label_Selected_Default**
914
-
915
- ---
916
-
917
- **Checkbox_No label_Selected_Hover**
918
-
919
- ---
920
-
921
- **Checkbox_No label_Selected_Disabled**
922
-
923
- ---
924
-
925
- #### Checkbox – Label
926
-
927
- | Default | Hover | Disabled |
928
- | ------- | ----- | -------- |
929
-
930
- **Checkbox_Label_Unselected_Default**
931
-
932
- ---
933
-
934
- **Checkbox_Label_Unselected_Hover**
935
-
936
- ---
937
-
938
- **Checkbox_Label_Unselected_Disabled**
939
-
940
- ---
941
-
942
- **Checkbox_Label_Indeterminate_Default**
943
-
944
- ---
945
-
946
- **Checkbox_Label_Indeterminate_Hover**
947
-
948
- ---
949
-
950
- **Checkbox_Label_Indeterminate_Disabled**
951
-
952
- ---
953
-
954
- **Checkbox_Label_Selected_Default**
955
-
956
- ---
957
-
958
- **Checkbox_Label_Selected_Hover**
959
-
960
- ---
961
-
962
- **Checkbox_Label_Selected_Disabled**
963
-
964
- ---
965
-
966
- #### Checkbox – Label + Caption
967
-
968
- | Default | Hover | Disabled |
969
- | ------- | ----- | -------- |
970
-
971
- **Checkbox_Label + Caption_Unselected_Default**
972
-
973
- ---
974
-
975
- **Checkbox_Label + Caption_Unselected_Hover**
976
-
977
- ---
978
-
979
- **Checkbox_Label + Caption_Unselected_Disabled**
980
-
981
- ---
982
-
983
- **Checkbox_Label + Caption_Indeterminate_Default**
984
-
985
- ---
986
-
987
- **Checkbox_Label + Caption_Indeterminate_Hover**
988
-
989
- ---
990
-
991
- **Checkbox_Label + Caption_Indeterminate_Disabled**
992
-
993
- ---
994
-
995
- **Checkbox_Label + Caption_Selected_Default**
996
-
997
- ---
998
-
999
- **Checkbox_Label + Caption_Selected_Hover**
1000
-
1001
- ---
1002
-
1003
- **Checkbox_Label + Caption_Selected_Disabled**
1004
-
1005
- ---
1006
-
1007
- ---
1008
-
1009
- ### Checkbox Spacing
1010
-
1011
- These rules establish how much margin should exist between and around elements.
1012
-
1013
- **Checkbox spacing**
1014
-
1015
- ---
1016
-
1017
- ---
1018
-
1019
- ### Intent Variations
1020
-
1021
- Use Default to communicate that the user has yet to enter a response, Negative to communicate when a user has entered an incorrect or incomplete response, and Notice when a user's response needs attention. Optionally, Intent Messages can be displayed to further communicate why a Negative or Notice intent was triggered. For more information see Intents.
1022
-
1023
- | Default | Negative | Negative + Intent Message | Notice | Notice + Intent Message |
1024
- | ------- | -------- | ------------------------- | ------ | ----------------------- |
1025
-
1026
- **Checkbox_Intent_Default**
1027
-
1028
- ---
1029
-
1030
- **Checkbox_Intent_Negative**
1031
-
1032
- ---
1033
-
1034
- **Checkbox_Intent_Negative + Message**
1035
-
1036
- ---
1037
-
1038
- **Checkbox_Intent_Notice**
1039
-
1040
- ---
1041
-
1042
- **Checkbox_Intent_Notice + Message**
1043
-
1044
- ---
1045
-
1046
- ---
1047
-
1048
- ## Radio
1049
-
1050
- | | In Figma | | | Meets Accessibility | | | In Code |
1051
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
1052
-
1053
- ### Live Instance
1054
-
1055
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
1056
-
1057
- Default
1058
-
1059
- ---
1060
-
1061
- ### Overview
1062
-
1063
- Use Radios when the user can only select one option from a group of choices. Each Radio must be coupled with a label (and optional caption) to communicate the result of a selection. If using the No Label variant, a custom label must be implemented as a separate element.
1064
-
1065
- #### Radio – No Label
1066
-
1067
- Use when Radio functionality is needed but a custom label is desired.
1068
-
1069
- | Default | Hover | Disabled |
1070
- | ------- | ----- | -------- |
1071
-
1072
- **Radio_No Label_Unselected_Default**
1073
-
1074
- ---
1075
-
1076
- **Radio_No Label_Unselected_Hover**
1077
-
1078
- ---
1079
-
1080
- **Radio_No Label_Unselected_Disabled**
1081
-
1082
- ---
1083
-
1084
- | Default | Disabled |
1085
- | ------- | -------- |
1086
-
1087
- **Radio_No Label_Selected_Default**
1088
-
1089
- ---
1090
-
1091
- **Radio_No Label_Selected_Disabled**
1092
-
1093
- ---
1094
-
1095
- #### Radio – Label
1096
-
1097
- | Default | Hover | Disabled |
1098
- | ------- | ----- | -------- |
1099
-
1100
- **Radio_Label_Unselected_Default**
1101
-
1102
- ---
1103
-
1104
- **Radio_Label_Unselected_Hover**
1105
-
1106
- ---
1107
-
1108
- **Radio_Label_Unselected_Disabled**
1109
-
1110
- ---
1111
-
1112
- | Default | Disabled |
1113
- | ------- | -------- |
1114
-
1115
- **Radio_Label_Selected_Default**
1116
-
1117
- ---
1118
-
1119
- **Radio_Label_Selected_Disabled**
1120
-
1121
- ---
1122
-
1123
- #### Radio – Label + Caption
1124
-
1125
- | Default | Hover | Disabled |
1126
- | ------- | ----- | -------- |
1127
-
1128
- **Radio_Label + Caption_Unselected_Default**
1129
-
1130
- ---
1131
-
1132
- **Radio_Label + Caption_Unselected_Hover**
1133
-
1134
- ---
1135
-
1136
- **Radio_Label + Caption_Unselected_Disabled**
1137
-
1138
- ---
1139
-
1140
- | Default | Disabled |
1141
- | ------- | -------- |
1142
-
1143
- **Radio_Label + Caption_Selected_Default**
1144
-
1145
- ---
1146
-
1147
- **Radio_Label + Caption_Selected_Disabled**
1148
-
1149
- ---
1150
-
1151
- ---
1152
-
1153
- ### Radio Spacing
1154
-
1155
- These rules establish how much margin should exist between and around elements.
1156
-
1157
- **Radio spacing**
1158
-
1159
- ---
1160
-
1161
- ---
1162
-
1163
- ### Intent Variations
1164
-
1165
- Use Default to communicate that the user has yet to enter a response, Negative to communicate when a user has entered an incorrect or incomplete response, and Notice when a user's response needs attention. Optionally, Intent Messages can be displayed to further communicate why a Negative or Notice intent was triggered. For more information see Intents.
1166
-
1167
- | Default | Negative | Negative + Intent Message | Notice | Notice + intent Message |
1168
- | ------- | -------- | ------------------------- | ------ | ----------------------- |
1169
-
1170
- **Radio_Intent_Default**
1171
-
1172
- ---
1173
-
1174
- **Radio_Intent_Negative**
1175
-
1176
- ---
1177
-
1178
- **Radio_Intent_Negative + Message**
1179
-
1180
- ---
1181
-
1182
- **Radio_Intent_Notice**
1183
-
1184
- ---
1185
-
1186
- **Radio_Intent_Notice + Message**
1187
-
1188
- ---
1189
-
1190
- ---
1191
-
1192
- ## Slider
1193
-
1194
- | | In Figma | | | Meets Accessibility | | | In Code |
1195
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
1196
-
1197
- ### Live Instance
1198
-
1199
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
1200
-
1201
- Default
1202
-
1203
- ---
1204
-
1205
- ### Overview
1206
-
1207
- Sliders allow users to select specific values or a range of values to input. Optionally, Sliders can include tick marks to provide context to users about the values available for selection.
1208
-
1209
- #### Slider – Single-sided
1210
-
1211
- Use when there is a specific datapoint or value within a dataset that the user is able to select.
1212
-
1213
- | No Tick Marks | Tick Marks |
1214
- | ------------- | ---------- |
1215
-
1216
- **Slider_Single-sided_No Tick Marks**
1217
-
1218
- ---
1219
-
1220
- **Slider_Single-sided_Tick Marks**
1221
-
1222
- ---
1223
-
1224
- #### Slider – Double-sided
1225
-
1226
- Use when users need the ability to select a range between two values within a dataset.
1227
-
1228
- | No Tick Marks | Tick Marks |
1229
- | ------------- | ---------- |
1230
-
1231
- **Slider_Double-sided_No Tick Marks**
1232
-
1233
- ---
1234
-
1235
- **Slider_Double-sided_Tick Marks**
1236
-
1237
- ---
1238
-
1239
- ---
1240
-
1241
- ### Slider Spacing
1242
-
1243
- These rules establish how much margin should exist between and around elements.
1244
-
1245
- **Slider spacing**
1246
-
1247
- ---
1248
-
1249
- ---
1250
-
1251
- ## Toggle Input
1252
-
1253
- | | In Figma | | | Meets Accessibility | | | In Code |
1254
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
1255
-
1256
- ### Live Instance
1257
-
1258
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
1259
-
1260
- Default
1261
-
1262
- ---
1263
-
1264
- ### Overview
1265
-
1266
- Toggle Inputs allow users to indicate true or false as part of a form or flip a setting or option from off to on (and vise versa). For toggling visibility of UI elements (like Panels), use a Toggle Button.
1267
-
1268
- | Default | Hover | Disabled |
1269
- | ------- | ----- | -------- |
1270
-
1271
- **Toggle_Off_Default**
1272
-
1273
- ---
1274
-
1275
- **Toggle_Off_Hover**
1276
-
1277
- ---
1278
-
1279
- **Toggle_Off_Disabled**
1280
-
1281
- ---
1282
-
1283
- **Toggle_On_Default**
1284
-
1285
- ---
1286
-
1287
- **Toggle_On_Hover**
1288
-
1289
- ---
1290
-
1291
- **Toggle_On_Disabled**
1292
-
1293
- ---
1294
-
1295
- ---
1296
-
1297
- ### Toggle Input Spacing
1298
-
1299
- These rules establish how much margin should exist between and around elements.
1300
-
1301
- **Toggle spacing**
1302
-
1303
- ---
1304
-
1305
- ## Code
1306
-
1307
- ## Control Input Components
1308
-
1309
- | There are a range of Control Input components available to use depending on the type of action or response the application needs from the user. | | **Jump to component:** InputCheckbox InputRadio InputSlider InputToggle |
1310
- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------- |
1311
-
1312
- ### Visual Preview
1313
-
1314
- **Preview_Code_InputCheckbox**
1315
-
1316
- ---
1317
-
1318
- **Preview_Code_InputRadio**
1319
-
1320
- ---
1321
-
1322
- **Preview_Code_InputSlider**
1323
-
1324
- ---
1325
-
1326
- **Preview_Code_InputToggle**
1327
-
1328
- ---
1329
-
1330
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
1331
-
1332
- ---
1333
-
1334
- ## InputCheckbox
1335
-
1336
- ### SDS Source Code
1337
-
1338
- The component's source code in the SDS codebase can be found here.
1339
-
1340
- ### SDS vs MUI
1341
-
1342
- The following props and options differ in how they function across the MUI `Checkbox` component and the SDS `InputCheckbox` component:
1343
-
1344
- - **`size`\*\***:\*\* Has no effect in SDS
1345
- - **`color`\*\***:\*\* Has no effect in SDS
1346
- - **`labelPlacement`\*\***:\*\* Has no effect in SDS
1347
- - **`icon`\*\***:\*\* SDS's `InputCheckbox` is not currently set up to support icons (if you add one as shown in the MUI documentation, it will replace the empty checkbox square, but clicking the icon will result in the checked checkbox square appearing in the icon's place)
1348
- - **`stage`** **and checkbox state :** This is the SDS prop that sets the checkbox's state as `unchecked`, `checked`, or `indeterminate`. If `stage` is set, interacting with the component has no effect in changing the checkbox state. By contrast, MUI has a boolean `defaultChecked` prop that sets the checkbox's state and _does_ allow the user to interact to change the state.
1349
- - **`caption`\*\***:\*\* This is an SDS-specific prop, which takes a string of text that is displayed below the primary `label` text.
1350
-
1351
- The following props are available for both the MUI and SDS components: **`required`**, **`disabled`**, and **`indeterminate`\*\***.\*\*
1352
-
1353
- ### MUI Documentation
1354
-
1355
- Documentation for the underlying MUI component can be found here.
1356
-
1357
- ### Props
1358
-
1359
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1360
-
1361
- | Name | Type | Default | Description |
1362
- | --------------- | --------------------------- | -------------- | ----------------------------------------------------------------------------------- | ----------- | ------------------------------------------- | ---------------------------------------- |
1363
- | `caption` | `string` | `-` | The caption of the InputCheckbox appears beneath the label in a lighter text color. |
1364
- | `checkboxProps` | `Partial<MUICheckboxProps>` | `{}` | Directly pass these props to the underlying MUI checkbox. |
1365
- | `label` | `string` | `-` | The label of the InputCheckbox. |
1366
- | `stage` | `"checked"` ` | "unchecked"` ` | "indeterminate"` | | Defines the stage or state of the checkbox. |
1367
- | `intent` | `"default"` ` | "notice"` ` | "negative"` ` | "positive"` | `"default"` | Defines the color of the `InputCheckbox` |
1368
- | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
1369
-
1370
- ### Code examples
1371
-
1372
- #### **Default InputCheckbox**
1373
-
1374
- This example has the minimum props needed for the `InputCheckbox` component.
1375
-
1376
- **/styles.css**
1377
-
1378
- ```css
1379
- body {
1380
- font-size: 13px;
1381
- font-weight: 400;
1382
- letter-spacing: 0.08px;
1383
- line-height: 20px;
1384
- text-transform: none;
1385
- font-family: "Inter", sans-serif;
1386
- }
1387
-
1388
- h1 {
1389
- font-size: 1.5rem;
1390
- }
1391
-
1392
- .app {
1393
- padding: 20px;
1394
- }
1395
- ```
1396
-
1397
- **tsconfig.json**
1398
-
1399
- ```json
1400
- {
1401
- "include": ["./**/*"],
1402
- "compilerOptions": {
1403
- "strict": true,
1404
- "esModuleInterop": true,
1405
- "lib": ["dom", "es2015"],
1406
- "jsx": "react-jsx"
1407
- }
1408
- }
1409
- ```
1410
-
1411
- **/App.tsx**
1412
-
1413
- ```tsx
1414
- import { InputCheckbox } from "@czi-sds/components";
1415
- import "./styles.css";
1416
-
1417
- function App() {
1418
- return (
1419
- <div className="app">
1420
- <InputCheckbox label="Label" />
1421
- </div>
1422
- );
1423
- }
1424
-
1425
- export default App;
1426
- ```
1427
-
1428
- **/index.tsx**
1429
-
1430
- ```tsx
1431
- import React from "react";
1432
- import { createRoot } from "react-dom/client";
1433
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1434
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1435
- import { Theme } from "@czi-sds/components";
1436
- import CssBaseline from "@mui/material/CssBaseline";
1437
- import useMediaQuery from "@mui/material/useMediaQuery";
1438
-
1439
- import App from "./App";
1440
-
1441
- const container = document.getElementById("root");
1442
- const root = createRoot(container!);
1443
-
1444
- const RootApp = () => {
1445
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1446
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1447
-
1448
- return (
1449
- <StyledEngineProvider injectFirst>
1450
- <ThemeProvider theme={theme}>
1451
- <EmotionThemeProvider theme={theme}>
1452
- <CssBaseline />
1453
- <App />
1454
- </EmotionThemeProvider>
1455
- </ThemeProvider>
1456
- </StyledEngineProvider>
1457
- );
1458
- };
1459
-
1460
- root.render(
1461
- <React.StrictMode>
1462
- <RootApp />
1463
- </React.StrictMode>
1464
- );
1465
- ```
1466
-
1467
- **/public/index.html**
1468
-
1469
- ```html
1470
- <!doctype html>
1471
- <html lang="en">
1472
- <head>
1473
- <meta charset="UTF-8" />
1474
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1475
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1476
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1477
- <link
1478
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1479
- rel="stylesheet"
1480
- />
1481
- <link
1482
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1483
- rel="stylesheet"
1484
- />
1485
- </head>
1486
- <body>
1487
- <div id="root"></div>
1488
- </body>
1489
- </html>
1490
- ```
1491
-
1492
- **/package.json**
1493
-
1494
- ```json
1495
- {
1496
- "dependencies": {
1497
- "react": "^18.0.0",
1498
- "react-dom": "^18.0.0",
1499
- "react-scripts": "^4.0.0"
1500
- },
1501
- "devDependencies": {
1502
- "@types/react": "^18.0.0",
1503
- "@types/react-dom": "^18.0.0",
1504
- "typescript": "^4.0.0"
1505
- },
1506
- "main": "/index.tsx"
1507
- }
1508
- ```
1509
-
1510
- ---
1511
-
1512
- #### InputCheckbox + Caption
1513
-
1514
- This example shows the `InputCheckbox` with an additional caption beneath the label, presented in a lighter text color.
1515
-
1516
- **/styles.css**
1517
-
1518
- ```css
1519
- body {
1520
- font-size: 13px;
1521
- font-weight: 400;
1522
- letter-spacing: 0.08px;
1523
- line-height: 20px;
1524
- text-transform: none;
1525
- font-family: "Inter", sans-serif;
1526
- }
1527
-
1528
- h1 {
1529
- font-size: 1.5rem;
1530
- }
1531
-
1532
- .app {
1533
- padding: 20px;
1534
- }
1535
- ```
1536
-
1537
- **tsconfig.json**
1538
-
1539
- ```json
1540
- {
1541
- "include": ["./**/*"],
1542
- "compilerOptions": {
1543
- "strict": true,
1544
- "esModuleInterop": true,
1545
- "lib": ["dom", "es2015"],
1546
- "jsx": "react-jsx"
1547
- }
1548
- }
1549
- ```
1550
-
1551
- **/App.tsx**
1552
-
1553
- ```tsx
1554
- import { InputCheckbox } from "@czi-sds/components";
1555
- import "./styles.css";
1556
-
1557
- function App() {
1558
- return (
1559
- <div className="app">
1560
- <InputCheckbox caption="Caption" label="Label" />
1561
- </div>
1562
- );
1563
- }
1564
-
1565
- export default App;
1566
- ```
1567
-
1568
- **/index.tsx**
1569
-
1570
- ```tsx
1571
- import React from "react";
1572
- import { createRoot } from "react-dom/client";
1573
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1574
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1575
- import { Theme } from "@czi-sds/components";
1576
- import CssBaseline from "@mui/material/CssBaseline";
1577
- import useMediaQuery from "@mui/material/useMediaQuery";
1578
-
1579
- import App from "./App";
1580
-
1581
- const container = document.getElementById("root");
1582
- const root = createRoot(container!);
1583
-
1584
- const RootApp = () => {
1585
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1586
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1587
-
1588
- return (
1589
- <StyledEngineProvider injectFirst>
1590
- <ThemeProvider theme={theme}>
1591
- <EmotionThemeProvider theme={theme}>
1592
- <CssBaseline />
1593
- <App />
1594
- </EmotionThemeProvider>
1595
- </ThemeProvider>
1596
- </StyledEngineProvider>
1597
- );
1598
- };
1599
-
1600
- root.render(
1601
- <React.StrictMode>
1602
- <RootApp />
1603
- </React.StrictMode>
1604
- );
1605
- ```
1606
-
1607
- **/public/index.html**
1608
-
1609
- ```html
1610
- <!doctype html>
1611
- <html lang="en">
1612
- <head>
1613
- <meta charset="UTF-8" />
1614
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1615
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1616
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1617
- <link
1618
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1619
- rel="stylesheet"
1620
- />
1621
- <link
1622
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1623
- rel="stylesheet"
1624
- />
1625
- </head>
1626
- <body>
1627
- <div id="root"></div>
1628
- </body>
1629
- </html>
1630
- ```
1631
-
1632
- **/package.json**
1633
-
1634
- ```json
1635
- {
1636
- "dependencies": {
1637
- "react": "^18.0.0",
1638
- "react-dom": "^18.0.0",
1639
- "react-scripts": "^4.0.0"
1640
- },
1641
- "devDependencies": {
1642
- "@types/react": "^18.0.0",
1643
- "@types/react-dom": "^18.0.0",
1644
- "typescript": "^4.0.0"
1645
- },
1646
- "main": "/index.tsx"
1647
- }
1648
- ```
1649
-
1650
- ---
1651
-
1652
- #### Indeterminate Checkbox
1653
-
1654
- This example demonstrates a parent checkbox initially set to an indeterminate stage. When all the child checkboxes are checked, the parent checkbox transitions to a checked state.
1655
-
1656
- **/styles.css**
1657
-
1658
- ```css
1659
- body {
1660
- font-size: 13px;
1661
- font-weight: 400;
1662
- letter-spacing: 0.08px;
1663
- line-height: 20px;
1664
- text-transform: none;
1665
- font-family: "Inter", sans-serif;
1666
- }
1667
-
1668
- h1 {
1669
- font-size: 1.5rem;
1670
- }
1671
-
1672
- .app {
1673
- padding: 20px;
1674
- }
1675
- ```
1676
-
1677
- **tsconfig.json**
1678
-
1679
- ```json
1680
- {
1681
- "include": ["./**/*"],
1682
- "compilerOptions": {
1683
- "strict": true,
1684
- "esModuleInterop": true,
1685
- "lib": ["dom", "es2015"],
1686
- "jsx": "react-jsx"
1687
- }
1688
- }
1689
- ```
1690
-
1691
- **/App.tsx**
1692
-
1693
- ```tsx
1694
- import { useState } from "react";
1695
- import { Box } from "@mui/material";
1696
- import { InputCheckbox } from "@czi-sds/components";
1697
- import "./styles.css";
1698
-
1699
- function App() {
1700
- const [checked, setChecked] = useState([true, false]);
1701
-
1702
- const handleChange1 = (event: React.ChangeEvent<HTMLInputElement>) => {
1703
- setChecked([event.target.checked, event.target.checked]);
1704
- };
1705
-
1706
- const handleChange2 = (event: React.ChangeEvent<HTMLInputElement>) => {
1707
- setChecked([event.target.checked, checked[1]]);
1708
- };
1709
-
1710
- const handleChange3 = (event: React.ChangeEvent<HTMLInputElement>) => {
1711
- setChecked([checked[0], event.target.checked]);
1712
- };
1713
-
1714
- const children = (
1715
- <Box sx={{ display: "flex", flexDirection: "column", ml: 6 }}>
1716
- <InputCheckbox
1717
- label="Child 1"
1718
- checkboxProps={{
1719
- checked: checked[0],
1720
- onChange: handleChange2,
1721
- }}
1722
- />
1723
- <InputCheckbox
1724
- label="Child 2"
1725
- checkboxProps={{
1726
- checked: checked[1],
1727
- onChange: handleChange3,
1728
- }}
1729
- />
1730
- </Box>
1731
- );
1732
-
1733
- return (
1734
- <div className="app">
1735
- <InputCheckbox
1736
- label="Parent"
1737
- checkboxProps={{
1738
- checked: checked[0] && checked[1],
1739
- indeterminate: checked[0] !== checked[1],
1740
- onChange: handleChange1,
1741
- }}
1742
- />
1743
- {children}
1744
- </div>
1745
- );
1746
- }
1747
-
1748
- export default App;
1749
- ```
1750
-
1751
- **/index.tsx**
1752
-
1753
- ```tsx
1754
- import React from "react";
1755
- import { createRoot } from "react-dom/client";
1756
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1757
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1758
- import { Theme } from "@czi-sds/components";
1759
- import CssBaseline from "@mui/material/CssBaseline";
1760
- import useMediaQuery from "@mui/material/useMediaQuery";
1761
-
1762
- import App from "./App";
1763
-
1764
- const container = document.getElementById("root");
1765
- const root = createRoot(container!);
1766
-
1767
- const RootApp = () => {
1768
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1769
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1770
-
1771
- return (
1772
- <StyledEngineProvider injectFirst>
1773
- <ThemeProvider theme={theme}>
1774
- <EmotionThemeProvider theme={theme}>
1775
- <CssBaseline />
1776
- <App />
1777
- </EmotionThemeProvider>
1778
- </ThemeProvider>
1779
- </StyledEngineProvider>
1780
- );
1781
- };
1782
-
1783
- root.render(
1784
- <React.StrictMode>
1785
- <RootApp />
1786
- </React.StrictMode>
1787
- );
1788
- ```
1789
-
1790
- **/public/index.html**
1791
-
1792
- ```html
1793
- <!doctype html>
1794
- <html lang="en">
1795
- <head>
1796
- <meta charset="UTF-8" />
1797
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1798
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1799
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1800
- <link
1801
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1802
- rel="stylesheet"
1803
- />
1804
- <link
1805
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1806
- rel="stylesheet"
1807
- />
1808
- </head>
1809
- <body>
1810
- <div id="root"></div>
1811
- </body>
1812
- </html>
1813
- ```
1814
-
1815
- **/package.json**
1816
-
1817
- ```json
1818
- {
1819
- "dependencies": {
1820
- "react": "^18.0.0",
1821
- "react-dom": "^18.0.0",
1822
- "react-scripts": "^4.0.0"
1823
- },
1824
- "devDependencies": {
1825
- "@types/react": "^18.0.0",
1826
- "@types/react-dom": "^18.0.0",
1827
- "typescript": "^4.0.0"
1828
- },
1829
- "main": "/index.tsx"
1830
- }
1831
- ```
1832
-
1833
- ---
1834
-
1835
- ---
1836
-
1837
- ## InputRadio
1838
-
1839
- ### SDS Source Code
1840
-
1841
- The component's source code in the SDS codebase can be found here.
1842
-
1843
- ### SDS vs MUI
1844
-
1845
- The following props and options differ in whether and how they function across MUI versus SDS's `InputRadio` component:
1846
-
1847
- - **`size`\*\***:\*\* Has no effect in SDS
1848
- - **`color`\*\***:\*\* Has no effect in SDS
1849
- - **`labelPlacement`\*\***:\*\* Has no effect in SDS
1850
- - **`caption`\*\***:\*\* This is an SDS-specific prop, which takes a string of text that is desplayed below the primary `label` text.
1851
- - **`row`\*\***:\*\* This boolean prop functions the same for both MUI and SDS's `InputRadio` component: its presence reformats the radio buttons (and their labels) within the `RadioGroup` parent component into a horizontal row.
1852
-
1853
- ### MUI Documentation
1854
-
1855
- Documentation for the underlying MUI component can be found here.
1856
-
1857
- ### Props
1858
-
1859
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1860
-
1861
- | Name | Type | Default | Description |
1862
- | ------------ | ------------------------ | ------------ | -------------------------------------------------------------------------------- | ----------------------------- | ----------- | ------------------------------------- |
1863
- | `caption` | `string` | - | The caption of the InputRadio appears beneath the label in a lighter text color. |
1864
- | `label` | `string` | - | The label of the InputCheckbox. |
1865
- | `radioProps` | `Partial<MUIRadioProps>` | `{}` | Directly pass these props to the underlying MUI radio. |
1866
- | `stage` | `"checked" | "unchecked"` | `unchecked` | The stage of the radio input. |
1867
- | `intent` | `"default"` ` | "notice"` ` | "negative"` ` | "positive"` | `"default"` | Defines the color of the `InputRadio` |
1868
- | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
1869
-
1870
- ### Code examples
1871
-
1872
- #### **Default InputRadio**
1873
-
1874
- This example has the minimum props needed for the `InputRadio` component.
1875
-
1876
- **/styles.css**
1877
-
1878
- ```css
1879
- body {
1880
- font-size: 13px;
1881
- font-weight: 400;
1882
- letter-spacing: 0.08px;
1883
- line-height: 20px;
1884
- text-transform: none;
1885
- font-family: "Inter", sans-serif;
1886
- }
1887
-
1888
- h1 {
1889
- font-size: 1.5rem;
1890
- }
1891
-
1892
- .app {
1893
- padding: 20px;
1894
- }
1895
- ```
1896
-
1897
- **tsconfig.json**
1898
-
1899
- ```json
1900
- {
1901
- "include": ["./**/*"],
1902
- "compilerOptions": {
1903
- "strict": true,
1904
- "esModuleInterop": true,
1905
- "lib": ["dom", "es2015"],
1906
- "jsx": "react-jsx"
1907
- }
1908
- }
1909
- ```
1910
-
1911
- **/App.tsx**
1912
-
1913
- ```tsx
1914
- import { InputRadio } from "@czi-sds/components";
1915
- import "./styles.css";
1916
-
1917
- function App() {
1918
- return (
1919
- <div className="app">
1920
- <InputRadio label="Label" />
1921
- </div>
1922
- );
1923
- }
1924
-
1925
- export default App;
1926
- ```
1927
-
1928
- **/index.tsx**
1929
-
1930
- ```tsx
1931
- import React from "react";
1932
- import { createRoot } from "react-dom/client";
1933
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1934
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1935
- import { Theme } from "@czi-sds/components";
1936
- import CssBaseline from "@mui/material/CssBaseline";
1937
- import useMediaQuery from "@mui/material/useMediaQuery";
1938
-
1939
- import App from "./App";
1940
-
1941
- const container = document.getElementById("root");
1942
- const root = createRoot(container!);
1943
-
1944
- const RootApp = () => {
1945
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1946
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1947
-
1948
- return (
1949
- <StyledEngineProvider injectFirst>
1950
- <ThemeProvider theme={theme}>
1951
- <EmotionThemeProvider theme={theme}>
1952
- <CssBaseline />
1953
- <App />
1954
- </EmotionThemeProvider>
1955
- </ThemeProvider>
1956
- </StyledEngineProvider>
1957
- );
1958
- };
1959
-
1960
- root.render(
1961
- <React.StrictMode>
1962
- <RootApp />
1963
- </React.StrictMode>
1964
- );
1965
- ```
1966
-
1967
- **/public/index.html**
1968
-
1969
- ```html
1970
- <!doctype html>
1971
- <html lang="en">
1972
- <head>
1973
- <meta charset="UTF-8" />
1974
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1975
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1976
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1977
- <link
1978
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1979
- rel="stylesheet"
1980
- />
1981
- <link
1982
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1983
- rel="stylesheet"
1984
- />
1985
- </head>
1986
- <body>
1987
- <div id="root"></div>
1988
- </body>
1989
- </html>
1990
- ```
1991
-
1992
- **/package.json**
1993
-
1994
- ```json
1995
- {
1996
- "dependencies": {
1997
- "react": "^18.0.0",
1998
- "react-dom": "^18.0.0",
1999
- "react-scripts": "^4.0.0"
2000
- },
2001
- "devDependencies": {
2002
- "@types/react": "^18.0.0",
2003
- "@types/react-dom": "^18.0.0",
2004
- "typescript": "^4.0.0"
2005
- },
2006
- "main": "/index.tsx"
2007
- }
2008
- ```
2009
-
2010
- ---
2011
-
2012
- #### InputRadio + Caption
2013
-
2014
- This example shows the `InputRadio` with an additional caption beneath the label, presented in a lighter text color.
2015
-
2016
- **/styles.css**
2017
-
2018
- ```css
2019
- body {
2020
- font-size: 13px;
2021
- font-weight: 400;
2022
- letter-spacing: 0.08px;
2023
- line-height: 20px;
2024
- text-transform: none;
2025
- font-family: "Inter", sans-serif;
2026
- }
2027
-
2028
- h1 {
2029
- font-size: 1.5rem;
2030
- }
2031
-
2032
- .app {
2033
- padding: 20px;
2034
- }
2035
- ```
2036
-
2037
- **tsconfig.json**
2038
-
2039
- ```json
2040
- {
2041
- "include": ["./**/*"],
2042
- "compilerOptions": {
2043
- "strict": true,
2044
- "esModuleInterop": true,
2045
- "lib": ["dom", "es2015"],
2046
- "jsx": "react-jsx"
2047
- }
2048
- }
2049
- ```
2050
-
2051
- **/App.tsx**
2052
-
2053
- ```tsx
2054
- import { InputRadio } from "@czi-sds/components";
2055
- import "./styles.css";
2056
-
2057
- function App() {
2058
- return (
2059
- <div className="app">
2060
- <InputRadio caption="Caption" label="Label" />
2061
- </div>
2062
- );
2063
- }
2064
-
2065
- export default App;
2066
- ```
2067
-
2068
- **/index.tsx**
2069
-
2070
- ```tsx
2071
- import React from "react";
2072
- import { createRoot } from "react-dom/client";
2073
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2074
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
2075
- import { Theme } from "@czi-sds/components";
2076
- import CssBaseline from "@mui/material/CssBaseline";
2077
- import useMediaQuery from "@mui/material/useMediaQuery";
2078
-
2079
- import App from "./App";
2080
-
2081
- const container = document.getElementById("root");
2082
- const root = createRoot(container!);
2083
-
2084
- const RootApp = () => {
2085
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
2086
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
2087
-
2088
- return (
2089
- <StyledEngineProvider injectFirst>
2090
- <ThemeProvider theme={theme}>
2091
- <EmotionThemeProvider theme={theme}>
2092
- <CssBaseline />
2093
- <App />
2094
- </EmotionThemeProvider>
2095
- </ThemeProvider>
2096
- </StyledEngineProvider>
2097
- );
2098
- };
2099
-
2100
- root.render(
2101
- <React.StrictMode>
2102
- <RootApp />
2103
- </React.StrictMode>
2104
- );
2105
- ```
2106
-
2107
- **/public/index.html**
2108
-
2109
- ```html
2110
- <!doctype html>
2111
- <html lang="en">
2112
- <head>
2113
- <meta charset="UTF-8" />
2114
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
2115
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2116
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2117
- <link
2118
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
2119
- rel="stylesheet"
2120
- />
2121
- <link
2122
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
2123
- rel="stylesheet"
2124
- />
2125
- </head>
2126
- <body>
2127
- <div id="root"></div>
2128
- </body>
2129
- </html>
2130
- ```
2131
-
2132
- **/package.json**
2133
-
2134
- ```json
2135
- {
2136
- "dependencies": {
2137
- "react": "^18.0.0",
2138
- "react-dom": "^18.0.0",
2139
- "react-scripts": "^4.0.0"
2140
- },
2141
- "devDependencies": {
2142
- "@types/react": "^18.0.0",
2143
- "@types/react-dom": "^18.0.0",
2144
- "typescript": "^4.0.0"
2145
- },
2146
- "main": "/index.tsx"
2147
- }
2148
- ```
2149
-
2150
- ---
2151
-
2152
- ---
2153
-
2154
- ## InputSlider
2155
-
2156
- ### SDS Source Code
2157
-
2158
- The component's source code in the SDS codebase can be found here.
2159
-
2160
- ### SDS vs MUI
2161
-
2162
- The following props and options differ in how they function across MUI's `Switch` component versus SDS's `InputToggle` component:
2163
-
2164
- - **`size`\*\***:\*\* Has no effect in SDS
2165
- - **`color`\*\***:\*\* Has no effect in SDS
2166
-
2167
- These are some of the common props that can be used for both the MUI `Switch` component and the SDS `InputToggle` component:
2168
-
2169
- - **`step`\*\***:\*\* Sets the step distance between selectable stops (and relatedly, if this prop is left out, the toggle is continuous, rather than discrete)
2170
- - **`marks`\*\***:\*\* When present and set to true, invokes the default marks style. When passed a rich array (of objects containing the value and the custom label to show at that value), sets marks and labels only at the positions specified by the array. See the "InputSlider with custom Marks" example below.
2171
- - **`valueLabelDisplay`\*\***:\*\* This prop determines whether and when the value label is displayed, and takes the following props: `auto` (the value label will display when the thumb is hovered or focused), `on` (default; labels display persistently), or `off` (labels are never displayed).
2172
- - **`orientation`\*\***:\*\* This prop controls which direction the slider is shown: `horizontal` (default) or `vertical`
2173
-
2174
- ### MUI Documentation
2175
-
2176
- Documentation for the underlying MUI component can be found here.
2177
-
2178
- ### Props
2179
-
2180
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
2181
-
2182
- | Name | Type | Default | Description |
2183
- | ------------------- | -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2184
- | `defaultValue` | `Array<number> |  number` | - | The default value. Use when the component is not controlled. |
2185
- | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
2186
- | `marks` | `bool` | `false` | Marks indicate predetermined values to which the user can move the slider. If true the marks are spaced according the value of the step prop. If an array, it should contain objects with value and an optional label keys. |
2187
- | `max` | `number` | `100` | The maximum allowed value of the slider. Should not be equal to min. |
2188
- | `min` | `number` | `0` | The minimum allowed value of the slider. Should not be equal to max. |
2189
- | `orientation` | `"horizontal"` | `horizontal` | The component orientation. |
2190
- | `step` | `number` | `1` | The granularity with which the slider can step through values. (A "discrete" slider.) The `min` prop serves as the origin for the valid values. We recommend (max - min) to be evenly divisible by the step. When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop. |
2191
- | `valueLabelDisplay` | `"auto"` ` |  "off"` ` |  "on"` | `off` | Controls when the value label is displayed: `auto`. the value label will display when the thumb is hovered or focused. . `on`. will display persistently. . `off`. will never display. |
2192
-
2193
- ### Code examples
2194
-
2195
- #### **Default InputSlider**
2196
-
2197
- This example has the minimum props needed for the `InputRadio` component.
2198
-
2199
- **/styles.css**
2200
-
2201
- ```css
2202
- body {
2203
- font-size: 13px;
2204
- font-weight: 400;
2205
- letter-spacing: 0.08px;
2206
- line-height: 20px;
2207
- text-transform: none;
2208
- font-family: "Inter", sans-serif;
2209
- }
2210
-
2211
- h1 {
2212
- font-size: 1.5rem;
2213
- }
2214
-
2215
- .app {
2216
- padding: 20px;
2217
- }
2218
- ```
2219
-
2220
- **tsconfig.json**
2221
-
2222
- ```json
2223
- {
2224
- "include": ["./**/*"],
2225
- "compilerOptions": {
2226
- "strict": true,
2227
- "esModuleInterop": true,
2228
- "lib": ["dom", "es2015"],
2229
- "jsx": "react-jsx"
2230
- }
2231
- }
2232
- ```
2233
-
2234
- **/App.tsx**
2235
-
2236
- ```tsx
2237
- import { InputSlider } from "@czi-sds/components";
2238
- import { Box } from "@mui/material";
2239
- import "./styles.css";
2240
-
2241
- function App() {
2242
- return (
2243
- <div className="app">
2244
- <Box sx={{ width: 200 }}>
2245
- <InputSlider label="Label" />
2246
- </Box>
2247
- </div>
2248
- );
2249
- }
2250
-
2251
- export default App;
2252
- ```
2253
-
2254
- **/index.tsx**
2255
-
2256
- ```tsx
2257
- import React from "react";
2258
- import { createRoot } from "react-dom/client";
2259
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2260
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
2261
- import { Theme } from "@czi-sds/components";
2262
- import CssBaseline from "@mui/material/CssBaseline";
2263
- import useMediaQuery from "@mui/material/useMediaQuery";
2264
-
2265
- import App from "./App";
2266
-
2267
- const container = document.getElementById("root");
2268
- const root = createRoot(container!);
2269
-
2270
- const RootApp = () => {
2271
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
2272
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
2273
-
2274
- return (
2275
- <StyledEngineProvider injectFirst>
2276
- <ThemeProvider theme={theme}>
2277
- <EmotionThemeProvider theme={theme}>
2278
- <CssBaseline />
2279
- <App />
2280
- </EmotionThemeProvider>
2281
- </ThemeProvider>
2282
- </StyledEngineProvider>
2283
- );
2284
- };
2285
-
2286
- root.render(
2287
- <React.StrictMode>
2288
- <RootApp />
2289
- </React.StrictMode>
2290
- );
2291
- ```
2292
-
2293
- **/public/index.html**
2294
-
2295
- ```html
2296
- <!doctype html>
2297
- <html lang="en">
2298
- <head>
2299
- <meta charset="UTF-8" />
2300
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
2301
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2302
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2303
- <link
2304
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
2305
- rel="stylesheet"
2306
- />
2307
- <link
2308
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
2309
- rel="stylesheet"
2310
- />
2311
- </head>
2312
- <body>
2313
- <div id="root"></div>
2314
- </body>
2315
- </html>
2316
- ```
2317
-
2318
- **/package.json**
2319
-
2320
- ```json
2321
- {
2322
- "dependencies": {
2323
- "react": "^18.0.0",
2324
- "react-dom": "^18.0.0",
2325
- "react-scripts": "^4.0.0"
2326
- },
2327
- "devDependencies": {
2328
- "@types/react": "^18.0.0",
2329
- "@types/react-dom": "^18.0.0",
2330
- "typescript": "^4.0.0"
2331
- },
2332
- "main": "/index.tsx"
2333
- }
2334
- ```
2335
-
2336
- ---
2337
-
2338
- #### InputSlider with custom Marks
2339
-
2340
- This example shows an `InputSlider` component that features custom marks precisely positioned at `0%`, `50%`, and `100%` of the slider's value.
2341
-
2342
- **/styles.css**
2343
-
2344
- ```css
2345
- body {
2346
- font-size: 13px;
2347
- font-weight: 400;
2348
- letter-spacing: 0.08px;
2349
- line-height: 20px;
2350
- text-transform: none;
2351
- font-family: "Inter", sans-serif;
2352
- }
2353
-
2354
- h1 {
2355
- font-size: 1.5rem;
2356
- }
2357
-
2358
- .app {
2359
- padding: 20px;
2360
- }
2361
- ```
2362
-
2363
- **tsconfig.json**
2364
-
2365
- ```json
2366
- {
2367
- "include": ["./**/*"],
2368
- "compilerOptions": {
2369
- "strict": true,
2370
- "esModuleInterop": true,
2371
- "lib": ["dom", "es2015"],
2372
- "jsx": "react-jsx"
2373
- }
2374
- }
2375
- ```
2376
-
2377
- **/App.tsx**
2378
-
2379
- ```tsx
2380
- import { InputSlider } from "@czi-sds/components";
2381
- import { Box } from "@mui/material";
2382
- import "./styles.css";
2383
-
2384
- const generateCustomMarks = (min: number, max: number) => {
2385
- return [
2386
- {
2387
- label: min,
2388
- value: min,
2389
- },
2390
- {
2391
- label: ((max - min) / 2 + min).toFixed(0),
2392
- value: (max - min) / 2 + min,
2393
- },
2394
- {
2395
- label: max,
2396
- value: max,
2397
- },
2398
- ];
2399
- };
2400
-
2401
- function App() {
2402
- return (
2403
- <div className="app">
2404
- <Box sx={{ width: 200 }}>
2405
- <InputSlider
2406
- label="Label"
2407
- marks={generateCustomMarks(0, 100)}
2408
- min={0}
2409
- max={100}
2410
- step={5}
2411
- valueLabelDisplay
2412
- />
2413
- </Box>
2414
- </div>
2415
- );
2416
- }
2417
-
2418
- export default App;
2419
- ```
2420
-
2421
- **/index.tsx**
2422
-
2423
- ```tsx
2424
- import React from "react";
2425
- import { createRoot } from "react-dom/client";
2426
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2427
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
2428
- import { Theme } from "@czi-sds/components";
2429
- import CssBaseline from "@mui/material/CssBaseline";
2430
- import useMediaQuery from "@mui/material/useMediaQuery";
2431
-
2432
- import App from "./App";
2433
-
2434
- const container = document.getElementById("root");
2435
- const root = createRoot(container!);
2436
-
2437
- const RootApp = () => {
2438
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
2439
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
2440
-
2441
- return (
2442
- <StyledEngineProvider injectFirst>
2443
- <ThemeProvider theme={theme}>
2444
- <EmotionThemeProvider theme={theme}>
2445
- <CssBaseline />
2446
- <App />
2447
- </EmotionThemeProvider>
2448
- </ThemeProvider>
2449
- </StyledEngineProvider>
2450
- );
2451
- };
2452
-
2453
- root.render(
2454
- <React.StrictMode>
2455
- <RootApp />
2456
- </React.StrictMode>
2457
- );
2458
- ```
2459
-
2460
- **/public/index.html**
2461
-
2462
- ```html
2463
- <!doctype html>
2464
- <html lang="en">
2465
- <head>
2466
- <meta charset="UTF-8" />
2467
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
2468
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2469
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2470
- <link
2471
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
2472
- rel="stylesheet"
2473
- />
2474
- <link
2475
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
2476
- rel="stylesheet"
2477
- />
2478
- </head>
2479
- <body>
2480
- <div id="root"></div>
2481
- </body>
2482
- </html>
2483
- ```
2484
-
2485
- **/package.json**
2486
-
2487
- ```json
2488
- {
2489
- "dependencies": {
2490
- "react": "^18.0.0",
2491
- "react-dom": "^18.0.0",
2492
- "react-scripts": "^4.0.0"
2493
- },
2494
- "devDependencies": {
2495
- "@types/react": "^18.0.0",
2496
- "@types/react-dom": "^18.0.0",
2497
- "typescript": "^4.0.0"
2498
- },
2499
- "main": "/index.tsx"
2500
- }
2501
- ```
2502
-
2503
- ---
2504
-
2505
- ---
2506
-
2507
- ## InputToggle
2508
-
2509
- ### SDS Source Code
2510
-
2511
- The component's source code in the SDS codebase can be found here.
2512
-
2513
- ### SDS vs MUI
2514
-
2515
- The following props and options differ and how they function across the MUI `Switch` component and the SDS `InputToggle` component:
2516
-
2517
- - **`size`\*\***:\*\* Has no effect in SDS
2518
- - **`color`\*\***:\*\* Has no effect in SDS
2519
- - **`label`** **and** **`labelPlacement`\*\***:\*\* Has no effect in SDS
2520
- - The **`required`** prop is available for both the MUI and SDS components.
2521
-
2522
- ### MUI Documentation
2523
-
2524
- Documentation for the underlying MUI component can be found here.
2525
-
2526
- ### Props
2527
-
2528
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
2529
-
2530
- | Name | Type | Default | Description |
2531
- | ---------- | -------- | ------- | ------------------------------------------------------- |
2532
- | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
2533
- | `offLabel` | `string` | `"Off"` | The text displayed within the InputToggle when it's off |
2534
- | `onChange` | `func` | | Sets what happens when a user toggles on the component. |
2535
- | `onLabel` | `string` | `"On"` | The text displayed within the InputToggle when it's off |
2536
- | `width` | `number` | `62` | Controls the `width` of the InputToggle element. |
2537
-
2538
- ### Code examples
2539
-
2540
- #### **Default InputToggle**
2541
-
2542
- This example has the minimum props needed for the `InputToggle` component.
2543
-
2544
- **/styles.css**
2545
-
2546
- ```css
2547
- body {
2548
- font-size: 13px;
2549
- font-weight: 400;
2550
- letter-spacing: 0.08px;
2551
- line-height: 20px;
2552
- text-transform: none;
2553
- font-family: "Inter", sans-serif;
2554
- }
2555
-
2556
- h1 {
2557
- font-size: 1.5rem;
2558
- }
2559
-
2560
- .app {
2561
- padding: 20px;
2562
- }
2563
- ```
2564
-
2565
- **tsconfig.json**
2566
-
2567
- ```json
2568
- {
2569
- "include": ["./**/*"],
2570
- "compilerOptions": {
2571
- "strict": true,
2572
- "esModuleInterop": true,
2573
- "lib": ["dom", "es2015"],
2574
- "jsx": "react-jsx"
2575
- }
2576
- }
2577
- ```
2578
-
2579
- **/App.tsx**
2580
-
2581
- ```tsx
2582
- import { InputToggle } from "@czi-sds/components";
2583
- import "./styles.css";
2584
-
2585
- function App() {
2586
- return (
2587
- <div className="app">
2588
- <InputToggle />
2589
- </div>
2590
- );
2591
- }
2592
-
2593
- export default App;
2594
- ```
2595
-
2596
- **/index.tsx**
2597
-
2598
- ```tsx
2599
- import React from "react";
2600
- import { createRoot } from "react-dom/client";
2601
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2602
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
2603
- import { Theme } from "@czi-sds/components";
2604
- import CssBaseline from "@mui/material/CssBaseline";
2605
- import useMediaQuery from "@mui/material/useMediaQuery";
2606
-
2607
- import App from "./App";
2608
-
2609
- const container = document.getElementById("root");
2610
- const root = createRoot(container!);
2611
-
2612
- const RootApp = () => {
2613
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
2614
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
2615
-
2616
- return (
2617
- <StyledEngineProvider injectFirst>
2618
- <ThemeProvider theme={theme}>
2619
- <EmotionThemeProvider theme={theme}>
2620
- <CssBaseline />
2621
- <App />
2622
- </EmotionThemeProvider>
2623
- </ThemeProvider>
2624
- </StyledEngineProvider>
2625
- );
2626
- };
2627
-
2628
- root.render(
2629
- <React.StrictMode>
2630
- <RootApp />
2631
- </React.StrictMode>
2632
- );
2633
- ```
2634
-
2635
- **/public/index.html**
2636
-
2637
- ```html
2638
- <!doctype html>
2639
- <html lang="en">
2640
- <head>
2641
- <meta charset="UTF-8" />
2642
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
2643
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2644
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2645
- <link
2646
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
2647
- rel="stylesheet"
2648
- />
2649
- <link
2650
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
2651
- rel="stylesheet"
2652
- />
2653
- </head>
2654
- <body>
2655
- <div id="root"></div>
2656
- </body>
2657
- </html>
2658
- ```
2659
-
2660
- **/package.json**
2661
-
2662
- ```json
2663
- {
2664
- "dependencies": {
2665
- "react": "^18.0.0",
2666
- "react-dom": "^18.0.0",
2667
- "react-scripts": "^4.0.0"
2668
- },
2669
- "devDependencies": {
2670
- "@types/react": "^18.0.0",
2671
- "@types/react-dom": "^18.0.0",
2672
- "typescript": "^4.0.0"
2673
- },
2674
- "main": "/index.tsx"
2675
- }
2676
- ```
2677
-
2678
- ---
2679
-
2680
- #### **InputToggle with customized on and off labels**
2681
-
2682
- This example shows an `InputToggle` component with customized on and off labels.
2683
-
2684
- **/styles.css**
2685
-
2686
- ```css
2687
- body {
2688
- font-size: 13px;
2689
- font-weight: 400;
2690
- letter-spacing: 0.08px;
2691
- line-height: 20px;
2692
- text-transform: none;
2693
- font-family: "Inter", sans-serif;
2694
- }
2695
-
2696
- h1 {
2697
- font-size: 1.5rem;
2698
- }
2699
-
2700
- .app {
2701
- padding: 20px;
2702
- }
2703
- ```
2704
-
2705
- **tsconfig.json**
2706
-
2707
- ```json
2708
- {
2709
- "include": ["./**/*"],
2710
- "compilerOptions": {
2711
- "strict": true,
2712
- "esModuleInterop": true,
2713
- "lib": ["dom", "es2015"],
2714
- "jsx": "react-jsx"
2715
- }
2716
- }
2717
- ```
2718
-
2719
- **/App.tsx**
2720
-
2721
- ```tsx
2722
- import { InputToggle } from "@czi-sds/components";
2723
- import "./styles.css";
2724
-
2725
- function App() {
2726
- return (
2727
- <div className="app">
2728
- <InputToggle onLabel="Start" offLabel="Finish" width={72} />
2729
- </div>
2730
- );
2731
- }
2732
-
2733
- export default App;
2734
- ```
2735
-
2736
- **/index.tsx**
2737
-
2738
- ```tsx
2739
- import React from "react";
2740
- import { createRoot } from "react-dom/client";
2741
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2742
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
2743
- import { Theme } from "@czi-sds/components";
2744
- import CssBaseline from "@mui/material/CssBaseline";
2745
- import useMediaQuery from "@mui/material/useMediaQuery";
2746
-
2747
- import App from "./App";
2748
-
2749
- const container = document.getElementById("root");
2750
- const root = createRoot(container!);
2751
-
2752
- const RootApp = () => {
2753
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
2754
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
2755
-
2756
- return (
2757
- <StyledEngineProvider injectFirst>
2758
- <ThemeProvider theme={theme}>
2759
- <EmotionThemeProvider theme={theme}>
2760
- <CssBaseline />
2761
- <App />
2762
- </EmotionThemeProvider>
2763
- </ThemeProvider>
2764
- </StyledEngineProvider>
2765
- );
2766
- };
2767
-
2768
- root.render(
2769
- <React.StrictMode>
2770
- <RootApp />
2771
- </React.StrictMode>
2772
- );
2773
- ```
2774
-
2775
- **/public/index.html**
2776
-
2777
- ```html
2778
- <!doctype html>
2779
- <html lang="en">
2780
- <head>
2781
- <meta charset="UTF-8" />
2782
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
2783
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2784
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2785
- <link
2786
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
2787
- rel="stylesheet"
2788
- />
2789
- <link
2790
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
2791
- rel="stylesheet"
2792
- />
2793
- </head>
2794
- <body>
2795
- <div id="root"></div>
2796
- </body>
2797
- </html>
2798
- ```
2799
-
2800
- **/package.json**
2801
-
2802
- ```json
2803
- {
2804
- "dependencies": {
2805
- "react": "^18.0.0",
2806
- "react-dom": "^18.0.0",
2807
- "react-scripts": "^4.0.0"
2808
- },
2809
- "devDependencies": {
2810
- "@types/react": "^18.0.0",
2811
- "@types/react-dom": "^18.0.0",
2812
- "typescript": "^4.0.0"
2813
- },
2814
- "main": "/index.tsx"
2815
- }
2816
- ```
2817
-
2818
- ---