@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,774 +0,0 @@
1
- # Accordions
2
-
3
- To help control the amount of information presented to the user, Accordions are expandable/collapsable elements that hide and reveal content.
4
-
5
- ## Overview
6
-
7
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
8
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
9
-
10
- Accordions are elements that can be used by designers to hide or reveal content. Use the header text to communicate what type of content the user can expect to see when the Accordion is expanded.
11
-
12
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
13
-
14
- **Accordion**
15
-
16
- ---
17
-
18
- ---
19
-
20
- **Accordion**
21
-
22
- ---
23
-
24
- ---
25
-
26
- ### Accordion Spacing
27
-
28
- These rules establish how much margin should exist between and around elements.
29
-
30
- **Accordion spacing**
31
-
32
- ---
33
-
34
- ## Code
35
-
36
- ## Accordion Component
37
-
38
- | Below you will find an interactive Storybook iframe for Accordions. 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:** Accordion |
39
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------- |
40
-
41
- ---
42
-
43
- > 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.
44
-
45
- ### Accordion
46
-
47
- Storybook
48
-
49
- ---
50
-
51
- To help control the amount of information presented to the user, Accordions are expandable/collapsable elements that hide and reveal content.
52
-
53
- ## Overview
54
-
55
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
56
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
57
-
58
- Accordions are elements that can be used by designers to hide or reveal content. Use the header text to communicate what type of content the user can expect to see when the Accordion is expanded. They can optionally include a bottom-positioned divider line to help visually separate an Accordion from the one below it.
59
-
60
- Once expanded, the content revealed within the Accordion can be whatever the designer desires, whether basic text or another component or element.
61
-
62
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
63
-
64
- **Accordion**
65
-
66
- ---
67
-
68
- ---
69
-
70
- **Accordion**
71
-
72
- ---
73
-
74
- ---
75
-
76
- **Accordion**
77
-
78
- ---
79
-
80
- ---
81
-
82
- ### Accordion Spacing
83
-
84
- These rules establish how much margin should exist between and around elements.
85
-
86
- **Accordion spacing**
87
-
88
- ---
89
-
90
- ## Code
91
-
92
- ## Accordion Component
93
-
94
- | Below you will find an interactive Storybook iframe for Accordions. 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:** Accordion |
95
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------- |
96
-
97
- ---
98
-
99
- ### Accordion
100
-
101
- Storybook
102
-
103
- ---
104
-
105
- Accordions are expandable/collapsable elements that hide and reveal content to help control the amount of information presented to the user at one time.
106
-
107
- ## Guidelines
108
-
109
- ## Overview
110
-
111
- | | In Figma | | | Meets Accessibility | | | In Code |
112
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
113
-
114
- ### Accordion Variants
115
-
116
- Accordions are elements that can be used to hide or reveal content. Use the header text to communicate what type of content the user can expect to see when the Accordion is expanded. Accordions can contain anything from — basic text to others components or elements.
117
-
118
- The Accordion indicator arrow may appear to the left or the right of the header. Accordions may show a subtitle below the header text. Accordions may show bottom divider lines to help visually separate them from one another.
119
-
120
- **Preview_Guidelines_Accordion_toggleLeft**
121
-
122
- ---
123
-
124
- **Preview_Guidelines_Accordion_toggleRight**
125
-
126
- ---
127
-
128
- ---
129
-
130
- ### Live Instance
131
-
132
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
133
-
134
- Default
135
-
136
- ---
137
-
138
- ### Accordion – Left Toggle
139
-
140
- Left-aligned toggles works well when the Accordion's container is wide, because a right-aligned toggle would be far from the header text and it is less obvious that the two elements are related.
141
-
142
- | Default | Default + Divider | Default + Subtitle | Expanded |
143
- | ------- | ----------------- | ------------------ | -------- |
144
-
145
- **toggleLeft_collapsed_no subtitle_no underline**
146
-
147
- ---
148
-
149
- **toggleLeft_collapsed_no subtitle_underlined**
150
-
151
- ---
152
-
153
- **toggleLeft_collapsed_subtitle_no underline**
154
-
155
- ---
156
-
157
- **toggleLeft_expanded_no subtitle_no underline**
158
-
159
- ---
160
-
161
- ---
162
-
163
- ### Accordion – Right Toggle
164
-
165
- Use when there's a preference for the Accordion toggle to appear to the right of its header text. The toggle icon right aligns to the right edge of the Accordion's container.
166
-
167
- | Default | Default + Divider | Default + Subtitle | Expanded |
168
- | ------- | ----------------- | ------------------ | -------- |
169
-
170
- **toggleRight_collapsed_no subtitle_no underline_n**
171
-
172
- ---
173
-
174
- **toggleRight_collapsed_no subtitle_underlined_n**
175
-
176
- ---
177
-
178
- **toggleRight_collapsed_subtitle_no underline**
179
-
180
- ---
181
-
182
- **toggleRight_expanded_no subtitle_no underline**
183
-
184
- ---
185
-
186
- ---
187
-
188
- ### Accordion Spacing
189
-
190
- These rules establish how much margin should exist between and around elements.
191
-
192
- **Accordion spacing**
193
-
194
- ---
195
-
196
- ## Code
197
-
198
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
199
-
200
- ## Accordion
201
-
202
- ### SDS Source Code
203
-
204
- The component's source code in the SDS codebase can be found here.
205
-
206
- ### SDS vs MUI
207
-
208
- The SDS `Accordion` component introduces a couple new props that aren't part of the MUI version, that make it easier to implement options that may be needed in CZI products:
209
-
210
- - **`useDivider`\*\***:\*\* this boolean prop adds a horizontal line below the accordion, which can help to visually separate it from other accordions if they are stacked
211
- - **`togglePosition`\*\***:\*\* takes `right` (default) or `left` as values, and specifies where the baked-in Chevron icon that acts as a visual toggle sits
212
-
213
- Additionally, there are a couple of MUI props that are not currently supported by the SDS `Accordion` component:
214
-
215
- - **`defaultExpanded`\*\***:\*\* this boolean prop has no effect when used
216
- - **`expanded`\*\***:\*\* this boolean prop is not recommended to be used with the SDS `Accordion` component, because it forces the accordion to remain open even when the user clicks it as though to close it
217
- - **`disableGutters`\*\***:\*\* this boolean prop is not needed with the SDS accordion design, and has no effect
218
-
219
- ### MUI Documentation
220
-
221
- Documentation for the underlying MUI component can be found here.
222
-
223
- ### Props
224
-
225
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
226
-
227
- | Name | Type | Default | Description |
228
- | ---------------- | ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
229
- | `id` | `string` | `-` | A unique id for each accordion item. |
230
- | `disabled` | `bool` | `false` | The `disabled` prop, when set to true, prevents user interaction with the Accordion component, keeping it in a static state. |
231
- | `togglePosition` | `"right"` ` | "left"` | `right` | Position of the toggle chevron icon. |
232
- | `subtitle` | `string` | `-` | A text that will be displayed as a subtitle beneath the accordion title. |
233
- | `useDivider` | `bool` | `false` | Display a divider line between accordion items. |
234
-
235
- There are more props that can be used with the `InputDropdown` component, via those available to MUI's `Accordion` component.
236
-
237
- ### Code examples
238
-
239
- #### Default Accordion
240
-
241
- This example has the minimum props needed for the `Accordion` component.
242
-
243
- **/styles.css**
244
-
245
- ```css
246
- body {
247
- font-size: 13px;
248
- font-weight: 400;
249
- letter-spacing: 0.08px;
250
- line-height: 20px;
251
- text-transform: none;
252
- font-family: "Inter", sans-serif;
253
- }
254
-
255
- h1 {
256
- font-size: 1.5rem;
257
- }
258
-
259
- .app {
260
- padding: 20px;
261
- }
262
- ```
263
-
264
- **tsconfig.json**
265
-
266
- ```json
267
- {
268
- "include": ["./**/*"],
269
- "compilerOptions": {
270
- "strict": true,
271
- "esModuleInterop": true,
272
- "lib": ["dom", "es2015"],
273
- "jsx": "react-jsx"
274
- }
275
- }
276
- ```
277
-
278
- **/App.tsx**
279
-
280
- ```tsx
281
- // Most minimal Accordion (just has the basic requirements)
282
-
283
- import {
284
- Accordion,
285
- AccordionHeader,
286
- AccordionDetails,
287
- } from "@czi-sds/components";
288
- import "./styles.css";
289
-
290
- function App() {
291
- return (
292
- <div className="app">
293
- <Accordion id="accordion-1" useDivider={false} togglePosition="right">
294
- <AccordionHeader>Accordion Header</AccordionHeader>
295
- <AccordionDetails>
296
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
297
- malesuada lacus ex, sit amet blandit leo lobortis eget.
298
- </AccordionDetails>
299
- </Accordion>
300
- </div>
301
- );
302
- }
303
-
304
- export default App;
305
- ```
306
-
307
- **/index.tsx**
308
-
309
- ```tsx
310
- import React from "react";
311
- import { createRoot } from "react-dom/client";
312
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
313
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
314
- import { Theme } from "@czi-sds/components";
315
- import CssBaseline from "@mui/material/CssBaseline";
316
- import useMediaQuery from "@mui/material/useMediaQuery";
317
-
318
- import App from "./App";
319
-
320
- const container = document.getElementById("root");
321
- const root = createRoot(container!);
322
-
323
- const RootApp = () => {
324
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
325
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
326
-
327
- return (
328
- <StyledEngineProvider injectFirst>
329
- <ThemeProvider theme={theme}>
330
- <EmotionThemeProvider theme={theme}>
331
- <CssBaseline />
332
- <App />
333
- </EmotionThemeProvider>
334
- </ThemeProvider>
335
- </StyledEngineProvider>
336
- );
337
- };
338
-
339
- root.render(
340
- <React.StrictMode>
341
- <RootApp />
342
- </React.StrictMode>
343
- );
344
- ```
345
-
346
- **/public/index.html**
347
-
348
- ```html
349
- <!doctype html>
350
- <html lang="en">
351
- <head>
352
- <meta charset="UTF-8" />
353
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
354
- <link rel="preconnect" href="https://fonts.googleapis.com" />
355
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
356
- <link
357
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
358
- rel="stylesheet"
359
- />
360
- <link
361
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
362
- rel="stylesheet"
363
- />
364
- </head>
365
- <body>
366
- <div id="root"></div>
367
- </body>
368
- </html>
369
- ```
370
-
371
- **/package.json**
372
-
373
- ```json
374
- {
375
- "dependencies": {
376
- "react": "^18.0.0",
377
- "react-dom": "^18.0.0",
378
- "react-scripts": "^4.0.0"
379
- },
380
- "devDependencies": {
381
- "@types/react": "^18.0.0",
382
- "@types/react-dom": "^18.0.0",
383
- "typescript": "^4.0.0"
384
- },
385
- "main": "/index.tsx"
386
- }
387
- ```
388
-
389
- ---
390
-
391
- #### Accordion with subtitles
392
-
393
- This example show a group of `Accordions`, each with its own subtitle and dividing line.
394
-
395
- **/styles.css**
396
-
397
- ```css
398
- body {
399
- font-size: 13px;
400
- font-weight: 400;
401
- letter-spacing: 0.08px;
402
- line-height: 20px;
403
- text-transform: none;
404
- font-family: "Inter", sans-serif;
405
- }
406
-
407
- h1 {
408
- font-size: 1.5rem;
409
- }
410
-
411
- .app {
412
- padding: 20px;
413
- }
414
- ```
415
-
416
- **tsconfig.json**
417
-
418
- ```json
419
- {
420
- "include": ["./**/*"],
421
- "compilerOptions": {
422
- "strict": true,
423
- "esModuleInterop": true,
424
- "lib": ["dom", "es2015"],
425
- "jsx": "react-jsx"
426
- }
427
- }
428
- ```
429
-
430
- **/App.tsx**
431
-
432
- ```tsx
433
- // Most minimal InputDropdown (just has the basic requirements)
434
-
435
- import {
436
- Accordion,
437
- AccordionHeader,
438
- AccordionDetails,
439
- } from "@czi-sds/components";
440
- import "./styles.css";
441
-
442
- function App() {
443
- return (
444
- <div className="app">
445
- <Accordion id="accordion-1" useDivider={true} togglePosition="right">
446
- <AccordionHeader subtitle="Explore the functionalities of our amazing product">
447
- Product Features
448
- </AccordionHeader>
449
- <AccordionDetails>
450
- Unveil the multitude of features that make our product stand out. From
451
- seamless integration with your existing workflow to advanced
452
- customization options, each feature has been meticulously crafted to
453
- empower you. Navigate through this section to discover how our product
454
- can revolutionize the way you work.
455
- </AccordionDetails>
456
- </Accordion>
457
- <Accordion id="accordion-2" useDivider={true} togglePosition="right">
458
- <AccordionHeader
459
- id={`accordion-2-header`}
460
- subtitle="Answers to commonly asked questions about our service"
461
- >
462
- FAQ Section
463
- </AccordionHeader>
464
- <AccordionDetails>
465
- Delve into a comprehensive compilation of frequently asked questions
466
- and their detailed answers. This section is your go-to resource for
467
- clarifying any doubts you might have about our service. Whether it's
468
- about pricing, compatibility, or functionality, we've got you covered
469
- with clear and concise explanations, ensuring a smooth and informed
470
- experience.
471
- </AccordionDetails>
472
- </Accordion>
473
-
474
- <Accordion id="accordion-3" useDivider={false} togglePosition="right">
475
- <AccordionHeader
476
- id={`accordion-3-header`}
477
- subtitle="Enhance your skills with our collection of educational materials"
478
- >
479
- Learning Resources
480
- </AccordionHeader>
481
- <AccordionDetails>
482
- Embark on a journey of continuous improvement with our treasure trove
483
- of learning materials. This section hosts an array of tutorials,
484
- guides, and insightful articles designed to enhance your skills and
485
- deepen your understanding. Whether you're a beginner or an expert,
486
- these resources offer valuable insights to help you grow and excel in
487
- your endeavors.
488
- </AccordionDetails>
489
- </Accordion>
490
- </div>
491
- );
492
- }
493
-
494
- export default App;
495
- ```
496
-
497
- **/index.tsx**
498
-
499
- ```tsx
500
- import React from "react";
501
- import { createRoot } from "react-dom/client";
502
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
503
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
504
- import { Theme } from "@czi-sds/components";
505
- import CssBaseline from "@mui/material/CssBaseline";
506
- import useMediaQuery from "@mui/material/useMediaQuery";
507
-
508
- import App from "./App";
509
-
510
- const container = document.getElementById("root");
511
- const root = createRoot(container!);
512
-
513
- const RootApp = () => {
514
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
515
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
516
-
517
- return (
518
- <StyledEngineProvider injectFirst>
519
- <ThemeProvider theme={theme}>
520
- <EmotionThemeProvider theme={theme}>
521
- <CssBaseline />
522
- <App />
523
- </EmotionThemeProvider>
524
- </ThemeProvider>
525
- </StyledEngineProvider>
526
- );
527
- };
528
-
529
- root.render(
530
- <React.StrictMode>
531
- <RootApp />
532
- </React.StrictMode>
533
- );
534
- ```
535
-
536
- **/public/index.html**
537
-
538
- ```html
539
- <!doctype html>
540
- <html lang="en">
541
- <head>
542
- <meta charset="UTF-8" />
543
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
544
- <link rel="preconnect" href="https://fonts.googleapis.com" />
545
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
546
- <link
547
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
548
- rel="stylesheet"
549
- />
550
- <link
551
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
552
- rel="stylesheet"
553
- />
554
- </head>
555
- <body>
556
- <div id="root"></div>
557
- </body>
558
- </html>
559
- ```
560
-
561
- **/package.json**
562
-
563
- ```json
564
- {
565
- "dependencies": {
566
- "react": "^18.0.0",
567
- "react-dom": "^18.0.0",
568
- "react-scripts": "^4.0.0"
569
- },
570
- "devDependencies": {
571
- "@types/react": "^18.0.0",
572
- "@types/react-dom": "^18.0.0",
573
- "typescript": "^4.0.0"
574
- },
575
- "main": "/index.tsx"
576
- }
577
- ```
578
-
579
- ---
580
-
581
- #### Accordion with disabled item
582
-
583
- This example shows a group of multiple `Accordions`, one of which is disabled and cannot be opened.
584
-
585
- **/styles.css**
586
-
587
- ```css
588
- body {
589
- font-size: 13px;
590
- font-weight: 400;
591
- letter-spacing: 0.08px;
592
- line-height: 20px;
593
- text-transform: none;
594
- font-family: "Inter", sans-serif;
595
- }
596
-
597
- h1 {
598
- font-size: 1.5rem;
599
- }
600
-
601
- .app {
602
- padding: 20px;
603
- }
604
- ```
605
-
606
- **tsconfig.json**
607
-
608
- ```json
609
- {
610
- "include": ["./**/*"],
611
- "compilerOptions": {
612
- "strict": true,
613
- "esModuleInterop": true,
614
- "lib": ["dom", "es2015"],
615
- "jsx": "react-jsx"
616
- }
617
- }
618
- ```
619
-
620
- **/App.tsx**
621
-
622
- ```tsx
623
- // Most minimal InputDropdown (just has the basic requirements)
624
-
625
- import {
626
- Accordion,
627
- AccordionHeader,
628
- AccordionDetails,
629
- } from "@czi-sds/components";
630
- import "./styles.css";
631
-
632
- function App() {
633
- return (
634
- <div className="app">
635
- <Accordion id="accordion-1" useDivider={true} togglePosition="right">
636
- <AccordionHeader subtitle="Explore the functionalities of our amazing product">
637
- Product Features
638
- </AccordionHeader>
639
- <AccordionDetails>
640
- Unveil the multitude of features that make our product stand out. From
641
- seamless integration with your existing workflow to advanced
642
- customization options, each feature has been meticulously crafted to
643
- empower you. Navigate through this section to discover how our product
644
- can revolutionize the way you work.
645
- </AccordionDetails>
646
- </Accordion>
647
- <Accordion
648
- disabled={true}
649
- id="accordion-2"
650
- useDivider={true}
651
- togglePosition="right"
652
- >
653
- <AccordionHeader
654
- id={`accordion-2-header`}
655
- subtitle="Answers to commonly asked questions about our service"
656
- >
657
- FAQ Section
658
- </AccordionHeader>
659
- <AccordionDetails>
660
- Delve into a comprehensive compilation of frequently asked questions
661
- and their detailed answers. This section is your go-to resource for
662
- clarifying any doubts you might have about our service. Whether it's
663
- about pricing, compatibility, or functionality, we've got you covered
664
- with clear and concise explanations, ensuring a smooth and informed
665
- experience.
666
- </AccordionDetails>
667
- </Accordion>
668
-
669
- <Accordion id="accordion-3" useDivider={false} togglePosition="right">
670
- <AccordionHeader
671
- id={`accordion-3-header`}
672
- subtitle="Enhance your skills with our collection of educational materials"
673
- >
674
- Learning Resources
675
- </AccordionHeader>
676
- <AccordionDetails>
677
- Embark on a journey of continuous improvement with our treasure trove
678
- of learning materials. This section hosts an array of tutorials,
679
- guides, and insightful articles designed to enhance your skills and
680
- deepen your understanding. Whether you're a beginner or an expert,
681
- these resources offer valuable insights to help you grow and excel in
682
- your endeavors.
683
- </AccordionDetails>
684
- </Accordion>
685
- </div>
686
- );
687
- }
688
-
689
- export default App;
690
- ```
691
-
692
- **/index.tsx**
693
-
694
- ```tsx
695
- import React from "react";
696
- import { createRoot } from "react-dom/client";
697
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
698
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
699
- import { Theme } from "@czi-sds/components";
700
- import CssBaseline from "@mui/material/CssBaseline";
701
- import useMediaQuery from "@mui/material/useMediaQuery";
702
-
703
- import App from "./App";
704
-
705
- const container = document.getElementById("root");
706
- const root = createRoot(container!);
707
-
708
- const RootApp = () => {
709
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
710
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
711
-
712
- return (
713
- <StyledEngineProvider injectFirst>
714
- <ThemeProvider theme={theme}>
715
- <EmotionThemeProvider theme={theme}>
716
- <CssBaseline />
717
- <App />
718
- </EmotionThemeProvider>
719
- </ThemeProvider>
720
- </StyledEngineProvider>
721
- );
722
- };
723
-
724
- root.render(
725
- <React.StrictMode>
726
- <RootApp />
727
- </React.StrictMode>
728
- );
729
- ```
730
-
731
- **/public/index.html**
732
-
733
- ```html
734
- <!doctype html>
735
- <html lang="en">
736
- <head>
737
- <meta charset="UTF-8" />
738
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
739
- <link rel="preconnect" href="https://fonts.googleapis.com" />
740
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
741
- <link
742
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
743
- rel="stylesheet"
744
- />
745
- <link
746
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
747
- rel="stylesheet"
748
- />
749
- </head>
750
- <body>
751
- <div id="root"></div>
752
- </body>
753
- </html>
754
- ```
755
-
756
- **/package.json**
757
-
758
- ```json
759
- {
760
- "dependencies": {
761
- "react": "^18.0.0",
762
- "react-dom": "^18.0.0",
763
- "react-scripts": "^4.0.0"
764
- },
765
- "devDependencies": {
766
- "@types/react": "^18.0.0",
767
- "@types/react-dom": "^18.0.0",
768
- "typescript": "^4.0.0"
769
- },
770
- "main": "/index.tsx"
771
- }
772
- ```
773
-
774
- ---