@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.
- package/data/component-props/Accordion.json +14 -15
- package/data/component-props/Alert.json +2 -44
- package/data/component-props/Autocomplete.json +14 -32
- package/data/component-props/Banner.json +11 -12
- package/data/component-props/Button.json +17 -82
- package/data/component-props/ButtonDropdown.json +26 -0
- package/data/component-props/ButtonIcon.json +4 -60
- package/data/component-props/ButtonToggle.json +2 -66
- package/data/component-props/Callout.json +11 -65
- package/data/component-props/CellBasic.json +28 -56
- package/data/component-props/CellComponent.json +4 -32
- package/data/component-props/CellHeader.json +13 -49
- package/data/component-props/ComplexFilter.json +24 -4
- package/data/component-props/ContentCard.json +66 -2
- package/data/component-props/Dialog.json +26 -0
- package/data/component-props/Dropdown.json +29 -67
- package/data/component-props/DropdownMenu.json +16 -56
- package/data/component-props/HeatmapChart.json +6 -87
- package/data/component-props/Icon.json +3 -8
- package/data/component-props/InputCheckbox.json +5 -53
- package/data/component-props/InputDropdown.json +11 -33
- package/data/component-props/InputRadio.json +5 -53
- package/data/component-props/InputSearch.json +6 -70
- package/data/component-props/InputSlider.json +21 -35
- package/data/component-props/InputText.json +7 -63
- package/data/component-props/InputToggle.json +5 -54
- package/data/component-props/Link.json +18 -0
- package/data/component-props/LoadingIndicator.json +1 -2
- package/data/component-props/MenuItem.json +11 -41
- package/data/component-props/MenuSelect.json +4 -67
- package/data/component-props/NavigationFooter.json +0 -8
- package/data/component-props/NavigationHeader.json +14 -65
- package/data/component-props/NavigationJumpTo.json +0 -40
- package/data/component-props/Notification.json +14 -58
- package/data/component-props/Pagination.json +8 -33
- package/data/component-props/Panel.json +4 -54
- package/data/component-props/SegmentedControl.json +0 -55
- package/data/component-props/TableRow.json +10 -38
- package/data/component-props/Tabs.json +18 -0
- package/data/component-props/Tag.json +10 -56
- package/data/component-props/TagFilter.json +0 -47
- package/data/component-props/Tooltip.json +12 -61
- package/data/component-props/TooltipCondensed.json +18 -0
- package/data/component-props/TooltipTable.json +0 -4
- package/data/zeroheight-cache.json +5195 -0
- package/data/zeroheight-exports/Accordion.md +717 -0
- package/data/zeroheight-exports/Banner.md +599 -0
- package/data/zeroheight-exports/Borders.md +117 -0
- package/data/zeroheight-exports/Buttons.md +2305 -0
- package/data/zeroheight-exports/Callout.md +778 -0
- package/data/zeroheight-exports/Colors.md +632 -0
- package/data/zeroheight-exports/Content-Card.md +161 -0
- package/data/zeroheight-exports/Contributing-to-SDS.md +98 -0
- package/data/zeroheight-exports/Control-Inputs.md +2121 -0
- package/data/zeroheight-exports/Corners.md +111 -0
- package/data/zeroheight-exports/Cover-page.md +3 -0
- package/data/zeroheight-exports/Dialog.md +1191 -0
- package/data/zeroheight-exports/Downloads.md +120 -0
- package/data/zeroheight-exports/Drop-Shadows.md +79 -0
- package/data/zeroheight-exports/Dropdown-Input.md +1180 -0
- package/data/zeroheight-exports/Dropdown-Menu.md +3883 -0
- package/data/zeroheight-exports/Element-Status-Tracker.md +267 -0
- package/data/zeroheight-exports/Field-Inputs.md +984 -0
- package/data/zeroheight-exports/Filters.md +888 -0
- package/data/zeroheight-exports/Getting-Started.md +1159 -0
- package/data/zeroheight-exports/Hero.md +262 -0
- package/data/zeroheight-exports/Icons.md +431 -0
- package/data/zeroheight-exports/Intent.md +46 -0
- package/data/zeroheight-exports/Introduction-to-Bases.md +35 -0
- package/data/zeroheight-exports/Introduction-to-Cells.md +35 -0
- package/data/zeroheight-exports/Introduction-to-DNA.md +35 -0
- package/data/zeroheight-exports/Introduction-to-Genes.md +35 -0
- package/data/zeroheight-exports/Introduction.md +115 -0
- package/data/zeroheight-exports/Link.md +386 -0
- package/data/zeroheight-exports/Lists.md +632 -0
- package/data/zeroheight-exports/Loading-Indicator.md +37 -0
- package/data/zeroheight-exports/Navigation.md +874 -0
- package/data/zeroheight-exports/Notification.md +888 -0
- package/data/zeroheight-exports/Panel.md +978 -0
- package/data/zeroheight-exports/README.md +124 -0
- package/data/zeroheight-exports/Responsive-Design.md +278 -0
- package/data/zeroheight-exports/Search-Input.md +53 -0
- package/data/zeroheight-exports/Search.md +592 -0
- package/data/zeroheight-exports/Segmented-Control.md +584 -0
- package/data/zeroheight-exports/Spacing.md +297 -0
- package/data/zeroheight-exports/Table.md +4944 -0
- package/data/zeroheight-exports/Tabs.md +801 -0
- package/data/zeroheight-exports/Tags.md +1055 -0
- package/data/zeroheight-exports/Text-Link.md +184 -0
- package/data/zeroheight-exports/Theming.md +332 -0
- package/data/zeroheight-exports/Tooltips.md +1580 -0
- package/data/zeroheight-exports/Typography.md +768 -0
- package/dist/stdio.js +193 -93
- package/package.json +4 -4
- package/data/component-props/Chip.json +0 -73
- package/data/component-props/List.json +0 -43
- package/data/component-props/Menu.json +0 -48
- package/data/component-props/Table.json +0 -26
- package/data/component-props-storybook/Accordion-storybook.json +0 -45
- package/data/component-props-storybook/Alert-storybook.json +0 -30
- package/data/component-props-storybook/Autocomplete-storybook.json +0 -67
- package/data/component-props-storybook/Banner-storybook.json +0 -78
- package/data/component-props-storybook/Button-storybook.json +0 -115
- package/data/component-props-storybook/ButtonDropdown-storybook.json +0 -73
- package/data/component-props-storybook/ButtonIcon-storybook.json +0 -60
- package/data/component-props-storybook/ButtonToggle-storybook.json +0 -68
- package/data/component-props-storybook/Callout-storybook.json +0 -90
- package/data/component-props-storybook/CellBasic-storybook.json +0 -138
- package/data/component-props-storybook/CellComponent-storybook.json +0 -48
- package/data/component-props-storybook/CellHeader-storybook.json +0 -71
- package/data/component-props-storybook/Chip-storybook.json +0 -26
- package/data/component-props-storybook/ComplexFilter-storybook.json +0 -60
- package/data/component-props-storybook/ContentCard-storybook.json +0 -175
- package/data/component-props-storybook/Dialog-storybook.json +0 -56
- package/data/component-props-storybook/Dropdown-storybook.json +0 -93
- package/data/component-props-storybook/DropdownMenu-storybook.json +0 -73
- package/data/component-props-storybook/HeatmapChart-storybook.json +0 -55
- package/data/component-props-storybook/Icon-storybook.json +0 -75
- package/data/component-props-storybook/InputCheckbox-storybook.json +0 -57
- package/data/component-props-storybook/InputDropdown-storybook.json +0 -80
- package/data/component-props-storybook/InputRadio-storybook.json +0 -56
- package/data/component-props-storybook/InputSearch-storybook.json +0 -55
- package/data/component-props-storybook/InputSlider-storybook.json +0 -55
- package/data/component-props-storybook/InputText-storybook.json +0 -59
- package/data/component-props-storybook/InputToggle-storybook.json +0 -42
- package/data/component-props-storybook/Link-storybook.json +0 -50
- package/data/component-props-storybook/List-storybook.json +0 -26
- package/data/component-props-storybook/LoadingIndicator-storybook.json +0 -34
- package/data/component-props-storybook/Menu-storybook.json +0 -26
- package/data/component-props-storybook/MenuItem-storybook.json +0 -74
- package/data/component-props-storybook/MenuSelect-storybook.json +0 -38
- package/data/component-props-storybook/NavigationFooter-storybook.json +0 -67
- package/data/component-props-storybook/NavigationHeader-storybook.json +0 -115
- package/data/component-props-storybook/NavigationJumpTo-storybook.json +0 -41
- package/data/component-props-storybook/Notification-storybook.json +0 -89
- package/data/component-props-storybook/Pagination-storybook.json +0 -50
- package/data/component-props-storybook/Panel-storybook.json +0 -52
- package/data/component-props-storybook/SegmentedControl-storybook.json +0 -30
- package/data/component-props-storybook/Table-storybook.json +0 -26
- package/data/component-props-storybook/TableHeader-storybook.json +0 -26
- package/data/component-props-storybook/TableRow-storybook.json +0 -62
- package/data/component-props-storybook/Tabs-storybook.json +0 -45
- package/data/component-props-storybook/Tag-storybook.json +0 -78
- package/data/component-props-storybook/TagFilter-storybook.json +0 -30
- package/data/component-props-storybook/Tooltip-storybook.json +0 -85
- package/data/component-props-storybook/TooltipCondensed-storybook.json +0 -38
- package/data/component-props-storybook/TooltipTable-storybook.json +0 -47
|
@@ -0,0 +1,984 @@
|
|
|
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
|
+
"compilerOptions": {
|
|
532
|
+
"strict": true,
|
|
533
|
+
"esModuleInterop": true,
|
|
534
|
+
"lib": ["dom", "es2015"],
|
|
535
|
+
"jsx": "react-jsx"
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
**/App.tsx**
|
|
541
|
+
|
|
542
|
+
```tsx
|
|
543
|
+
import { InputSearch } from "@czi-sds/components";
|
|
544
|
+
import { Box } from "@mui/material";
|
|
545
|
+
import "./styles.css";
|
|
546
|
+
|
|
547
|
+
function App() {
|
|
548
|
+
return (
|
|
549
|
+
<div className="app">
|
|
550
|
+
<Box sx={{ width: 300 }}>
|
|
551
|
+
<InputSearch id="search-input" label="search" placeholder="Search" />
|
|
552
|
+
</Box>
|
|
553
|
+
</div>
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export default App;
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
**/index.tsx**
|
|
561
|
+
|
|
562
|
+
```tsx
|
|
563
|
+
import React from "react";
|
|
564
|
+
import { createRoot } from "react-dom/client";
|
|
565
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
566
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
567
|
+
import { Theme } from "@czi-sds/components";
|
|
568
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
569
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
570
|
+
|
|
571
|
+
import App from "./App";
|
|
572
|
+
|
|
573
|
+
const container = document.getElementById("root");
|
|
574
|
+
const root = createRoot(container!);
|
|
575
|
+
|
|
576
|
+
const RootApp = () => {
|
|
577
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
578
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
579
|
+
|
|
580
|
+
return (
|
|
581
|
+
<StyledEngineProvider injectFirst>
|
|
582
|
+
<ThemeProvider theme={theme}>
|
|
583
|
+
<EmotionThemeProvider theme={theme}>
|
|
584
|
+
<CssBaseline />
|
|
585
|
+
<App />
|
|
586
|
+
</EmotionThemeProvider>
|
|
587
|
+
</ThemeProvider>
|
|
588
|
+
</StyledEngineProvider>
|
|
589
|
+
);
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
root.render(
|
|
593
|
+
<React.StrictMode>
|
|
594
|
+
<RootApp />
|
|
595
|
+
</React.StrictMode>
|
|
596
|
+
);
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
**/public/index.html**
|
|
600
|
+
|
|
601
|
+
```html
|
|
602
|
+
<!doctype html>
|
|
603
|
+
<html lang="en">
|
|
604
|
+
<head>
|
|
605
|
+
<meta charset="UTF-8" />
|
|
606
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
607
|
+
<title>Field Inputs</title>
|
|
608
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
609
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
610
|
+
<link
|
|
611
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
612
|
+
rel="stylesheet"
|
|
613
|
+
/>
|
|
614
|
+
<link
|
|
615
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
616
|
+
rel="stylesheet"
|
|
617
|
+
/>
|
|
618
|
+
</head>
|
|
619
|
+
<body>
|
|
620
|
+
<div id="root"></div>
|
|
621
|
+
</body>
|
|
622
|
+
</html>
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
**/package.json**
|
|
626
|
+
|
|
627
|
+
```json
|
|
628
|
+
{
|
|
629
|
+
"dependencies": {
|
|
630
|
+
"react": "^18.0.0",
|
|
631
|
+
"react-dom": "^18.0.0",
|
|
632
|
+
"react-scripts": "^4.0.0"
|
|
633
|
+
},
|
|
634
|
+
"devDependencies": {
|
|
635
|
+
"@types/react": "^18.0.0",
|
|
636
|
+
"@types/react-dom": "^18.0.0",
|
|
637
|
+
"typescript": "^4.0.0"
|
|
638
|
+
},
|
|
639
|
+
"main": "/index.tsx"
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
## InputText
|
|
648
|
+
|
|
649
|
+
### SDS Source Code
|
|
650
|
+
|
|
651
|
+
The component's source code in the SDS codebase can be found here.
|
|
652
|
+
|
|
653
|
+
### SDS vs MUI
|
|
654
|
+
|
|
655
|
+
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.
|
|
656
|
+
|
|
657
|
+
- **`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
|
|
658
|
+
- **`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
|
|
659
|
+
- **`required`\*\***:\*_ SDS's `InputText` does not render the expected asterisk (_) following the label when this prop is `true`
|
|
660
|
+
- **`select`\*\***:\*\* SDS's `InputText` is not set up to support this boolean prop
|
|
661
|
+
|
|
662
|
+
The following functionality is available to both MUI's `TextField` component and SDS's `InputText` component, but SDS uses different prop names, shown below:
|
|
663
|
+
|
|
664
|
+
- **`sdsType`\*\***:\*\* This is the SDS-equivalent of MUI's boolean `multiline` prop, and takes `textField` (default) or `textArea` as values
|
|
665
|
+
- **`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`)
|
|
666
|
+
- **`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.
|
|
667
|
+
|
|
668
|
+
### MUI Documentation
|
|
669
|
+
|
|
670
|
+
Documentation for the underlying MUI `TextField`component can be found here.
|
|
671
|
+
|
|
672
|
+
### Props
|
|
673
|
+
|
|
674
|
+
Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
|
|
675
|
+
|
|
676
|
+
| Name | Type | Default | Description |
|
|
677
|
+
| ------------- | --------------- | ------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ----------- | -------------------------------------------------------------- |
|
|
678
|
+
| `disabled` | `boolean` | `false` | When set to `true`, the component becomes disabled and cannot be interacted with. |
|
|
679
|
+
| `hideLabel` | `boolean` | `false` | If `true`, the label is hidden. |
|
|
680
|
+
| `id` | `string` | `-` | Specifies the unique `id` for the input element, needed for accessibility. |
|
|
681
|
+
| `intent` | `"default"` ` | "negative"` ` | "notice"` ` | "positive"` | `"default"` | Alters the border color and visual intent of the search input. |
|
|
682
|
+
| `label` | `string` | `-` | The `label` for the input element. |
|
|
683
|
+
| `placeholder` | `string` | `-` | Sets the `placeholder` text displayed within the input element. |
|
|
684
|
+
| `sdsType` | `"textField"` ` | "textArea"` | `"textField"` | Defines the type of component to render, with options for a text input or text area. |
|
|
685
|
+
|
|
686
|
+
### Code examples
|
|
687
|
+
|
|
688
|
+
#### **InputText – Text Field**
|
|
689
|
+
|
|
690
|
+
This component represents the text field variant of the `InputText` component.
|
|
691
|
+
|
|
692
|
+
**/styles.css**
|
|
693
|
+
|
|
694
|
+
```css
|
|
695
|
+
body {
|
|
696
|
+
font-size: 13px;
|
|
697
|
+
font-weight: 400;
|
|
698
|
+
letter-spacing: 0.08px;
|
|
699
|
+
line-height: 20px;
|
|
700
|
+
text-transform: none;
|
|
701
|
+
font-family: "Inter", sans-serif;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
h1 {
|
|
705
|
+
font-size: 1.5rem;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.app {
|
|
709
|
+
padding: 20px;
|
|
710
|
+
}
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
**tsconfig.json**
|
|
714
|
+
|
|
715
|
+
```json
|
|
716
|
+
{
|
|
717
|
+
"include": ["./**/*"],
|
|
718
|
+
"compilerOptions": {
|
|
719
|
+
"strict": true,
|
|
720
|
+
"esModuleInterop": true,
|
|
721
|
+
"lib": ["dom", "es2015"],
|
|
722
|
+
"jsx": "react-jsx"
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
**/App.tsx**
|
|
728
|
+
|
|
729
|
+
```tsx
|
|
730
|
+
import { InputText } from "@czi-sds/components";
|
|
731
|
+
import { Box } from "@mui/material";
|
|
732
|
+
import "./styles.css";
|
|
733
|
+
|
|
734
|
+
function App() {
|
|
735
|
+
return (
|
|
736
|
+
<div className="app">
|
|
737
|
+
<Box sx={{ width: 300 }}>
|
|
738
|
+
<InputText
|
|
739
|
+
id="search-input"
|
|
740
|
+
label="Label"
|
|
741
|
+
placeholder="Enter your text"
|
|
742
|
+
hideLabel
|
|
743
|
+
/>
|
|
744
|
+
</Box>
|
|
745
|
+
</div>
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export default App;
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
**/index.tsx**
|
|
753
|
+
|
|
754
|
+
```tsx
|
|
755
|
+
import React from "react";
|
|
756
|
+
import { createRoot } from "react-dom/client";
|
|
757
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
758
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
759
|
+
import { Theme } from "@czi-sds/components";
|
|
760
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
761
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
762
|
+
|
|
763
|
+
import App from "./App";
|
|
764
|
+
|
|
765
|
+
const container = document.getElementById("root");
|
|
766
|
+
const root = createRoot(container!);
|
|
767
|
+
|
|
768
|
+
const RootApp = () => {
|
|
769
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
770
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
771
|
+
|
|
772
|
+
return (
|
|
773
|
+
<StyledEngineProvider injectFirst>
|
|
774
|
+
<ThemeProvider theme={theme}>
|
|
775
|
+
<EmotionThemeProvider theme={theme}>
|
|
776
|
+
<CssBaseline />
|
|
777
|
+
<App />
|
|
778
|
+
</EmotionThemeProvider>
|
|
779
|
+
</ThemeProvider>
|
|
780
|
+
</StyledEngineProvider>
|
|
781
|
+
);
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
root.render(
|
|
785
|
+
<React.StrictMode>
|
|
786
|
+
<RootApp />
|
|
787
|
+
</React.StrictMode>
|
|
788
|
+
);
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
**/public/index.html**
|
|
792
|
+
|
|
793
|
+
```html
|
|
794
|
+
<!doctype html>
|
|
795
|
+
<html lang="en">
|
|
796
|
+
<head>
|
|
797
|
+
<meta charset="UTF-8" />
|
|
798
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
799
|
+
<title>Field Inputs</title>
|
|
800
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
801
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
802
|
+
<link
|
|
803
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
804
|
+
rel="stylesheet"
|
|
805
|
+
/>
|
|
806
|
+
<link
|
|
807
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
808
|
+
rel="stylesheet"
|
|
809
|
+
/>
|
|
810
|
+
</head>
|
|
811
|
+
<body>
|
|
812
|
+
<div id="root"></div>
|
|
813
|
+
</body>
|
|
814
|
+
</html>
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
**/package.json**
|
|
818
|
+
|
|
819
|
+
```json
|
|
820
|
+
{
|
|
821
|
+
"dependencies": {
|
|
822
|
+
"react": "^18.0.0",
|
|
823
|
+
"react-dom": "^18.0.0",
|
|
824
|
+
"react-scripts": "^4.0.0"
|
|
825
|
+
},
|
|
826
|
+
"devDependencies": {
|
|
827
|
+
"@types/react": "^18.0.0",
|
|
828
|
+
"@types/react-dom": "^18.0.0",
|
|
829
|
+
"typescript": "^4.0.0"
|
|
830
|
+
},
|
|
831
|
+
"main": "/index.tsx"
|
|
832
|
+
}
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
---
|
|
836
|
+
|
|
837
|
+
#### InputText – Text Area
|
|
838
|
+
|
|
839
|
+
This component represents the text area variant of the `InputText` component.
|
|
840
|
+
|
|
841
|
+
**/styles.css**
|
|
842
|
+
|
|
843
|
+
```css
|
|
844
|
+
body {
|
|
845
|
+
font-size: 13px;
|
|
846
|
+
font-weight: 400;
|
|
847
|
+
letter-spacing: 0.08px;
|
|
848
|
+
line-height: 20px;
|
|
849
|
+
text-transform: none;
|
|
850
|
+
font-family: "Inter", sans-serif;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
h1 {
|
|
854
|
+
font-size: 1.5rem;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.app {
|
|
858
|
+
padding: 20px;
|
|
859
|
+
}
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
**tsconfig.json**
|
|
863
|
+
|
|
864
|
+
```json
|
|
865
|
+
{
|
|
866
|
+
"include": ["./**/*"],
|
|
867
|
+
"compilerOptions": {
|
|
868
|
+
"strict": true,
|
|
869
|
+
"esModuleInterop": true,
|
|
870
|
+
"lib": ["dom", "es2015"],
|
|
871
|
+
"jsx": "react-jsx"
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
**/App.tsx**
|
|
877
|
+
|
|
878
|
+
```tsx
|
|
879
|
+
import { InputText } from "@czi-sds/components";
|
|
880
|
+
import { Box } from "@mui/material";
|
|
881
|
+
import "./styles.css";
|
|
882
|
+
|
|
883
|
+
function App() {
|
|
884
|
+
return (
|
|
885
|
+
<div className="app">
|
|
886
|
+
<Box sx={{ width: 300 }}>
|
|
887
|
+
<InputText
|
|
888
|
+
id="search-input"
|
|
889
|
+
label="Description"
|
|
890
|
+
placeholder="Enter your text"
|
|
891
|
+
sdsType="textArea"
|
|
892
|
+
/>
|
|
893
|
+
</Box>
|
|
894
|
+
</div>
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export default App;
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
**/index.tsx**
|
|
902
|
+
|
|
903
|
+
```tsx
|
|
904
|
+
import React from "react";
|
|
905
|
+
import { createRoot } from "react-dom/client";
|
|
906
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
907
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
908
|
+
import { Theme } from "@czi-sds/components";
|
|
909
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
910
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
911
|
+
|
|
912
|
+
import App from "./App";
|
|
913
|
+
|
|
914
|
+
const container = document.getElementById("root");
|
|
915
|
+
const root = createRoot(container!);
|
|
916
|
+
|
|
917
|
+
const RootApp = () => {
|
|
918
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
919
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
920
|
+
|
|
921
|
+
return (
|
|
922
|
+
<StyledEngineProvider injectFirst>
|
|
923
|
+
<ThemeProvider theme={theme}>
|
|
924
|
+
<EmotionThemeProvider theme={theme}>
|
|
925
|
+
<CssBaseline />
|
|
926
|
+
<App />
|
|
927
|
+
</EmotionThemeProvider>
|
|
928
|
+
</ThemeProvider>
|
|
929
|
+
</StyledEngineProvider>
|
|
930
|
+
);
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
root.render(
|
|
934
|
+
<React.StrictMode>
|
|
935
|
+
<RootApp />
|
|
936
|
+
</React.StrictMode>
|
|
937
|
+
);
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
**/public/index.html**
|
|
941
|
+
|
|
942
|
+
```html
|
|
943
|
+
<!doctype html>
|
|
944
|
+
<html lang="en">
|
|
945
|
+
<head>
|
|
946
|
+
<meta charset="UTF-8" />
|
|
947
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
948
|
+
<title>Field Inputs</title>
|
|
949
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
950
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
951
|
+
<link
|
|
952
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
953
|
+
rel="stylesheet"
|
|
954
|
+
/>
|
|
955
|
+
<link
|
|
956
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
957
|
+
rel="stylesheet"
|
|
958
|
+
/>
|
|
959
|
+
</head>
|
|
960
|
+
<body>
|
|
961
|
+
<div id="root"></div>
|
|
962
|
+
</body>
|
|
963
|
+
</html>
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
**/package.json**
|
|
967
|
+
|
|
968
|
+
```json
|
|
969
|
+
{
|
|
970
|
+
"dependencies": {
|
|
971
|
+
"react": "^18.0.0",
|
|
972
|
+
"react-dom": "^18.0.0",
|
|
973
|
+
"react-scripts": "^4.0.0"
|
|
974
|
+
},
|
|
975
|
+
"devDependencies": {
|
|
976
|
+
"@types/react": "^18.0.0",
|
|
977
|
+
"@types/react-dom": "^18.0.0",
|
|
978
|
+
"typescript": "^4.0.0"
|
|
979
|
+
},
|
|
980
|
+
"main": "/index.tsx"
|
|
981
|
+
}
|
|
982
|
+
```
|
|
983
|
+
|
|
984
|
+
---
|