@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,1111 +0,0 @@
1
- # Filters
2
-
3
- Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
4
-
5
- ## Overview
6
-
7
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
8
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
9
-
10
- Filters are comprised of a Dropdown Input which serves as a clickable Filter label combined with a Dropdown Menu to show the Filter Input options when the Filter Label is active, and Tags to display which options are currently being filtered on. The Dropdown Menu activated when the Filter Label is clicked displays the Filter Input options available.
11
-
12
- Users can filter using any combination of Filter options presented to them—see the Filtering Logic section below for an overview of how applied Filters affect the dataset being filtered on.
13
-
14
- | **Closed** | **Open** | **Active** |
15
- | ---------- | -------- | ---------- |
16
-
17
- **Filter_Closed**
18
-
19
- ---
20
-
21
- **Filter_Open**
22
-
23
- ---
24
-
25
- **Filter_Active**
26
-
27
- ---
28
-
29
- ### Filter Variants
30
-
31
- **Default**
32
-
33
- ---
34
-
35
- ---
36
-
37
- **Default + Search**
38
-
39
- ---
40
-
41
- ### Filter Example
42
-
43
- The example below shows Filters being used as part of the plugin search on napari hub.
44
-
45
- **Filter_Example**
46
-
47
- ---
48
-
49
- ---
50
-
51
- ### Filter Spacing
52
-
53
- These rules establish how much margin should exist between and around elements. Follow spacing rules for Dropdown Menus for spacing guidance for the Filter Input.
54
-
55
- **Filter_Spacing**
56
-
57
- ---
58
-
59
- ---
60
-
61
- ## Filtering Logic
62
-
63
- Filtering logic is handled at the product level; however, this section offers some suggestions for best practices to consider when establishing filtering logic.
64
-
65
- **Between filter categories: use "AND"**
66
-
67
- ---
68
-
69
- **Within filter categories: use "OR"**
70
-
71
- ---
72
-
73
- ## Code
74
-
75
- ## Filter Components
76
-
77
- | Below you will find an interactive Storybook iframe for Filters. 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:** FilterComplex |
78
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ------------------------------------ |
79
-
80
- ---
81
-
82
- > 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.
83
-
84
- ### FilterComplex
85
-
86
- Note: the Filter component used in napari hub + .org is using the FilterComplex component from the SDS codebase.
87
-
88
- Storybook
89
-
90
- ---
91
-
92
- Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
93
-
94
- ## Overview
95
-
96
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
97
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
98
-
99
- Filters are comprised of a Dropdown Input which serves as a clickable Filter label combined with a Dropdown Menu to show the Filter Input options when the Filter Label is active, and Filter Tags to display which options are currently being filtered on.
100
-
101
- The Dropdown Menu that is activated when the Filter Label is clicked displays the Filter Input options available and, depending on the needs of the dataset, can be Single-select (Radio Lockup), Multi-select (Checkbox Lockup), or a Range (Slider). Users can filter using any combination of Filter options presented to them—see the Filtering Logic section below for an overview of how applied Filters affect the dataset being filtered on.
102
-
103
- | **Closed** | **Open** | **Active** |
104
- | ---------- | -------- | ---------- |
105
-
106
- **Complex Filter_Closed**
107
-
108
- ---
109
-
110
- **Complex Filter_Open**
111
-
112
- ---
113
-
114
- **Complex Filter_Active**
115
-
116
- ---
117
-
118
- ### Filter Variants
119
-
120
- **Single-select**
121
-
122
- ---
123
-
124
- ---
125
-
126
- **Single-select + Search**
127
-
128
- ---
129
-
130
- ---
131
-
132
- **Multi-select**
133
-
134
- ---
135
-
136
- ---
137
-
138
- **Multi-select + Search**
139
-
140
- ---
141
-
142
- ### Filter Example
143
-
144
- The example below shows Complex Filters being used as part of a Basic Panel in CZ GEN EPI.
145
-
146
- **Complex Filter_Example**
147
-
148
- ---
149
-
150
- ---
151
-
152
- ### Filter Spacing
153
-
154
- These rules establish how much margin should exist between and around elements. Follow spacing rules for Dropdown Menus for spacing guidance for the Complex Filter Input.
155
-
156
- **Complex Filter_Spacing**
157
-
158
- ---
159
-
160
- ---
161
-
162
- ## Filtering Logic
163
-
164
- Filtering logic is handled at the product level, however, this section offers some suggestions for best practices to consider when establishing filtering logic.
165
-
166
- **Between filter categories: use "AND"**
167
-
168
- ---
169
-
170
- ---
171
-
172
- **Within filter categories: use "OR"**
173
-
174
- ---
175
-
176
- ## Code
177
-
178
- ## Filter Components
179
-
180
- | Below you will find an interactive Storybook iframe for Filters. 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:** FilterComplex |
181
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ------------------------------------ |
182
-
183
- ---
184
-
185
- > This component appears as it is 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.
186
-
187
- ### FilterComplex
188
-
189
- Storybook
190
-
191
- ---
192
-
193
- Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
194
-
195
- ## Overview
196
-
197
- ## Filter Variants
198
-
199
- | Filters come in two different variants for designers to use depending on the filtering needs of the dataset the filter applies to. Simple Filters are used when the dataset has few filter options and there is space within the layout to fit them all, whereas Complex Filters are used when there are multiple filters needed to fit into one layout, necessitating a more compact design. Follow the usage criteria accompanying each variant as a guide for selecting the correct Filter for any given use case. | | **Jump to variant:** Simple Complex Filtering Logic |
200
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------- |
201
-
202
- ---
203
-
204
- ## Simple Filter
205
-
206
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
207
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
208
-
209
- Use the Simple Filter when there are only a few options to filter on or there are only a few filter categories needed for a given dataset. Simple Filters are comprised of a Filter Label combined with a Filter Input that is Single-select (Radio Lockup), Multi-select (Checkbox Lockup), or a Range (Slider) depending on the filtering needs of the dataset. In contrast to Complex Filters which keep filter options contained within a Dropdown Menu, Simple Filters have all of the options for each filter exposed in the UI and viewable by the user. Users can filter using any combination of Filter options presented to them—see the Filtering Logic section below for an overview of how applied Filters affect the dataset being filtered.
210
-
211
- **Single-select**
212
-
213
- ---
214
-
215
- ---
216
-
217
- **Multi-select**
218
-
219
- ---
220
-
221
- ---
222
-
223
- **Range**
224
-
225
- ---
226
-
227
- ### Simple Filter Example
228
-
229
- The example below shows Simple Filters being used as part of a Basic Panel in CZ ID.
230
-
231
- **Simple Filter_Example**
232
-
233
- ---
234
-
235
- ---
236
-
237
- ### Simple Filter Spacing
238
-
239
- These rules establish how much margin should exist between and around elements.
240
-
241
- **Simple Filter Spacing**
242
-
243
- ---
244
-
245
- ---
246
-
247
- ## Complex Filter
248
-
249
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
250
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
251
-
252
- Use the Complex Filter when there are multiple filters needed to fit into one layout, necessitating a more compact design than a Simple Filter would allow for. Complex Filters are comprised of a Dropdown Input which serves as a clickable Filter Label combined with a Dropdown Menu to show the Filter Input options when the Filter Label is active, and Filter Tags to display which options are currently being filtered on.
253
-
254
- The Dropdown Menu that is activated when the Filter Label is clicked displays the Filter Input options available and, depending on the needs of the dataset, can be Single-select (Radio Lockup), Multi-select (Checkbox Lockup), or a Range (Slider). Users can filter using any combination of Filter options presented to them—see the Filtering Logic section below for an overview of how applied Filters affect the dataset being filtered on.
255
-
256
- | **Closed** | **Open** | **Active** |
257
- | ---------- | -------- | ---------- |
258
-
259
- **Complex Filter_Closed**
260
-
261
- ---
262
-
263
- **Complex Filter_Open**
264
-
265
- ---
266
-
267
- **Complex Filter_Active**
268
-
269
- ---
270
-
271
- ### Complex Filter Variants
272
-
273
- **Single-select**
274
-
275
- ---
276
-
277
- ---
278
-
279
- **Single-select + Search**
280
-
281
- ---
282
-
283
- ---
284
-
285
- **Multi-select**
286
-
287
- ---
288
-
289
- ---
290
-
291
- **Multi-select + Search**
292
-
293
- ---
294
-
295
- ---
296
-
297
- **Range**
298
-
299
- ---
300
-
301
- ### Complex Filter Example
302
-
303
- The example below shows Complex Filters being used as part of a Basic Panel in CZ ID.
304
-
305
- **Complex Filter_Example**
306
-
307
- ---
308
-
309
- ---
310
-
311
- ### Complex Filter Spacing
312
-
313
- These rules establish how much margin should exist between and around elements. Follow spacing rules for Dropdown Menus for spacing guidance for the Complex Filter Input.
314
-
315
- **Complex Filter_Spacing**
316
-
317
- ---
318
-
319
- ---
320
-
321
- ## Filtering Logic
322
-
323
- Filtering logic is handled at the product level, however, this section offers some suggestions for best practices to consider when establishing filtering logic.
324
-
325
- **Between filter categories: use “AND”**
326
-
327
- ---
328
-
329
- ---
330
-
331
- **Within filter category: use “OR”**
332
-
333
- ---
334
-
335
- ## Code
336
-
337
- ## Filter Components
338
-
339
- | Below you will find an interactive Storybook iframe for Panels. 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:** FilterSimple FilterComplex |
340
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------- |
341
-
342
- ---
343
-
344
- ### FilterSimple (coming soon)
345
-
346
- ---
347
-
348
- ### FilterComplex
349
-
350
- Storybook
351
-
352
- ---
353
-
354
- Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
355
-
356
- ## Guidelines
357
-
358
- ## Filter Components
359
-
360
- | There are two Filter components available to use depending on the filtering needs of the dataset. Simple Filter is used when the dataset has few filters and there is space within the layout to fit them all, whereas Complex Filter is used when there are many filters needed to fit into one layout, necessitating a more compact design. | | **Jump to component:** Simple Filter Complex Filter |
361
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------- |
362
-
363
- ### Visual Preview
364
-
365
- **Preview_Guidelines_Filter_Simple**
366
-
367
- ---
368
-
369
- **Preview_Guidelines_Filter_Complex**
370
-
371
- ---
372
-
373
- ---
374
-
375
- ## Simple Filter
376
-
377
- | | In Figma | | | Meets Accessibility | | | In Code |
378
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
379
-
380
- ### Live Instance
381
-
382
- > **Note:** Live instance for Simple Filter will be added soon.
383
-
384
- ---
385
-
386
- ### Overview
387
-
388
- Use Simple Filter when there are only a few filter categories or a few options per category needed for a given dataset. Simple Filter is comprised of a label combined with an input that is Single-select (Radio Input), Multi-select (Checkbox Input), or a Range (Slider) depending on the filtering needs of the dataset. It has all of the options for each filter exposed in the UI and viewable by the user. Users can filter using any combination of Filter options presented to them—see the Filtering Logic section below for an overview of how applied Filters affect the dataset being filtered.
389
-
390
- | Single-select | Multi-select | Range |
391
- | ------------- | ------------ | ----- |
392
-
393
- **Simple Filter_Single-select**
394
-
395
- ---
396
-
397
- **Simple Filter_Multi-select**
398
-
399
- ---
400
-
401
- **Simple Filter_Range**
402
-
403
- ---
404
-
405
- ---
406
-
407
- ### Simple Filter example
408
-
409
- The example below shows Simple Filters being used as part of a Basic Panel (documentation to come) in CZ ID.
410
-
411
- **Simple Filter_Example**
412
-
413
- ---
414
-
415
- ---
416
-
417
- ### Simple Filter Spacing
418
-
419
- These rules establish how much margin should exist between and around elements.
420
-
421
- **Simple Filter Spacing**
422
-
423
- ---
424
-
425
- ---
426
-
427
- ## Complex Filter
428
-
429
- | | In Figma | | | Meets Accessibility | | | In Code |
430
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
431
-
432
- ### Live Instance
433
-
434
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
435
-
436
- Default
437
-
438
- ---
439
-
440
- ### Overview
441
-
442
- Use Complex Filter when there are many filters needed to fit into one layout, necessitating a more compact design than Simple Filter allows for. Complex Filter is comprised of a Dropdown Input, which serves as a trigger, combined with a Dropdown Menu which displays the available filter options. After the user selects a filter option, Filter Tags are added below the Dropdown Input to display the active filter selections.
443
-
444
- The Dropdown Menu triggered when the Dropdown Input is clicked can be Single-select, Multi-select, or a Range (Slider) depending on the needs of the dataset. Users can filter using any combination of Filter options presented to them—see the Filtering Logic section below for an overview of how applied Filters affect the dataset being filtered on.
445
-
446
- | Single-select | Single-select + Search | Multi-select | Multi-select + Search | Range |
447
- | ------------- | ---------------------- | ------------ | --------------------- | ----- |
448
-
449
- **Complex Filter_Input_Single-select**
450
-
451
- ---
452
-
453
- **Complex Filter_Input_Single-select + Search**
454
-
455
- ---
456
-
457
- **Complex Filter_Input_Multi-select**
458
-
459
- ---
460
-
461
- **Complex Filter_Input_Multi-select + Search**
462
-
463
- ---
464
-
465
- **Complex Filter_Input_Range**
466
-
467
- ---
468
-
469
- #### **Complex Filter states**
470
-
471
- | Closed | Open | Active |
472
- | ------ | ---- | ------ |
473
-
474
- **Complex Filter_Closed**
475
-
476
- ---
477
-
478
- **Complex Filter_Open**
479
-
480
- ---
481
-
482
- **Complex Filter_Active**
483
-
484
- ---
485
-
486
- ---
487
-
488
- ### Complex Filter example
489
-
490
- The example below shows Complex Filters being used as part of a Basic Panel (documentation to come) in CZ ID.
491
-
492
- **Complex Filter_Example**
493
-
494
- ---
495
-
496
- ---
497
-
498
- ### Complex Filter Spacing
499
-
500
- These rules establish how much margin should exist between and around elements. Follow spacing rules for Dropdown Menus for spacing guidance for the Complex Filter Input.
501
-
502
- **Complex Filter_Spacing**
503
-
504
- ---
505
-
506
- ---
507
-
508
- ### Filtering Logic
509
-
510
- Filtering logic is handled at the product level, however, this section offers some suggestions for best practices to consider when establishing filtering logic.
511
-
512
- **Between filter categories: use "AND"**
513
-
514
- ---
515
-
516
- **Within filter categories: use "OR"**
517
-
518
- ---
519
-
520
- ## Code
521
-
522
- ## Filter Components
523
-
524
- | There are two `Filter` components available to use depending on the filtering needs of the dataset. `SimpleFilter` is used when the dataset has few filters and there is space within the layout to fit them all, whereas `ComplexFilter` is used when there are many filters needed to fit into one layout, necessitating a more compact design. | | **Jump to component:** SimpleFilter ComplexFilter |
525
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------- |
526
-
527
- ### Visual Preview
528
-
529
- **Preview_Code_Filter_Simple**
530
-
531
- ---
532
-
533
- **Preview_Code_Filter_Complex**
534
-
535
- ---
536
-
537
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
538
-
539
- ---
540
-
541
- ## SimpleFilter
542
-
543
- > **Note:** Code details for `SimpleFilter` will be added soon.
544
-
545
- ---
546
-
547
- ## ComplexFilter
548
-
549
- ### SDS Source Code
550
-
551
- The component's source code in the SDS codebase can be found here.
552
-
553
- ### SDS vs MUI
554
-
555
- The `ComplexFilter` is not directly based on any MUI component, but it does use the SDS `Dropdown` component, which in turn is ultimately based on MUI's `Autocomplete` component. As such, props that are available to either SDS's `Dropdown` and / or MUI's `Autocomplete` can be passed to `ComplexFilter` as such:
556
-
557
- - **`DropdownMenuProps`\*\***:\*\* use this prop to pass MUI`Autocomplete`-specific props to `ComplexFilter`
558
- - **`InputDropdownProps`\*\***:\*\* use this prop to pass SDS `InputDropdown`-specific props to `ComplexFilter`
559
-
560
- ### Props
561
-
562
- Any custom SDS props and MUI props required for implementation are found in the table below. See the MUI documentation for additional optional props.
563
-
564
- | Name | Type | Default | Description |
565
- | ------------------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
566
- | `isTriggerChangeOnOptionClick` | `bool` | `false` | Determines whether changes are triggered in real-time upon clicking an option |
567
- | `keepSearchOnSelect` | `bool` | | Maintains a search input when a user selects an option (only if multiple selections are allowed via the `multiple` prop; otherwise the dropdown closes upon selection) |
568
- | `label` | `string` | `""` | Sets the label of filter, shown both when closed and open |
569
- | `multiple` | `bool` | `false` | Defines whether multiple selections or can be made from the filter simultaneously or only one |
570
- | `onChange` | `func` | `-` | Function to set what happens when a new value is set via the filter |
571
- | `search` | `bool` | `false` | Provides a search bar at the top of the filter from which users can narrow the list of menu items |
572
-
573
- ### Code Examples
574
-
575
- #### Default ComplexFilter
576
-
577
- This examples demonstrates the minimum props needed to render a `ComplexFilter`.
578
-
579
- **/styles.css**
580
-
581
- ```css
582
- body {
583
- font-size: 13px;
584
- font-weight: 400;
585
- letter-spacing: 0.08px;
586
- line-height: 20px;
587
- text-transform: none;
588
- font-family: "Inter", sans-serif;
589
- }
590
-
591
- h1 {
592
- font-size: 1.5rem;
593
- }
594
-
595
- .app {
596
- padding: 20px;
597
- }
598
- ```
599
-
600
- **tsconfig.json**
601
-
602
- ```json
603
- {
604
- "include": ["./**/*"],
605
- "compilerOptions": {
606
- "strict": true,
607
- "esModuleInterop": true,
608
- "lib": ["dom", "es2015"],
609
- "jsx": "react-jsx"
610
- }
611
- }
612
- ```
613
-
614
- **/App.tsx**
615
-
616
- ```tsx
617
- import { ComplexFilter, DefaultDropdownMenuOption } from "@czi-sds/components";
618
- import "./styles.css";
619
-
620
- const MENU_ITEMS: DefaultDropdownMenuOption[] = [
621
- {
622
- name: "Fruit: Apple",
623
- section: "Fruit",
624
- count: 10,
625
- },
626
- {
627
- name: "Fruit: Cherry",
628
- section: "Fruit",
629
- count: 150,
630
- },
631
- {
632
- name: "Fruit: Orange",
633
- section: "Fruit",
634
- count: 15,
635
- },
636
- {
637
- name: "Vegetable: Carrot",
638
- section: "Vegetable",
639
- count: 34,
640
- },
641
- {
642
- name: "Vegetable: Kale",
643
- section: "Vegetable",
644
- },
645
- {
646
- name: "Vegetable: Lettuce",
647
- section: "Vegetable",
648
- },
649
- ];
650
-
651
- function App() {
652
- return (
653
- <div className="app">
654
- <ComplexFilter
655
- label="Filter Label"
656
- onChange={() => {}}
657
- options={MENU_ITEMS}
658
- />
659
- </div>
660
- );
661
- }
662
-
663
- export default App;
664
- ```
665
-
666
- **/index.tsx**
667
-
668
- ```tsx
669
- import React from "react";
670
- import { createRoot } from "react-dom/client";
671
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
672
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
673
- import { Theme } from "@czi-sds/components";
674
- import CssBaseline from "@mui/material/CssBaseline";
675
- import useMediaQuery from "@mui/material/useMediaQuery";
676
-
677
- import App from "./App";
678
-
679
- const container = document.getElementById("root");
680
- const root = createRoot(container!);
681
-
682
- const RootApp = () => {
683
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
684
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
685
-
686
- return (
687
- <StyledEngineProvider injectFirst>
688
- <ThemeProvider theme={theme}>
689
- <EmotionThemeProvider theme={theme}>
690
- <CssBaseline />
691
- <App />
692
- </EmotionThemeProvider>
693
- </ThemeProvider>
694
- </StyledEngineProvider>
695
- );
696
- };
697
-
698
- root.render(
699
- <React.StrictMode>
700
- <RootApp />
701
- </React.StrictMode>
702
- );
703
- ```
704
-
705
- **/public/index.html**
706
-
707
- ```html
708
- <!doctype html>
709
- <html lang="en">
710
- <head>
711
- <meta charset="UTF-8" />
712
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
713
- <link rel="preconnect" href="https://fonts.googleapis.com" />
714
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
715
- <link
716
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
717
- rel="stylesheet"
718
- />
719
- <link
720
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
721
- rel="stylesheet"
722
- />
723
- </head>
724
- <body>
725
- <div id="root"></div>
726
- </body>
727
- </html>
728
- ```
729
-
730
- **/package.json**
731
-
732
- ```json
733
- {
734
- "dependencies": {
735
- "react": "^18.0.0",
736
- "react-dom": "^18.0.0",
737
- "react-scripts": "^4.0.0"
738
- },
739
- "devDependencies": {
740
- "@types/react": "^18.0.0",
741
- "@types/react-dom": "^18.0.0",
742
- "typescript": "^4.0.0"
743
- },
744
- "main": "/index.tsx"
745
- }
746
- ```
747
-
748
- ---
749
-
750
- #### Multi select ComplexFilter with Search
751
-
752
- This example showcases a `ComplexFilter` component featuring `InputSearch` for filtering menu items. Users have the flexibility to select multiple options to refine their selections.
753
-
754
- **/styles.css**
755
-
756
- ```css
757
- body {
758
- font-size: 13px;
759
- font-weight: 400;
760
- letter-spacing: 0.08px;
761
- line-height: 20px;
762
- text-transform: none;
763
- font-family: "Inter", sans-serif;
764
- }
765
-
766
- h1 {
767
- font-size: 1.5rem;
768
- }
769
-
770
- .app {
771
- padding: 20px;
772
- }
773
- ```
774
-
775
- **tsconfig.json**
776
-
777
- ```json
778
- {
779
- "include": ["./**/*"],
780
- "compilerOptions": {
781
- "strict": true,
782
- "esModuleInterop": true,
783
- "lib": ["dom", "es2015"],
784
- "jsx": "react-jsx"
785
- }
786
- }
787
- ```
788
-
789
- **/App.tsx**
790
-
791
- ```tsx
792
- import { ComplexFilter, DefaultDropdownMenuOption } from "@czi-sds/components";
793
- import "./styles.css";
794
-
795
- const MENU_ITEMS: DefaultDropdownMenuOption[] = [
796
- {
797
- name: "Fruit: Apple",
798
- section: "Fruit",
799
- count: 10,
800
- },
801
- {
802
- name: "Fruit: Cherry",
803
- section: "Fruit",
804
- count: 150,
805
- },
806
- {
807
- name: "Fruit: Orange",
808
- section: "Fruit",
809
- count: 15,
810
- },
811
- {
812
- name: "Vegetable: Carrot",
813
- section: "Vegetable",
814
- count: 34,
815
- },
816
- {
817
- name: "Vegetable: Kale",
818
- section: "Vegetable",
819
- },
820
- {
821
- name: "Vegetable: Lettuce",
822
- section: "Vegetable",
823
- },
824
- ];
825
-
826
- function App() {
827
- return (
828
- <div className="app">
829
- <ComplexFilter
830
- label="Filter Label"
831
- onChange={() => {}}
832
- options={MENU_ITEMS}
833
- DropdownMenuProps={{
834
- groupBy: (option: DefaultDropdownMenuOption) =>
835
- option.section as string,
836
- }}
837
- multiple
838
- search
839
- />
840
- </div>
841
- );
842
- }
843
-
844
- export default App;
845
- ```
846
-
847
- **/index.tsx**
848
-
849
- ```tsx
850
- import React from "react";
851
- import { createRoot } from "react-dom/client";
852
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
853
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
854
- import { Theme } from "@czi-sds/components";
855
- import CssBaseline from "@mui/material/CssBaseline";
856
- import useMediaQuery from "@mui/material/useMediaQuery";
857
-
858
- import App from "./App";
859
-
860
- const container = document.getElementById("root");
861
- const root = createRoot(container!);
862
-
863
- const RootApp = () => {
864
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
865
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
866
-
867
- return (
868
- <StyledEngineProvider injectFirst>
869
- <ThemeProvider theme={theme}>
870
- <EmotionThemeProvider theme={theme}>
871
- <CssBaseline />
872
- <App />
873
- </EmotionThemeProvider>
874
- </ThemeProvider>
875
- </StyledEngineProvider>
876
- );
877
- };
878
-
879
- root.render(
880
- <React.StrictMode>
881
- <RootApp />
882
- </React.StrictMode>
883
- );
884
- ```
885
-
886
- **/public/index.html**
887
-
888
- ```html
889
- <!doctype html>
890
- <html lang="en">
891
- <head>
892
- <meta charset="UTF-8" />
893
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
894
- <link rel="preconnect" href="https://fonts.googleapis.com" />
895
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
896
- <link
897
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
898
- rel="stylesheet"
899
- />
900
- <link
901
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
902
- rel="stylesheet"
903
- />
904
- </head>
905
- <body>
906
- <div id="root"></div>
907
- </body>
908
- </html>
909
- ```
910
-
911
- **/package.json**
912
-
913
- ```json
914
- {
915
- "dependencies": {
916
- "react": "^18.0.0",
917
- "react-dom": "^18.0.0",
918
- "react-scripts": "^4.0.0"
919
- },
920
- "devDependencies": {
921
- "@types/react": "^18.0.0",
922
- "@types/react-dom": "^18.0.0",
923
- "typescript": "^4.0.0"
924
- },
925
- "main": "/index.tsx"
926
- }
927
- ```
928
-
929
- ---
930
-
931
- #### ComplexFilter with realtime selection changes
932
-
933
- This example showcases the functionality that enables the dropdown selections to be instantly reflected in the tags in real-time. This is achieved by utilizing the `isTriggerChangeOnOptionClick` prop.
934
-
935
- **/styles.css**
936
-
937
- ```css
938
- body {
939
- font-size: 13px;
940
- font-weight: 400;
941
- letter-spacing: 0.08px;
942
- line-height: 20px;
943
- text-transform: none;
944
- font-family: "Inter", sans-serif;
945
- }
946
-
947
- h1 {
948
- font-size: 1.5rem;
949
- }
950
-
951
- .app {
952
- padding: 20px;
953
- }
954
- ```
955
-
956
- **tsconfig.json**
957
-
958
- ```json
959
- {
960
- "include": ["./**/*"],
961
- "compilerOptions": {
962
- "strict": true,
963
- "esModuleInterop": true,
964
- "lib": ["dom", "es2015"],
965
- "jsx": "react-jsx"
966
- }
967
- }
968
- ```
969
-
970
- **/App.tsx**
971
-
972
- ```tsx
973
- import { ComplexFilter, DefaultDropdownMenuOption } from "@czi-sds/components";
974
- import "./styles.css";
975
-
976
- const MENU_ITEMS: DefaultDropdownMenuOption[] = [
977
- {
978
- name: "Fruit: Apple",
979
- section: "Fruit",
980
- count: 10,
981
- },
982
- {
983
- name: "Fruit: Cherry",
984
- section: "Fruit",
985
- count: 150,
986
- },
987
- {
988
- name: "Fruit: Orange",
989
- section: "Fruit",
990
- count: 15,
991
- },
992
- {
993
- name: "Vegetable: Carrot",
994
- section: "Vegetable",
995
- count: 34,
996
- },
997
- {
998
- name: "Vegetable: Kale",
999
- section: "Vegetable",
1000
- },
1001
- {
1002
- name: "Vegetable: Lettuce",
1003
- section: "Vegetable",
1004
- },
1005
- ];
1006
-
1007
- function App() {
1008
- return (
1009
- <div className="app">
1010
- <ComplexFilter
1011
- label="Filter Label"
1012
- onChange={() => {}}
1013
- options={MENU_ITEMS}
1014
- DropdownMenuProps={{
1015
- groupBy: (option: DefaultDropdownMenuOption) =>
1016
- option.section as string,
1017
- }}
1018
- multiple
1019
- search
1020
- isTriggerChangeOnOptionClick
1021
- />
1022
- </div>
1023
- );
1024
- }
1025
-
1026
- export default App;
1027
- ```
1028
-
1029
- **/index.tsx**
1030
-
1031
- ```tsx
1032
- import React from "react";
1033
- import { createRoot } from "react-dom/client";
1034
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1035
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1036
- import { Theme } from "@czi-sds/components";
1037
- import CssBaseline from "@mui/material/CssBaseline";
1038
- import useMediaQuery from "@mui/material/useMediaQuery";
1039
-
1040
- import App from "./App";
1041
-
1042
- const container = document.getElementById("root");
1043
- const root = createRoot(container!);
1044
-
1045
- const RootApp = () => {
1046
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1047
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1048
-
1049
- return (
1050
- <StyledEngineProvider injectFirst>
1051
- <ThemeProvider theme={theme}>
1052
- <EmotionThemeProvider theme={theme}>
1053
- <CssBaseline />
1054
- <App />
1055
- </EmotionThemeProvider>
1056
- </ThemeProvider>
1057
- </StyledEngineProvider>
1058
- );
1059
- };
1060
-
1061
- root.render(
1062
- <React.StrictMode>
1063
- <RootApp />
1064
- </React.StrictMode>
1065
- );
1066
- ```
1067
-
1068
- **/public/index.html**
1069
-
1070
- ```html
1071
- <!doctype html>
1072
- <html lang="en">
1073
- <head>
1074
- <meta charset="UTF-8" />
1075
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1076
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1077
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1078
- <link
1079
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1080
- rel="stylesheet"
1081
- />
1082
- <link
1083
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1084
- rel="stylesheet"
1085
- />
1086
- </head>
1087
- <body>
1088
- <div id="root"></div>
1089
- </body>
1090
- </html>
1091
- ```
1092
-
1093
- **/package.json**
1094
-
1095
- ```json
1096
- {
1097
- "dependencies": {
1098
- "react": "^18.0.0",
1099
- "react-dom": "^18.0.0",
1100
- "react-scripts": "^4.0.0"
1101
- },
1102
- "devDependencies": {
1103
- "@types/react": "^18.0.0",
1104
- "@types/react-dom": "^18.0.0",
1105
- "typescript": "^4.0.0"
1106
- },
1107
- "main": "/index.tsx"
1108
- }
1109
- ```
1110
-
1111
- ---