@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.
- package/data/zeroheight-cache.json +5195 -0
- package/data/zeroheight-exports/Accordion.md +675 -0
- package/data/zeroheight-exports/Banner.md +576 -0
- package/data/zeroheight-exports/Borders.md +118 -0
- package/data/zeroheight-exports/Buttons.md +2260 -0
- package/data/zeroheight-exports/Callout.md +756 -0
- package/data/zeroheight-exports/Colors.md +633 -0
- package/data/zeroheight-exports/Content-Card.md +162 -0
- package/data/zeroheight-exports/Contributing-to-SDS.md +99 -0
- package/data/zeroheight-exports/Control-Inputs.md +2066 -0
- package/data/zeroheight-exports/Corners.md +112 -0
- package/data/zeroheight-exports/Cover-page.md +4 -0
- package/data/zeroheight-exports/Dialog.md +1133 -0
- package/data/zeroheight-exports/Downloads.md +121 -0
- package/data/zeroheight-exports/Drop-Shadows.md +80 -0
- package/data/zeroheight-exports/Dropdown-Input.md +1149 -0
- package/data/zeroheight-exports/Dropdown-Menu.md +3787 -0
- package/data/zeroheight-exports/Element-Status-Tracker.md +268 -0
- package/data/zeroheight-exports/Field-Inputs.md +965 -0
- package/data/zeroheight-exports/Filters.md +868 -0
- package/data/zeroheight-exports/Getting-Started.md +1296 -0
- package/data/zeroheight-exports/Hero.md +256 -0
- package/data/zeroheight-exports/Icons.md +432 -0
- package/data/zeroheight-exports/Intent.md +47 -0
- package/data/zeroheight-exports/Introduction-to-Bases.md +36 -0
- package/data/zeroheight-exports/Introduction-to-Cells.md +36 -0
- package/data/zeroheight-exports/Introduction-to-DNA.md +36 -0
- package/data/zeroheight-exports/Introduction-to-Genes.md +36 -0
- package/data/zeroheight-exports/Introduction.md +116 -0
- package/data/zeroheight-exports/Link.md +373 -0
- package/data/zeroheight-exports/Lists.md +617 -0
- package/data/zeroheight-exports/Loading-Indicator.md +38 -0
- package/data/zeroheight-exports/Navigation.md +853 -0
- package/data/zeroheight-exports/Notification.md +858 -0
- package/data/zeroheight-exports/Panel.md +862 -0
- package/data/zeroheight-exports/README.md +124 -0
- package/data/zeroheight-exports/Responsive-Design.md +275 -0
- package/data/zeroheight-exports/Search-Input.md +54 -0
- package/data/zeroheight-exports/Search.md +609 -0
- package/data/zeroheight-exports/Segmented-Control.md +561 -0
- package/data/zeroheight-exports/Spacing.md +298 -0
- package/data/zeroheight-exports/Table.md +4832 -0
- package/data/zeroheight-exports/Tabs.md +773 -0
- package/data/zeroheight-exports/Tags.md +1025 -0
- package/data/zeroheight-exports/Text-Link.md +185 -0
- package/data/zeroheight-exports/Theming.md +313 -0
- package/data/zeroheight-exports/Tooltips.md +1564 -0
- package/data/zeroheight-exports/Typography.md +769 -0
- package/dist/stdio.js +188 -0
- package/package.json +4 -3
|
@@ -0,0 +1,1025 @@
|
|
|
1
|
+
# Tags
|
|
2
|
+
|
|
3
|
+
Tags are used to help with categorization on plugin pages or in conjunction with filters to indicate which have been applied to the results of a search.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
| There are two Tag component types—standard Tags and Filter Tags. Tags are used to label the attributes of each plugin, helping users identify relevant plugins to use in their workflows whereas Filter Tags are used in conjunction with the Filter component to indicate which filters have been applied to the list of plugins. Follow the usage criteria accompanying each variant as a guide for selecting the correct Tag for any given use case. | | **Jump to variant:** Tag Filter Tag |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
|
|
10
|
+
### Visual Preview
|
|
11
|
+
|
|
12
|
+
Use the links below to jump to information on a specific Tag:
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Tag
|
|
17
|
+
|
|
18
|
+
| | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
|
|
19
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
20
|
+
|
|
21
|
+
Tags are used to label the attributes of each plugin; these attributes are able to be filtered on using the Filter component. On the plugin list page, when a given parameter is filtered on, any matching attributes will appear as `active` Tags at the bottom of each plugin card. Additional attributes will continue to be displayed as `inactive` Tags. Users can click on any `inactive` Tag to add it as a Filter parameter.
|
|
22
|
+
|
|
23
|
+
If the user has clicked into a plugin's detail page while having one or more Filter parameters applied, all applicable Tags within the filtered category will appear at the top of the page with the Filtered parameter(s) appearing as `active` Tags. Additional attributes will continue to be displayed as `inactive` Tags. Users can click on any `inactive` Tag to bring them back to the plugin list page and add that attribute to their list of parameters being filtered on.
|
|
24
|
+
|
|
25
|
+
The InfoCircle icons within each Tag can be hovered over to display a Tooltip that will provide a definition of the parameter listed on the Tag.
|
|
26
|
+
|
|
27
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
28
|
+
|
|
29
|
+
| **Default (Inactive)** | **Default (Active)** | **Hover** | **Pressed** |
|
|
30
|
+
| --- | --- | --- | --- |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### Tag Spacing
|
|
35
|
+
|
|
36
|
+
These rules establish how much margin should exist between and around elements.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Filter Tag
|
|
41
|
+
|
|
42
|
+
| | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
|
|
43
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
44
|
+
|
|
45
|
+
On the left-side filter panel on the plugin list page, Filter Tags appear underneath each Filter Dropdown Input to communicate that the plugin list is being filtered on the parameter indicated on the Tag. Users can click on the Xmark icon on the tag to remove that parameter from the group of filters being applied.
|
|
46
|
+
|
|
47
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
48
|
+
|
|
49
|
+
| **Default** | **Hover** | **Pressed** |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### Filter Tag Spacing
|
|
55
|
+
|
|
56
|
+
These rules establish how much margin should exist between and around elements.
|
|
57
|
+
|
|
58
|
+
## Code
|
|
59
|
+
|
|
60
|
+
## Tag Components
|
|
61
|
+
|
|
62
|
+
| Below you will find interactive Storybook iframes for each component within the Tags 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:** Tag TagFilter |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
>This component appears as it is in the default SDS codebase. Once imported into the napari hub or napari.org codebases, use a theme file to enable the napari visual appearance customization.
|
|
68
|
+
|
|
69
|
+
### Tag
|
|
70
|
+
|
|
71
|
+
Storybook
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### TagFilter
|
|
76
|
+
|
|
77
|
+
Storybook
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
Tags are used to label the status of certain elements or in conjunction with filters to indicate which have been applied when viewing datasets.
|
|
82
|
+
|
|
83
|
+
## Overview
|
|
84
|
+
|
|
85
|
+
## Tag Variants
|
|
86
|
+
|
|
87
|
+
| There are two primary Tag variants—Filter Tags and standard Tags. Filter Tags are used in conjunction with the Filter component to indicate which filters have been applied to a given dataset. Standard Tags are used throughout the UI whenever there's a need to label an element or communicate a status associated with it. Follow the usage criteria accompanying each variant as a guide for selecting the correct Tag for any given use case. | | **Jump to variant:** Filter Rounded |
|
|
88
|
+
| --- | --- | --- |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Filter Tag
|
|
93
|
+
|
|
94
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
95
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
96
|
+
|
|
97
|
+
### Filter Tag
|
|
98
|
+
|
|
99
|
+
Used in conjunction with Filters to communicate that the dataset is being filtered on the parameter indicated in the Filter Tag. Users click on the Filter Tag to remove that parameter from the group of filters being applied.
|
|
100
|
+
|
|
101
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
102
|
+
|
|
103
|
+
| **Default** | **Hover** | **Pressed** |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### Filter Tag Spacing
|
|
109
|
+
|
|
110
|
+
These rules establish how much margin should exist between and around elements.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Rounded Tag
|
|
115
|
+
|
|
116
|
+
| | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
|
|
117
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
118
|
+
|
|
119
|
+
### Secondary Rounded Tag
|
|
120
|
+
|
|
121
|
+
Used in CZ GEN EPI without an icon to display the status of a sample within tables or trees. Used with an icon on status message screens.
|
|
122
|
+
|
|
123
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
124
|
+
|
|
125
|
+
| **Default** | **Hover** | **Pressed** |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
|
|
128
|
+
| **Default + Icon** | **Hover** | **Pressed** |
|
|
129
|
+
| --- | --- | --- |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
### Rounded Tag Spacing
|
|
134
|
+
|
|
135
|
+
These rules establish how much margin should exist between and around elements.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### Intent Variations
|
|
140
|
+
|
|
141
|
+
There are four different intents that Tags can communicate—Info, Error, Success, and Warning—indicated with the use of color and selected using the `intent` prop.
|
|
142
|
+
|
|
143
|
+
The Info variant is used when the information being communicated is neutral in nature and is meant to draw the user's attention to the element it is placed beside, providing additional context or details. The Error, Success, and Warning variants are meant to be used to communicate the status of the element, feature, or process they are placed beside.
|
|
144
|
+
|
|
145
|
+
| **Error** | **Info** |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
|
|
148
|
+
| **Success** | **Warning** |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
|
|
151
|
+
## Code
|
|
152
|
+
|
|
153
|
+
## Tag Components
|
|
154
|
+
|
|
155
|
+
| Below you will find interactive Storybook iframes for each component within the Tags 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:** TagFilter Tag |
|
|
156
|
+
| --- | --- | --- |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
>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.
|
|
161
|
+
|
|
162
|
+
### TagFilter
|
|
163
|
+
|
|
164
|
+
Storybook
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
### Tag
|
|
169
|
+
|
|
170
|
+
Storybook
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
Tags are used to label the status of certain elements or in conjunction with filters to indicate which have been applied when viewing datasets.
|
|
175
|
+
|
|
176
|
+
## Overview
|
|
177
|
+
|
|
178
|
+
## Tag Variants
|
|
179
|
+
|
|
180
|
+
| There are two primary Tag variants—Filter Tags and standard Tags. Filter Tags are used in conjunction with the Filter component to indicate which filters have been applied to a given dataset. Standard Tags come in two styles, Rounded and Square, and can be used throughout the UI whenever there's a need to label an element or communicate a status associated with it. Follow the usage criteria accompanying each variant as a guide for selecting the correct Tag for any given use case. | | **Jump to variant:** Filter Rounded Square |
|
|
181
|
+
| --- | --- | --- |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Filter Tag
|
|
186
|
+
|
|
187
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
188
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
189
|
+
|
|
190
|
+
Used in conjunction with Filters to communicate that the dataset is being filtered on the parameter indicated in the Tag. Users click on the Filter Tag to remove that parameter from the group of filters being applied.
|
|
191
|
+
|
|
192
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
193
|
+
|
|
194
|
+
| **Default** | **Hover** | **Pressed** |
|
|
195
|
+
| --- | --- | --- |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### Filter Tag Spacing
|
|
200
|
+
|
|
201
|
+
These rules establish how much margin should exist between and around elements.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Rounded Tag
|
|
206
|
+
|
|
207
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
208
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
209
|
+
|
|
210
|
+
Secondary Tag option for a primary label.
|
|
211
|
+
|
|
212
|
+
Used in CZ ID without an icon to display the status of a sample within a Table. Used with an icon on status message screens.
|
|
213
|
+
|
|
214
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
215
|
+
|
|
216
|
+
| **Default** | **Hover** | **Pressed** |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
|
|
219
|
+
| **Default + Icon** | **Hover** | **Pressed** |
|
|
220
|
+
| --- | --- | --- |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
### Rounded Tag Spacing
|
|
225
|
+
|
|
226
|
+
These rules establish how much margin should exist between and around elements.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Square Tag
|
|
231
|
+
|
|
232
|
+
| | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
|
|
233
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
234
|
+
|
|
235
|
+
Alternate Tag shape for a label.
|
|
236
|
+
|
|
237
|
+
Used within CZ ID to label taxons as pathogenic.
|
|
238
|
+
|
|
239
|
+
Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
|
|
240
|
+
|
|
241
|
+
| **Default** | **Hover** | **Pressed** |
|
|
242
|
+
| --- | --- | --- |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
### Square Tag Spacing
|
|
247
|
+
|
|
248
|
+
These rules establish how much margin should exist between and around elements.
|
|
249
|
+
|
|
250
|
+
## Code
|
|
251
|
+
|
|
252
|
+
## Tag Components
|
|
253
|
+
|
|
254
|
+
| Below you will find interactive Storybook iframes for each component within the Tags 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:** TagFilter Tag |
|
|
255
|
+
| --- | --- | --- |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
### TagFilter
|
|
260
|
+
|
|
261
|
+
Storybook
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Tag
|
|
266
|
+
|
|
267
|
+
Storybook
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
Tags are used to label the status of certain elements or in conjunction with filters to indicate which have been applied when viewing datasets.
|
|
274
|
+
|
|
275
|
+
## Guidelines
|
|
276
|
+
|
|
277
|
+
## Tag Components
|
|
278
|
+
|
|
279
|
+
| There are two types of Tags—standard and filter. Filter Tags are used in conjunction with the Filter component to indicate which filters have been applied to a given dataset. Standard Tags come in two styles, Rounded and Square, and can be used throughout the UI whenever there's a need to label an element or communicate a status associated with it. | | **Jump to variant:** Tag Filter Tag |
|
|
280
|
+
| --- | --- | --- |
|
|
281
|
+
|
|
282
|
+
### Visual Preview
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Tag
|
|
287
|
+
|
|
288
|
+
| | In Figma | | | Meets Accessibility | | | In Code |
|
|
289
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
290
|
+
|
|
291
|
+
### Tag Styles
|
|
292
|
+
|
|
293
|
+
The two available Tag styles are shown below, demonstrated here using the primary type. There are five intents that Tags can communicate—see the Intent Variations section below for more details.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### Live Instance
|
|
298
|
+
|
|
299
|
+
Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
|
|
300
|
+
|
|
301
|
+
Default
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### Tag – Rounded
|
|
306
|
+
|
|
307
|
+
Tag – Rounded is the default style used across applications, however if an alternate style is needed, use Tag – Square.
|
|
308
|
+
|
|
309
|
+
#### Primary
|
|
310
|
+
|
|
311
|
+
Use Tag – Primary in conjunction with the primary or most important content. Include an icon when needing to provide additional context to users of what content the Tag is connected to.
|
|
312
|
+
|
|
313
|
+
>**Note:** An icon must be included when using the large variant.
|
|
314
|
+
|
|
315
|
+
| Default | Hover | Pressed |
|
|
316
|
+
| --- | --- | --- |
|
|
317
|
+
|
|
318
|
+
#### Secondary
|
|
319
|
+
|
|
320
|
+
Use Tag – Secondary in conjunction with secondary or less important content. Include an icon when needing to provide additional context to users of what content the Tag is connected to.
|
|
321
|
+
|
|
322
|
+
>**Note:** An icon must be included when using the large variant.
|
|
323
|
+
|
|
324
|
+
| Default | Hover | Pressed |
|
|
325
|
+
| --- | --- | --- |
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
### Tag – Square
|
|
330
|
+
|
|
331
|
+
Tag – Square is to be used when an alternate Tag style is needed as determined by the product designer.
|
|
332
|
+
|
|
333
|
+
#### Primary
|
|
334
|
+
|
|
335
|
+
Use Tag – Primary in conjunction with the primary or most important content. Include an icon when needing to provide additional context to users of what content the Tag is connected to.
|
|
336
|
+
|
|
337
|
+
>**Note:** An icon must be included when using the large variant.
|
|
338
|
+
|
|
339
|
+
| Default | Hover | Pressed |
|
|
340
|
+
| --- | --- | --- |
|
|
341
|
+
|
|
342
|
+
#### Secondary
|
|
343
|
+
|
|
344
|
+
Use Tag – Secondary in conjunction with secondary or less important content. Include an icon when needing to provide additional context to users of what content the Tag is connected to.
|
|
345
|
+
|
|
346
|
+
>**Note:** An icon must be included when using the large variant.
|
|
347
|
+
|
|
348
|
+
| Default | Hover | Pressed |
|
|
349
|
+
| --- | --- | --- |
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### Tag Spacing
|
|
354
|
+
|
|
355
|
+
These rules establish how much margin should exist between and around elements.
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
### Intent Variations
|
|
360
|
+
|
|
361
|
+
There are six different intents that Tags can communicate—Beta, Info, Negative, None, Notice, and Positive—indicated with the use of color.
|
|
362
|
+
|
|
363
|
+
Each intent is demonstrated below using the default state of the rounded variant for reference. Regardless of variant, the colors used are the same.
|
|
364
|
+
|
|
365
|
+
#### Primary
|
|
366
|
+
|
|
367
|
+
| Beta | Info | Negative | None | Notice | Positive |
|
|
368
|
+
| --- | --- | --- | --- | --- | --- |
|
|
369
|
+
|
|
370
|
+
#### Secondary
|
|
371
|
+
|
|
372
|
+
| Beta | Info | Negative | None | Notice | Positive |
|
|
373
|
+
| --- | --- | --- | --- | --- | --- |
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Filter Tag
|
|
378
|
+
|
|
379
|
+
| | In Figma | | | Meets Accessibility | | | In Code |
|
|
380
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
381
|
+
|
|
382
|
+
### Live Instance
|
|
383
|
+
|
|
384
|
+
Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
|
|
385
|
+
|
|
386
|
+
Default
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
### Overview
|
|
391
|
+
|
|
392
|
+
Used Filter Tag in conjunction with Filters to communicate that the dataset is being filtered on the parameter indicated on the Filter Tag. Users click on the `Xmark` icon to remove that parameter from the group of filters being applied.
|
|
393
|
+
|
|
394
|
+
| Default | Hover | Pressed |
|
|
395
|
+
| --- | --- | --- |
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### Filter Tag Spacing
|
|
400
|
+
|
|
401
|
+
These rules establish how much margin should exist between and around elements.
|
|
402
|
+
|
|
403
|
+
## Code
|
|
404
|
+
|
|
405
|
+
## Tag Components
|
|
406
|
+
|
|
407
|
+
| There are two types of `Tags`—standard and filter. `TagFilter` is used in conjunction with the `Filter` component to indicate which filters have been applied to a given dataset. `Tag` comes in two styles, Rounded and Square, and can be used throughout the UI whenever there's a need to label an element or communicate a status associated with it. | | **Jump to variant:** Tag TagFilter |
|
|
408
|
+
| --- | --- | --- |
|
|
409
|
+
|
|
410
|
+
### Visual Preview
|
|
411
|
+
|
|
412
|
+
>**Note:** The code examples below must install dependencies before displaying and may take extra time to load
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Tag
|
|
417
|
+
|
|
418
|
+
### SDS Source Code
|
|
419
|
+
|
|
420
|
+
The component's source code in the SDS codebase can be found here.
|
|
421
|
+
|
|
422
|
+
### SDS vs MUI
|
|
423
|
+
|
|
424
|
+
The SDS `Tag` component is built on top of MUI's `Chip` component, though SDS is currently set up with distinct `Tag` and `TagFilter` components. The former is clickable but not deletable (whereas MUI's `Chip` can be either, both, or neither). Additionally, SDS's `Tag` component has a couple of props to help display SDS-specific visual properties:
|
|
425
|
+
|
|
426
|
+
* **`sdsStyle`****:** This prop allows you specify whether the `Tag` should be `rounded` (default) or `square`.
|
|
427
|
+
* **`sdsType`****:** This prop takes values of `primary` (default) or `secondary`.
|
|
428
|
+
* **`size`****:** This prop is not available to SDS's `Tag`; instead its size changes automatically based on whether it is accommodating an icon via the `icon` prop or not.
|
|
429
|
+
|
|
430
|
+
### MUI Documentation
|
|
431
|
+
|
|
432
|
+
Documentation for the underlying MUI component can be found here.
|
|
433
|
+
|
|
434
|
+
### Props
|
|
435
|
+
|
|
436
|
+
Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
|
|
437
|
+
|
|
438
|
+
| Name | Type | Default | Description |
|
|
439
|
+
| --- | --- | --- | --- |
|
|
440
|
+
| `hover` | `bool` | `-` | If `true`, the component changes color when hovered over. |
|
|
441
|
+
| `label` | `string` | `-` | The label of the Tag. |
|
|
442
|
+
| `sdsType` | `"primary"` `| "secondary"` | `primary` | The `primary` variant has a `400` background color and white text color. The `secondary` variant has a `100` background color and `500` text color. |
|
|
443
|
+
| `sdsStyle` | `"square"` `| "rounded"` | `rounded` | The shape of the component. |
|
|
444
|
+
| `sdsSize` | `"s" | "l"` | `"s"` | The size of the Tag component. The large-size tag must include an icon. |
|
|
445
|
+
| `color` | `| "beta"` `| "info"` `| "negative"` `| "notice"` `| "positive"` `| [string, string]` `| [string, string, string]` | `-` | You have the flexibility to define the color of the component in two ways: 1. Choose from the available theme colors, such as `primary`, `info`, and more. 2. Customize the colors using one of the following syntax options:
|
|
446
|
+
1. [`label and icon color`, `background color`]
|
|
447
|
+
2. [`label color`, `background color`, `icon color`] |
|
|
448
|
+
| `icon` | `JSX.Element` | `-` | The icon that appears on the leading edge of the component. |
|
|
449
|
+
|
|
450
|
+
### Code examples
|
|
451
|
+
|
|
452
|
+
#### **Default Tag**
|
|
453
|
+
|
|
454
|
+
This example has the minimum props needed for the `Tag` component.
|
|
455
|
+
|
|
456
|
+
**/styles.css**
|
|
457
|
+
|
|
458
|
+
```css
|
|
459
|
+
body {
|
|
460
|
+
font-size: 13px;
|
|
461
|
+
font-weight: 400;
|
|
462
|
+
letter-spacing: 0.08px;
|
|
463
|
+
line-height: 20px;
|
|
464
|
+
text-transform: none;
|
|
465
|
+
font-family: "Inter", sans-serif;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
h1 {
|
|
469
|
+
font-size: 1.5rem;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.app {
|
|
473
|
+
padding: 20px;
|
|
474
|
+
}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
**tsconfig.json**
|
|
478
|
+
|
|
479
|
+
```json
|
|
480
|
+
{
|
|
481
|
+
"include": [
|
|
482
|
+
"./**/*"
|
|
483
|
+
],
|
|
484
|
+
"compilerOptions": {
|
|
485
|
+
"strict": true,
|
|
486
|
+
"esModuleInterop": true,
|
|
487
|
+
"lib": [ "dom", "es2015" ],
|
|
488
|
+
"jsx": "react-jsx"
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**/App.tsx**
|
|
494
|
+
|
|
495
|
+
```tsx
|
|
496
|
+
import { Tag } from "@czi-sds/components";
|
|
497
|
+
import "./styles.css";
|
|
498
|
+
|
|
499
|
+
function App() {
|
|
500
|
+
return (
|
|
501
|
+
<div className="app">
|
|
502
|
+
<Tag label="Science Design System"/>
|
|
503
|
+
</div>
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export default App;
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
**/index.tsx**
|
|
511
|
+
|
|
512
|
+
```tsx
|
|
513
|
+
import React from "react";
|
|
514
|
+
import { createRoot } from "react-dom/client";
|
|
515
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
516
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
517
|
+
import { Theme } from "@czi-sds/components";
|
|
518
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
519
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
520
|
+
|
|
521
|
+
import App from "./App";
|
|
522
|
+
|
|
523
|
+
const container = document.getElementById("root");
|
|
524
|
+
const root = createRoot(container!);
|
|
525
|
+
|
|
526
|
+
const RootApp = () => {
|
|
527
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
528
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
529
|
+
|
|
530
|
+
return (
|
|
531
|
+
<StyledEngineProvider injectFirst>
|
|
532
|
+
<ThemeProvider theme={theme}>
|
|
533
|
+
<EmotionThemeProvider theme={theme}>
|
|
534
|
+
<CssBaseline />
|
|
535
|
+
<App />
|
|
536
|
+
</EmotionThemeProvider>
|
|
537
|
+
</ThemeProvider>
|
|
538
|
+
</StyledEngineProvider>
|
|
539
|
+
);
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
root.render(
|
|
543
|
+
<React.StrictMode>
|
|
544
|
+
<RootApp />
|
|
545
|
+
</React.StrictMode>
|
|
546
|
+
);
|
|
547
|
+
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
**/public/index.html**
|
|
551
|
+
|
|
552
|
+
```html
|
|
553
|
+
<!DOCTYPE html>
|
|
554
|
+
<html lang="en">
|
|
555
|
+
<head>
|
|
556
|
+
<meta charset="UTF-8" />
|
|
557
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
558
|
+
<title>Tags</title>
|
|
559
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
560
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
561
|
+
<link
|
|
562
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
563
|
+
rel="stylesheet"
|
|
564
|
+
/>
|
|
565
|
+
<link
|
|
566
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
567
|
+
rel="stylesheet"
|
|
568
|
+
/>
|
|
569
|
+
</head>
|
|
570
|
+
<body>
|
|
571
|
+
<div id="root"></div>
|
|
572
|
+
</body>
|
|
573
|
+
</html>
|
|
574
|
+
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**/package.json**
|
|
578
|
+
|
|
579
|
+
```json
|
|
580
|
+
{"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"}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
585
|
+
#### Tag + Icon
|
|
586
|
+
|
|
587
|
+
This example displays a rounded warning `Tag` component featuring an SDS icon positioned on the left side.
|
|
588
|
+
|
|
589
|
+
**/styles.css**
|
|
590
|
+
|
|
591
|
+
```css
|
|
592
|
+
body {
|
|
593
|
+
font-size: 13px;
|
|
594
|
+
font-weight: 400;
|
|
595
|
+
letter-spacing: 0.08px;
|
|
596
|
+
line-height: 20px;
|
|
597
|
+
text-transform: none;
|
|
598
|
+
font-family: "Inter", sans-serif;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
h1 {
|
|
602
|
+
font-size: 1.5rem;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.app {
|
|
606
|
+
padding: 20px;
|
|
607
|
+
}
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
**tsconfig.json**
|
|
611
|
+
|
|
612
|
+
```json
|
|
613
|
+
{
|
|
614
|
+
"include": [
|
|
615
|
+
"./**/*"
|
|
616
|
+
],
|
|
617
|
+
"compilerOptions": {
|
|
618
|
+
"strict": true,
|
|
619
|
+
"esModuleInterop": true,
|
|
620
|
+
"lib": [ "dom", "es2015" ],
|
|
621
|
+
"jsx": "react-jsx"
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
**/App.tsx**
|
|
627
|
+
|
|
628
|
+
```tsx
|
|
629
|
+
import { Icon, Tag } from "@czi-sds/components";
|
|
630
|
+
import "./styles.css";
|
|
631
|
+
|
|
632
|
+
function App() {
|
|
633
|
+
return (
|
|
634
|
+
<div className="app">
|
|
635
|
+
<Tag
|
|
636
|
+
label="Virus"
|
|
637
|
+
icon={<Icon sdsSize="l" sdsIcon="Virus" />}
|
|
638
|
+
sdsStyle="rounded"
|
|
639
|
+
color="negative"
|
|
640
|
+
sdsSize="l"
|
|
641
|
+
/>
|
|
642
|
+
</div>
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
export default App;
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
**/index.tsx**
|
|
650
|
+
|
|
651
|
+
```tsx
|
|
652
|
+
import React from "react";
|
|
653
|
+
import { createRoot } from "react-dom/client";
|
|
654
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
655
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
656
|
+
import { Theme } from "@czi-sds/components";
|
|
657
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
658
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
659
|
+
|
|
660
|
+
import App from "./App";
|
|
661
|
+
|
|
662
|
+
const container = document.getElementById("root");
|
|
663
|
+
const root = createRoot(container!);
|
|
664
|
+
|
|
665
|
+
const RootApp = () => {
|
|
666
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
667
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
668
|
+
|
|
669
|
+
return (
|
|
670
|
+
<StyledEngineProvider injectFirst>
|
|
671
|
+
<ThemeProvider theme={theme}>
|
|
672
|
+
<EmotionThemeProvider theme={theme}>
|
|
673
|
+
<CssBaseline />
|
|
674
|
+
<App />
|
|
675
|
+
</EmotionThemeProvider>
|
|
676
|
+
</ThemeProvider>
|
|
677
|
+
</StyledEngineProvider>
|
|
678
|
+
);
|
|
679
|
+
};
|
|
680
|
+
|
|
681
|
+
root.render(
|
|
682
|
+
<React.StrictMode>
|
|
683
|
+
<RootApp />
|
|
684
|
+
</React.StrictMode>
|
|
685
|
+
);
|
|
686
|
+
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
**/public/index.html**
|
|
690
|
+
|
|
691
|
+
```html
|
|
692
|
+
<!DOCTYPE html>
|
|
693
|
+
<html lang="en">
|
|
694
|
+
<head>
|
|
695
|
+
<meta charset="UTF-8" />
|
|
696
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
697
|
+
<title>Tags</title>
|
|
698
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
699
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
700
|
+
<link
|
|
701
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
702
|
+
rel="stylesheet"
|
|
703
|
+
/>
|
|
704
|
+
<link
|
|
705
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
706
|
+
rel="stylesheet"
|
|
707
|
+
/>
|
|
708
|
+
</head>
|
|
709
|
+
<body>
|
|
710
|
+
<div id="root"></div>
|
|
711
|
+
</body>
|
|
712
|
+
</html>
|
|
713
|
+
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
**/package.json**
|
|
717
|
+
|
|
718
|
+
```json
|
|
719
|
+
{"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"}
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
---
|
|
723
|
+
|
|
724
|
+
#### Tag with custom colors
|
|
725
|
+
|
|
726
|
+
This example shows a `Tag` component with customized colors applied to the label, background, and icon for a unique visual presentation.
|
|
727
|
+
|
|
728
|
+
**/styles.css**
|
|
729
|
+
|
|
730
|
+
```css
|
|
731
|
+
body {
|
|
732
|
+
font-size: 13px;
|
|
733
|
+
font-weight: 400;
|
|
734
|
+
letter-spacing: 0.08px;
|
|
735
|
+
line-height: 20px;
|
|
736
|
+
text-transform: none;
|
|
737
|
+
font-family: "Inter", sans-serif;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
h1 {
|
|
741
|
+
font-size: 1.5rem;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.app {
|
|
745
|
+
padding: 20px;
|
|
746
|
+
}
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
**tsconfig.json**
|
|
750
|
+
|
|
751
|
+
```json
|
|
752
|
+
{
|
|
753
|
+
"include": [
|
|
754
|
+
"./**/*"
|
|
755
|
+
],
|
|
756
|
+
"compilerOptions": {
|
|
757
|
+
"strict": true,
|
|
758
|
+
"esModuleInterop": true,
|
|
759
|
+
"lib": [ "dom", "es2015" ],
|
|
760
|
+
"jsx": "react-jsx"
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
**/App.tsx**
|
|
766
|
+
|
|
767
|
+
```tsx
|
|
768
|
+
import { Icon, Tag } from "@czi-sds/components";
|
|
769
|
+
import "./styles.css";
|
|
770
|
+
|
|
771
|
+
function App() {
|
|
772
|
+
return (
|
|
773
|
+
<div className="app">
|
|
774
|
+
<Tag
|
|
775
|
+
label="Star"
|
|
776
|
+
icon={<Icon sdsSize="l" sdsIcon="Star" />}
|
|
777
|
+
color={["yellow", "#f23", "orange"]}
|
|
778
|
+
sdsStyle="rounded"
|
|
779
|
+
sdsSize="l"
|
|
780
|
+
/>
|
|
781
|
+
</div>
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export default App;
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
**/index.tsx**
|
|
789
|
+
|
|
790
|
+
```tsx
|
|
791
|
+
import React from "react";
|
|
792
|
+
import { createRoot } from "react-dom/client";
|
|
793
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
794
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
795
|
+
import { Theme } from "@czi-sds/components";
|
|
796
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
797
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
798
|
+
|
|
799
|
+
import App from "./App";
|
|
800
|
+
|
|
801
|
+
const container = document.getElementById("root");
|
|
802
|
+
const root = createRoot(container!);
|
|
803
|
+
|
|
804
|
+
const RootApp = () => {
|
|
805
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
806
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
807
|
+
|
|
808
|
+
return (
|
|
809
|
+
<StyledEngineProvider injectFirst>
|
|
810
|
+
<ThemeProvider theme={theme}>
|
|
811
|
+
<EmotionThemeProvider theme={theme}>
|
|
812
|
+
<CssBaseline />
|
|
813
|
+
<App />
|
|
814
|
+
</EmotionThemeProvider>
|
|
815
|
+
</ThemeProvider>
|
|
816
|
+
</StyledEngineProvider>
|
|
817
|
+
);
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
root.render(
|
|
821
|
+
<React.StrictMode>
|
|
822
|
+
<RootApp />
|
|
823
|
+
</React.StrictMode>
|
|
824
|
+
);
|
|
825
|
+
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
**/public/index.html**
|
|
829
|
+
|
|
830
|
+
```html
|
|
831
|
+
<!DOCTYPE html>
|
|
832
|
+
<html lang="en">
|
|
833
|
+
<head>
|
|
834
|
+
<meta charset="UTF-8" />
|
|
835
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
836
|
+
<title>Tags</title>
|
|
837
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
838
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
839
|
+
<link
|
|
840
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
841
|
+
rel="stylesheet"
|
|
842
|
+
/>
|
|
843
|
+
<link
|
|
844
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
845
|
+
rel="stylesheet"
|
|
846
|
+
/>
|
|
847
|
+
</head>
|
|
848
|
+
<body>
|
|
849
|
+
<div id="root"></div>
|
|
850
|
+
</body>
|
|
851
|
+
</html>
|
|
852
|
+
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
**/package.json**
|
|
856
|
+
|
|
857
|
+
```json
|
|
858
|
+
{"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"}
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
---
|
|
862
|
+
|
|
863
|
+
---
|
|
864
|
+
|
|
865
|
+
## TagFilter
|
|
866
|
+
|
|
867
|
+
### SDS Source Code
|
|
868
|
+
|
|
869
|
+
The component's source code in the SDS codebase can be found here.
|
|
870
|
+
|
|
871
|
+
### SDS vs MUI
|
|
872
|
+
|
|
873
|
+
SDS's `TagFilter` component is built on top of MUI's `Chip` component and serves one specific purpose: it is meant to be used in conjunction with `Filters`, and does not have any of the stylistic props available to it that MUI's `Chip` or SDS's `Tag` components have.
|
|
874
|
+
|
|
875
|
+
### MUI Documentation
|
|
876
|
+
|
|
877
|
+
Documentation for the underlying MUI component can be found here.
|
|
878
|
+
|
|
879
|
+
### Props
|
|
880
|
+
|
|
881
|
+
Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
|
|
882
|
+
|
|
883
|
+
| Name | Type | Default | Description |
|
|
884
|
+
| --- | --- | --- | --- |
|
|
885
|
+
| `label` | `string` | `-` | The content of the component. |
|
|
886
|
+
| `onDelete` | `func` | `-` | Callback fired when the delete icon is clicked. If set, the delete icon will be shown. |
|
|
887
|
+
|
|
888
|
+
### Code examples
|
|
889
|
+
|
|
890
|
+
#### Default TagFilter
|
|
891
|
+
|
|
892
|
+
This example has the minimum props needed for the `TagFilter` component.
|
|
893
|
+
|
|
894
|
+
**/styles.css**
|
|
895
|
+
|
|
896
|
+
```css
|
|
897
|
+
body {
|
|
898
|
+
font-size: 13px;
|
|
899
|
+
font-weight: 400;
|
|
900
|
+
letter-spacing: 0.08px;
|
|
901
|
+
line-height: 20px;
|
|
902
|
+
text-transform: none;
|
|
903
|
+
font-family: "Inter", sans-serif;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
h1 {
|
|
907
|
+
font-size: 1.5rem;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
.app {
|
|
911
|
+
padding: 20px;
|
|
912
|
+
}
|
|
913
|
+
```
|
|
914
|
+
|
|
915
|
+
**tsconfig.json**
|
|
916
|
+
|
|
917
|
+
```json
|
|
918
|
+
{
|
|
919
|
+
"include": [
|
|
920
|
+
"./**/*"
|
|
921
|
+
],
|
|
922
|
+
"compilerOptions": {
|
|
923
|
+
"strict": true,
|
|
924
|
+
"esModuleInterop": true,
|
|
925
|
+
"lib": [ "dom", "es2015" ],
|
|
926
|
+
"jsx": "react-jsx"
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
**/App.tsx**
|
|
932
|
+
|
|
933
|
+
```tsx
|
|
934
|
+
import { TagFilter } from "@czi-sds/components";
|
|
935
|
+
import "./styles.css";
|
|
936
|
+
|
|
937
|
+
function App() {
|
|
938
|
+
return (
|
|
939
|
+
<div className="app">
|
|
940
|
+
<TagFilter
|
|
941
|
+
label="Science Design System"
|
|
942
|
+
onDelete={() => {}}
|
|
943
|
+
/>
|
|
944
|
+
</div>
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
export default App;
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
**/index.tsx**
|
|
952
|
+
|
|
953
|
+
```tsx
|
|
954
|
+
import React from "react";
|
|
955
|
+
import { createRoot } from "react-dom/client";
|
|
956
|
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
|
|
957
|
+
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
|
|
958
|
+
import { Theme } from "@czi-sds/components";
|
|
959
|
+
import CssBaseline from "@mui/material/CssBaseline";
|
|
960
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
961
|
+
|
|
962
|
+
import App from "./App";
|
|
963
|
+
|
|
964
|
+
const container = document.getElementById("root");
|
|
965
|
+
const root = createRoot(container!);
|
|
966
|
+
|
|
967
|
+
const RootApp = () => {
|
|
968
|
+
const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
|
|
969
|
+
const theme = prefersDarkMode ? Theme("dark") : Theme("light");
|
|
970
|
+
|
|
971
|
+
return (
|
|
972
|
+
<StyledEngineProvider injectFirst>
|
|
973
|
+
<ThemeProvider theme={theme}>
|
|
974
|
+
<EmotionThemeProvider theme={theme}>
|
|
975
|
+
<CssBaseline />
|
|
976
|
+
<App />
|
|
977
|
+
</EmotionThemeProvider>
|
|
978
|
+
</ThemeProvider>
|
|
979
|
+
</StyledEngineProvider>
|
|
980
|
+
);
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
root.render(
|
|
984
|
+
<React.StrictMode>
|
|
985
|
+
<RootApp />
|
|
986
|
+
</React.StrictMode>
|
|
987
|
+
);
|
|
988
|
+
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
**/public/index.html**
|
|
992
|
+
|
|
993
|
+
```html
|
|
994
|
+
<!DOCTYPE html>
|
|
995
|
+
<html lang="en">
|
|
996
|
+
<head>
|
|
997
|
+
<meta charset="UTF-8" />
|
|
998
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
999
|
+
<title>Tags</title>
|
|
1000
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
1001
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
1002
|
+
<link
|
|
1003
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
1004
|
+
rel="stylesheet"
|
|
1005
|
+
/>
|
|
1006
|
+
<link
|
|
1007
|
+
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
|
|
1008
|
+
rel="stylesheet"
|
|
1009
|
+
/>
|
|
1010
|
+
</head>
|
|
1011
|
+
<body>
|
|
1012
|
+
<div id="root"></div>
|
|
1013
|
+
</body>
|
|
1014
|
+
</html>
|
|
1015
|
+
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
**/package.json**
|
|
1019
|
+
|
|
1020
|
+
```json
|
|
1021
|
+
{"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"}
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
---
|
|
1025
|
+
|