@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
@@ -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. |