@czi-sds/mcp 0.16.0 → 0.18.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 (167) 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/ProteinStructureViewer.md +1044 -0
  44. package/data/component-docs/SegmentedControl.md +396 -0
  45. package/data/component-docs/StackedBarChart.md +475 -0
  46. package/data/component-docs/Table.md +2000 -0
  47. package/data/component-docs/TableHeader.md +53 -0
  48. package/data/component-docs/TableRow.md +74 -0
  49. package/data/component-docs/Tabs.md +455 -0
  50. package/data/component-docs/Tag.md +647 -0
  51. package/data/component-docs/TagFilter.md +131 -0
  52. package/data/component-docs/Tooltip.md +561 -0
  53. package/data/component-docs/TooltipCondensed.md +203 -0
  54. package/data/component-docs/TooltipTable.md +145 -0
  55. package/data/component-docs/index.json +267 -0
  56. package/data/component-list.json +2 -5
  57. package/data/component-props/Accordion.json +31 -11
  58. package/data/component-props/Alert.json +3 -3
  59. package/data/component-props/Autocomplete.json +150 -15
  60. package/data/component-props/Banner.json +31 -17
  61. package/data/component-props/Button.json +45 -20
  62. package/data/component-props/ButtonDropdown.json +36 -17
  63. package/data/component-props/ButtonDropdownLegacy.json +11 -11
  64. package/data/component-props/ButtonGroup.json +32 -11
  65. package/data/component-props/ButtonIcon.json +10 -10
  66. package/data/component-props/ButtonLegacy.json +19 -19
  67. package/data/component-props/ButtonToggle.json +32 -19
  68. package/data/component-props/ButtonToggleLegacy.json +11 -11
  69. package/data/component-props/Callout.json +58 -17
  70. package/data/component-props/CellBasic.json +94 -41
  71. package/data/component-props/CellComponent.json +23 -7
  72. package/data/component-props/CellHeader.json +62 -19
  73. package/data/component-props/ComplexFilter.json +52 -21
  74. package/data/component-props/ContentCard.json +70 -47
  75. package/data/component-props/Dialog.json +47 -14
  76. package/data/component-props/Dropdown.json +68 -31
  77. package/data/component-props/DropdownMenu.json +128 -23
  78. package/data/component-props/HeatmapChart.json +88 -12
  79. package/data/component-props/Hero.json +80 -39
  80. package/data/component-props/Icon.json +20 -9
  81. package/data/component-props/InputCheckbox.json +36 -14
  82. package/data/component-props/InputDropdown.json +75 -27
  83. package/data/component-props/InputRadio.json +31 -13
  84. package/data/component-props/InputSearch.json +41 -18
  85. package/data/component-props/InputSlider.json +46 -19
  86. package/data/component-props/InputText.json +26 -19
  87. package/data/component-props/InputToggle.json +26 -9
  88. package/data/component-props/IntentMessage.json +38 -9
  89. package/data/component-props/Link.json +13 -7
  90. package/data/component-props/LoadingIndicator.json +11 -3
  91. package/data/component-props/MenuItem.json +38 -19
  92. package/data/component-props/MenuSelect.json +8 -8
  93. package/data/component-props/NavigationFooter.json +49 -19
  94. package/data/component-props/NavigationHeader.json +150 -37
  95. package/data/component-props/NavigationJumpTo.json +33 -7
  96. package/data/component-props/Notification.json +39 -21
  97. package/data/component-props/Pagination.json +39 -11
  98. package/data/component-props/Panel.json +62 -9
  99. package/data/component-props/Popover.json +80 -7
  100. package/data/component-props/PreComposedTable.json +99 -27
  101. package/data/component-props/ProteinStructureViewer.json +117 -0
  102. package/data/component-props/SegmentedControl.json +42 -3
  103. package/data/component-props/StackedBarChart.json +116 -42
  104. package/data/component-props/TableRow.json +38 -19
  105. package/data/component-props/Tabs.json +66 -9
  106. package/data/component-props/Tag.json +34 -17
  107. package/data/component-props/TagFilter.json +10 -3
  108. package/data/component-props/Tooltip.json +49 -18
  109. package/data/component-props/TooltipCondensed.json +18 -9
  110. package/data/component-props/TooltipTable.json +17 -7
  111. package/data/resources/{zeroheight-rules.md → documentation-rules.md} +43 -30
  112. package/data/resources/figma-rules.md +2 -2
  113. package/data/tailwind.json +20 -14
  114. package/dist/stdio.js +112 -208
  115. package/package.json +9 -5
  116. package/data/component-props/ButtonDropdownV2.json +0 -34
  117. package/data/component-props/ButtonNew.json +0 -47
  118. package/data/component-props/ButtonToggleV2.json +0 -44
  119. package/data/component-props/ButtonV2.json +0 -43
  120. package/data/zeroheight-cache.json +0 -10259
  121. package/data/zeroheight-exports/Accordion.md +0 -774
  122. package/data/zeroheight-exports/Banner.md +0 -691
  123. package/data/zeroheight-exports/Borders.md +0 -117
  124. package/data/zeroheight-exports/Buttons.md +0 -1854
  125. package/data/zeroheight-exports/Callout.md +0 -931
  126. package/data/zeroheight-exports/Colors.md +0 -1755
  127. package/data/zeroheight-exports/Content-Card.md +0 -309
  128. package/data/zeroheight-exports/Contributing-to-SDS.md +0 -98
  129. package/data/zeroheight-exports/Control-Inputs.md +0 -2818
  130. package/data/zeroheight-exports/Corners.md +0 -104
  131. package/data/zeroheight-exports/Cover-page.md +0 -3
  132. package/data/zeroheight-exports/Dialog.md +0 -1367
  133. package/data/zeroheight-exports/Downloads.md +0 -236
  134. package/data/zeroheight-exports/Drop-Shadows.md +0 -79
  135. package/data/zeroheight-exports/Dropdown-Input.md +0 -1776
  136. package/data/zeroheight-exports/Dropdown-Menus.md +0 -913
  137. package/data/zeroheight-exports/Element-Status-Tracker.md +0 -267
  138. package/data/zeroheight-exports/Field-Inputs.md +0 -1405
  139. package/data/zeroheight-exports/Filters.md +0 -1111
  140. package/data/zeroheight-exports/Getting-Started.md +0 -1157
  141. package/data/zeroheight-exports/Hero.md +0 -414
  142. package/data/zeroheight-exports/Icons.md +0 -2067
  143. package/data/zeroheight-exports/Intent.md +0 -86
  144. package/data/zeroheight-exports/Introduction-to-Bases.md +0 -35
  145. package/data/zeroheight-exports/Introduction-to-Cells.md +0 -35
  146. package/data/zeroheight-exports/Introduction-to-DNA.md +0 -35
  147. package/data/zeroheight-exports/Introduction-to-Genes.md +0 -35
  148. package/data/zeroheight-exports/Introduction.md +0 -115
  149. package/data/zeroheight-exports/Link.md +0 -432
  150. package/data/zeroheight-exports/Lists.md +0 -986
  151. package/data/zeroheight-exports/Loading-Indicator.md +0 -41
  152. package/data/zeroheight-exports/Navigation.md +0 -1190
  153. package/data/zeroheight-exports/Notification.md +0 -1038
  154. package/data/zeroheight-exports/Panel.md +0 -1030
  155. package/data/zeroheight-exports/README.md +0 -122
  156. package/data/zeroheight-exports/Responsive-Design.md +0 -330
  157. package/data/zeroheight-exports/Search-Input.md +0 -91
  158. package/data/zeroheight-exports/Search.md +0 -822
  159. package/data/zeroheight-exports/Segmented-Control.md +0 -609
  160. package/data/zeroheight-exports/Spacing.md +0 -297
  161. package/data/zeroheight-exports/Table.md +0 -5345
  162. package/data/zeroheight-exports/Tabs.md +0 -1324
  163. package/data/zeroheight-exports/Tags.md +0 -1545
  164. package/data/zeroheight-exports/Text-Link.md +0 -268
  165. package/data/zeroheight-exports/Theming.md +0 -362
  166. package/data/zeroheight-exports/Tooltips.md +0 -2015
  167. package/data/zeroheight-exports/Typography.md +0 -800
@@ -0,0 +1,155 @@
1
+ # Dropdown
2
+
3
+ > **Dropdown is a trigger and a menu together.** It pairs InputDropdown, the field the user clicks, with DropdownMenu, the list that opens, and takes care of what sits between them. Reach for those two directly only when the menu has to open from something Dropdown does not draw; the Dropdowns overview covers how the family fits together.
4
+
5
+ ## Source Code
6
+
7
+ The component's source code in the SDS codebase can be found [here](https://github.com/chanzuckerberg/sci-components/blob/main/packages/components/src/core/Dropdown/index.tsx).
8
+
9
+ ## Import
10
+
11
+ **React TypeScript**
12
+
13
+ ```tsx
14
+ import { Dropdown } from "@czi-sds/components";
15
+ ```
16
+
17
+ ## Code Examples
18
+
19
+ ### **Default Dropdown**
20
+
21
+ This example illustrates the minimum set of props required for rendering a Dropdown component.
22
+
23
+ **Example: DefaultDropdown**
24
+
25
+ ```tsx
26
+ import { Dropdown, DefaultAutocompleteOption } from "@czi-sds/components";
27
+
28
+ const MENU_ITEMS: DefaultAutocompleteOption[] = [
29
+ {
30
+ name: "Menu item 1",
31
+ },
32
+ {
33
+ name: "Menu item 2",
34
+ },
35
+ {
36
+ name: "Menu item 3",
37
+ },
38
+ {
39
+ name: "Menu item 4",
40
+ },
41
+ ];
42
+
43
+ function App() {
44
+ return (
45
+ <div className="app">
46
+ <Dropdown label="Click Target" onChange={() => {}} options={MENU_ITEMS} />
47
+ </div>
48
+ );
49
+ }
50
+
51
+ export default App;
52
+ ```
53
+
54
+ ### **Multi-select Dropdown with Search**
55
+
56
+ A search feature can be easily incorporated into the Dropdown component by including the `search` prop.
57
+
58
+ The search functionality operates by dynamically filtering out non-matching options as the user types, displaying only the menu items whose text corresponds to that input. If no matching items are found, the Dropdown will automatically present "No options" below the search bar.
59
+
60
+ To ensure that the search input retains its text even after a user selects a menu item (when multiple selections are allowed), set the `keepSearchOnSelect` prop to `true` within the `DropdownMenuProps` prop. This allows users to conveniently choose multiple menu items that match the searched term without the need to re-enter it for each selection.
61
+
62
+ **Example: MultiSelectDropdownWithSearch**
63
+
64
+ ```tsx
65
+ import { Dropdown, DefaultAutocompleteOption } from "@czi-sds/components";
66
+
67
+ const MENU_ITEMS: DefaultAutocompleteOption[] = [
68
+ {
69
+ name: "Fruit: Apple",
70
+ section: "Fruit",
71
+ count: 10,
72
+ },
73
+ {
74
+ name: "Fruit: Cherry",
75
+ section: "Fruit",
76
+ count: 150,
77
+ },
78
+ {
79
+ name: "Fruit: Orange",
80
+ section: "Fruit",
81
+ count: 15,
82
+ },
83
+ {
84
+ name: "Vegetable: Carrot",
85
+ section: "Vegetable",
86
+ count: 34,
87
+ },
88
+ {
89
+ name: "Vegetable: Kale",
90
+ section: "Vegetable",
91
+ },
92
+ {
93
+ name: "Vegetable: Lettuce",
94
+ section: "Vegetable",
95
+ },
96
+ ];
97
+
98
+ function App() {
99
+ return (
100
+ <div className="app">
101
+ <Dropdown
102
+ label="Click Target"
103
+ onChange={() => {}}
104
+ options={MENU_ITEMS}
105
+ search
106
+ multiple
107
+ DropdownMenuProps={{
108
+ keepSearchOnSelect: true,
109
+ groupBy: (option: DefaultAutocompleteOption) =>
110
+ option.section as string,
111
+ }}
112
+ />
113
+ </div>
114
+ );
115
+ }
116
+
117
+ export default App;
118
+ ```
119
+
120
+ ## SDS vs MUI
121
+
122
+ SDS's Dropdown component is a combination of two other SDS components: DropdownMenu and InputDropdown, since these would often be used together to create a complete dropdown element in the UI. DropdownMenu is built off of MUI's Autocomplete component, but InputDropdown is built from scratch.
123
+
124
+ These are a few of the most relevant ways in which SDS's DropdownMenu (which is used within Dropdown) integrates withAutocomplete and other MUI components:
125
+
126
+ - SDS Dropdown uses [MUI Autocomplete](https://mui.com/material-ui/react-autocomplete/) under the hood, so all props passed to DropdownMenu are ultimately passed to the Autocomplete component as well. This means MUI's Autocomplete props can be used on SDS's DropdownMenu if needed.
127
+
128
+ - SDS Dropdown uses [MUI Popper](https://mui.com/material-ui/react-popper/). A custom Popper component can be passed via `props.PopperComponent` and/or `props.PopperBaseProps` to control the popper component.
129
+
130
+ - Similarly, SDS Dropdown uses [MUI Paper](https://mui.com/material-ui/react-paper/). A custom Paper component can be passed via `props.PaperComponent` to enable custom styling.
131
+
132
+ ## Props
133
+
134
+ Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
135
+
136
+ | Name | Type | Default | Description |
137
+ | ------------------------------ | ----------------------------------------------------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
138
+ | `buttonPosition` | `"left"` \| `"right"` | `"left"` | Specifies the position of the Apply/Cancel buttons at the Dropdown footer. |
139
+ | `buttons` | `boolean` | `false` | When set to `true`, a set of Apply/Cancel buttons will be displayed at the Dropdown footer. |
140
+ | `closeOnBlur` | `boolean` | `true` | When set to `true`, the Dropdown will automatically close when a click occurs outside of it. |
141
+ | `disabled` | `boolean` | `false` | When `true`, the Dropdown is disabled and user interaction is not allowed. |
142
+ | `isTriggerChangeOnOptionClick` | `boolean` | `false` | When set to `true`, changes in Dropdown selections are applied in real-time to the react state. |
143
+ | `label` | `ReactNode` | - | The label of the Dropdown. |
144
+ | `multiple` | `boolean` | `true` | Determines whether the Dropdown allows for multiple item selection. |
145
+ | `onChange` | `(options: Value<DefaultDropdownMenuOption, Multiple>) => void;` | - | Callback fired when the value changes. |
146
+ | `onClose` | `function` | - | Callback fired when the Dropdown requests to be closed. |
147
+ | `search` | `boolean` | `true` | When set to `true`, a search input is displayed at the top of the Dropdown for filtering options. |
148
+ | `DropdownMenuProps` | `Partial<DropdownMenuProps>` | - | These props are directly passed to the underlying DropdownMenu component, customizing its behavior. It is also the way to reach the menu's `PopperComponent`, `PaperComponent` and placement. |
149
+ | `options` | `AutocompleteSingleColumnOption<T>[]` \| `AutocompleteMultiColumnOption<T>[]` | - | An array of options to be displayed as MenuItems within the Dropdown. |
150
+ | `InputDropdownProps` | `Partial<InputDropdownPropsType>` | - | These props are directly passed to the underlying InputDropdown component, customizing its behavior. |
151
+ | `value` | `string \| Array<string>` | - | The current value of the Dropdown, representing the selected item(s) based on the multi-select status. |
152
+ | `isSearchAutoFocus` | `boolean` | `true` | Puts the cursor in the search input as the menu opens. It only applies alongside `search`. |
153
+ | `onInputChange` | `function` | - | Called as the search text changes. **Signature:** `function(event: SyntheticEvent, value: string, reason: AutocompleteInputChangeReason) => void` |
154
+ | `title` | `ReactNode` | - | A heading shown at the top of the menu. |
155
+ | `InputDropdownComponent` | `element` | `InputDropdown` | The component used to render the Dropdown trigger button. |