@czi-sds/mcp 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +2 -1
  2. package/data/component-docs/Accordion.md +291 -0
  3. package/data/component-docs/Autocomplete.md +525 -0
  4. package/data/component-docs/Banner.md +231 -0
  5. package/data/component-docs/Button.md +224 -0
  6. package/data/component-docs/ButtonDropdown.md +256 -0
  7. package/data/component-docs/ButtonGroup.md +320 -0
  8. package/data/component-docs/ButtonToggle.md +397 -0
  9. package/data/component-docs/Callout.md +268 -0
  10. package/data/component-docs/CellBasic.md +122 -0
  11. package/data/component-docs/CellComponent.md +63 -0
  12. package/data/component-docs/CellHeader.md +128 -0
  13. package/data/component-docs/ComplexFilter.md +294 -0
  14. package/data/component-docs/ContentCard.md +406 -0
  15. package/data/component-docs/Dialog.md +651 -0
  16. package/data/component-docs/Dropdown.md +155 -0
  17. package/data/component-docs/DropdownMenu.md +949 -0
  18. package/data/component-docs/HeatmapChart.md +782 -0
  19. package/data/component-docs/Hero.md +363 -0
  20. package/data/component-docs/Icon.md +283 -0
  21. package/data/component-docs/InputCheckbox.md +205 -0
  22. package/data/component-docs/InputDropdown.md +482 -0
  23. package/data/component-docs/InputRadio.md +173 -0
  24. package/data/component-docs/InputSearch.md +81 -0
  25. package/data/component-docs/InputSlider.md +189 -0
  26. package/data/component-docs/InputText.md +110 -0
  27. package/data/component-docs/InputToggle.md +141 -0
  28. package/data/component-docs/IntentMessage.md +293 -0
  29. package/data/component-docs/Legend.md +442 -0
  30. package/data/component-docs/Link.md +23 -0
  31. package/data/component-docs/List.md +300 -0
  32. package/data/component-docs/LoadingIndicator.md +198 -0
  33. package/data/component-docs/Menu.md +298 -0
  34. package/data/component-docs/MenuItem.md +100 -0
  35. package/data/component-docs/NavigationFooter.md +165 -0
  36. package/data/component-docs/NavigationHeader.md +500 -0
  37. package/data/component-docs/NavigationJumpTo.md +414 -0
  38. package/data/component-docs/Notification.md +288 -0
  39. package/data/component-docs/Pagination.md +67 -0
  40. package/data/component-docs/Panel.md +636 -0
  41. package/data/component-docs/Popover.md +448 -0
  42. package/data/component-docs/PreComposedTable.md +2947 -0
  43. package/data/component-docs/SegmentedControl.md +396 -0
  44. package/data/component-docs/StackedBarChart.md +475 -0
  45. package/data/component-docs/Table.md +2000 -0
  46. package/data/component-docs/TableHeader.md +53 -0
  47. package/data/component-docs/TableRow.md +74 -0
  48. package/data/component-docs/Tabs.md +455 -0
  49. package/data/component-docs/Tag.md +647 -0
  50. package/data/component-docs/TagFilter.md +131 -0
  51. package/data/component-docs/Tooltip.md +561 -0
  52. package/data/component-docs/TooltipCondensed.md +203 -0
  53. package/data/component-docs/TooltipTable.md +145 -0
  54. package/data/component-docs/index.json +262 -0
  55. package/data/component-list.json +2 -5
  56. package/data/component-props/Accordion.json +31 -11
  57. package/data/component-props/Alert.json +3 -3
  58. package/data/component-props/Autocomplete.json +150 -15
  59. package/data/component-props/Banner.json +31 -17
  60. package/data/component-props/Button.json +45 -20
  61. package/data/component-props/ButtonDropdown.json +36 -17
  62. package/data/component-props/ButtonDropdownLegacy.json +11 -11
  63. package/data/component-props/ButtonGroup.json +32 -11
  64. package/data/component-props/ButtonIcon.json +10 -10
  65. package/data/component-props/ButtonLegacy.json +19 -19
  66. package/data/component-props/ButtonToggle.json +32 -19
  67. package/data/component-props/ButtonToggleLegacy.json +11 -11
  68. package/data/component-props/Callout.json +58 -17
  69. package/data/component-props/CellBasic.json +94 -41
  70. package/data/component-props/CellComponent.json +23 -7
  71. package/data/component-props/CellHeader.json +62 -19
  72. package/data/component-props/ComplexFilter.json +52 -21
  73. package/data/component-props/ContentCard.json +70 -47
  74. package/data/component-props/Dialog.json +47 -14
  75. package/data/component-props/Dropdown.json +67 -31
  76. package/data/component-props/DropdownMenu.json +128 -23
  77. package/data/component-props/HeatmapChart.json +88 -12
  78. package/data/component-props/Hero.json +80 -39
  79. package/data/component-props/Icon.json +20 -9
  80. package/data/component-props/InputCheckbox.json +36 -14
  81. package/data/component-props/InputDropdown.json +75 -27
  82. package/data/component-props/InputRadio.json +31 -13
  83. package/data/component-props/InputSearch.json +41 -18
  84. package/data/component-props/InputSlider.json +46 -19
  85. package/data/component-props/InputText.json +26 -19
  86. package/data/component-props/InputToggle.json +26 -9
  87. package/data/component-props/IntentMessage.json +38 -9
  88. package/data/component-props/Link.json +13 -7
  89. package/data/component-props/LoadingIndicator.json +11 -3
  90. package/data/component-props/MenuItem.json +38 -19
  91. package/data/component-props/MenuSelect.json +8 -8
  92. package/data/component-props/NavigationFooter.json +49 -19
  93. package/data/component-props/NavigationHeader.json +150 -37
  94. package/data/component-props/NavigationJumpTo.json +33 -7
  95. package/data/component-props/Notification.json +39 -21
  96. package/data/component-props/Pagination.json +39 -11
  97. package/data/component-props/Panel.json +62 -9
  98. package/data/component-props/Popover.json +80 -7
  99. package/data/component-props/PreComposedTable.json +99 -27
  100. package/data/component-props/SegmentedControl.json +42 -3
  101. package/data/component-props/StackedBarChart.json +116 -42
  102. package/data/component-props/TableRow.json +38 -19
  103. package/data/component-props/Tabs.json +66 -9
  104. package/data/component-props/Tag.json +34 -17
  105. package/data/component-props/TagFilter.json +10 -3
  106. package/data/component-props/Tooltip.json +49 -18
  107. package/data/component-props/TooltipCondensed.json +18 -9
  108. package/data/component-props/TooltipTable.json +17 -7
  109. package/data/resources/{zeroheight-rules.md → documentation-rules.md} +43 -30
  110. package/data/resources/figma-rules.md +2 -2
  111. package/dist/stdio.js +483 -780
  112. package/package.json +12 -8
  113. package/data/component-props/ButtonDropdownV2.json +0 -34
  114. package/data/component-props/ButtonNew.json +0 -47
  115. package/data/component-props/ButtonToggleV2.json +0 -44
  116. package/data/component-props/ButtonV2.json +0 -43
  117. package/data/zeroheight-cache.json +0 -10259
  118. package/data/zeroheight-exports/Accordion.md +0 -774
  119. package/data/zeroheight-exports/Banner.md +0 -691
  120. package/data/zeroheight-exports/Borders.md +0 -117
  121. package/data/zeroheight-exports/Buttons.md +0 -1854
  122. package/data/zeroheight-exports/Callout.md +0 -931
  123. package/data/zeroheight-exports/Colors.md +0 -1755
  124. package/data/zeroheight-exports/Content-Card.md +0 -309
  125. package/data/zeroheight-exports/Contributing-to-SDS.md +0 -98
  126. package/data/zeroheight-exports/Control-Inputs.md +0 -2818
  127. package/data/zeroheight-exports/Corners.md +0 -104
  128. package/data/zeroheight-exports/Cover-page.md +0 -3
  129. package/data/zeroheight-exports/Dialog.md +0 -1367
  130. package/data/zeroheight-exports/Downloads.md +0 -236
  131. package/data/zeroheight-exports/Drop-Shadows.md +0 -79
  132. package/data/zeroheight-exports/Dropdown-Input.md +0 -1776
  133. package/data/zeroheight-exports/Dropdown-Menus.md +0 -913
  134. package/data/zeroheight-exports/Element-Status-Tracker.md +0 -267
  135. package/data/zeroheight-exports/Field-Inputs.md +0 -1405
  136. package/data/zeroheight-exports/Filters.md +0 -1111
  137. package/data/zeroheight-exports/Getting-Started.md +0 -1157
  138. package/data/zeroheight-exports/Hero.md +0 -414
  139. package/data/zeroheight-exports/Icons.md +0 -2067
  140. package/data/zeroheight-exports/Intent.md +0 -86
  141. package/data/zeroheight-exports/Introduction-to-Bases.md +0 -35
  142. package/data/zeroheight-exports/Introduction-to-Cells.md +0 -35
  143. package/data/zeroheight-exports/Introduction-to-DNA.md +0 -35
  144. package/data/zeroheight-exports/Introduction-to-Genes.md +0 -35
  145. package/data/zeroheight-exports/Introduction.md +0 -115
  146. package/data/zeroheight-exports/Link.md +0 -432
  147. package/data/zeroheight-exports/Lists.md +0 -986
  148. package/data/zeroheight-exports/Loading-Indicator.md +0 -41
  149. package/data/zeroheight-exports/Navigation.md +0 -1190
  150. package/data/zeroheight-exports/Notification.md +0 -1038
  151. package/data/zeroheight-exports/Panel.md +0 -1030
  152. package/data/zeroheight-exports/README.md +0 -122
  153. package/data/zeroheight-exports/Responsive-Design.md +0 -330
  154. package/data/zeroheight-exports/Search-Input.md +0 -91
  155. package/data/zeroheight-exports/Search.md +0 -822
  156. package/data/zeroheight-exports/Segmented-Control.md +0 -609
  157. package/data/zeroheight-exports/Spacing.md +0 -297
  158. package/data/zeroheight-exports/Table.md +0 -5345
  159. package/data/zeroheight-exports/Tabs.md +0 -1324
  160. package/data/zeroheight-exports/Tags.md +0 -1545
  161. package/data/zeroheight-exports/Text-Link.md +0 -268
  162. package/data/zeroheight-exports/Theming.md +0 -362
  163. package/data/zeroheight-exports/Tooltips.md +0 -2015
  164. package/data/zeroheight-exports/Typography.md +0 -800
@@ -1,1545 +0,0 @@
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
- **Tag**
15
-
16
- ---
17
-
18
- **TagFilter**
19
-
20
- ---
21
-
22
- ---
23
-
24
- ## Tag
25
-
26
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
27
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
28
-
29
- 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.
30
-
31
- 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.
32
-
33
- 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.
34
-
35
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
36
-
37
- | **Default (Inactive)** | **Default (Active)** | **Hover** | **Pressed** |
38
- | ---------------------- | -------------------- | --------- | ----------- |
39
-
40
- **Tag**
41
-
42
- ---
43
-
44
- **Tag**
45
-
46
- ---
47
-
48
- **Tag**
49
-
50
- ---
51
-
52
- **Tag**
53
-
54
- ---
55
-
56
- ---
57
-
58
- ### Tag Spacing
59
-
60
- These rules establish how much margin should exist between and around elements.
61
-
62
- **Tag spacing**
63
-
64
- ---
65
-
66
- ---
67
-
68
- ## Filter Tag
69
-
70
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
71
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
72
-
73
- 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.
74
-
75
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
76
-
77
- | **Default** | **Hover** | **Pressed** |
78
- | ----------- | --------- | ----------- |
79
-
80
- **Tag**
81
-
82
- ---
83
-
84
- **Tag**
85
-
86
- ---
87
-
88
- **Tag**
89
-
90
- ---
91
-
92
- ---
93
-
94
- ### Filter Tag Spacing
95
-
96
- These rules establish how much margin should exist between and around elements.
97
-
98
- **Filter Tag spacing**
99
-
100
- ---
101
-
102
- ## Code
103
-
104
- ## Tag Components
105
-
106
- | 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 |
107
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------ |
108
-
109
- ---
110
-
111
- > 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.
112
-
113
- ### Tag
114
-
115
- Storybook
116
-
117
- ---
118
-
119
- ### TagFilter 
120
-
121
- Storybook
122
-
123
- ---
124
-
125
- Tags are used to label the status of certain elements or in conjunction with filters to indicate which have been applied when viewing datasets.
126
-
127
- ## Overview
128
-
129
- ## Tag Variants
130
-
131
- | 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 |
132
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------- |
133
-
134
- ---
135
-
136
- ## Filter Tag
137
-
138
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
139
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
140
-
141
- ### Filter Tag
142
-
143
- 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.
144
-
145
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
146
-
147
- | **Default** | **Hover** | **Pressed** |
148
- | ----------- | --------- | ----------- |
149
-
150
- **TagFilter**
151
-
152
- ---
153
-
154
- **TagFilter**
155
-
156
- ---
157
-
158
- **TagFilter**
159
-
160
- ---
161
-
162
- ---
163
-
164
- ### Filter Tag Spacing
165
-
166
- These rules establish how much margin should exist between and around elements.
167
-
168
- **Filter Tag spacing**
169
-
170
- ---
171
-
172
- ---
173
-
174
- ## Rounded Tag
175
-
176
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
177
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
178
-
179
- ### Secondary Rounded Tag
180
-
181
- 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.
182
-
183
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
184
-
185
- | **Default** | **Hover** | **Pressed** |
186
- | ----------- | --------- | ----------- |
187
-
188
- **Tag**
189
-
190
- ---
191
-
192
- **Tag**
193
-
194
- ---
195
-
196
- **Tag**
197
-
198
- ---
199
-
200
- | **Default + Icon** | **Hover** | **Pressed** |
201
- | ------------------ | --------- | ----------- |
202
-
203
- **Tag**
204
-
205
- ---
206
-
207
- **Tag**
208
-
209
- ---
210
-
211
- **Tag**
212
-
213
- ---
214
-
215
- ---
216
-
217
- ### Rounded Tag Spacing
218
-
219
- These rules establish how much margin should exist between and around elements.
220
-
221
- **Rounded Tag spacing_CZ GE**
222
-
223
- ---
224
-
225
- ---
226
-
227
- ### Intent Variations
228
-
229
- 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.
230
-
231
- 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.
232
-
233
- | **Error** | **Info** |
234
- | --------- | -------- |
235
-
236
- **Error variant**
237
-
238
- ---
239
-
240
- **Info variant**
241
-
242
- ---
243
-
244
- | **Success** | **Warning** |
245
- | ----------- | ----------- |
246
-
247
- **Success variant**
248
-
249
- ---
250
-
251
- **Warning variant**
252
-
253
- ---
254
-
255
- ## Code
256
-
257
- ## Tag Components
258
-
259
- | 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 |
260
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------ |
261
-
262
- ---
263
-
264
- > 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.
265
-
266
- ### TagFilter
267
-
268
- Storybook
269
-
270
- ---
271
-
272
- ### Tag
273
-
274
- Storybook
275
-
276
- ---
277
-
278
- Tags are used to label the status of certain elements or in conjunction with filters to indicate which have been applied when viewing datasets.
279
-
280
- ## Overview
281
-
282
- ## Tag Variants
283
-
284
- | 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 |
285
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------ |
286
-
287
- ---
288
-
289
- ## Filter Tag
290
-
291
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
292
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
293
-
294
- 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.
295
-
296
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
297
-
298
- | **Default** | **Hover** | **Pressed** |
299
- | ----------- | --------- | ----------- |
300
-
301
- **TagFilter**
302
-
303
- ---
304
-
305
- **TagFilter**
306
-
307
- ---
308
-
309
- **TagFilter**
310
-
311
- ---
312
-
313
- ---
314
-
315
- ### Filter Tag Spacing
316
-
317
- These rules establish how much margin should exist between and around elements.
318
-
319
- **Filter Tag spacing**
320
-
321
- ---
322
-
323
- ---
324
-
325
- ## Rounded Tag
326
-
327
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
328
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
329
-
330
- Secondary Tag option for a primary label.
331
-
332
- 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.
333
-
334
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
335
-
336
- | **Default** | **Hover** | **Pressed** |
337
- | ----------- | --------- | ----------- |
338
-
339
- **Tag**
340
-
341
- ---
342
-
343
- **Tag**
344
-
345
- ---
346
-
347
- **Tag**
348
-
349
- ---
350
-
351
- | **Default + Icon** | **Hover** | **Pressed** |
352
- | ------------------ | --------- | ----------- |
353
-
354
- **Tag**
355
-
356
- ---
357
-
358
- **Tag**
359
-
360
- ---
361
-
362
- **Tag**
363
-
364
- ---
365
-
366
- ---
367
-
368
- ### Rounded Tag Spacing
369
-
370
- These rules establish how much margin should exist between and around elements.
371
-
372
- **Rounded Tag spacing_CZ ID**
373
-
374
- ---
375
-
376
- ---
377
-
378
- ## Square Tag
379
-
380
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
381
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
382
-
383
- Alternate Tag shape for a label.
384
-
385
- Used within CZ ID to label taxons as pathogenic.
386
-
387
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
388
-
389
- | **Default** | **Hover** | **Pressed** |
390
- | ----------- | --------- | ----------- |
391
-
392
- **Tag**
393
-
394
- ---
395
-
396
- **Tag**
397
-
398
- ---
399
-
400
- **Tag**
401
-
402
- ---
403
-
404
- ---
405
-
406
- ### Square Tag Spacing
407
-
408
- These rules establish how much margin should exist between and around elements.
409
-
410
- **Square Tag spacing_CZ ID**
411
-
412
- ---
413
-
414
- ## Code
415
-
416
- ## Tag Components
417
-
418
- | 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 |
419
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------ |
420
-
421
- ---
422
-
423
- ### TagFilter
424
-
425
- Storybook
426
-
427
- ---
428
-
429
- ### Tag
430
-
431
- Storybook
432
-
433
- ---
434
-
435
- Tags are used to label the status of certain elements or in conjunction with filters to indicate which have been applied when viewing datasets.
436
-
437
- ## Guidelines
438
-
439
- ## Tag Components
440
-
441
- | 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 |
442
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------- |
443
-
444
- ### Visual Preview
445
-
446
- **Preview_Guidelines_Tag**
447
-
448
- ---
449
-
450
- **Preview_Guidelines_TagFilter**
451
-
452
- ---
453
-
454
- ---
455
-
456
- ## Tag
457
-
458
- | | In Figma | | | Meets Accessibility | | | In Code |
459
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
460
-
461
- ### Tag Styles
462
-
463
- 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.
464
-
465
- **Tag_Rounded**
466
-
467
- ---
468
-
469
- **Tag_Square**
470
-
471
- ---
472
-
473
- ---
474
-
475
- ### Live Instance
476
-
477
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
478
-
479
- Default
480
-
481
- ---
482
-
483
- ### Tag – Rounded
484
-
485
- Tag – Rounded is the default style used across applications, however if an alternate style is needed, use Tag – Square.
486
-
487
- #### Primary
488
-
489
- 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.
490
-
491
- > **Note:** An icon must be included when using the large variant.
492
-
493
- | Default | Hover | Pressed |
494
- | ------- | ----- | ------- |
495
-
496
- **Tag_Primary_Rounded_Small_No Icon_Default**
497
-
498
- ---
499
-
500
- **Tag_Primary_Rounded_Small_No Icon_Hover**
501
-
502
- ---
503
-
504
- **Tag_Primary_Rounded_Small_No Icon_Pressed**
505
-
506
- ---
507
-
508
- **Tag_Primary_Rounded_Small_Icon_Default**
509
-
510
- ---
511
-
512
- **Tag_Primary_Rounded_Small_Icon_Hover**
513
-
514
- ---
515
-
516
- **Tag_Primary_Rounded_Small_Icon_Pressed**
517
-
518
- ---
519
-
520
- **Tag_Primary_Rounded_Large_Icon_Default**
521
-
522
- ---
523
-
524
- **Tag_Primary_Rounded_Large_Icon_Hover**
525
-
526
- ---
527
-
528
- **Tag_Primary_Rounded_Large_Icon_Pressed**
529
-
530
- ---
531
-
532
- #### Secondary
533
-
534
- 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.
535
-
536
- > **Note:** An icon must be included when using the large variant.
537
-
538
- | Default | Hover | Pressed |
539
- | ------- | ----- | ------- |
540
-
541
- **Tag_Secondary_Rounded_Small_No Icon_Default**
542
-
543
- ---
544
-
545
- **Tag_Secondary_Rounded_Small_No Icon_Hover**
546
-
547
- ---
548
-
549
- **Tag_Secondary_Rounded_Small_No Icon_Pressed**
550
-
551
- ---
552
-
553
- **Tag_Secondary_Rounded_Small_Icon_Default**
554
-
555
- ---
556
-
557
- **Tag_Secondary_Rounded_Small_Icon_Hover**
558
-
559
- ---
560
-
561
- **Tag_Secondary_Rounded_Small_Icon_Pressed**
562
-
563
- ---
564
-
565
- **Tag_Secondary_Rounded_Large_Icon_Default**
566
-
567
- ---
568
-
569
- **Tag_Secondary_Rounded_Large_Icon_Hover**
570
-
571
- ---
572
-
573
- **Tag_Secondary_Rounded_Large_Icon_Pressed**
574
-
575
- ---
576
-
577
- ---
578
-
579
- ### Tag – Square
580
-
581
- Tag – Square is to be used when an alternate Tag style is needed as determined by the product designer.
582
-
583
- #### Primary
584
-
585
- 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.
586
-
587
- > **Note:** An icon must be included when using the large variant.
588
-
589
- | Default | Hover | Pressed |
590
- | ------- | ----- | ------- |
591
-
592
- **Tag_Primary_Square_Small_No Icon_Default**
593
-
594
- ---
595
-
596
- **Tag_Primary_Square_Small_No Icon_Hover**
597
-
598
- ---
599
-
600
- **Tag_Primary_Square_Small_No Icon_Pressed**
601
-
602
- ---
603
-
604
- **Tag_Primary_Square_Small_Icon_Default**
605
-
606
- ---
607
-
608
- **Tag_Primary_Square_Small_Icon_Hover**
609
-
610
- ---
611
-
612
- **Tag_Primary_Square_Small_Icon_Pressed**
613
-
614
- ---
615
-
616
- **Tag_Primary_Square_Large_Icon_Default**
617
-
618
- ---
619
-
620
- **Tag_Primary_Square_Large_Icon_Hover**
621
-
622
- ---
623
-
624
- **Tag_Primary_Square_Large_Icon_Pressed**
625
-
626
- ---
627
-
628
- #### Secondary
629
-
630
- 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.
631
-
632
- > **Note:** An icon must be included when using the large variant.
633
-
634
- | Default | Hover | Pressed |
635
- | ------- | ----- | ------- |
636
-
637
- **Tag_Secondary_Square_Small_No Icon_Default**
638
-
639
- ---
640
-
641
- **Tag_Secondary_Square_Small_No Icon_Hover**
642
-
643
- ---
644
-
645
- **Tag_Secondary_Square_Small_No Icon_Pressed**
646
-
647
- ---
648
-
649
- **Tag_Secondary_Square_Small_Icon_Default**
650
-
651
- ---
652
-
653
- **Tag_Secondary_Square_Small_Icon_Hover**
654
-
655
- ---
656
-
657
- **Tag_Secondary_Square_Small_Icon_Pressed**
658
-
659
- ---
660
-
661
- **Tag_Secondary_Square_Large_Icon_Default**
662
-
663
- ---
664
-
665
- **Tag_Secondary_Square_Large_Icon_Hover**
666
-
667
- ---
668
-
669
- **Tag_Secondary_Square_Large_Icon_Pressed**
670
-
671
- ---
672
-
673
- ---
674
-
675
- ### Tag Spacing
676
-
677
- These rules establish how much margin should exist between and around elements.
678
-
679
- **Tag Spacing**
680
-
681
- ---
682
-
683
- ---
684
-
685
- ### Intent Variations
686
-
687
- There are six different intents that Tags can communicate—Beta, Info, Negative, None, Notice, and Positive—indicated with the use of color.
688
-
689
- Each intent is demonstrated below using the default state of the rounded variant for reference. Regardless of variant, the colors used are the same.
690
-
691
- #### Primary
692
-
693
- | Beta | Info | Negative | None | Notice | Positive |
694
- | ---- | ---- | -------- | ---- | ------ | -------- |
695
-
696
- **Tag_Primary_Small_No Icon_Intent_Beta**
697
-
698
- ---
699
-
700
- **Tag_Primary_Small_No Icon_Intent_Info**
701
-
702
- ---
703
-
704
- **Tag_Primary_Small_No Icon_Intent_Negative**
705
-
706
- ---
707
-
708
- **Tag_Primary_Small_No Icon_Intent_None**
709
-
710
- ---
711
-
712
- **Tag_Primary_Small_No Icon_Intent_Notice**
713
-
714
- ---
715
-
716
- **Tag_Primary_Small_No Icon_Intent_Positive**
717
-
718
- ---
719
-
720
- **Tag_Primary_Small_Icon_Intent_Beta**
721
-
722
- ---
723
-
724
- **Tag_Primary_Small_Icon_Intent_Info**
725
-
726
- ---
727
-
728
- **Tag_Primary_Small_Icon_Intent_Negative**
729
-
730
- ---
731
-
732
- **Tag_Primary_Small_Icon_Intent_None**
733
-
734
- ---
735
-
736
- **Tag_Primary_Small_Icon_Intent_Notice**
737
-
738
- ---
739
-
740
- **Tag_Primary_Small_Icon_Intent_Positive**
741
-
742
- ---
743
-
744
- **Tag_Primary_Large_No Icon_Intent_Beta**
745
-
746
- ---
747
-
748
- **Tag_Primary_Large_No Icon_Intent_Info**
749
-
750
- ---
751
-
752
- **Tag_Primary_Large_No Icon_Intent_Negative**
753
-
754
- ---
755
-
756
- **Tag_Primary_Large_No Icon_Intent_None**
757
-
758
- ---
759
-
760
- **Tag_Primary_Large_No Icon_Intent_Notice**
761
-
762
- ---
763
-
764
- **Tag_Primary_Large_No Icon_Intent_Positive**
765
-
766
- ---
767
-
768
- #### Secondary
769
-
770
- | Beta | Info | Negative | None | Notice | Positive |
771
- | ---- | ---- | -------- | ---- | ------ | -------- |
772
-
773
- **Tag_Secondary_Small_No Icon_Intent_Beta**
774
-
775
- ---
776
-
777
- **Tag_Secondary_Small_No Icon_Intent_Info**
778
-
779
- ---
780
-
781
- **Tag_Secondary_Small_No Icon_Intent_Negative**
782
-
783
- ---
784
-
785
- **Tag_Secondary_Small_No Icon_Intent_None**
786
-
787
- ---
788
-
789
- **Tag_Secondary_Small_No Icon_Intent_Notice**
790
-
791
- ---
792
-
793
- **Tag_Secondary_Small_No Icon_Intent_Positive**
794
-
795
- ---
796
-
797
- **Tag_Secondary_Small_Icon_Intent_Beta**
798
-
799
- ---
800
-
801
- **Tag_Secondary_Small_Icon_Intent_Info**
802
-
803
- ---
804
-
805
- **Tag_Secondary_Small_Icon_Intent_Negative**
806
-
807
- ---
808
-
809
- **Tag_Secondary_Small_Icon_Intent_None**
810
-
811
- ---
812
-
813
- **Tag_Secondary_Small_Icon_Intent_Notice**
814
-
815
- ---
816
-
817
- **Tag_Secondary_Small_Icon_Intent_Positive**
818
-
819
- ---
820
-
821
- **Tag_Secondary_Large_No Icon_Intent_Beta**
822
-
823
- ---
824
-
825
- **Tag_Secondary_Large_No Icon_Intent_Info**
826
-
827
- ---
828
-
829
- **Tag_Secondary_Large_No Icon_Intent_Negative**
830
-
831
- ---
832
-
833
- **Tag_Secondary_Large_No Icon_Intent_None**
834
-
835
- ---
836
-
837
- **Tag_Secondary_Large_No Icon_Intent_Notice**
838
-
839
- ---
840
-
841
- **Tag_Secondary_Large_No Icon_Intent_Positive**
842
-
843
- ---
844
-
845
- ---
846
-
847
- ## Filter Tag
848
-
849
- | | In Figma | | | Meets Accessibility | | | In Code |
850
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
851
-
852
- ### Live Instance
853
-
854
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
855
-
856
- Default
857
-
858
- ---
859
-
860
- ### Overview
861
-
862
- 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.
863
-
864
- | Default | Hover | Pressed |
865
- | ------- | ----- | ------- |
866
-
867
- **TagFilter_Default**
868
-
869
- ---
870
-
871
- **TagFilter_Hover**
872
-
873
- ---
874
-
875
- **TagFilter_Pressed**
876
-
877
- ---
878
-
879
- ---
880
-
881
- ### Filter Tag Spacing
882
-
883
- These rules establish how much margin should exist between and around elements.
884
-
885
- **Filter Tag spacing**
886
-
887
- ---
888
-
889
- ## Code
890
-
891
- ## Tag Components
892
-
893
- | 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 |
894
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ---------------------------------- |
895
-
896
- ### Visual Preview
897
-
898
- **Preview_Code_Tag**
899
-
900
- ---
901
-
902
- **Preview_Code_TagFilter**
903
-
904
- ---
905
-
906
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
907
-
908
- ---
909
-
910
- ## Tag
911
-
912
- ### SDS Source Code
913
-
914
- The component's source code in the SDS codebase can be found here.
915
-
916
- ### SDS vs MUI
917
-
918
- 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:
919
-
920
- - **`sdsStyle`\*\***:\*\* This prop allows you specify whether the `Tag` should be `rounded` (default) or `square`.
921
- - **`sdsType`\*\***:\*\* This prop takes values of `primary` (default) or `secondary`.
922
- - **`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.
923
-
924
- ### MUI Documentation
925
-
926
- Documentation for the underlying MUI component can be found here.
927
-
928
- ### Props
929
-
930
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
931
-
932
- | Name | Type | Default | Description |
933
- | ---------- | ------------- | ------------ | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------- | ------------------- | ------------------------- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
934
- | `hover` | `bool` | `-` | If `true`, the component changes color when hovered over. |
935
- | `label` | `string` | `-` | The label of the Tag. |
936
- | `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. |
937
- | `sdsStyle` | `"square"` ` | "rounded"` | `rounded` | The shape of the component. |
938
- | `sdsSize` | `"s" | "l"` | `"s"` | The size of the Tag component. The large-size tag must include an icon. |
939
- | `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: |
940
-
941
- 1. [`label and icon color`, `background color`]
942
- 2. [`label color`, `background color`, `icon color`] |
943
-
944
- | `icon` | `JSX.Element` | `-` | The icon that appears on the leading edge of the component. |
945
-
946
- ### Code examples
947
-
948
- #### **Default Tag**
949
-
950
- This example has the minimum props needed for the `Tag` component.
951
-
952
- **/styles.css**
953
-
954
- ```css
955
- body {
956
- font-size: 13px;
957
- font-weight: 400;
958
- letter-spacing: 0.08px;
959
- line-height: 20px;
960
- text-transform: none;
961
- font-family: "Inter", sans-serif;
962
- }
963
-
964
- h1 {
965
- font-size: 1.5rem;
966
- }
967
-
968
- .app {
969
- padding: 20px;
970
- }
971
- ```
972
-
973
- **tsconfig.json**
974
-
975
- ```json
976
- {
977
- "include": ["./**/*"],
978
- "compilerOptions": {
979
- "strict": true,
980
- "esModuleInterop": true,
981
- "lib": ["dom", "es2015"],
982
- "jsx": "react-jsx"
983
- }
984
- }
985
- ```
986
-
987
- **/App.tsx**
988
-
989
- ```tsx
990
- import { Tag } from "@czi-sds/components";
991
- import "./styles.css";
992
-
993
- function App() {
994
- return (
995
- <div className="app">
996
- <Tag label="Science Design System" />
997
- </div>
998
- );
999
- }
1000
-
1001
- export default App;
1002
- ```
1003
-
1004
- **/index.tsx**
1005
-
1006
- ```tsx
1007
- import React from "react";
1008
- import { createRoot } from "react-dom/client";
1009
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1010
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1011
- import { Theme } from "@czi-sds/components";
1012
- import CssBaseline from "@mui/material/CssBaseline";
1013
- import useMediaQuery from "@mui/material/useMediaQuery";
1014
-
1015
- import App from "./App";
1016
-
1017
- const container = document.getElementById("root");
1018
- const root = createRoot(container!);
1019
-
1020
- const RootApp = () => {
1021
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1022
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1023
-
1024
- return (
1025
- <StyledEngineProvider injectFirst>
1026
- <ThemeProvider theme={theme}>
1027
- <EmotionThemeProvider theme={theme}>
1028
- <CssBaseline />
1029
- <App />
1030
- </EmotionThemeProvider>
1031
- </ThemeProvider>
1032
- </StyledEngineProvider>
1033
- );
1034
- };
1035
-
1036
- root.render(
1037
- <React.StrictMode>
1038
- <RootApp />
1039
- </React.StrictMode>
1040
- );
1041
- ```
1042
-
1043
- **/public/index.html**
1044
-
1045
- ```html
1046
- <!doctype html>
1047
- <html lang="en">
1048
- <head>
1049
- <meta charset="UTF-8" />
1050
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1051
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1052
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1053
- <link
1054
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1055
- rel="stylesheet"
1056
- />
1057
- <link
1058
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1059
- rel="stylesheet"
1060
- />
1061
- </head>
1062
- <body>
1063
- <div id="root"></div>
1064
- </body>
1065
- </html>
1066
- ```
1067
-
1068
- **/package.json**
1069
-
1070
- ```json
1071
- {
1072
- "dependencies": {
1073
- "react": "^18.0.0",
1074
- "react-dom": "^18.0.0",
1075
- "react-scripts": "^4.0.0"
1076
- },
1077
- "devDependencies": {
1078
- "@types/react": "^18.0.0",
1079
- "@types/react-dom": "^18.0.0",
1080
- "typescript": "^4.0.0"
1081
- },
1082
- "main": "/index.tsx"
1083
- }
1084
- ```
1085
-
1086
- ---
1087
-
1088
- #### Tag + Icon
1089
-
1090
- This example displays a rounded warning `Tag` component featuring an SDS icon positioned on the left side.
1091
-
1092
- **/styles.css**
1093
-
1094
- ```css
1095
- body {
1096
- font-size: 13px;
1097
- font-weight: 400;
1098
- letter-spacing: 0.08px;
1099
- line-height: 20px;
1100
- text-transform: none;
1101
- font-family: "Inter", sans-serif;
1102
- }
1103
-
1104
- h1 {
1105
- font-size: 1.5rem;
1106
- }
1107
-
1108
- .app {
1109
- padding: 20px;
1110
- }
1111
- ```
1112
-
1113
- **tsconfig.json**
1114
-
1115
- ```json
1116
- {
1117
- "include": ["./**/*"],
1118
- "compilerOptions": {
1119
- "strict": true,
1120
- "esModuleInterop": true,
1121
- "lib": ["dom", "es2015"],
1122
- "jsx": "react-jsx"
1123
- }
1124
- }
1125
- ```
1126
-
1127
- **/App.tsx**
1128
-
1129
- ```tsx
1130
- import { Icon, Tag } from "@czi-sds/components";
1131
- import "./styles.css";
1132
-
1133
- function App() {
1134
- return (
1135
- <div className="app">
1136
- <Tag
1137
- label="Virus"
1138
- icon={<Icon sdsSize="l" sdsIcon="Virus" />}
1139
- sdsStyle="rounded"
1140
- color="negative"
1141
- sdsSize="l"
1142
- />
1143
- </div>
1144
- );
1145
- }
1146
-
1147
- export default App;
1148
- ```
1149
-
1150
- **/index.tsx**
1151
-
1152
- ```tsx
1153
- import React from "react";
1154
- import { createRoot } from "react-dom/client";
1155
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1156
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1157
- import { Theme } from "@czi-sds/components";
1158
- import CssBaseline from "@mui/material/CssBaseline";
1159
- import useMediaQuery from "@mui/material/useMediaQuery";
1160
-
1161
- import App from "./App";
1162
-
1163
- const container = document.getElementById("root");
1164
- const root = createRoot(container!);
1165
-
1166
- const RootApp = () => {
1167
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1168
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1169
-
1170
- return (
1171
- <StyledEngineProvider injectFirst>
1172
- <ThemeProvider theme={theme}>
1173
- <EmotionThemeProvider theme={theme}>
1174
- <CssBaseline />
1175
- <App />
1176
- </EmotionThemeProvider>
1177
- </ThemeProvider>
1178
- </StyledEngineProvider>
1179
- );
1180
- };
1181
-
1182
- root.render(
1183
- <React.StrictMode>
1184
- <RootApp />
1185
- </React.StrictMode>
1186
- );
1187
- ```
1188
-
1189
- **/public/index.html**
1190
-
1191
- ```html
1192
- <!doctype html>
1193
- <html lang="en">
1194
- <head>
1195
- <meta charset="UTF-8" />
1196
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1197
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1198
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1199
- <link
1200
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1201
- rel="stylesheet"
1202
- />
1203
- <link
1204
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1205
- rel="stylesheet"
1206
- />
1207
- </head>
1208
- <body>
1209
- <div id="root"></div>
1210
- </body>
1211
- </html>
1212
- ```
1213
-
1214
- **/package.json**
1215
-
1216
- ```json
1217
- {
1218
- "dependencies": {
1219
- "react": "^18.0.0",
1220
- "react-dom": "^18.0.0",
1221
- "react-scripts": "^4.0.0"
1222
- },
1223
- "devDependencies": {
1224
- "@types/react": "^18.0.0",
1225
- "@types/react-dom": "^18.0.0",
1226
- "typescript": "^4.0.0"
1227
- },
1228
- "main": "/index.tsx"
1229
- }
1230
- ```
1231
-
1232
- ---
1233
-
1234
- #### Tag with custom colors
1235
-
1236
- This example shows a `Tag` component with customized colors applied to the label, background, and icon for a unique visual presentation.
1237
-
1238
- **/styles.css**
1239
-
1240
- ```css
1241
- body {
1242
- font-size: 13px;
1243
- font-weight: 400;
1244
- letter-spacing: 0.08px;
1245
- line-height: 20px;
1246
- text-transform: none;
1247
- font-family: "Inter", sans-serif;
1248
- }
1249
-
1250
- h1 {
1251
- font-size: 1.5rem;
1252
- }
1253
-
1254
- .app {
1255
- padding: 20px;
1256
- }
1257
- ```
1258
-
1259
- **tsconfig.json**
1260
-
1261
- ```json
1262
- {
1263
- "include": ["./**/*"],
1264
- "compilerOptions": {
1265
- "strict": true,
1266
- "esModuleInterop": true,
1267
- "lib": ["dom", "es2015"],
1268
- "jsx": "react-jsx"
1269
- }
1270
- }
1271
- ```
1272
-
1273
- **/App.tsx**
1274
-
1275
- ```tsx
1276
- import { Icon, Tag } from "@czi-sds/components";
1277
- import "./styles.css";
1278
-
1279
- function App() {
1280
- return (
1281
- <div className="app">
1282
- <Tag
1283
- label="Star"
1284
- icon={<Icon sdsSize="l" sdsIcon="Star" />}
1285
- color={["yellow", "#f23", "orange"]}
1286
- sdsStyle="rounded"
1287
- sdsSize="l"
1288
- />
1289
- </div>
1290
- );
1291
- }
1292
-
1293
- export default App;
1294
- ```
1295
-
1296
- **/index.tsx**
1297
-
1298
- ```tsx
1299
- import React from "react";
1300
- import { createRoot } from "react-dom/client";
1301
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1302
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1303
- import { Theme } from "@czi-sds/components";
1304
- import CssBaseline from "@mui/material/CssBaseline";
1305
- import useMediaQuery from "@mui/material/useMediaQuery";
1306
-
1307
- import App from "./App";
1308
-
1309
- const container = document.getElementById("root");
1310
- const root = createRoot(container!);
1311
-
1312
- const RootApp = () => {
1313
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1314
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1315
-
1316
- return (
1317
- <StyledEngineProvider injectFirst>
1318
- <ThemeProvider theme={theme}>
1319
- <EmotionThemeProvider theme={theme}>
1320
- <CssBaseline />
1321
- <App />
1322
- </EmotionThemeProvider>
1323
- </ThemeProvider>
1324
- </StyledEngineProvider>
1325
- );
1326
- };
1327
-
1328
- root.render(
1329
- <React.StrictMode>
1330
- <RootApp />
1331
- </React.StrictMode>
1332
- );
1333
- ```
1334
-
1335
- **/public/index.html**
1336
-
1337
- ```html
1338
- <!doctype html>
1339
- <html lang="en">
1340
- <head>
1341
- <meta charset="UTF-8" />
1342
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1343
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1344
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1345
- <link
1346
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1347
- rel="stylesheet"
1348
- />
1349
- <link
1350
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1351
- rel="stylesheet"
1352
- />
1353
- </head>
1354
- <body>
1355
- <div id="root"></div>
1356
- </body>
1357
- </html>
1358
- ```
1359
-
1360
- **/package.json**
1361
-
1362
- ```json
1363
- {
1364
- "dependencies": {
1365
- "react": "^18.0.0",
1366
- "react-dom": "^18.0.0",
1367
- "react-scripts": "^4.0.0"
1368
- },
1369
- "devDependencies": {
1370
- "@types/react": "^18.0.0",
1371
- "@types/react-dom": "^18.0.0",
1372
- "typescript": "^4.0.0"
1373
- },
1374
- "main": "/index.tsx"
1375
- }
1376
- ```
1377
-
1378
- ---
1379
-
1380
- ---
1381
-
1382
- ## TagFilter
1383
-
1384
- ### SDS Source Code
1385
-
1386
- The component's source code in the SDS codebase can be found here.
1387
-
1388
- ### SDS vs MUI
1389
-
1390
- 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.
1391
-
1392
- ### MUI Documentation
1393
-
1394
- Documentation for the underlying MUI component can be found here.
1395
-
1396
- ### Props
1397
-
1398
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1399
-
1400
- | Name | Type | Default | Description |
1401
- | ---------- | -------- | ------- | -------------------------------------------------------------------------------------- |
1402
- | `label` | `string` | `-` | The content of the component. |
1403
- | `onDelete` | `func` | `-` | Callback fired when the delete icon is clicked. If set, the delete icon will be shown. |
1404
-
1405
- ### Code examples
1406
-
1407
- #### Default TagFilter
1408
-
1409
- This example has the minimum props needed for the `TagFilter` component.
1410
-
1411
- **/styles.css**
1412
-
1413
- ```css
1414
- body {
1415
- font-size: 13px;
1416
- font-weight: 400;
1417
- letter-spacing: 0.08px;
1418
- line-height: 20px;
1419
- text-transform: none;
1420
- font-family: "Inter", sans-serif;
1421
- }
1422
-
1423
- h1 {
1424
- font-size: 1.5rem;
1425
- }
1426
-
1427
- .app {
1428
- padding: 20px;
1429
- }
1430
- ```
1431
-
1432
- **tsconfig.json**
1433
-
1434
- ```json
1435
- {
1436
- "include": ["./**/*"],
1437
- "compilerOptions": {
1438
- "strict": true,
1439
- "esModuleInterop": true,
1440
- "lib": ["dom", "es2015"],
1441
- "jsx": "react-jsx"
1442
- }
1443
- }
1444
- ```
1445
-
1446
- **/App.tsx**
1447
-
1448
- ```tsx
1449
- import { TagFilter } from "@czi-sds/components";
1450
- import "./styles.css";
1451
-
1452
- function App() {
1453
- return (
1454
- <div className="app">
1455
- <TagFilter label="Science Design System" onDelete={() => {}} />
1456
- </div>
1457
- );
1458
- }
1459
-
1460
- export default App;
1461
- ```
1462
-
1463
- **/index.tsx**
1464
-
1465
- ```tsx
1466
- import React from "react";
1467
- import { createRoot } from "react-dom/client";
1468
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1469
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1470
- import { Theme } from "@czi-sds/components";
1471
- import CssBaseline from "@mui/material/CssBaseline";
1472
- import useMediaQuery from "@mui/material/useMediaQuery";
1473
-
1474
- import App from "./App";
1475
-
1476
- const container = document.getElementById("root");
1477
- const root = createRoot(container!);
1478
-
1479
- const RootApp = () => {
1480
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1481
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1482
-
1483
- return (
1484
- <StyledEngineProvider injectFirst>
1485
- <ThemeProvider theme={theme}>
1486
- <EmotionThemeProvider theme={theme}>
1487
- <CssBaseline />
1488
- <App />
1489
- </EmotionThemeProvider>
1490
- </ThemeProvider>
1491
- </StyledEngineProvider>
1492
- );
1493
- };
1494
-
1495
- root.render(
1496
- <React.StrictMode>
1497
- <RootApp />
1498
- </React.StrictMode>
1499
- );
1500
- ```
1501
-
1502
- **/public/index.html**
1503
-
1504
- ```html
1505
- <!doctype html>
1506
- <html lang="en">
1507
- <head>
1508
- <meta charset="UTF-8" />
1509
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1510
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1511
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1512
- <link
1513
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1514
- rel="stylesheet"
1515
- />
1516
- <link
1517
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1518
- rel="stylesheet"
1519
- />
1520
- </head>
1521
- <body>
1522
- <div id="root"></div>
1523
- </body>
1524
- </html>
1525
- ```
1526
-
1527
- **/package.json**
1528
-
1529
- ```json
1530
- {
1531
- "dependencies": {
1532
- "react": "^18.0.0",
1533
- "react-dom": "^18.0.0",
1534
- "react-scripts": "^4.0.0"
1535
- },
1536
- "devDependencies": {
1537
- "@types/react": "^18.0.0",
1538
- "@types/react-dom": "^18.0.0",
1539
- "typescript": "^4.0.0"
1540
- },
1541
- "main": "/index.tsx"
1542
- }
1543
- ```
1544
-
1545
- ---