@czi-sds/mcp 0.2.2 → 0.3.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 (50) hide show
  1. package/data/zeroheight-cache.json +5195 -0
  2. package/data/zeroheight-exports/Accordion.md +675 -0
  3. package/data/zeroheight-exports/Banner.md +576 -0
  4. package/data/zeroheight-exports/Borders.md +118 -0
  5. package/data/zeroheight-exports/Buttons.md +2260 -0
  6. package/data/zeroheight-exports/Callout.md +756 -0
  7. package/data/zeroheight-exports/Colors.md +633 -0
  8. package/data/zeroheight-exports/Content-Card.md +162 -0
  9. package/data/zeroheight-exports/Contributing-to-SDS.md +99 -0
  10. package/data/zeroheight-exports/Control-Inputs.md +2066 -0
  11. package/data/zeroheight-exports/Corners.md +112 -0
  12. package/data/zeroheight-exports/Cover-page.md +4 -0
  13. package/data/zeroheight-exports/Dialog.md +1133 -0
  14. package/data/zeroheight-exports/Downloads.md +121 -0
  15. package/data/zeroheight-exports/Drop-Shadows.md +80 -0
  16. package/data/zeroheight-exports/Dropdown-Input.md +1149 -0
  17. package/data/zeroheight-exports/Dropdown-Menu.md +3787 -0
  18. package/data/zeroheight-exports/Element-Status-Tracker.md +268 -0
  19. package/data/zeroheight-exports/Field-Inputs.md +965 -0
  20. package/data/zeroheight-exports/Filters.md +868 -0
  21. package/data/zeroheight-exports/Getting-Started.md +1296 -0
  22. package/data/zeroheight-exports/Hero.md +256 -0
  23. package/data/zeroheight-exports/Icons.md +432 -0
  24. package/data/zeroheight-exports/Intent.md +47 -0
  25. package/data/zeroheight-exports/Introduction-to-Bases.md +36 -0
  26. package/data/zeroheight-exports/Introduction-to-Cells.md +36 -0
  27. package/data/zeroheight-exports/Introduction-to-DNA.md +36 -0
  28. package/data/zeroheight-exports/Introduction-to-Genes.md +36 -0
  29. package/data/zeroheight-exports/Introduction.md +116 -0
  30. package/data/zeroheight-exports/Link.md +373 -0
  31. package/data/zeroheight-exports/Lists.md +617 -0
  32. package/data/zeroheight-exports/Loading-Indicator.md +38 -0
  33. package/data/zeroheight-exports/Navigation.md +853 -0
  34. package/data/zeroheight-exports/Notification.md +858 -0
  35. package/data/zeroheight-exports/Panel.md +862 -0
  36. package/data/zeroheight-exports/README.md +124 -0
  37. package/data/zeroheight-exports/Responsive-Design.md +275 -0
  38. package/data/zeroheight-exports/Search-Input.md +54 -0
  39. package/data/zeroheight-exports/Search.md +609 -0
  40. package/data/zeroheight-exports/Segmented-Control.md +561 -0
  41. package/data/zeroheight-exports/Spacing.md +298 -0
  42. package/data/zeroheight-exports/Table.md +4832 -0
  43. package/data/zeroheight-exports/Tabs.md +773 -0
  44. package/data/zeroheight-exports/Tags.md +1025 -0
  45. package/data/zeroheight-exports/Text-Link.md +185 -0
  46. package/data/zeroheight-exports/Theming.md +313 -0
  47. package/data/zeroheight-exports/Tooltips.md +1564 -0
  48. package/data/zeroheight-exports/Typography.md +769 -0
  49. package/dist/stdio.js +188 -0
  50. package/package.json +4 -3
@@ -0,0 +1,965 @@
1
+ # Field Inputs
2
+
3
+ Field Inputs are elements that allow users to type within them, providing an area for users to enter content and information or perform a search.
4
+
5
+ ## Overview
6
+
7
+ ## Field Input Variants
8
+
9
+ | There are two Field Input variants available for designers to use—Search Inputs allow users to enter text to perform a search and Text Inputs provide a free-form space for users to type in information as needed. Follow the usage criteria accompanying each variant as a guide for selecting the correct Text Input for any given use case. | | **Jump to variant:** Rounded Search Square Search Text |
10
+ | --- | --- | --- |
11
+
12
+ ---
13
+
14
+ ## Rounded Search Input
15
+
16
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
17
+ | --- | --- | --- | --- | --- | --- | --- | --- |
18
+
19
+ Used in CZ GEN EPI for top-level searches and when searching within Tables.
20
+
21
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
22
+
23
+ | **Default** | **Hover** | **Focus** | **Disabled** |
24
+ | --- | --- | --- | --- |
25
+
26
+  
27
+
28
+ ### Rounded Search Input Intent States
29
+
30
+ The `intent` prop is used to communicate the response state of the user's search inquiry.
31
+
32
+ Use `intent: default` to communicate when a user has entered an accepted or complete search.
33
+
34
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete search.
35
+
36
+ Use `intent: warning` to communicate when a user needs to be alerted that their search needs attention.
37
+
38
+ | **Default** | **Error** | **Warning** |
39
+ | --- | --- | --- |
40
+
41
+ ---
42
+
43
+ ### Rounded Search Input Spacing
44
+
45
+ These rules establish how much margin should exist between and around elements.
46
+
47
+  
48
+
49
+ ---
50
+
51
+ ## Square Search Input
52
+
53
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
54
+ | --- | --- | --- | --- | --- | --- | --- | --- |
55
+
56
+ Used in CZ GEN EPI for searches constrained to the element the Input is placed within such as Dropdown Menus or Forms.
57
+
58
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
59
+
60
+ | **Default** | **Hover** | **Focus** | **Disabled** |
61
+ | --- | --- | --- | --- |
62
+
63
+  
64
+
65
+ ### Square Search Input Intent States
66
+
67
+ The `intent` prop is used to communicate the response state of the user's search inquiry.
68
+
69
+ Use `intent: default` to communicate when a user has entered an accepted or complete search.
70
+
71
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete search.
72
+
73
+ Use `intent: warning` to communicate when a user needs to be alerted that their search needs attention.
74
+
75
+ | **Default** | **Error** | **Warning** |
76
+ | --- | --- | --- |
77
+
78
+ ---
79
+
80
+ ### Square Search Input Spacing
81
+
82
+ These rules establish how much margin should exist between and around elements.
83
+
84
+  
85
+
86
+ ---
87
+
88
+ ## Text Input
89
+
90
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
91
+ | --- | --- | --- | --- | --- | --- | --- | --- |
92
+
93
+ ### Text Field Input
94
+
95
+ The Text Field Input is meant to fit one line of text and should be only used when there is a limited amount or a single line's worth of content intended for the user to input.
96
+
97
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
98
+
99
+ | **Default** | **Hover** | **Focus** | **Disabled** |
100
+ | --- | --- | --- | --- |
101
+
102
+  
103
+
104
+ ### Text Area Input
105
+
106
+ The Text Area Input is meant to fit multiple lines of text and should be used when there is the potential that the user will want or need to input more than a single line's worth of content.
107
+
108
+ It includes a handle in the bottom right corner that the user can grab and drag to expand its size.
109
+
110
+ It can be set to accept a specific number of characters in case there is a need to limit how much content the user can enter.
111
+
112
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
113
+
114
+ | **Default** | **Hover** | **Focus** | **Disabled** |
115
+ | --- | --- | --- | --- |
116
+
117
+  
118
+
119
+ ### Text Input Intent States
120
+
121
+ The `intent` prop is used to communicate the response state of the text the user has input.
122
+
123
+ Use `intent: default` to communicate when a user has entered an accepted or complete input.
124
+
125
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete input.
126
+
127
+ Use `intent: warning` to communicate when a user needs to be alerted that the content they've input needs attention.
128
+
129
+ | **Default** | **Error** | **Warning** |
130
+ | --- | --- | --- |
131
+
132
+ ---
133
+
134
+ ---
135
+
136
+ ### Text Input Spacing
137
+
138
+ These rules establish how much margin should exist between and around elements.
139
+
140
+ ## Code
141
+
142
+ ## Field Input Components
143
+
144
+ | Below you will find an interactive Storybook iframe for Field Inputs. 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:** InputSearch InputText |
145
+ | --- | --- | --- |
146
+
147
+ ---
148
+
149
+ >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.
150
+
151
+ ### InputSearch
152
+
153
+ Storybook
154
+
155
+ ---
156
+
157
+ ### InputText
158
+
159
+ Storybook
160
+
161
+ ---
162
+
163
+ Field Inputs are elements that allow users to type within them, providing an area for users to enter content and information or perform a search.
164
+
165
+ ## Overview
166
+
167
+ ## Field Input Variants
168
+
169
+ | There are two Field Input variants available for designers to use—Search Inputs allow users to enter text to perform a search and Text Inputs provide a free-form space for users to type in information as needed. Follow the usage criteria accompanying each variant as a guide for selecting the correct Text Input for any given use case. | | **Jump to variant:** Rounded Search Square Search Text |
170
+ | --- | --- | --- |
171
+
172
+ ---
173
+
174
+ ## Rounded Search Input
175
+
176
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
177
+ | --- | --- | --- | --- | --- | --- | --- | --- |
178
+
179
+ Used in CZ ID for top-level searches and when searching within Tables.
180
+
181
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
182
+
183
+ | **Default** | **Hover** | **Focus** | **Disabled** |
184
+ | --- | --- | --- | --- |
185
+
186
+  
187
+
188
+ ### Rounded Search Input Intent States
189
+
190
+ The `intent` prop is used to communicate the response state of the user's search inquiry.
191
+
192
+ Use `intent: default` to communicate when a user has entered an accepted or complete search.
193
+
194
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete search.
195
+
196
+ Use `intent: warning` to communicate when a user needs to be alerted that their search needs attention.
197
+
198
+ | **Default** | **Error** | **Warning** |
199
+ | --- | --- | --- |
200
+
201
+ ---
202
+
203
+ ### Rounded Search Input Spacing
204
+
205
+ These rules establish how much margin should exist between and around elements.
206
+
207
+ ---
208
+
209
+ ## Square Search Input
210
+
211
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
212
+ | --- | --- | --- | --- | --- | --- | --- | --- |
213
+
214
+ Used in CZ ID for searches constrained to the element the Input is placed within such as Dropdown Menus or Forms.
215
+
216
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
217
+
218
+ | **Default** | **Hover** | **Focus** | **Disabled** |
219
+ | --- | --- | --- | --- |
220
+
221
+  
222
+
223
+ ### Square Search Input Intent States
224
+
225
+ The `intent` prop is used to communicate the response state of the user's search inquiry.
226
+
227
+ Use `intent: default` to communicate when a user has entered an accepted or complete search.
228
+
229
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete search.
230
+
231
+ Use `intent: warning` to communicate when a user needs to be alerted that their search needs attention.
232
+
233
+ | **Default** | **Error** | **Warning** |
234
+ | --- | --- | --- |
235
+
236
+ ---
237
+
238
+ ### Square Search Input Spacing
239
+
240
+ These rules establish how much margin should exist between and around elements.
241
+
242
+ ---
243
+
244
+ ## Text Input
245
+
246
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
247
+ | --- | --- | --- | --- | --- | --- | --- | --- |
248
+
249
+ ### Text Field Input
250
+
251
+ The Text Field Input is meant to fit one line of text and should be only used when there is a limited amount or a single line's worth of content intended for the user to input.
252
+
253
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
254
+
255
+ | **Default** | **Hover** | **Focus** | **Disabled** |
256
+ | --- | --- | --- | --- |
257
+
258
+  
259
+
260
+ ### Text Area Input
261
+
262
+ The Text Area Input is meant to fit multiple lines of text and should be used when there is the potential that the user will want or need to input more than a single line's worth of content.
263
+
264
+ It includes a handle in the bottom right corner that the user can grab and drag to expand its size.
265
+
266
+ It can be set to accept a specific number of characters in case there is a need to limit how much content the user can enter.
267
+
268
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
269
+
270
+ | **Default** | **Hover** | **Focus** | **Disabled** |
271
+ | --- | --- | --- | --- |
272
+
273
+  
274
+
275
+ ### Text Input Intent States
276
+
277
+ The `intent` prop is used to communicate the response state of the text the user has input.
278
+
279
+ Use `intent: default` to communicate when a user has entered an accepted or complete input.
280
+
281
+ Use `intent: error` to communicate when a user has entered an incorrect or incomplete input.
282
+
283
+ Use `intent: warning` to communicate when a user needs to be alerted that the content they've input needs attention.
284
+
285
+ | **Default** | **Error** | **Warning** |
286
+ | --- | --- | --- |
287
+
288
+ ---
289
+
290
+ ---
291
+
292
+ ### Text Input Spacing
293
+
294
+ These rules establish how much margin should exist between and around elements.
295
+
296
+ ## Code
297
+
298
+ ## Field Input Components
299
+
300
+ | Below you will find an interactive Storybook iframe for Field Inputs. 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:** InputSearch InputText |
301
+ | --- | --- | --- |
302
+
303
+ ---
304
+
305
+ ### InputSearch
306
+
307
+ Storybook
308
+
309
+ ---
310
+
311
+ ### InputText
312
+
313
+ Storybook
314
+
315
+ ---
316
+
317
+ Field Inputs are elements that allow users to type within them, providing an area for users to enter content and information or perform a search.
318
+
319
+ ## Guidelines
320
+
321
+ ## Field Input Components
322
+
323
+ | There are two Field Input components available to use—Search Inputs allow users to enter text to perform a search and Text Inputs provide a free-form space for users to type in information as needed. | | **Jump to variant:** Search Input Text Input |
324
+ | --- | --- | --- |
325
+
326
+ ### Visual Preview
327
+
328
+ ---
329
+
330
+ ## Search Input
331
+
332
+ | | In Figma | | | Meets Accessibility | | | In Code |
333
+ | --- | --- | --- | --- | --- | --- | --- | --- |
334
+
335
+ ### Search Input Styles
336
+
337
+ ---
338
+
339
+ ### Live Instance
340
+
341
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
342
+
343
+ Default
344
+
345
+ ---
346
+
347
+ ### Search Input – Rounded
348
+
349
+ Use Search Input – Rounded as part of top-level or primary application searches such as instances where the user will be searching across the entire product or platform.
350
+
351
+ After users enter text into the Search field, an `XmarkCircle` icon appears; if clicked the field is reset to default.
352
+
353
+ | Default | Hover | Focus | Default (user input) | Disabled |
354
+ | --- | --- | --- | --- | --- |
355
+
356
+ ---
357
+
358
+ ### Search Input – Square
359
+
360
+ Use Search Input – Square for searches constrained to the element the Input is placed within such as when used in Dropdown Menus or Panels, or within the body or main content area of applications.
361
+
362
+ After users enter text into the Search field, an `XmarkCircle` icon appears; if clicked the field is reset to default.
363
+
364
+ | Default | Hover | Focus | Default (user input) | Disabled |
365
+ | --- | --- | --- | --- | --- |
366
+
367
+ ---
368
+
369
+ ### Search Input Spacing
370
+
371
+ These rules establish how much margin should exist between and around elements.
372
+
373
+ ---
374
+
375
+ ### Intent Variations
376
+
377
+ Use Default to communicate that the user has yet to enter a response or the response is valid, Negative to communicate when a user has entered an incorrect or incomplete response, and Notice when a user's response needs attention.
378
+
379
+ Optionally, Intent Messages can be displayed to further communicate why a Negative or Notice intent was triggered. For more information see Intents.
380
+
381
+ Each intent is demonstrated below using the Rounded variant for reference. Regardless of variant, the colors used are the same:
382
+
383
+ | Default | Negative | Negative + Intent Message | Notice | Notice + Intent Message |
384
+ | --- | --- | --- | --- | --- |
385
+
386
+ ---
387
+
388
+ ## Text Input
389
+
390
+ | | In Figma | | | Meets Accessibility | | | In Code |
391
+ | --- | --- | --- | --- | --- | --- | --- | --- |
392
+
393
+ ### Text Input Types
394
+
395
+ ---
396
+
397
+ ### Live Instance
398
+
399
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
400
+
401
+ Default
402
+
403
+ ---
404
+
405
+ ### Text Input – Field
406
+
407
+ Text Input – Field is designed to fit one line of text and should be only used when there is a limited amount or a single line's worth of content intended for the user to input.
408
+
409
+ | Default | Hover | Focus | Default (user input) | Disabled |
410
+ | --- | --- | --- | --- | --- |
411
+
412
+ ---
413
+
414
+ ### Text Input – Area
415
+
416
+ Text Input – Area is meant to fit multiple lines of text and should be used when there is the potential that the user will want or need to input more than a single line's worth of content.
417
+
418
+ It includes a handle in the bottom right corner that the user can grab and drag to expand its size.
419
+
420
+ It can be set to accept a specific number of characters in case there is a need to limit how much content the user can enter.
421
+
422
+ | Default | Hover | Focus | Default (user input) | Disabled |
423
+ | --- | --- | --- | --- | --- |
424
+
425
+ ---
426
+
427
+ ### Text Input Spacing
428
+
429
+ These rules establish how much margin should exist between and around elements.
430
+
431
+ ---
432
+
433
+ ### Text Input Intent Variations
434
+
435
+ Use Default to communicate that the user has yet to enter a response or the response is valid, Negative to communicate when a user has entered an incorrect or incomplete response, Notice when a user's response needs attention, and Positive when a user's response is accepted or correct.
436
+
437
+ Optionally, Intent Messages can be displayed to further communicate why a Negative, Notice, or Positive intent was triggered. For more information see Intents.
438
+
439
+ | Default | Negative | Negative + Intent Message | Notice | Notice + Intent Message | Positive | Positive + Intent Message |
440
+ | :---: | :---: | --- | :---: | --- | :---: | --- |
441
+
442
+ ## Code
443
+
444
+ ## Control Input Components
445
+
446
+ | There are two Field Input components available to use—`InputSearch` allows users to enter text to perform a search and `InputText` provide a free-form space for users to type in information as needed. | | **Jump to component:** InputSearch InputText |
447
+ | --- | --- | --- |
448
+
449
+ ### Visual Preview
450
+
451
+ >**Note:** The code examples below must install dependencies before displaying and may take extra time to load
452
+
453
+ ---
454
+
455
+ ## InputSearch
456
+
457
+ ### SDS Source Code
458
+
459
+ The component's source code in the SDS codebase can be found here.
460
+
461
+ ### SDS vs MUI
462
+
463
+ SDS's `InputSearch` is built on MUI's `TextField` component, with `type="search"`. It also has the SDS "search" icon automatically included, aligned to the right end of the field.
464
+
465
+ The following props are available to MUI's `TextField` component, but do not work the same way (or at all) for SDS's `InputSearch` component:
466
+
467
+ * **`variants`****:** SDS's `InputSearch` component is not set up to support values for this prop (aside from `outlined`, `InputSearch` default), and using other values available to MUI (`filled`, `standard`) may result in unreliable outputs
468
+ * **`size`****:** SDS's `InputSearch` component is not set up to support values for this prop (aside from `small`, `InputText`'s default), and using other values available to MUI (`medium`, `large`) may not have reliable outputs
469
+ * **`required`****:** SDS's `InputSearch` does not render the expected asterisk (*) following the label when this prop is `true`
470
+ * **`select`****:** SDS's `InputSearch` is not set up to support this boolean prop
471
+ * **`hiddenLabel`****:** The `label` ("Search", by default) for SDS's component is included within the search field, not outside of it, and the MUI `hiddenLabel` prop will not hide the label
472
+
473
+ The following functionality is available to both MUI's `TextField` component and SDS's `InputText` component, but SDS uses different prop names, shown below:
474
+
475
+ * **`intent`****:** This prop is the way you can set colors for SDS's `InputText`, based on its error state. It takes `default` (default, gray), `error`, or `warning` as values. The related MUI-color-setting prop, `color`, has no effect for `InputText` in SDS.
476
+
477
+ SDS's `InputSearch` has an additional `sdsStyle` prop to help with setting SDS-specific styles, which takes `square` (default) or `rounded` as values.
478
+
479
+ ### MUI Documentation
480
+
481
+ Documentation for the underlying MUI `TextField` component can be found here.
482
+
483
+ ### Props
484
+
485
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
486
+
487
+ | Name | Type | Default | Description |
488
+ | --- | --- | --- | --- |
489
+ | `disabled` | `boolean` | `false` | When set to `true`, the component becomes disabled and cannot be interacted with. |
490
+ | `handleSubmit` | `func` | `function(value: string) => void` | This function is called when the Search icon is clicked, allowing user to handle the search operation. |
491
+ | `id` | `string` | `-` | Specifies the unique `id` for the input element, needed for accessibility. |
492
+ | `intent` | `"default"` `| "negative"` `| "notice"` `| "positive"` | `"default"` | Alters the border color and visual intent of the search input. |
493
+ | `label` | `string` | `-` | Although hidden, this `label` is provided for accessibility purposes. |
494
+ | `onChange` | `func` | `function(event: React.ChangeEvent) => void` | Defines the action to be taken when the input value changes. |
495
+ | `placeholder` | `string` | `"Search"` | Sets the `placeholder` text displayed within the input element. |
496
+ | `sdsStyle` | `"rounded"` `| "square"` | `"square"` | Determines the visual style of the component, with options for `rounded` or `square` design. |
497
+ | `value` | `string` | `-` | The value of the `input` element, required for a controlled component. |
498
+
499
+ ### Code examples
500
+
501
+ #### **Default InputSearch**
502
+
503
+ This example has the minimum props needed for the `InputSearch` component.
504
+
505
+ **/styles.css**
506
+
507
+ ```css
508
+ body {
509
+ font-size: 13px;
510
+ font-weight: 400;
511
+ letter-spacing: 0.08px;
512
+ line-height: 20px;
513
+ text-transform: none;
514
+ font-family: "Inter", sans-serif;
515
+ }
516
+
517
+ h1 {
518
+ font-size: 1.5rem;
519
+ }
520
+
521
+ .app {
522
+ padding: 20px;
523
+ }
524
+ ```
525
+
526
+ **tsconfig.json**
527
+
528
+ ```json
529
+ {
530
+ "include": [
531
+ "./**/*"
532
+ ],
533
+ "compilerOptions": {
534
+ "strict": true,
535
+ "esModuleInterop": true,
536
+ "lib": [ "dom", "es2015" ],
537
+ "jsx": "react-jsx"
538
+ }
539
+ }
540
+ ```
541
+
542
+ **/App.tsx**
543
+
544
+ ```tsx
545
+ import { InputSearch } from "@czi-sds/components";
546
+ import { Box } from "@mui/material";
547
+ import "./styles.css";
548
+
549
+ function App() {
550
+ return (
551
+ <div className="app">
552
+ <Box sx={{ width: 300 }}>
553
+ <InputSearch
554
+ id="search-input"
555
+ label="search"
556
+ placeholder="Search"
557
+ />
558
+ </Box>
559
+ </div>
560
+ );
561
+ }
562
+
563
+ export default App;
564
+ ```
565
+
566
+ **/index.tsx**
567
+
568
+ ```tsx
569
+ import React from "react";
570
+ import { createRoot } from "react-dom/client";
571
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
572
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
573
+ import { Theme } from "@czi-sds/components";
574
+ import CssBaseline from "@mui/material/CssBaseline";
575
+ import useMediaQuery from "@mui/material/useMediaQuery";
576
+
577
+ import App from "./App";
578
+
579
+ const container = document.getElementById("root");
580
+ const root = createRoot(container!);
581
+
582
+ const RootApp = () => {
583
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
584
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
585
+
586
+ return (
587
+ <StyledEngineProvider injectFirst>
588
+ <ThemeProvider theme={theme}>
589
+ <EmotionThemeProvider theme={theme}>
590
+ <CssBaseline />
591
+ <App />
592
+ </EmotionThemeProvider>
593
+ </ThemeProvider>
594
+ </StyledEngineProvider>
595
+ );
596
+ };
597
+
598
+ root.render(
599
+ <React.StrictMode>
600
+ <RootApp />
601
+ </React.StrictMode>
602
+ );
603
+
604
+ ```
605
+
606
+ **/public/index.html**
607
+
608
+ ```html
609
+ <!DOCTYPE html>
610
+ <html lang="en">
611
+ <head>
612
+ <meta charset="UTF-8" />
613
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
614
+ <title>Field Inputs</title>
615
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
616
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
617
+ <link
618
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
619
+ rel="stylesheet"
620
+ />
621
+ <link
622
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
623
+ rel="stylesheet"
624
+ />
625
+ </head>
626
+ <body>
627
+ <div id="root"></div>
628
+ </body>
629
+ </html>
630
+
631
+ ```
632
+
633
+ **/package.json**
634
+
635
+ ```json
636
+ {"dependencies":{"react":"^18.0.0","react-dom":"^18.0.0","react-scripts":"^4.0.0"},"devDependencies":{"@types/react":"^18.0.0","@types/react-dom":"^18.0.0","typescript":"^4.0.0"},"main":"/index.tsx"}
637
+ ```
638
+
639
+ ---
640
+
641
+ ---
642
+
643
+ ## InputText
644
+
645
+ ### SDS Source Code
646
+
647
+ The component's source code in the SDS codebase can be found here.
648
+
649
+ ### SDS vs MUI
650
+
651
+ Like SDS's `InputSearch` (which is also built upon the same MUI component), the following props and options do not work the same way (or at all) for SDS's `InputText` component even though they are available to MUI's `TextField` component.
652
+
653
+ * **`variants`****:** SDS's `InputText` component is not set up to support values for this prop (aside from `outlined`, `InputText`'s default), and using other values available to MUI (`filled`, `standard`) may result in unreliable outputs
654
+ * **`size`****:** SDS's `InputText` component is not set up to support values for this prop (aside from `small`, `InputText`'s default), and using other values available to MUI (`medium`, `large`) may not have reliable outputs
655
+ * **`required`****:** SDS's `InputText` does not render the expected asterisk (*) following the label when this prop is `true`
656
+ * **`select`****:** SDS's `InputText` is not set up to support this boolean prop
657
+
658
+ The following functionality is available to both MUI's `TextField` component and SDS's `InputText` component, but SDS uses different prop names, shown below:
659
+
660
+ * **`sdsType`****:** This is the SDS-equivalent of MUI's boolean `multiline` prop, and takes `textField` (default) or `textArea` as values
661
+ * **`hideLabel`****:** This is the SDS-equivalent of the `hiddenLabel` prop used in MUI; both are boolean with the default not including them (value of `false`)
662
+ * **`intent`****:** This prop is the way you can set colors for SDS's `InputText`, based on its error state. It takes `default` (default, gray), `error`, or `warning` as values. The related MUI-color-setting prop, `color`, has no effect for `InputText` in SDS.
663
+
664
+ ### MUI Documentation
665
+
666
+ Documentation for the underlying MUI `TextField`component can be found here.
667
+
668
+ ### Props
669
+
670
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
671
+
672
+ | Name | Type | Default | Description |
673
+ | --- | --- | --- | --- |
674
+ | `disabled` | `boolean` | `false` | When set to `true`, the component becomes disabled and cannot be interacted with. |
675
+ | `hideLabel` | `boolean` | `false` | If `true`, the label is hidden.  |
676
+ | `id` | `string` | `-` | Specifies the unique `id` for the input element, needed for accessibility. |
677
+ | `intent` | `"default"` `| "negative"` `| "notice"` `| "positive"` | `"default"` | Alters the border color and visual intent of the search input. |
678
+ | `label` | `string` | `-` | The `label` for the input element. |
679
+ | `placeholder` | `string` | `-` | Sets the `placeholder` text displayed within the input element. |
680
+ | `sdsType` | `"textField"` `| "textArea"` | `"textField"` | Defines the type of component to render, with options for a text input or text area. |
681
+
682
+ ### Code examples
683
+
684
+ #### **InputText – Text Field**
685
+
686
+ This component represents the text field variant of the `InputText` component.
687
+
688
+ **/styles.css**
689
+
690
+ ```css
691
+ body {
692
+ font-size: 13px;
693
+ font-weight: 400;
694
+ letter-spacing: 0.08px;
695
+ line-height: 20px;
696
+ text-transform: none;
697
+ font-family: "Inter", sans-serif;
698
+ }
699
+
700
+ h1 {
701
+ font-size: 1.5rem;
702
+ }
703
+
704
+ .app {
705
+ padding: 20px;
706
+ }
707
+ ```
708
+
709
+ **tsconfig.json**
710
+
711
+ ```json
712
+ {
713
+ "include": [
714
+ "./**/*"
715
+ ],
716
+ "compilerOptions": {
717
+ "strict": true,
718
+ "esModuleInterop": true,
719
+ "lib": [ "dom", "es2015" ],
720
+ "jsx": "react-jsx"
721
+ }
722
+ }
723
+ ```
724
+
725
+ **/App.tsx**
726
+
727
+ ```tsx
728
+ import { InputText } from "@czi-sds/components";
729
+ import { Box } from "@mui/material";
730
+ import "./styles.css";
731
+
732
+ function App() {
733
+ return (
734
+ <div className="app">
735
+ <Box sx={{ width: 300 }}>
736
+ <InputText
737
+ id="search-input"
738
+ label="Label"
739
+ placeholder="Enter your text"
740
+ hideLabel
741
+ />
742
+ </Box>
743
+ </div>
744
+ );
745
+ }
746
+
747
+ export default App;
748
+ ```
749
+
750
+ **/index.tsx**
751
+
752
+ ```tsx
753
+ import React from "react";
754
+ import { createRoot } from "react-dom/client";
755
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
756
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
757
+ import { Theme } from "@czi-sds/components";
758
+ import CssBaseline from "@mui/material/CssBaseline";
759
+ import useMediaQuery from "@mui/material/useMediaQuery";
760
+
761
+ import App from "./App";
762
+
763
+ const container = document.getElementById("root");
764
+ const root = createRoot(container!);
765
+
766
+ const RootApp = () => {
767
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
768
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
769
+
770
+ return (
771
+ <StyledEngineProvider injectFirst>
772
+ <ThemeProvider theme={theme}>
773
+ <EmotionThemeProvider theme={theme}>
774
+ <CssBaseline />
775
+ <App />
776
+ </EmotionThemeProvider>
777
+ </ThemeProvider>
778
+ </StyledEngineProvider>
779
+ );
780
+ };
781
+
782
+ root.render(
783
+ <React.StrictMode>
784
+ <RootApp />
785
+ </React.StrictMode>
786
+ );
787
+
788
+ ```
789
+
790
+ **/public/index.html**
791
+
792
+ ```html
793
+ <!DOCTYPE html>
794
+ <html lang="en">
795
+ <head>
796
+ <meta charset="UTF-8" />
797
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
798
+ <title>Field Inputs</title>
799
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
800
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
801
+ <link
802
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
803
+ rel="stylesheet"
804
+ />
805
+ <link
806
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
807
+ rel="stylesheet"
808
+ />
809
+ </head>
810
+ <body>
811
+ <div id="root"></div>
812
+ </body>
813
+ </html>
814
+
815
+ ```
816
+
817
+ **/package.json**
818
+
819
+ ```json
820
+ {"dependencies":{"react":"^18.0.0","react-dom":"^18.0.0","react-scripts":"^4.0.0"},"devDependencies":{"@types/react":"^18.0.0","@types/react-dom":"^18.0.0","typescript":"^4.0.0"},"main":"/index.tsx"}
821
+ ```
822
+
823
+ ---
824
+
825
+ #### InputText – Text Area
826
+
827
+ This component represents the text area variant of the `InputText` component.
828
+
829
+ **/styles.css**
830
+
831
+ ```css
832
+ body {
833
+ font-size: 13px;
834
+ font-weight: 400;
835
+ letter-spacing: 0.08px;
836
+ line-height: 20px;
837
+ text-transform: none;
838
+ font-family: "Inter", sans-serif;
839
+ }
840
+
841
+ h1 {
842
+ font-size: 1.5rem;
843
+ }
844
+
845
+ .app {
846
+ padding: 20px;
847
+ }
848
+ ```
849
+
850
+ **tsconfig.json**
851
+
852
+ ```json
853
+ {
854
+ "include": [
855
+ "./**/*"
856
+ ],
857
+ "compilerOptions": {
858
+ "strict": true,
859
+ "esModuleInterop": true,
860
+ "lib": [ "dom", "es2015" ],
861
+ "jsx": "react-jsx"
862
+ }
863
+ }
864
+ ```
865
+
866
+ **/App.tsx**
867
+
868
+ ```tsx
869
+ import { InputText } from "@czi-sds/components";
870
+ import { Box } from "@mui/material";
871
+ import "./styles.css";
872
+
873
+ function App() {
874
+ return (
875
+ <div className="app">
876
+ <Box sx={{ width: 300 }}>
877
+ <InputText
878
+ id="search-input"
879
+ label="Description"
880
+ placeholder="Enter your text"
881
+ sdsType="textArea"
882
+ />
883
+ </Box>
884
+ </div>
885
+ );
886
+ }
887
+
888
+ export default App;
889
+ ```
890
+
891
+ **/index.tsx**
892
+
893
+ ```tsx
894
+ import React from "react";
895
+ import { createRoot } from "react-dom/client";
896
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
897
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
898
+ import { Theme } from "@czi-sds/components";
899
+ import CssBaseline from "@mui/material/CssBaseline";
900
+ import useMediaQuery from "@mui/material/useMediaQuery";
901
+
902
+ import App from "./App";
903
+
904
+ const container = document.getElementById("root");
905
+ const root = createRoot(container!);
906
+
907
+ const RootApp = () => {
908
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
909
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
910
+
911
+ return (
912
+ <StyledEngineProvider injectFirst>
913
+ <ThemeProvider theme={theme}>
914
+ <EmotionThemeProvider theme={theme}>
915
+ <CssBaseline />
916
+ <App />
917
+ </EmotionThemeProvider>
918
+ </ThemeProvider>
919
+ </StyledEngineProvider>
920
+ );
921
+ };
922
+
923
+ root.render(
924
+ <React.StrictMode>
925
+ <RootApp />
926
+ </React.StrictMode>
927
+ );
928
+
929
+ ```
930
+
931
+ **/public/index.html**
932
+
933
+ ```html
934
+ <!DOCTYPE html>
935
+ <html lang="en">
936
+ <head>
937
+ <meta charset="UTF-8" />
938
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
939
+ <title>Field Inputs</title>
940
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
941
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
942
+ <link
943
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
944
+ rel="stylesheet"
945
+ />
946
+ <link
947
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
948
+ rel="stylesheet"
949
+ />
950
+ </head>
951
+ <body>
952
+ <div id="root"></div>
953
+ </body>
954
+ </html>
955
+
956
+ ```
957
+
958
+ **/package.json**
959
+
960
+ ```json
961
+ {"dependencies":{"react":"^18.0.0","react-dom":"^18.0.0","react-scripts":"^4.0.0"},"devDependencies":{"@types/react":"^18.0.0","@types/react-dom":"^18.0.0","typescript":"^4.0.0"},"main":"/index.tsx"}
962
+ ```
963
+
964
+ ---
965
+