@czi-sds/mcp 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/data/component-props/Accordion.json +14 -15
  2. package/data/component-props/Alert.json +2 -44
  3. package/data/component-props/Autocomplete.json +14 -32
  4. package/data/component-props/Banner.json +11 -12
  5. package/data/component-props/Button.json +17 -82
  6. package/data/component-props/ButtonDropdown.json +26 -0
  7. package/data/component-props/ButtonIcon.json +4 -60
  8. package/data/component-props/ButtonToggle.json +2 -66
  9. package/data/component-props/Callout.json +11 -65
  10. package/data/component-props/CellBasic.json +28 -56
  11. package/data/component-props/CellComponent.json +4 -32
  12. package/data/component-props/CellHeader.json +13 -49
  13. package/data/component-props/ComplexFilter.json +24 -4
  14. package/data/component-props/ContentCard.json +66 -2
  15. package/data/component-props/Dialog.json +26 -0
  16. package/data/component-props/Dropdown.json +29 -67
  17. package/data/component-props/DropdownMenu.json +16 -56
  18. package/data/component-props/HeatmapChart.json +6 -87
  19. package/data/component-props/Icon.json +3 -8
  20. package/data/component-props/InputCheckbox.json +5 -53
  21. package/data/component-props/InputDropdown.json +11 -33
  22. package/data/component-props/InputRadio.json +5 -53
  23. package/data/component-props/InputSearch.json +6 -70
  24. package/data/component-props/InputSlider.json +21 -35
  25. package/data/component-props/InputText.json +7 -63
  26. package/data/component-props/InputToggle.json +5 -54
  27. package/data/component-props/Link.json +18 -0
  28. package/data/component-props/LoadingIndicator.json +1 -2
  29. package/data/component-props/MenuItem.json +11 -41
  30. package/data/component-props/MenuSelect.json +4 -67
  31. package/data/component-props/NavigationFooter.json +0 -8
  32. package/data/component-props/NavigationHeader.json +14 -65
  33. package/data/component-props/NavigationJumpTo.json +0 -40
  34. package/data/component-props/Notification.json +14 -58
  35. package/data/component-props/Pagination.json +8 -33
  36. package/data/component-props/Panel.json +4 -54
  37. package/data/component-props/SegmentedControl.json +0 -55
  38. package/data/component-props/TableRow.json +10 -38
  39. package/data/component-props/Tabs.json +18 -0
  40. package/data/component-props/Tag.json +10 -56
  41. package/data/component-props/TagFilter.json +0 -47
  42. package/data/component-props/Tooltip.json +12 -61
  43. package/data/component-props/TooltipCondensed.json +18 -0
  44. package/data/component-props/TooltipTable.json +0 -4
  45. package/data/zeroheight-cache.json +5195 -0
  46. package/data/zeroheight-exports/Accordion.md +717 -0
  47. package/data/zeroheight-exports/Banner.md +599 -0
  48. package/data/zeroheight-exports/Borders.md +117 -0
  49. package/data/zeroheight-exports/Buttons.md +2305 -0
  50. package/data/zeroheight-exports/Callout.md +778 -0
  51. package/data/zeroheight-exports/Colors.md +632 -0
  52. package/data/zeroheight-exports/Content-Card.md +161 -0
  53. package/data/zeroheight-exports/Contributing-to-SDS.md +98 -0
  54. package/data/zeroheight-exports/Control-Inputs.md +2121 -0
  55. package/data/zeroheight-exports/Corners.md +111 -0
  56. package/data/zeroheight-exports/Cover-page.md +3 -0
  57. package/data/zeroheight-exports/Dialog.md +1191 -0
  58. package/data/zeroheight-exports/Downloads.md +120 -0
  59. package/data/zeroheight-exports/Drop-Shadows.md +79 -0
  60. package/data/zeroheight-exports/Dropdown-Input.md +1180 -0
  61. package/data/zeroheight-exports/Dropdown-Menu.md +3883 -0
  62. package/data/zeroheight-exports/Element-Status-Tracker.md +267 -0
  63. package/data/zeroheight-exports/Field-Inputs.md +984 -0
  64. package/data/zeroheight-exports/Filters.md +888 -0
  65. package/data/zeroheight-exports/Getting-Started.md +1159 -0
  66. package/data/zeroheight-exports/Hero.md +262 -0
  67. package/data/zeroheight-exports/Icons.md +431 -0
  68. package/data/zeroheight-exports/Intent.md +46 -0
  69. package/data/zeroheight-exports/Introduction-to-Bases.md +35 -0
  70. package/data/zeroheight-exports/Introduction-to-Cells.md +35 -0
  71. package/data/zeroheight-exports/Introduction-to-DNA.md +35 -0
  72. package/data/zeroheight-exports/Introduction-to-Genes.md +35 -0
  73. package/data/zeroheight-exports/Introduction.md +115 -0
  74. package/data/zeroheight-exports/Link.md +386 -0
  75. package/data/zeroheight-exports/Lists.md +632 -0
  76. package/data/zeroheight-exports/Loading-Indicator.md +37 -0
  77. package/data/zeroheight-exports/Navigation.md +874 -0
  78. package/data/zeroheight-exports/Notification.md +888 -0
  79. package/data/zeroheight-exports/Panel.md +978 -0
  80. package/data/zeroheight-exports/README.md +124 -0
  81. package/data/zeroheight-exports/Responsive-Design.md +278 -0
  82. package/data/zeroheight-exports/Search-Input.md +53 -0
  83. package/data/zeroheight-exports/Search.md +592 -0
  84. package/data/zeroheight-exports/Segmented-Control.md +584 -0
  85. package/data/zeroheight-exports/Spacing.md +297 -0
  86. package/data/zeroheight-exports/Table.md +4944 -0
  87. package/data/zeroheight-exports/Tabs.md +801 -0
  88. package/data/zeroheight-exports/Tags.md +1055 -0
  89. package/data/zeroheight-exports/Text-Link.md +184 -0
  90. package/data/zeroheight-exports/Theming.md +332 -0
  91. package/data/zeroheight-exports/Tooltips.md +1580 -0
  92. package/data/zeroheight-exports/Typography.md +768 -0
  93. package/dist/stdio.js +193 -93
  94. package/package.json +4 -4
  95. package/data/component-props/Chip.json +0 -73
  96. package/data/component-props/List.json +0 -43
  97. package/data/component-props/Menu.json +0 -48
  98. package/data/component-props/Table.json +0 -26
  99. package/data/component-props-storybook/Accordion-storybook.json +0 -45
  100. package/data/component-props-storybook/Alert-storybook.json +0 -30
  101. package/data/component-props-storybook/Autocomplete-storybook.json +0 -67
  102. package/data/component-props-storybook/Banner-storybook.json +0 -78
  103. package/data/component-props-storybook/Button-storybook.json +0 -115
  104. package/data/component-props-storybook/ButtonDropdown-storybook.json +0 -73
  105. package/data/component-props-storybook/ButtonIcon-storybook.json +0 -60
  106. package/data/component-props-storybook/ButtonToggle-storybook.json +0 -68
  107. package/data/component-props-storybook/Callout-storybook.json +0 -90
  108. package/data/component-props-storybook/CellBasic-storybook.json +0 -138
  109. package/data/component-props-storybook/CellComponent-storybook.json +0 -48
  110. package/data/component-props-storybook/CellHeader-storybook.json +0 -71
  111. package/data/component-props-storybook/Chip-storybook.json +0 -26
  112. package/data/component-props-storybook/ComplexFilter-storybook.json +0 -60
  113. package/data/component-props-storybook/ContentCard-storybook.json +0 -175
  114. package/data/component-props-storybook/Dialog-storybook.json +0 -56
  115. package/data/component-props-storybook/Dropdown-storybook.json +0 -93
  116. package/data/component-props-storybook/DropdownMenu-storybook.json +0 -73
  117. package/data/component-props-storybook/HeatmapChart-storybook.json +0 -55
  118. package/data/component-props-storybook/Icon-storybook.json +0 -75
  119. package/data/component-props-storybook/InputCheckbox-storybook.json +0 -57
  120. package/data/component-props-storybook/InputDropdown-storybook.json +0 -80
  121. package/data/component-props-storybook/InputRadio-storybook.json +0 -56
  122. package/data/component-props-storybook/InputSearch-storybook.json +0 -55
  123. package/data/component-props-storybook/InputSlider-storybook.json +0 -55
  124. package/data/component-props-storybook/InputText-storybook.json +0 -59
  125. package/data/component-props-storybook/InputToggle-storybook.json +0 -42
  126. package/data/component-props-storybook/Link-storybook.json +0 -50
  127. package/data/component-props-storybook/List-storybook.json +0 -26
  128. package/data/component-props-storybook/LoadingIndicator-storybook.json +0 -34
  129. package/data/component-props-storybook/Menu-storybook.json +0 -26
  130. package/data/component-props-storybook/MenuItem-storybook.json +0 -74
  131. package/data/component-props-storybook/MenuSelect-storybook.json +0 -38
  132. package/data/component-props-storybook/NavigationFooter-storybook.json +0 -67
  133. package/data/component-props-storybook/NavigationHeader-storybook.json +0 -115
  134. package/data/component-props-storybook/NavigationJumpTo-storybook.json +0 -41
  135. package/data/component-props-storybook/Notification-storybook.json +0 -89
  136. package/data/component-props-storybook/Pagination-storybook.json +0 -50
  137. package/data/component-props-storybook/Panel-storybook.json +0 -52
  138. package/data/component-props-storybook/SegmentedControl-storybook.json +0 -30
  139. package/data/component-props-storybook/Table-storybook.json +0 -26
  140. package/data/component-props-storybook/TableHeader-storybook.json +0 -26
  141. package/data/component-props-storybook/TableRow-storybook.json +0 -62
  142. package/data/component-props-storybook/Tabs-storybook.json +0 -45
  143. package/data/component-props-storybook/Tag-storybook.json +0 -78
  144. package/data/component-props-storybook/TagFilter-storybook.json +0 -30
  145. package/data/component-props-storybook/Tooltip-storybook.json +0 -85
  146. package/data/component-props-storybook/TooltipCondensed-storybook.json +0 -38
  147. package/data/component-props-storybook/TooltipTable-storybook.json +0 -47
@@ -0,0 +1,888 @@
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 Variants
18
+
19
+ ---
20
+
21
+ ### Filter Example
22
+
23
+ The example below shows Filters being used as part of the plugin search on napari hub.
24
+
25
+ ---
26
+
27
+ ### Filter Spacing
28
+
29
+ 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.
30
+
31
+ ---
32
+
33
+ ## Filtering Logic
34
+
35
+ Filtering logic is handled at the product level; however, this section offers some suggestions for best practices to consider when establishing filtering logic.
36
+
37
+ ## Code
38
+
39
+ ## Filter Components
40
+
41
+ | 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 |
42
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ------------------------------------ |
43
+
44
+ ---
45
+
46
+ > 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.
47
+
48
+ ### FilterComplex
49
+
50
+ Note: the Filter component used in napari hub + .org is using the FilterComplex component from the SDS codebase.
51
+
52
+ Storybook
53
+
54
+ ---
55
+
56
+ Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
57
+
58
+ ## Overview
59
+
60
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
61
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ | **Closed** | **Open** | **Active** |
68
+ | ---------- | -------- | ---------- |
69
+
70
+ ### Filter Variants
71
+
72
+ ---
73
+
74
+ ---
75
+
76
+ ---
77
+
78
+
79
+
80
+ ### Filter Example
81
+
82
+ The example below shows Complex Filters being used as part of a Basic Panel in CZ GEN EPI.
83
+
84
+ ---
85
+
86
+ ### Filter Spacing
87
+
88
+ 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.
89
+
90
+ ---
91
+
92
+ ## Filtering Logic
93
+
94
+ Filtering logic is handled at the product level, however, this section offers some suggestions for best practices to consider when establishing filtering logic.
95
+
96
+ ---
97
+
98
+ ## Code
99
+
100
+ ## Filter Components
101
+
102
+ | 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 |
103
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ------------------------------------ |
104
+
105
+ ---
106
+
107
+ > 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.
108
+
109
+ ### FilterComplex
110
+
111
+ Storybook
112
+
113
+ ---
114
+
115
+ Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
116
+
117
+ ## Overview
118
+
119
+ ## Filter Variants
120
+
121
+ | 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 |
122
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------- |
123
+
124
+ ---
125
+
126
+ ## Simple Filter
127
+
128
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
129
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
130
+
131
+ 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.
132
+
133
+ ---
134
+
135
+ ---
136
+
137
+ ### Simple Filter Example
138
+
139
+ The example below shows Simple Filters being used as part of a Basic Panel in CZ ID.
140
+
141
+
142
+
143
+ ---
144
+
145
+ ### Simple Filter Spacing
146
+
147
+ These rules establish how much margin should exist between and around elements.
148
+
149
+ ---
150
+
151
+ ## Complex Filter
152
+
153
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
154
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
155
+
156
+ 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.
157
+
158
+ 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.
159
+
160
+ | **Closed** | **Open** | **Active** |
161
+ | ---------- | -------- | ---------- |
162
+
163
+ ### Complex Filter Variants
164
+
165
+ ---
166
+
167
+ ---
168
+
169
+ ---
170
+
171
+ ---
172
+
173
+
174
+
175
+ ### Complex Filter Example
176
+
177
+ The example below shows Complex Filters being used as part of a Basic Panel in CZ ID.
178
+
179
+ ---
180
+
181
+ ### Complex Filter Spacing
182
+
183
+ 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.
184
+
185
+ ---
186
+
187
+ ## Filtering Logic
188
+
189
+ Filtering logic is handled at the product level, however, this section offers some suggestions for best practices to consider when establishing filtering logic.
190
+
191
+ ---
192
+
193
+ ## Code
194
+
195
+ ## Filter Components
196
+
197
+ | 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 |
198
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------- |
199
+
200
+ ---
201
+
202
+ ### FilterSimple (coming soon)
203
+
204
+ ---
205
+
206
+ ### FilterComplex
207
+
208
+ Storybook
209
+
210
+ ---
211
+
212
+ Filters are used to narrow down large amounts of data based on specific criteria, helping users hone in on specific datasets within the product.
213
+
214
+ ## Guidelines
215
+
216
+ ## Filter Components
217
+
218
+ | 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 |
219
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------- |
220
+
221
+ ### Visual Preview
222
+
223
+ ---
224
+
225
+ ## Simple Filter
226
+
227
+ | | In Figma | | | Meets Accessibility | | | In Code |
228
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
229
+
230
+ ### Live Instance
231
+
232
+ > **Note:** Live instance for Simple Filter will be added soon.
233
+
234
+ ---
235
+
236
+ ### Overview
237
+
238
+ 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.
239
+
240
+ | Single-select | Multi-select | Range |
241
+ | ------------- | ------------ | ----- |
242
+
243
+ ---
244
+
245
+ ### Simple Filter example
246
+
247
+ The example below shows Simple Filters being used as part of a Basic Panel (documentation to come) in CZ ID.
248
+
249
+ ---
250
+
251
+ ### Simple Filter Spacing
252
+
253
+ These rules establish how much margin should exist between and around elements.
254
+
255
+ ---
256
+
257
+ ## Complex Filter
258
+
259
+ | | In Figma | | | Meets Accessibility | | | In Code |
260
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
261
+
262
+ ### Live Instance
263
+
264
+ Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
265
+
266
+ Default
267
+
268
+ ---
269
+
270
+ ### Overview
271
+
272
+ 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.
273
+
274
+ 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.
275
+
276
+ | Single-select | Single-select + Search | Multi-select | Multi-select + Search | Range |
277
+ | ------------- | ---------------------- | ------------ | --------------------- | ----- |
278
+
279
+ #### **Complex Filter states**
280
+
281
+ | Closed | Open | Active |
282
+ | ------ | ---- | ------ |
283
+
284
+ ---
285
+
286
+ ### Complex Filter example
287
+
288
+ The example below shows Complex Filters being used as part of a Basic Panel (documentation to come) in CZ ID.
289
+
290
+ ---
291
+
292
+ ### Complex Filter Spacing
293
+
294
+ 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.
295
+
296
+ ---
297
+
298
+ ### Filtering Logic
299
+
300
+ Filtering logic is handled at the product level, however, this section offers some suggestions for best practices to consider when establishing filtering logic.
301
+
302
+ ## Code
303
+
304
+ ## Filter Components
305
+
306
+ | 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 |
307
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------- |
308
+
309
+ ### Visual Preview
310
+
311
+ > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
312
+
313
+ ---
314
+
315
+ ## SimpleFilter
316
+
317
+ > **Note:** Code details for `SimpleFilter` will be added soon.
318
+
319
+ ---
320
+
321
+ ## ComplexFilter
322
+
323
+ ### SDS Source Code
324
+
325
+ The component's source code in the SDS codebase can be found here.
326
+
327
+ ### SDS vs MUI
328
+
329
+ 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:
330
+
331
+ - **`DropdownMenuProps`\*\***:\*\* use this prop to pass MUI`Autocomplete`-specific props to `ComplexFilter`
332
+ - **`InputDropdownProps`\*\***:\*\* use this prop to pass SDS `InputDropdown`-specific props to `ComplexFilter`
333
+
334
+ ### Props
335
+
336
+ Any custom SDS props and MUI props required for implementation are found in the table below. See the MUI documentation for additional optional props.
337
+
338
+ | Name | Type | Default | Description |
339
+ | ------------------------------ | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
340
+ | `isTriggerChangeOnOptionClick` | `bool` | `false` | Determines whether changes are triggered in real-time upon clicking an option |
341
+ | `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) |
342
+ | `label` | `string` | `""` | Sets the label of filter, shown both when closed and open |
343
+ | `multiple` | `bool` | `false` | Defines whether multiple selections or can be made from the filter simultaneously or only one |
344
+ | `onChange` | `func` | `-` | Function to set what happens when a new value is set via the filter |
345
+ | `search` | `bool` | `false` | Provides a search bar at the top of the filter from which users can narrow the list of menu items |
346
+
347
+ ### Code Examples
348
+
349
+ #### Default ComplexFilter
350
+
351
+ This examples demonstrates the minimum props needed to render a `ComplexFilter`.
352
+
353
+ **/styles.css**
354
+
355
+ ```css
356
+ body {
357
+ font-size: 13px;
358
+ font-weight: 400;
359
+ letter-spacing: 0.08px;
360
+ line-height: 20px;
361
+ text-transform: none;
362
+ font-family: "Inter", sans-serif;
363
+ }
364
+
365
+ h1 {
366
+ font-size: 1.5rem;
367
+ }
368
+
369
+ .app {
370
+ padding: 20px;
371
+ }
372
+ ```
373
+
374
+ **tsconfig.json**
375
+
376
+ ```json
377
+ {
378
+ "include": ["./**/*"],
379
+ "compilerOptions": {
380
+ "strict": true,
381
+ "esModuleInterop": true,
382
+ "lib": ["dom", "es2015"],
383
+ "jsx": "react-jsx"
384
+ }
385
+ }
386
+ ```
387
+
388
+ **/App.tsx**
389
+
390
+ ```tsx
391
+ import { ComplexFilter, DefaultDropdownMenuOption } from "@czi-sds/components";
392
+ import "./styles.css";
393
+
394
+ const MENU_ITEMS: DefaultDropdownMenuOption[] = [
395
+ {
396
+ name: "Fruit: Apple",
397
+ section: "Fruit",
398
+ count: 10,
399
+ },
400
+ {
401
+ name: "Fruit: Cherry",
402
+ section: "Fruit",
403
+ count: 150,
404
+ },
405
+ {
406
+ name: "Fruit: Orange",
407
+ section: "Fruit",
408
+ count: 15,
409
+ },
410
+ {
411
+ name: "Vegetable: Carrot",
412
+ section: "Vegetable",
413
+ count: 34,
414
+ },
415
+ {
416
+ name: "Vegetable: Kale",
417
+ section: "Vegetable",
418
+ },
419
+ {
420
+ name: "Vegetable: Lettuce",
421
+ section: "Vegetable",
422
+ },
423
+ ];
424
+
425
+ function App() {
426
+ return (
427
+ <div className="app">
428
+ <ComplexFilter
429
+ label="Filter Label"
430
+ onChange={() => {}}
431
+ options={MENU_ITEMS}
432
+ />
433
+ </div>
434
+ );
435
+ }
436
+
437
+ export default App;
438
+ ```
439
+
440
+ **/index.tsx**
441
+
442
+ ```tsx
443
+ import React from "react";
444
+ import { createRoot } from "react-dom/client";
445
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
446
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
447
+ import { Theme } from "@czi-sds/components";
448
+ import CssBaseline from "@mui/material/CssBaseline";
449
+ import useMediaQuery from "@mui/material/useMediaQuery";
450
+
451
+ import App from "./App";
452
+
453
+ const container = document.getElementById("root");
454
+ const root = createRoot(container!);
455
+
456
+ const RootApp = () => {
457
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
458
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
459
+
460
+ return (
461
+ <StyledEngineProvider injectFirst>
462
+ <ThemeProvider theme={theme}>
463
+ <EmotionThemeProvider theme={theme}>
464
+ <CssBaseline />
465
+ <App />
466
+ </EmotionThemeProvider>
467
+ </ThemeProvider>
468
+ </StyledEngineProvider>
469
+ );
470
+ };
471
+
472
+ root.render(
473
+ <React.StrictMode>
474
+ <RootApp />
475
+ </React.StrictMode>
476
+ );
477
+ ```
478
+
479
+ **/public/index.html**
480
+
481
+ ```html
482
+ <!doctype html>
483
+ <html lang="en">
484
+ <head>
485
+ <meta charset="UTF-8" />
486
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
487
+ <title>Filters</title>
488
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
489
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
490
+ <link
491
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
492
+ rel="stylesheet"
493
+ />
494
+ <link
495
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
496
+ rel="stylesheet"
497
+ />
498
+ </head>
499
+ <body>
500
+ <div id="root"></div>
501
+ </body>
502
+ </html>
503
+ ```
504
+
505
+ **/package.json**
506
+
507
+ ```json
508
+ {
509
+ "dependencies": {
510
+ "react": "^18.0.0",
511
+ "react-dom": "^18.0.0",
512
+ "react-scripts": "^4.0.0"
513
+ },
514
+ "devDependencies": {
515
+ "@types/react": "^18.0.0",
516
+ "@types/react-dom": "^18.0.0",
517
+ "typescript": "^4.0.0"
518
+ },
519
+ "main": "/index.tsx"
520
+ }
521
+ ```
522
+
523
+ ---
524
+
525
+ #### Multi select ComplexFilter with Search
526
+
527
+ This example showcases a `ComplexFilter` component featuring `InputSearch` for filtering menu items. Users have the flexibility to select multiple options to refine their selections.
528
+
529
+ **/styles.css**
530
+
531
+ ```css
532
+ body {
533
+ font-size: 13px;
534
+ font-weight: 400;
535
+ letter-spacing: 0.08px;
536
+ line-height: 20px;
537
+ text-transform: none;
538
+ font-family: "Inter", sans-serif;
539
+ }
540
+
541
+ h1 {
542
+ font-size: 1.5rem;
543
+ }
544
+
545
+ .app {
546
+ padding: 20px;
547
+ }
548
+ ```
549
+
550
+ **tsconfig.json**
551
+
552
+ ```json
553
+ {
554
+ "include": ["./**/*"],
555
+ "compilerOptions": {
556
+ "strict": true,
557
+ "esModuleInterop": true,
558
+ "lib": ["dom", "es2015"],
559
+ "jsx": "react-jsx"
560
+ }
561
+ }
562
+ ```
563
+
564
+ **/App.tsx**
565
+
566
+ ```tsx
567
+ import { ComplexFilter, DefaultDropdownMenuOption } from "@czi-sds/components";
568
+ import "./styles.css";
569
+
570
+ const MENU_ITEMS: DefaultDropdownMenuOption[] = [
571
+ {
572
+ name: "Fruit: Apple",
573
+ section: "Fruit",
574
+ count: 10,
575
+ },
576
+ {
577
+ name: "Fruit: Cherry",
578
+ section: "Fruit",
579
+ count: 150,
580
+ },
581
+ {
582
+ name: "Fruit: Orange",
583
+ section: "Fruit",
584
+ count: 15,
585
+ },
586
+ {
587
+ name: "Vegetable: Carrot",
588
+ section: "Vegetable",
589
+ count: 34,
590
+ },
591
+ {
592
+ name: "Vegetable: Kale",
593
+ section: "Vegetable",
594
+ },
595
+ {
596
+ name: "Vegetable: Lettuce",
597
+ section: "Vegetable",
598
+ },
599
+ ];
600
+
601
+ function App() {
602
+ return (
603
+ <div className="app">
604
+ <ComplexFilter
605
+ label="Filter Label"
606
+ onChange={() => {}}
607
+ options={MENU_ITEMS}
608
+ DropdownMenuProps={{
609
+ groupBy: (option: DefaultDropdownMenuOption) =>
610
+ option.section as string,
611
+ }}
612
+ multiple
613
+ search
614
+ />
615
+ </div>
616
+ );
617
+ }
618
+
619
+ export default App;
620
+ ```
621
+
622
+ **/index.tsx**
623
+
624
+ ```tsx
625
+ import React from "react";
626
+ import { createRoot } from "react-dom/client";
627
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
628
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
629
+ import { Theme } from "@czi-sds/components";
630
+ import CssBaseline from "@mui/material/CssBaseline";
631
+ import useMediaQuery from "@mui/material/useMediaQuery";
632
+
633
+ import App from "./App";
634
+
635
+ const container = document.getElementById("root");
636
+ const root = createRoot(container!);
637
+
638
+ const RootApp = () => {
639
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
640
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
641
+
642
+ return (
643
+ <StyledEngineProvider injectFirst>
644
+ <ThemeProvider theme={theme}>
645
+ <EmotionThemeProvider theme={theme}>
646
+ <CssBaseline />
647
+ <App />
648
+ </EmotionThemeProvider>
649
+ </ThemeProvider>
650
+ </StyledEngineProvider>
651
+ );
652
+ };
653
+
654
+ root.render(
655
+ <React.StrictMode>
656
+ <RootApp />
657
+ </React.StrictMode>
658
+ );
659
+ ```
660
+
661
+ **/public/index.html**
662
+
663
+ ```html
664
+ <!doctype html>
665
+ <html lang="en">
666
+ <head>
667
+ <meta charset="UTF-8" />
668
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
669
+ <title>Filters</title>
670
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
671
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
672
+ <link
673
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
674
+ rel="stylesheet"
675
+ />
676
+ <link
677
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
678
+ rel="stylesheet"
679
+ />
680
+ </head>
681
+ <body>
682
+ <div id="root"></div>
683
+ </body>
684
+ </html>
685
+ ```
686
+
687
+ **/package.json**
688
+
689
+ ```json
690
+ {
691
+ "dependencies": {
692
+ "react": "^18.0.0",
693
+ "react-dom": "^18.0.0",
694
+ "react-scripts": "^4.0.0"
695
+ },
696
+ "devDependencies": {
697
+ "@types/react": "^18.0.0",
698
+ "@types/react-dom": "^18.0.0",
699
+ "typescript": "^4.0.0"
700
+ },
701
+ "main": "/index.tsx"
702
+ }
703
+ ```
704
+
705
+ ---
706
+
707
+ #### ComplexFilter with realtime selection changes
708
+
709
+ 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.
710
+
711
+ **/styles.css**
712
+
713
+ ```css
714
+ body {
715
+ font-size: 13px;
716
+ font-weight: 400;
717
+ letter-spacing: 0.08px;
718
+ line-height: 20px;
719
+ text-transform: none;
720
+ font-family: "Inter", sans-serif;
721
+ }
722
+
723
+ h1 {
724
+ font-size: 1.5rem;
725
+ }
726
+
727
+ .app {
728
+ padding: 20px;
729
+ }
730
+ ```
731
+
732
+ **tsconfig.json**
733
+
734
+ ```json
735
+ {
736
+ "include": ["./**/*"],
737
+ "compilerOptions": {
738
+ "strict": true,
739
+ "esModuleInterop": true,
740
+ "lib": ["dom", "es2015"],
741
+ "jsx": "react-jsx"
742
+ }
743
+ }
744
+ ```
745
+
746
+ **/App.tsx**
747
+
748
+ ```tsx
749
+ import { ComplexFilter, DefaultDropdownMenuOption } from "@czi-sds/components";
750
+ import "./styles.css";
751
+
752
+ const MENU_ITEMS: DefaultDropdownMenuOption[] = [
753
+ {
754
+ name: "Fruit: Apple",
755
+ section: "Fruit",
756
+ count: 10,
757
+ },
758
+ {
759
+ name: "Fruit: Cherry",
760
+ section: "Fruit",
761
+ count: 150,
762
+ },
763
+ {
764
+ name: "Fruit: Orange",
765
+ section: "Fruit",
766
+ count: 15,
767
+ },
768
+ {
769
+ name: "Vegetable: Carrot",
770
+ section: "Vegetable",
771
+ count: 34,
772
+ },
773
+ {
774
+ name: "Vegetable: Kale",
775
+ section: "Vegetable",
776
+ },
777
+ {
778
+ name: "Vegetable: Lettuce",
779
+ section: "Vegetable",
780
+ },
781
+ ];
782
+
783
+ function App() {
784
+ return (
785
+ <div className="app">
786
+ <ComplexFilter
787
+ label="Filter Label"
788
+ onChange={() => {}}
789
+ options={MENU_ITEMS}
790
+ DropdownMenuProps={{
791
+ groupBy: (option: DefaultDropdownMenuOption) =>
792
+ option.section as string,
793
+ }}
794
+ multiple
795
+ search
796
+ isTriggerChangeOnOptionClick
797
+ />
798
+ </div>
799
+ );
800
+ }
801
+
802
+ export default App;
803
+ ```
804
+
805
+ **/index.tsx**
806
+
807
+ ```tsx
808
+ import React from "react";
809
+ import { createRoot } from "react-dom/client";
810
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
811
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
812
+ import { Theme } from "@czi-sds/components";
813
+ import CssBaseline from "@mui/material/CssBaseline";
814
+ import useMediaQuery from "@mui/material/useMediaQuery";
815
+
816
+ import App from "./App";
817
+
818
+ const container = document.getElementById("root");
819
+ const root = createRoot(container!);
820
+
821
+ const RootApp = () => {
822
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
823
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
824
+
825
+ return (
826
+ <StyledEngineProvider injectFirst>
827
+ <ThemeProvider theme={theme}>
828
+ <EmotionThemeProvider theme={theme}>
829
+ <CssBaseline />
830
+ <App />
831
+ </EmotionThemeProvider>
832
+ </ThemeProvider>
833
+ </StyledEngineProvider>
834
+ );
835
+ };
836
+
837
+ root.render(
838
+ <React.StrictMode>
839
+ <RootApp />
840
+ </React.StrictMode>
841
+ );
842
+ ```
843
+
844
+ **/public/index.html**
845
+
846
+ ```html
847
+ <!doctype html>
848
+ <html lang="en">
849
+ <head>
850
+ <meta charset="UTF-8" />
851
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
852
+ <title>Filters</title>
853
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
854
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
855
+ <link
856
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
857
+ rel="stylesheet"
858
+ />
859
+ <link
860
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
861
+ rel="stylesheet"
862
+ />
863
+ </head>
864
+ <body>
865
+ <div id="root"></div>
866
+ </body>
867
+ </html>
868
+ ```
869
+
870
+ **/package.json**
871
+
872
+ ```json
873
+ {
874
+ "dependencies": {
875
+ "react": "^18.0.0",
876
+ "react-dom": "^18.0.0",
877
+ "react-scripts": "^4.0.0"
878
+ },
879
+ "devDependencies": {
880
+ "@types/react": "^18.0.0",
881
+ "@types/react-dom": "^18.0.0",
882
+ "typescript": "^4.0.0"
883
+ },
884
+ "main": "/index.tsx"
885
+ }
886
+ ```
887
+
888
+ ---