@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,2121 @@
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
+ ---
29
+
30
+ ---
31
+
32
+ ### Checkbox Lockups
33
+
34
+ Each Checkbox must be coupled with a label to communicate the result of a selection.
35
+
36
+
37
+
38
+ ---
39
+
40
+ ### Checkbox Spacing
41
+
42
+ These rules establish how much margin should exist between and around elements.
43
+
44
+
45
+
46
+ ---
47
+
48
+ ## Radio Input
49
+
50
+ | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
51
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
52
+
53
+ 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.
54
+
55
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
56
+
57
+ | **Default** | **Hover** | **Disabled** |
58
+ | ----------- | --------- | ------------ |
59
+
60
+ ---
61
+
62
+ ### Radio Lockups
63
+
64
+ Each Radio must be coupled with a label to communicate the result of a selection.
65
+
66
+ ---
67
+
68
+ ### Radio Spacing
69
+
70
+ These rules establish how much margin should exist between and around elements.
71
+
72
+
73
+
74
+ ## Code
75
+
76
+ ## Control Input Components
77
+
78
+ | 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 |
79
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------- |
80
+
81
+ ---
82
+
83
+ > 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.
84
+
85
+ ### InputCheckbox
86
+
87
+ Storybook
88
+
89
+ ---
90
+
91
+ ### InputRadio
92
+
93
+ Storybook
94
+
95
+ ---
96
+
97
+ Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
98
+
99
+ ## Overview
100
+
101
+ ## Control Input Variants
102
+
103
+ | 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 |
104
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------ |
105
+
106
+ ### Visual Preview
107
+
108
+ Use the links below to jump to information on a specific Control Input variant:
109
+
110
+ ---
111
+
112
+ ## Checkbox Input
113
+
114
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
115
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
116
+
117
+ 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.
118
+
119
+ Use `sdsStage: indeterminate` to indicate a mixed selection; reserved for cases where "Select All" is an option as part of a group of checkboxes.
120
+
121
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
122
+
123
+ | **Default** | **Hover** | **Disabled** |
124
+ | ----------- | --------- | ------------ |
125
+
126
+ ---
127
+
128
+
129
+
130
+ ---
131
+
132
+
133
+
134
+ ### Checkbox Intent States
135
+
136
+ Use `intent: default` to communicate that a user has yet to enter a response.
137
+
138
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
139
+
140
+ Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
141
+
142
+ | **Default** | **Error** | **Warning** |
143
+ | ----------- | --------- | ----------- |
144
+
145
+
146
+
147
+ ### Checkbox Lockups
148
+
149
+ 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.
150
+
151
+ ---
152
+
153
+ ### Checkbox Spacing
154
+
155
+ These rules establish how much margin should exist between and around elements.
156
+
157
+ ---
158
+
159
+ ## Radio Input
160
+
161
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
162
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
163
+
164
+ 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.
165
+
166
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
167
+
168
+ | **Default** | **Hover** | **Disabled** |
169
+ | ----------- | --------- | ------------ |
170
+
171
+ | **Default** | **Disabled** |
172
+ | ----------- | ------------ |
173
+
174
+
175
+
176
+ ### Radio Intent States
177
+
178
+ Use `intent: default` to communicate that user has yet to enter a response.
179
+
180
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
181
+
182
+ Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
183
+
184
+ | **Default** | **Error** | **Warning** |
185
+ | ----------- | --------- | ----------- |
186
+
187
+ ### Radio Lockups
188
+
189
+ 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.
190
+
191
+ ---
192
+
193
+ ### Radio Spacing
194
+
195
+ These rules establish how much margin should exist between and around elements.
196
+
197
+ ---
198
+
199
+ ## Toggle
200
+
201
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
202
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
203
+
204
+ Use to allow the user to flip a setting or option from off to on and vice versa.
205
+
206
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
207
+
208
+ | **Default** | **Hover** | **Disabled** |
209
+ | ----------- | --------- | ------------ |
210
+
211
+ ---
212
+
213
+ ---
214
+
215
+ ### Toggle Spacing
216
+
217
+ These rules establish how much margin should exist between and around elements.
218
+
219
+ ## Code
220
+
221
+ ## Control Input Components
222
+
223
+ | 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 |
224
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------- |
225
+
226
+ ---
227
+
228
+ > 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.
229
+
230
+ ### InputCheckbox
231
+
232
+ Storybook
233
+
234
+ ---
235
+
236
+ ### InputRadio
237
+
238
+ Storybook
239
+
240
+ ---
241
+
242
+ ### InputToggle
243
+
244
+ Storybook
245
+
246
+ ---
247
+
248
+ Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
249
+
250
+ ## Overview
251
+
252
+ ## Control Input Variants
253
+
254
+ | 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 |
255
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------- |
256
+
257
+ ### Visual Preview
258
+
259
+ Use the links below to jump to information on a specific Control Input variant:
260
+
261
+ ---
262
+
263
+ ## Checkbox Input
264
+
265
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
266
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
267
+
268
+ 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.
269
+
270
+ Use `sdsStage: indeterminate` to indicate a mixed selection; reserved for cases where "Select All" is an option as part of a group of checkboxes.
271
+
272
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
273
+
274
+ | **Default** | **Hover** | **Disabled** |
275
+ | ----------- | --------- | ------------ |
276
+
277
+ ---
278
+
279
+ ---
280
+
281
+
282
+
283
+ ### Checkbox Intent States
284
+
285
+ Use `intent: default` to communicate that user has yet to enter a response.
286
+
287
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
288
+
289
+ Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
290
+
291
+ | **Default** | **Error** | **Warning** |
292
+ | ----------- | --------- | ----------- |
293
+
294
+ ### Checkbox Lockups
295
+
296
+ 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.
297
+
298
+ ---
299
+
300
+ ### Checkbox Spacing
301
+
302
+ These rules establish how much margin should exist between and around elements.
303
+
304
+ ---
305
+
306
+ ## Radio Input
307
+
308
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
309
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
310
+
311
+ 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.
312
+
313
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
314
+
315
+ | **Default** | **Hover** | **Disabled** |
316
+ | ----------- | --------- | ------------ |
317
+
318
+ | **Default** | **Disabled** |
319
+ | ----------- | ------------ |
320
+
321
+ ### Radio Intent States
322
+
323
+ Use `intent: default` to communicate that user has yet to enter a response.
324
+
325
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete response.
326
+
327
+ Use `intent: warning` to communicate when a user needs to be alerted that their response needs attention.
328
+
329
+ | **Default** | **Error** | **Warning** |
330
+ | ----------- | --------- | ----------- |
331
+
332
+
333
+
334
+ ### Radio Lockups
335
+
336
+ 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.
337
+
338
+ ---
339
+
340
+ ### Radio Spacing
341
+
342
+ These rules establish how much margin should exist between and around elements.
343
+
344
+ ---
345
+
346
+ ## Toggle
347
+
348
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
349
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
350
+
351
+ Use to allow the user to flip a setting or option from off to on and vice versa.
352
+
353
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
354
+
355
+ | **Default** | **Hover** | **Disabled** |
356
+ | ----------- | --------- | ------------ |
357
+
358
+ ---
359
+
360
+ ---
361
+
362
+ ### Toggle Switch Spacing
363
+
364
+ These rules establish how much margin should exist between and around elements.
365
+
366
+ ---
367
+
368
+ ## Slider
369
+
370
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
371
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
372
+
373
+ ### Single-sided Slider
374
+
375
+ Use when there is a specific datapoint or value within a dataset that the user is able to select.
376
+
377
+ ---
378
+
379
+ ### Double-sided Slider
380
+
381
+ Use when users need the ability to select a range between two values within a dataset.
382
+
383
+ ---
384
+
385
+ ---
386
+
387
+ ### Slider Spacing
388
+
389
+ These rules establish how much margin should exist between and around elements.
390
+
391
+ ## Code
392
+
393
+ ## Control Input Components
394
+
395
+ | 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 |
396
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------- |
397
+
398
+ ---
399
+
400
+ ### InputCheckbox
401
+
402
+ Storybook
403
+
404
+ ---
405
+
406
+ ### InputRadio
407
+
408
+ Storybook
409
+
410
+ ---
411
+
412
+ ### InputToggle
413
+
414
+ Storybook
415
+
416
+ ---
417
+
418
+ ### InputSlider
419
+
420
+ Storybook
421
+
422
+ ---
423
+
424
+ Control Inputs are elements that enable users to make selections and communicate choices when presented with various options in the UI.
425
+
426
+ ## Guidelines
427
+
428
+ ## Control Input Components
429
+
430
+ | 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 |
431
+ | ----------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------- |
432
+
433
+ ### Visual Preview
434
+
435
+ ---
436
+
437
+ ## Checkbox
438
+
439
+ | | In Figma | | | Meets Accessibility | | | In Code |
440
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
441
+
442
+ ### Live Instance
443
+
444
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
445
+
446
+ Default
447
+
448
+ ---
449
+
450
+ ### Overview
451
+
452
+ 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.
453
+
454
+ 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.
455
+
456
+ #### Checkbox – No Label
457
+
458
+ Use when Checkbox functionality is needed but a custom label is desired.
459
+
460
+ | Default | Hover | Disabled |
461
+ | ------- | ----- | -------- |
462
+
463
+ #### Checkbox – Label
464
+
465
+ | Default | Hover | Disabled |
466
+ | ------- | ----- | -------- |
467
+
468
+ #### Checkbox – Label + Caption
469
+
470
+ | Default | Hover | Disabled |
471
+ | ------- | ----- | -------- |
472
+
473
+ ---
474
+
475
+ ### Checkbox Spacing
476
+
477
+ These rules establish how much margin should exist between and around elements.
478
+
479
+ ---
480
+
481
+ ### Intent Variations
482
+
483
+ 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.
484
+
485
+ | Default | Negative | Negative + Intent Message | Notice | Notice + Intent Message |
486
+ | ------- | -------- | ------------------------- | ------ | ----------------------- |
487
+
488
+ ---
489
+
490
+ ## Radio
491
+
492
+ | | In Figma | | | Meets Accessibility | | | In Code |
493
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
494
+
495
+ ### Live Instance
496
+
497
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
498
+
499
+ Default
500
+
501
+ ---
502
+
503
+ ### Overview
504
+
505
+ 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.
506
+
507
+ #### Radio – No Label
508
+
509
+ Use when Radio functionality is needed but a custom label is desired.
510
+
511
+ | Default | Hover | Disabled |
512
+ | ------- | ----- | -------- |
513
+
514
+ | Default | Disabled |
515
+ | ------- | -------- |
516
+
517
+ #### Radio – Label
518
+
519
+ | Default | Hover | Disabled |
520
+ | ------- | ----- | -------- |
521
+
522
+ | Default | Disabled |
523
+ | ------- | -------- |
524
+
525
+ #### Radio – Label + Caption
526
+
527
+ | Default | Hover | Disabled |
528
+ | ------- | ----- | -------- |
529
+
530
+ | Default | Disabled |
531
+ | ------- | -------- |
532
+
533
+ ---
534
+
535
+ ### Radio Spacing
536
+
537
+ These rules establish how much margin should exist between and around elements.
538
+
539
+ ---
540
+
541
+ ### Intent Variations
542
+
543
+ 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.
544
+
545
+ | Default | Negative | Negative + Intent Message | Notice | Notice + intent Message |
546
+ | ------- | -------- | ------------------------- | ------ | ----------------------- |
547
+
548
+ ---
549
+
550
+ ## Slider
551
+
552
+ | | In Figma | | | Meets Accessibility | | | In Code |
553
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
554
+
555
+ ### Live Instance
556
+
557
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
558
+
559
+ Default
560
+
561
+ ---
562
+
563
+ ### Overview
564
+
565
+ 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.
566
+
567
+ #### Slider – Single-sided
568
+
569
+ Use when there is a specific datapoint or value within a dataset that the user is able to select.
570
+
571
+ | No Tick Marks | Tick Marks |
572
+ | ------------- | ---------- |
573
+
574
+ #### Slider – Double-sided
575
+
576
+ Use when users need the ability to select a range between two values within a dataset.
577
+
578
+ | No Tick Marks | Tick Marks |
579
+ | ------------- | ---------- |
580
+
581
+ ---
582
+
583
+ ### Slider Spacing
584
+
585
+ These rules establish how much margin should exist between and around elements.
586
+
587
+ ---
588
+
589
+ ## Toggle Input
590
+
591
+ | | In Figma | | | Meets Accessibility | | | In Code |
592
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
593
+
594
+ ### Live Instance
595
+
596
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
597
+
598
+ Default
599
+
600
+ ---
601
+
602
+ ### Overview
603
+
604
+ 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.
605
+
606
+ | Default | Hover | Disabled |
607
+ | ------- | ----- | -------- |
608
+
609
+ ---
610
+
611
+ ### Toggle Input Spacing
612
+
613
+ These rules establish how much margin should exist between and around elements.
614
+
615
+ ## Code
616
+
617
+ ## Control Input Components
618
+
619
+ | 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 |
620
+ | ----------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------- |
621
+
622
+ ### Visual Preview
623
+
624
+ > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
625
+
626
+ ---
627
+
628
+ ## InputCheckbox
629
+
630
+ ### SDS Source Code
631
+
632
+ The component's source code in the SDS codebase can be found here.
633
+
634
+ ### SDS vs MUI
635
+
636
+ The following props and options differ in how they function across the MUI `Checkbox` component and the SDS `InputCheckbox` component:
637
+
638
+ - **`size`\*\***:\*\* Has no effect in SDS
639
+ - **`color`\*\***:\*\* Has no effect in SDS
640
+ - **`labelPlacement`\*\***:\*\* Has no effect in SDS
641
+ - **`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)
642
+ - **`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.
643
+ - **`caption`\*\***:\*\* This is an SDS-specific prop, which takes a string of text that is displayed below the primary `label` text.
644
+
645
+ The following props are available for both the MUI and SDS components: **`required`**, **`disabled`**, and **`indeterminate`\*\***.\*\*
646
+
647
+ ### MUI Documentation
648
+
649
+ Documentation for the underlying MUI component can be found here.
650
+
651
+ ### Props
652
+
653
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
654
+
655
+ | Name | Type | Default | Description |
656
+ | --------------- | --------------------------- | -------------- | ----------------------------------------------------------------------------------- | ----------- | ------------------------------------------- | ---------------------------------------- |
657
+ | `caption` | `string` | `-` | The caption of the InputCheckbox appears beneath the label in a lighter text color. |
658
+ | `checkboxProps` | `Partial<MUICheckboxProps>` | `{}` | Directly pass these props to the underlying MUI checkbox. |
659
+ | `label` | `string` | `-` | The label of the InputCheckbox. |
660
+ | `stage` | `"checked"` ` | "unchecked"` ` | "indeterminate"` | | Defines the stage or state of the checkbox. |
661
+ | `intent` | `"default"` ` | "notice"` ` | "negative"` ` | "positive"` | `"default"` | Defines the color of the `InputCheckbox` |
662
+ | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
663
+
664
+ ### Code examples
665
+
666
+ #### **Default InputCheckbox**
667
+
668
+ This example has the minimum props needed for the `InputCheckbox` component.
669
+
670
+ **/styles.css**
671
+
672
+ ```css
673
+ body {
674
+ font-size: 13px;
675
+ font-weight: 400;
676
+ letter-spacing: 0.08px;
677
+ line-height: 20px;
678
+ text-transform: none;
679
+ font-family: "Inter", sans-serif;
680
+ }
681
+
682
+ h1 {
683
+ font-size: 1.5rem;
684
+ }
685
+
686
+ .app {
687
+ padding: 20px;
688
+ }
689
+ ```
690
+
691
+ **tsconfig.json**
692
+
693
+ ```json
694
+ {
695
+ "include": ["./**/*"],
696
+ "compilerOptions": {
697
+ "strict": true,
698
+ "esModuleInterop": true,
699
+ "lib": ["dom", "es2015"],
700
+ "jsx": "react-jsx"
701
+ }
702
+ }
703
+ ```
704
+
705
+ **/App.tsx**
706
+
707
+ ```tsx
708
+ import { InputCheckbox } from "@czi-sds/components";
709
+ import "./styles.css";
710
+
711
+ function App() {
712
+ return (
713
+ <div className="app">
714
+ <InputCheckbox label="Label" />
715
+ </div>
716
+ );
717
+ }
718
+
719
+ export default App;
720
+ ```
721
+
722
+ **/index.tsx**
723
+
724
+ ```tsx
725
+ import React from "react";
726
+ import { createRoot } from "react-dom/client";
727
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
728
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
729
+ import { Theme } from "@czi-sds/components";
730
+ import CssBaseline from "@mui/material/CssBaseline";
731
+ import useMediaQuery from "@mui/material/useMediaQuery";
732
+
733
+ import App from "./App";
734
+
735
+ const container = document.getElementById("root");
736
+ const root = createRoot(container!);
737
+
738
+ const RootApp = () => {
739
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
740
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
741
+
742
+ return (
743
+ <StyledEngineProvider injectFirst>
744
+ <ThemeProvider theme={theme}>
745
+ <EmotionThemeProvider theme={theme}>
746
+ <CssBaseline />
747
+ <App />
748
+ </EmotionThemeProvider>
749
+ </ThemeProvider>
750
+ </StyledEngineProvider>
751
+ );
752
+ };
753
+
754
+ root.render(
755
+ <React.StrictMode>
756
+ <RootApp />
757
+ </React.StrictMode>
758
+ );
759
+ ```
760
+
761
+ **/public/index.html**
762
+
763
+ ```html
764
+ <!doctype html>
765
+ <html lang="en">
766
+ <head>
767
+ <meta charset="UTF-8" />
768
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
769
+ <title>Control Inputs</title>
770
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
771
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
772
+ <link
773
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
774
+ rel="stylesheet"
775
+ />
776
+ <link
777
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
778
+ rel="stylesheet"
779
+ />
780
+ </head>
781
+ <body>
782
+ <div id="root"></div>
783
+ </body>
784
+ </html>
785
+ ```
786
+
787
+ **/package.json**
788
+
789
+ ```json
790
+ {
791
+ "dependencies": {
792
+ "react": "^18.0.0",
793
+ "react-dom": "^18.0.0",
794
+ "react-scripts": "^4.0.0"
795
+ },
796
+ "devDependencies": {
797
+ "@types/react": "^18.0.0",
798
+ "@types/react-dom": "^18.0.0",
799
+ "typescript": "^4.0.0"
800
+ },
801
+ "main": "/index.tsx"
802
+ }
803
+ ```
804
+
805
+ ---
806
+
807
+ #### InputCheckbox + Caption
808
+
809
+ This example shows the `InputCheckbox` with an additional caption beneath the label, presented in a lighter text color.
810
+
811
+ **/styles.css**
812
+
813
+ ```css
814
+ body {
815
+ font-size: 13px;
816
+ font-weight: 400;
817
+ letter-spacing: 0.08px;
818
+ line-height: 20px;
819
+ text-transform: none;
820
+ font-family: "Inter", sans-serif;
821
+ }
822
+
823
+ h1 {
824
+ font-size: 1.5rem;
825
+ }
826
+
827
+ .app {
828
+ padding: 20px;
829
+ }
830
+ ```
831
+
832
+ **tsconfig.json**
833
+
834
+ ```json
835
+ {
836
+ "include": ["./**/*"],
837
+ "compilerOptions": {
838
+ "strict": true,
839
+ "esModuleInterop": true,
840
+ "lib": ["dom", "es2015"],
841
+ "jsx": "react-jsx"
842
+ }
843
+ }
844
+ ```
845
+
846
+ **/App.tsx**
847
+
848
+ ```tsx
849
+ import { InputCheckbox } from "@czi-sds/components";
850
+ import "./styles.css";
851
+
852
+ function App() {
853
+ return (
854
+ <div className="app">
855
+ <InputCheckbox caption="Caption" label="Label" />
856
+ </div>
857
+ );
858
+ }
859
+
860
+ export default App;
861
+ ```
862
+
863
+ **/index.tsx**
864
+
865
+ ```tsx
866
+ import React from "react";
867
+ import { createRoot } from "react-dom/client";
868
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
869
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
870
+ import { Theme } from "@czi-sds/components";
871
+ import CssBaseline from "@mui/material/CssBaseline";
872
+ import useMediaQuery from "@mui/material/useMediaQuery";
873
+
874
+ import App from "./App";
875
+
876
+ const container = document.getElementById("root");
877
+ const root = createRoot(container!);
878
+
879
+ const RootApp = () => {
880
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
881
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
882
+
883
+ return (
884
+ <StyledEngineProvider injectFirst>
885
+ <ThemeProvider theme={theme}>
886
+ <EmotionThemeProvider theme={theme}>
887
+ <CssBaseline />
888
+ <App />
889
+ </EmotionThemeProvider>
890
+ </ThemeProvider>
891
+ </StyledEngineProvider>
892
+ );
893
+ };
894
+
895
+ root.render(
896
+ <React.StrictMode>
897
+ <RootApp />
898
+ </React.StrictMode>
899
+ );
900
+ ```
901
+
902
+ **/public/index.html**
903
+
904
+ ```html
905
+ <!doctype html>
906
+ <html lang="en">
907
+ <head>
908
+ <meta charset="UTF-8" />
909
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
910
+ <title>Control Inputs</title>
911
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
912
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
913
+ <link
914
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
915
+ rel="stylesheet"
916
+ />
917
+ <link
918
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
919
+ rel="stylesheet"
920
+ />
921
+ </head>
922
+ <body>
923
+ <div id="root"></div>
924
+ </body>
925
+ </html>
926
+ ```
927
+
928
+ **/package.json**
929
+
930
+ ```json
931
+ {
932
+ "dependencies": {
933
+ "react": "^18.0.0",
934
+ "react-dom": "^18.0.0",
935
+ "react-scripts": "^4.0.0"
936
+ },
937
+ "devDependencies": {
938
+ "@types/react": "^18.0.0",
939
+ "@types/react-dom": "^18.0.0",
940
+ "typescript": "^4.0.0"
941
+ },
942
+ "main": "/index.tsx"
943
+ }
944
+ ```
945
+
946
+ ---
947
+
948
+ #### Indeterminate Checkbox
949
+
950
+ 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.
951
+
952
+ **/styles.css**
953
+
954
+ ```css
955
+ body {
956
+ font-size: 13px;
957
+ font-weight: 400;
958
+ letter-spacing: 0.08px;
959
+ line-height: 20px;
960
+ text-transform: none;
961
+ font-family: "Inter", sans-serif;
962
+ }
963
+
964
+ h1 {
965
+ font-size: 1.5rem;
966
+ }
967
+
968
+ .app {
969
+ padding: 20px;
970
+ }
971
+ ```
972
+
973
+ **tsconfig.json**
974
+
975
+ ```json
976
+ {
977
+ "include": ["./**/*"],
978
+ "compilerOptions": {
979
+ "strict": true,
980
+ "esModuleInterop": true,
981
+ "lib": ["dom", "es2015"],
982
+ "jsx": "react-jsx"
983
+ }
984
+ }
985
+ ```
986
+
987
+ **/App.tsx**
988
+
989
+ ```tsx
990
+ import { useState } from "react";
991
+ import { Box } from "@mui/material";
992
+ import { InputCheckbox } from "@czi-sds/components";
993
+ import "./styles.css";
994
+
995
+ function App() {
996
+ const [checked, setChecked] = useState([true, false]);
997
+
998
+ const handleChange1 = (event: React.ChangeEvent<HTMLInputElement>) => {
999
+ setChecked([event.target.checked, event.target.checked]);
1000
+ };
1001
+
1002
+ const handleChange2 = (event: React.ChangeEvent<HTMLInputElement>) => {
1003
+ setChecked([event.target.checked, checked[1]]);
1004
+ };
1005
+
1006
+ const handleChange3 = (event: React.ChangeEvent<HTMLInputElement>) => {
1007
+ setChecked([checked[0], event.target.checked]);
1008
+ };
1009
+
1010
+ const children = (
1011
+ <Box sx={{ display: "flex", flexDirection: "column", ml: 6 }}>
1012
+ <InputCheckbox
1013
+ label="Child 1"
1014
+ checkboxProps={{
1015
+ checked: checked[0],
1016
+ onChange: handleChange2,
1017
+ }}
1018
+ />
1019
+ <InputCheckbox
1020
+ label="Child 2"
1021
+ checkboxProps={{
1022
+ checked: checked[1],
1023
+ onChange: handleChange3,
1024
+ }}
1025
+ />
1026
+ </Box>
1027
+ );
1028
+
1029
+ return (
1030
+ <div className="app">
1031
+ <InputCheckbox
1032
+ label="Parent"
1033
+ checkboxProps={{
1034
+ checked: checked[0] && checked[1],
1035
+ indeterminate: checked[0] !== checked[1],
1036
+ onChange: handleChange1,
1037
+ }}
1038
+ />
1039
+ {children}
1040
+ </div>
1041
+ );
1042
+ }
1043
+
1044
+ export default App;
1045
+ ```
1046
+
1047
+ **/index.tsx**
1048
+
1049
+ ```tsx
1050
+ import React from "react";
1051
+ import { createRoot } from "react-dom/client";
1052
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1053
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1054
+ import { Theme } from "@czi-sds/components";
1055
+ import CssBaseline from "@mui/material/CssBaseline";
1056
+ import useMediaQuery from "@mui/material/useMediaQuery";
1057
+
1058
+ import App from "./App";
1059
+
1060
+ const container = document.getElementById("root");
1061
+ const root = createRoot(container!);
1062
+
1063
+ const RootApp = () => {
1064
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1065
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1066
+
1067
+ return (
1068
+ <StyledEngineProvider injectFirst>
1069
+ <ThemeProvider theme={theme}>
1070
+ <EmotionThemeProvider theme={theme}>
1071
+ <CssBaseline />
1072
+ <App />
1073
+ </EmotionThemeProvider>
1074
+ </ThemeProvider>
1075
+ </StyledEngineProvider>
1076
+ );
1077
+ };
1078
+
1079
+ root.render(
1080
+ <React.StrictMode>
1081
+ <RootApp />
1082
+ </React.StrictMode>
1083
+ );
1084
+ ```
1085
+
1086
+ **/public/index.html**
1087
+
1088
+ ```html
1089
+ <!doctype html>
1090
+ <html lang="en">
1091
+ <head>
1092
+ <meta charset="UTF-8" />
1093
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1094
+ <title>Control Inputs</title>
1095
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1096
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1097
+ <link
1098
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1099
+ rel="stylesheet"
1100
+ />
1101
+ <link
1102
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1103
+ rel="stylesheet"
1104
+ />
1105
+ </head>
1106
+ <body>
1107
+ <div id="root"></div>
1108
+ </body>
1109
+ </html>
1110
+ ```
1111
+
1112
+ **/package.json**
1113
+
1114
+ ```json
1115
+ {
1116
+ "dependencies": {
1117
+ "react": "^18.0.0",
1118
+ "react-dom": "^18.0.0",
1119
+ "react-scripts": "^4.0.0"
1120
+ },
1121
+ "devDependencies": {
1122
+ "@types/react": "^18.0.0",
1123
+ "@types/react-dom": "^18.0.0",
1124
+ "typescript": "^4.0.0"
1125
+ },
1126
+ "main": "/index.tsx"
1127
+ }
1128
+ ```
1129
+
1130
+ ---
1131
+
1132
+ ---
1133
+
1134
+ ## InputRadio
1135
+
1136
+ ### SDS Source Code
1137
+
1138
+ The component's source code in the SDS codebase can be found here.
1139
+
1140
+ ### SDS vs MUI
1141
+
1142
+ The following props and options differ in whether and how they function across MUI versus SDS's `InputRadio` component:
1143
+
1144
+ - **`size`\*\***:\*\* Has no effect in SDS
1145
+ - **`color`\*\***:\*\* Has no effect in SDS
1146
+ - **`labelPlacement`\*\***:\*\* Has no effect in SDS
1147
+ - **`caption`\*\***:\*\* This is an SDS-specific prop, which takes a string of text that is desplayed below the primary `label` text.
1148
+ - **`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.
1149
+
1150
+ ### MUI Documentation
1151
+
1152
+ Documentation for the underlying MUI component can be found here.
1153
+
1154
+ ### Props
1155
+
1156
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1157
+
1158
+ | Name | Type | Default | Description |
1159
+ | ------------ | ------------------------ | ------------ | -------------------------------------------------------------------------------- | ----------------------------- | ----------- | ------------------------------------- |
1160
+ | `caption` | `string` | - | The caption of the InputRadio appears beneath the label in a lighter text color. |
1161
+ | `label` | `string` | - | The label of the InputCheckbox. |
1162
+ | `radioProps` | `Partial<MUIRadioProps>` | `{}` | Directly pass these props to the underlying MUI radio. |
1163
+ | `stage` | `"checked" | "unchecked"` | `unchecked` | The stage of the radio input. |
1164
+ | `intent` | `"default"` ` | "notice"` ` | "negative"` ` | "positive"` | `"default"` | Defines the color of the `InputRadio` |
1165
+ | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
1166
+
1167
+ ### Code examples
1168
+
1169
+ #### **Default InputRadio**
1170
+
1171
+ This example has the minimum props needed for the `InputRadio` component.
1172
+
1173
+ **/styles.css**
1174
+
1175
+ ```css
1176
+ body {
1177
+ font-size: 13px;
1178
+ font-weight: 400;
1179
+ letter-spacing: 0.08px;
1180
+ line-height: 20px;
1181
+ text-transform: none;
1182
+ font-family: "Inter", sans-serif;
1183
+ }
1184
+
1185
+ h1 {
1186
+ font-size: 1.5rem;
1187
+ }
1188
+
1189
+ .app {
1190
+ padding: 20px;
1191
+ }
1192
+ ```
1193
+
1194
+ **tsconfig.json**
1195
+
1196
+ ```json
1197
+ {
1198
+ "include": ["./**/*"],
1199
+ "compilerOptions": {
1200
+ "strict": true,
1201
+ "esModuleInterop": true,
1202
+ "lib": ["dom", "es2015"],
1203
+ "jsx": "react-jsx"
1204
+ }
1205
+ }
1206
+ ```
1207
+
1208
+ **/App.tsx**
1209
+
1210
+ ```tsx
1211
+ import { InputRadio } from "@czi-sds/components";
1212
+ import "./styles.css";
1213
+
1214
+ function App() {
1215
+ return (
1216
+ <div className="app">
1217
+ <InputRadio label="Label" />
1218
+ </div>
1219
+ );
1220
+ }
1221
+
1222
+ export default App;
1223
+ ```
1224
+
1225
+ **/index.tsx**
1226
+
1227
+ ```tsx
1228
+ import React from "react";
1229
+ import { createRoot } from "react-dom/client";
1230
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1231
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1232
+ import { Theme } from "@czi-sds/components";
1233
+ import CssBaseline from "@mui/material/CssBaseline";
1234
+ import useMediaQuery from "@mui/material/useMediaQuery";
1235
+
1236
+ import App from "./App";
1237
+
1238
+ const container = document.getElementById("root");
1239
+ const root = createRoot(container!);
1240
+
1241
+ const RootApp = () => {
1242
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1243
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1244
+
1245
+ return (
1246
+ <StyledEngineProvider injectFirst>
1247
+ <ThemeProvider theme={theme}>
1248
+ <EmotionThemeProvider theme={theme}>
1249
+ <CssBaseline />
1250
+ <App />
1251
+ </EmotionThemeProvider>
1252
+ </ThemeProvider>
1253
+ </StyledEngineProvider>
1254
+ );
1255
+ };
1256
+
1257
+ root.render(
1258
+ <React.StrictMode>
1259
+ <RootApp />
1260
+ </React.StrictMode>
1261
+ );
1262
+ ```
1263
+
1264
+ **/public/index.html**
1265
+
1266
+ ```html
1267
+ <!doctype html>
1268
+ <html lang="en">
1269
+ <head>
1270
+ <meta charset="UTF-8" />
1271
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1272
+ <title>Control Inputs</title>
1273
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1274
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1275
+ <link
1276
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1277
+ rel="stylesheet"
1278
+ />
1279
+ <link
1280
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1281
+ rel="stylesheet"
1282
+ />
1283
+ </head>
1284
+ <body>
1285
+ <div id="root"></div>
1286
+ </body>
1287
+ </html>
1288
+ ```
1289
+
1290
+ **/package.json**
1291
+
1292
+ ```json
1293
+ {
1294
+ "dependencies": {
1295
+ "react": "^18.0.0",
1296
+ "react-dom": "^18.0.0",
1297
+ "react-scripts": "^4.0.0"
1298
+ },
1299
+ "devDependencies": {
1300
+ "@types/react": "^18.0.0",
1301
+ "@types/react-dom": "^18.0.0",
1302
+ "typescript": "^4.0.0"
1303
+ },
1304
+ "main": "/index.tsx"
1305
+ }
1306
+ ```
1307
+
1308
+ ---
1309
+
1310
+ #### InputRadio + Caption
1311
+
1312
+ This example shows the `InputRadio` with an additional caption beneath the label, presented in a lighter text color.
1313
+
1314
+ **/styles.css**
1315
+
1316
+ ```css
1317
+ body {
1318
+ font-size: 13px;
1319
+ font-weight: 400;
1320
+ letter-spacing: 0.08px;
1321
+ line-height: 20px;
1322
+ text-transform: none;
1323
+ font-family: "Inter", sans-serif;
1324
+ }
1325
+
1326
+ h1 {
1327
+ font-size: 1.5rem;
1328
+ }
1329
+
1330
+ .app {
1331
+ padding: 20px;
1332
+ }
1333
+ ```
1334
+
1335
+ **tsconfig.json**
1336
+
1337
+ ```json
1338
+ {
1339
+ "include": ["./**/*"],
1340
+ "compilerOptions": {
1341
+ "strict": true,
1342
+ "esModuleInterop": true,
1343
+ "lib": ["dom", "es2015"],
1344
+ "jsx": "react-jsx"
1345
+ }
1346
+ }
1347
+ ```
1348
+
1349
+ **/App.tsx**
1350
+
1351
+ ```tsx
1352
+ import { InputRadio } from "@czi-sds/components";
1353
+ import "./styles.css";
1354
+
1355
+ function App() {
1356
+ return (
1357
+ <div className="app">
1358
+ <InputRadio caption="Caption" label="Label" />
1359
+ </div>
1360
+ );
1361
+ }
1362
+
1363
+ export default App;
1364
+ ```
1365
+
1366
+ **/index.tsx**
1367
+
1368
+ ```tsx
1369
+ import React from "react";
1370
+ import { createRoot } from "react-dom/client";
1371
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1372
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1373
+ import { Theme } from "@czi-sds/components";
1374
+ import CssBaseline from "@mui/material/CssBaseline";
1375
+ import useMediaQuery from "@mui/material/useMediaQuery";
1376
+
1377
+ import App from "./App";
1378
+
1379
+ const container = document.getElementById("root");
1380
+ const root = createRoot(container!);
1381
+
1382
+ const RootApp = () => {
1383
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1384
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1385
+
1386
+ return (
1387
+ <StyledEngineProvider injectFirst>
1388
+ <ThemeProvider theme={theme}>
1389
+ <EmotionThemeProvider theme={theme}>
1390
+ <CssBaseline />
1391
+ <App />
1392
+ </EmotionThemeProvider>
1393
+ </ThemeProvider>
1394
+ </StyledEngineProvider>
1395
+ );
1396
+ };
1397
+
1398
+ root.render(
1399
+ <React.StrictMode>
1400
+ <RootApp />
1401
+ </React.StrictMode>
1402
+ );
1403
+ ```
1404
+
1405
+ **/public/index.html**
1406
+
1407
+ ```html
1408
+ <!doctype html>
1409
+ <html lang="en">
1410
+ <head>
1411
+ <meta charset="UTF-8" />
1412
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1413
+ <title>Control Inputs</title>
1414
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1415
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1416
+ <link
1417
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1418
+ rel="stylesheet"
1419
+ />
1420
+ <link
1421
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1422
+ rel="stylesheet"
1423
+ />
1424
+ </head>
1425
+ <body>
1426
+ <div id="root"></div>
1427
+ </body>
1428
+ </html>
1429
+ ```
1430
+
1431
+ **/package.json**
1432
+
1433
+ ```json
1434
+ {
1435
+ "dependencies": {
1436
+ "react": "^18.0.0",
1437
+ "react-dom": "^18.0.0",
1438
+ "react-scripts": "^4.0.0"
1439
+ },
1440
+ "devDependencies": {
1441
+ "@types/react": "^18.0.0",
1442
+ "@types/react-dom": "^18.0.0",
1443
+ "typescript": "^4.0.0"
1444
+ },
1445
+ "main": "/index.tsx"
1446
+ }
1447
+ ```
1448
+
1449
+ ---
1450
+
1451
+ ---
1452
+
1453
+ ## InputSlider
1454
+
1455
+ ### SDS Source Code
1456
+
1457
+ The component's source code in the SDS codebase can be found here.
1458
+
1459
+ ### SDS vs MUI
1460
+
1461
+ The following props and options differ in how they function across MUI's `Switch` component versus SDS's `InputToggle` component:
1462
+
1463
+ - **`size`\*\***:\*\* Has no effect in SDS
1464
+ - **`color`\*\***:\*\* Has no effect in SDS
1465
+
1466
+ These are some of the common props that can be used for both the MUI `Switch` component and the SDS `InputToggle` component:
1467
+
1468
+ - **`step`\*\***:\*\* Sets the step distance between selectable stops (and relatedly, if this prop is left out, the toggle is continuous, rather than discrete)
1469
+ - **`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.
1470
+ - **`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).
1471
+ - **`orientation`\*\***:\*\* This prop controls which direction the slider is shown: `horizontal` (default) or `vertical`
1472
+
1473
+ ### MUI Documentation
1474
+
1475
+ Documentation for the underlying MUI component can be found here.
1476
+
1477
+ ### Props
1478
+
1479
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1480
+
1481
+ | Name | Type | Default | Description |
1482
+ | ------------------- | -------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1483
+ | `defaultValue` | `Array<number> |  number` | - | The default value. Use when the component is not controlled. |
1484
+ | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
1485
+ | `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. |
1486
+ | `max` | `number` | `100` | The maximum allowed value of the slider. Should not be equal to min. |
1487
+ | `min` | `number` | `0` | The minimum allowed value of the slider. Should not be equal to max. |
1488
+ | `orientation` | `"horizontal"` | `horizontal` | The component orientation. |
1489
+ | `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. |
1490
+ | `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. |
1491
+
1492
+ ### Code examples
1493
+
1494
+ #### **Default InputSlider**
1495
+
1496
+ This example has the minimum props needed for the `InputRadio` component.
1497
+
1498
+ **/styles.css**
1499
+
1500
+ ```css
1501
+ body {
1502
+ font-size: 13px;
1503
+ font-weight: 400;
1504
+ letter-spacing: 0.08px;
1505
+ line-height: 20px;
1506
+ text-transform: none;
1507
+ font-family: "Inter", sans-serif;
1508
+ }
1509
+
1510
+ h1 {
1511
+ font-size: 1.5rem;
1512
+ }
1513
+
1514
+ .app {
1515
+ padding: 20px;
1516
+ }
1517
+ ```
1518
+
1519
+ **tsconfig.json**
1520
+
1521
+ ```json
1522
+ {
1523
+ "include": ["./**/*"],
1524
+ "compilerOptions": {
1525
+ "strict": true,
1526
+ "esModuleInterop": true,
1527
+ "lib": ["dom", "es2015"],
1528
+ "jsx": "react-jsx"
1529
+ }
1530
+ }
1531
+ ```
1532
+
1533
+ **/App.tsx**
1534
+
1535
+ ```tsx
1536
+ import { InputSlider } from "@czi-sds/components";
1537
+ import { Box } from "@mui/material";
1538
+ import "./styles.css";
1539
+
1540
+ function App() {
1541
+ return (
1542
+ <div className="app">
1543
+ <Box sx={{ width: 200 }}>
1544
+ <InputSlider label="Label" />
1545
+ </Box>
1546
+ </div>
1547
+ );
1548
+ }
1549
+
1550
+ export default App;
1551
+ ```
1552
+
1553
+ **/index.tsx**
1554
+
1555
+ ```tsx
1556
+ import React from "react";
1557
+ import { createRoot } from "react-dom/client";
1558
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1559
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1560
+ import { Theme } from "@czi-sds/components";
1561
+ import CssBaseline from "@mui/material/CssBaseline";
1562
+ import useMediaQuery from "@mui/material/useMediaQuery";
1563
+
1564
+ import App from "./App";
1565
+
1566
+ const container = document.getElementById("root");
1567
+ const root = createRoot(container!);
1568
+
1569
+ const RootApp = () => {
1570
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1571
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1572
+
1573
+ return (
1574
+ <StyledEngineProvider injectFirst>
1575
+ <ThemeProvider theme={theme}>
1576
+ <EmotionThemeProvider theme={theme}>
1577
+ <CssBaseline />
1578
+ <App />
1579
+ </EmotionThemeProvider>
1580
+ </ThemeProvider>
1581
+ </StyledEngineProvider>
1582
+ );
1583
+ };
1584
+
1585
+ root.render(
1586
+ <React.StrictMode>
1587
+ <RootApp />
1588
+ </React.StrictMode>
1589
+ );
1590
+ ```
1591
+
1592
+ **/public/index.html**
1593
+
1594
+ ```html
1595
+ <!doctype html>
1596
+ <html lang="en">
1597
+ <head>
1598
+ <meta charset="UTF-8" />
1599
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1600
+ <title>Control Inputs</title>
1601
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1602
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1603
+ <link
1604
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1605
+ rel="stylesheet"
1606
+ />
1607
+ <link
1608
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1609
+ rel="stylesheet"
1610
+ />
1611
+ </head>
1612
+ <body>
1613
+ <div id="root"></div>
1614
+ </body>
1615
+ </html>
1616
+ ```
1617
+
1618
+ **/package.json**
1619
+
1620
+ ```json
1621
+ {
1622
+ "dependencies": {
1623
+ "react": "^18.0.0",
1624
+ "react-dom": "^18.0.0",
1625
+ "react-scripts": "^4.0.0"
1626
+ },
1627
+ "devDependencies": {
1628
+ "@types/react": "^18.0.0",
1629
+ "@types/react-dom": "^18.0.0",
1630
+ "typescript": "^4.0.0"
1631
+ },
1632
+ "main": "/index.tsx"
1633
+ }
1634
+ ```
1635
+
1636
+ ---
1637
+
1638
+ #### InputSlider with custom Marks
1639
+
1640
+ This example shows an `InputSlider` component that features custom marks precisely positioned at `0%`, `50%`, and `100%` of the slider's value.
1641
+
1642
+ **/styles.css**
1643
+
1644
+ ```css
1645
+ body {
1646
+ font-size: 13px;
1647
+ font-weight: 400;
1648
+ letter-spacing: 0.08px;
1649
+ line-height: 20px;
1650
+ text-transform: none;
1651
+ font-family: "Inter", sans-serif;
1652
+ }
1653
+
1654
+ h1 {
1655
+ font-size: 1.5rem;
1656
+ }
1657
+
1658
+ .app {
1659
+ padding: 20px;
1660
+ }
1661
+ ```
1662
+
1663
+ **tsconfig.json**
1664
+
1665
+ ```json
1666
+ {
1667
+ "include": ["./**/*"],
1668
+ "compilerOptions": {
1669
+ "strict": true,
1670
+ "esModuleInterop": true,
1671
+ "lib": ["dom", "es2015"],
1672
+ "jsx": "react-jsx"
1673
+ }
1674
+ }
1675
+ ```
1676
+
1677
+ **/App.tsx**
1678
+
1679
+ ```tsx
1680
+ import { InputSlider } from "@czi-sds/components";
1681
+ import { Box } from "@mui/material";
1682
+ import "./styles.css";
1683
+
1684
+ const generateCustomMarks = (min: number, max: number) => {
1685
+ return [
1686
+ {
1687
+ label: min,
1688
+ value: min,
1689
+ },
1690
+ {
1691
+ label: ((max - min) / 2 + min).toFixed(0),
1692
+ value: (max - min) / 2 + min,
1693
+ },
1694
+ {
1695
+ label: max,
1696
+ value: max,
1697
+ },
1698
+ ];
1699
+ };
1700
+
1701
+ function App() {
1702
+ return (
1703
+ <div className="app">
1704
+ <Box sx={{ width: 200 }}>
1705
+ <InputSlider
1706
+ label="Label"
1707
+ marks={generateCustomMarks(0, 100)}
1708
+ min={0}
1709
+ max={100}
1710
+ step={5}
1711
+ valueLabelDisplay
1712
+ />
1713
+ </Box>
1714
+ </div>
1715
+ );
1716
+ }
1717
+
1718
+ export default App;
1719
+ ```
1720
+
1721
+ **/index.tsx**
1722
+
1723
+ ```tsx
1724
+ import React from "react";
1725
+ import { createRoot } from "react-dom/client";
1726
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1727
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1728
+ import { Theme } from "@czi-sds/components";
1729
+ import CssBaseline from "@mui/material/CssBaseline";
1730
+ import useMediaQuery from "@mui/material/useMediaQuery";
1731
+
1732
+ import App from "./App";
1733
+
1734
+ const container = document.getElementById("root");
1735
+ const root = createRoot(container!);
1736
+
1737
+ const RootApp = () => {
1738
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1739
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1740
+
1741
+ return (
1742
+ <StyledEngineProvider injectFirst>
1743
+ <ThemeProvider theme={theme}>
1744
+ <EmotionThemeProvider theme={theme}>
1745
+ <CssBaseline />
1746
+ <App />
1747
+ </EmotionThemeProvider>
1748
+ </ThemeProvider>
1749
+ </StyledEngineProvider>
1750
+ );
1751
+ };
1752
+
1753
+ root.render(
1754
+ <React.StrictMode>
1755
+ <RootApp />
1756
+ </React.StrictMode>
1757
+ );
1758
+ ```
1759
+
1760
+ **/public/index.html**
1761
+
1762
+ ```html
1763
+ <!doctype html>
1764
+ <html lang="en">
1765
+ <head>
1766
+ <meta charset="UTF-8" />
1767
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1768
+ <title>Control Inputs</title>
1769
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1770
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1771
+ <link
1772
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1773
+ rel="stylesheet"
1774
+ />
1775
+ <link
1776
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1777
+ rel="stylesheet"
1778
+ />
1779
+ </head>
1780
+ <body>
1781
+ <div id="root"></div>
1782
+ </body>
1783
+ </html>
1784
+ ```
1785
+
1786
+ **/package.json**
1787
+
1788
+ ```json
1789
+ {
1790
+ "dependencies": {
1791
+ "react": "^18.0.0",
1792
+ "react-dom": "^18.0.0",
1793
+ "react-scripts": "^4.0.0"
1794
+ },
1795
+ "devDependencies": {
1796
+ "@types/react": "^18.0.0",
1797
+ "@types/react-dom": "^18.0.0",
1798
+ "typescript": "^4.0.0"
1799
+ },
1800
+ "main": "/index.tsx"
1801
+ }
1802
+ ```
1803
+
1804
+ ---
1805
+
1806
+ ---
1807
+
1808
+ ## InputToggle
1809
+
1810
+ ### SDS Source Code
1811
+
1812
+ The component's source code in the SDS codebase can be found here.
1813
+
1814
+ ### SDS vs MUI
1815
+
1816
+ The following props and options differ and how they function across the MUI `Switch` component and the SDS `InputToggle` component:
1817
+
1818
+ - **`size`\*\***:\*\* Has no effect in SDS
1819
+ - **`color`\*\***:\*\* Has no effect in SDS
1820
+ - **`label`** **and** **`labelPlacement`\*\***:\*\* Has no effect in SDS
1821
+ - The **`required`** prop is available for both the MUI and SDS components.
1822
+
1823
+ ### MUI Documentation
1824
+
1825
+ Documentation for the underlying MUI component can be found here.
1826
+
1827
+ ### Props
1828
+
1829
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1830
+
1831
+ | Name | Type | Default | Description |
1832
+ | ---------- | -------- | ------- | ------------------------------------------------------- |
1833
+ | `disabled` | `bool` | `false` | If `true`, the component is disabled. |
1834
+ | `offLabel` | `string` | `"Off"` | The text displayed within the InputToggle when it's off |
1835
+ | `onChange` | `func` | | Sets what happens when a user toggles on the component. |
1836
+ | `onLabel` | `string` | `"On"` | The text displayed within the InputToggle when it's off |
1837
+ | `width` | `number` | `62` | Controls the `width` of the InputToggle element. |
1838
+
1839
+ ### Code examples
1840
+
1841
+ #### **Default InputToggle**
1842
+
1843
+ This example has the minimum props needed for the `InputToggle` component.
1844
+
1845
+ **/styles.css**
1846
+
1847
+ ```css
1848
+ body {
1849
+ font-size: 13px;
1850
+ font-weight: 400;
1851
+ letter-spacing: 0.08px;
1852
+ line-height: 20px;
1853
+ text-transform: none;
1854
+ font-family: "Inter", sans-serif;
1855
+ }
1856
+
1857
+ h1 {
1858
+ font-size: 1.5rem;
1859
+ }
1860
+
1861
+ .app {
1862
+ padding: 20px;
1863
+ }
1864
+ ```
1865
+
1866
+ **tsconfig.json**
1867
+
1868
+ ```json
1869
+ {
1870
+ "include": ["./**/*"],
1871
+ "compilerOptions": {
1872
+ "strict": true,
1873
+ "esModuleInterop": true,
1874
+ "lib": ["dom", "es2015"],
1875
+ "jsx": "react-jsx"
1876
+ }
1877
+ }
1878
+ ```
1879
+
1880
+ **/App.tsx**
1881
+
1882
+ ```tsx
1883
+ import { InputToggle } from "@czi-sds/components";
1884
+ import "./styles.css";
1885
+
1886
+ function App() {
1887
+ return (
1888
+ <div className="app">
1889
+ <InputToggle />
1890
+ </div>
1891
+ );
1892
+ }
1893
+
1894
+ export default App;
1895
+ ```
1896
+
1897
+ **/index.tsx**
1898
+
1899
+ ```tsx
1900
+ import React from "react";
1901
+ import { createRoot } from "react-dom/client";
1902
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1903
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1904
+ import { Theme } from "@czi-sds/components";
1905
+ import CssBaseline from "@mui/material/CssBaseline";
1906
+ import useMediaQuery from "@mui/material/useMediaQuery";
1907
+
1908
+ import App from "./App";
1909
+
1910
+ const container = document.getElementById("root");
1911
+ const root = createRoot(container!);
1912
+
1913
+ const RootApp = () => {
1914
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1915
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1916
+
1917
+ return (
1918
+ <StyledEngineProvider injectFirst>
1919
+ <ThemeProvider theme={theme}>
1920
+ <EmotionThemeProvider theme={theme}>
1921
+ <CssBaseline />
1922
+ <App />
1923
+ </EmotionThemeProvider>
1924
+ </ThemeProvider>
1925
+ </StyledEngineProvider>
1926
+ );
1927
+ };
1928
+
1929
+ root.render(
1930
+ <React.StrictMode>
1931
+ <RootApp />
1932
+ </React.StrictMode>
1933
+ );
1934
+ ```
1935
+
1936
+ **/public/index.html**
1937
+
1938
+ ```html
1939
+ <!doctype html>
1940
+ <html lang="en">
1941
+ <head>
1942
+ <meta charset="UTF-8" />
1943
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1944
+ <title>Control Inputs</title>
1945
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
1946
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1947
+ <link
1948
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
1949
+ rel="stylesheet"
1950
+ />
1951
+ <link
1952
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
1953
+ rel="stylesheet"
1954
+ />
1955
+ </head>
1956
+ <body>
1957
+ <div id="root"></div>
1958
+ </body>
1959
+ </html>
1960
+ ```
1961
+
1962
+ **/package.json**
1963
+
1964
+ ```json
1965
+ {
1966
+ "dependencies": {
1967
+ "react": "^18.0.0",
1968
+ "react-dom": "^18.0.0",
1969
+ "react-scripts": "^4.0.0"
1970
+ },
1971
+ "devDependencies": {
1972
+ "@types/react": "^18.0.0",
1973
+ "@types/react-dom": "^18.0.0",
1974
+ "typescript": "^4.0.0"
1975
+ },
1976
+ "main": "/index.tsx"
1977
+ }
1978
+ ```
1979
+
1980
+ ---
1981
+
1982
+ #### **InputToggle with customized on and off labels**
1983
+
1984
+ This example shows an `InputToggle` component with customized on and off labels.
1985
+
1986
+ **/styles.css**
1987
+
1988
+ ```css
1989
+ body {
1990
+ font-size: 13px;
1991
+ font-weight: 400;
1992
+ letter-spacing: 0.08px;
1993
+ line-height: 20px;
1994
+ text-transform: none;
1995
+ font-family: "Inter", sans-serif;
1996
+ }
1997
+
1998
+ h1 {
1999
+ font-size: 1.5rem;
2000
+ }
2001
+
2002
+ .app {
2003
+ padding: 20px;
2004
+ }
2005
+ ```
2006
+
2007
+ **tsconfig.json**
2008
+
2009
+ ```json
2010
+ {
2011
+ "include": ["./**/*"],
2012
+ "compilerOptions": {
2013
+ "strict": true,
2014
+ "esModuleInterop": true,
2015
+ "lib": ["dom", "es2015"],
2016
+ "jsx": "react-jsx"
2017
+ }
2018
+ }
2019
+ ```
2020
+
2021
+ **/App.tsx**
2022
+
2023
+ ```tsx
2024
+ import { InputToggle } from "@czi-sds/components";
2025
+ import "./styles.css";
2026
+
2027
+ function App() {
2028
+ return (
2029
+ <div className="app">
2030
+ <InputToggle onLabel="Start" offLabel="Finish" width={72} />
2031
+ </div>
2032
+ );
2033
+ }
2034
+
2035
+ export default App;
2036
+ ```
2037
+
2038
+ **/index.tsx**
2039
+
2040
+ ```tsx
2041
+ import React from "react";
2042
+ import { createRoot } from "react-dom/client";
2043
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
2044
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
2045
+ import { Theme } from "@czi-sds/components";
2046
+ import CssBaseline from "@mui/material/CssBaseline";
2047
+ import useMediaQuery from "@mui/material/useMediaQuery";
2048
+
2049
+ import App from "./App";
2050
+
2051
+ const container = document.getElementById("root");
2052
+ const root = createRoot(container!);
2053
+
2054
+ const RootApp = () => {
2055
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
2056
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
2057
+
2058
+ return (
2059
+ <StyledEngineProvider injectFirst>
2060
+ <ThemeProvider theme={theme}>
2061
+ <EmotionThemeProvider theme={theme}>
2062
+ <CssBaseline />
2063
+ <App />
2064
+ </EmotionThemeProvider>
2065
+ </ThemeProvider>
2066
+ </StyledEngineProvider>
2067
+ );
2068
+ };
2069
+
2070
+ root.render(
2071
+ <React.StrictMode>
2072
+ <RootApp />
2073
+ </React.StrictMode>
2074
+ );
2075
+ ```
2076
+
2077
+ **/public/index.html**
2078
+
2079
+ ```html
2080
+ <!doctype html>
2081
+ <html lang="en">
2082
+ <head>
2083
+ <meta charset="UTF-8" />
2084
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
2085
+ <title>Control Inputs</title>
2086
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
2087
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
2088
+ <link
2089
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
2090
+ rel="stylesheet"
2091
+ />
2092
+ <link
2093
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
2094
+ rel="stylesheet"
2095
+ />
2096
+ </head>
2097
+ <body>
2098
+ <div id="root"></div>
2099
+ </body>
2100
+ </html>
2101
+ ```
2102
+
2103
+ **/package.json**
2104
+
2105
+ ```json
2106
+ {
2107
+ "dependencies": {
2108
+ "react": "^18.0.0",
2109
+ "react-dom": "^18.0.0",
2110
+ "react-scripts": "^4.0.0"
2111
+ },
2112
+ "devDependencies": {
2113
+ "@types/react": "^18.0.0",
2114
+ "@types/react-dom": "^18.0.0",
2115
+ "typescript": "^4.0.0"
2116
+ },
2117
+ "main": "/index.tsx"
2118
+ }
2119
+ ```
2120
+
2121
+ ---