@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
@@ -1,691 +0,0 @@
1
- # Banners
2
-
3
- Banners are used to communicate product status updates to users, allowing the product teams to provide important information to their users.
4
-
5
- ## Overview
6
-
7
- ## Banner Variants
8
-
9
- | Banners are meant to communicate product status updates to users such as system maintenance, new features, known product bugs or issues. etc. and are not meant to be used in response to an action the user has taken within the product. Use a Callout or Notification for these purposes. There are two Banner variants meant to be used in an alternating manner, allowing multiple Banners to be stacked together while maintaining the ability to differentiate between them. Both Banner variants can optionally be set to be manually dismissible by the user, allowing them to hide the Banner from view once it has been read. Banners span the full width of the page. Follow the usage criteria accompanying each variant as a guide for selecting the correct Banner for any given use case. | | **Jump to variant:** Primary Secondary |
10
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------- |
11
-
12
- ---
13
-
14
- ## Banner
15
-
16
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
17
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
18
-
19
- ### Primary Banner
20
-
21
- Use this variant in instances where only one Banner will be used on the page. If using multiple, this should be the first or top Banner used, followed by the secondary variant. Continue alternating variants for as many Banners as are needed. This ensures the Banners can be differentiated without the need for space or divider lines between them.
22
-
23
- If additional context or information is needed beyond the space available on the Banner, it is recommended that a Link to an additional page with this information is included.
24
-
25
- When the information being communicated on the Banner is intended to remain persistent on the screen and is not manually dismissible by the user, use a persistent Banner. To allow the user to manually dismiss the Banner, use a dismissible Banner.
26
-
27
- **Default (Persistent)**
28
-
29
- ---
30
-
31
- ---
32
-
33
- **Default (Dismissible)**
34
-
35
- ---
36
-
37
- ---
38
-
39
- **Hover (Dismissible)**
40
-
41
- ---
42
-
43
- ### Secondary Banner
44
-
45
- Use only when accompanied by the primary variant. If using multiple, this should be the second Banner used, followed by the primary variant. Continue alternating variants for as many Banners as are needed. This ensures the Banners can be differentiated without the need for space or divider lines between them.
46
-
47
- If additional context or information is needed beyond the space available on the Banner, it is recommended that a Link to an additional page with this information is included.
48
-
49
- When the information being communicated on the Banner is intended to remain persistent on the screen and is not manually dismissible by the user, use a persistent Banner. To allow the user to manually dismiss the Banner, use a dismissible Banner.
50
-
51
- **Default (Persistent)**
52
-
53
- ---
54
-
55
- ---
56
-
57
- **Default (Dismissible)**
58
-
59
- ---
60
-
61
- ---
62
-
63
- **Hover (Dismissible)**
64
-
65
- ---
66
-
67
- ---
68
-
69
- ### Banner Spacing
70
-
71
- These rules establish how much margin should exist between and around elements.
72
-
73
- **Banner spacing**
74
-
75
- ---
76
-
77
- ## Code
78
-
79
- ## Banner Component
80
-
81
- | Below you will find an interactive Storybook iframe for Banners. 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:** Banner |
82
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------- |
83
-
84
- ---
85
-
86
- ### Banner
87
-
88
- Storybook
89
-
90
- ---
91
-
92
- Banners are used to communicate product status updates to users, allowing the product teams to provide important information to their users.
93
-
94
- ## Guidelines
95
-
96
- ## Overview
97
-
98
- | | In Figma | | | Meets Accessibility | | | In Code |
99
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
100
-
101
- ### Banner Variants
102
-
103
- Banners communicate product status updates such as system maintenance, new features, known product bugs or issues. etc. and should not be used to respond to actions the user has taken within the product; use a Callout or Notification for these purposes.
104
-
105
- There are two Banner variants: a primary Banner if only one Banner is needed and a secondary Banner if two or more Banners need to be shown at one time. This allows multiple Banners to be stacked together while maintaining the ability to differentiate between them.
106
-
107
- Both Banner variants can optionally be set to be manually dismissible by the user, allowing them to hide the Banner from view once it has been read.
108
-
109
- Banners span the full width of the page.
110
-
111
- **Preview_Guidelines_Banner_Primary**
112
-
113
- ---
114
-
115
- **Preview_Guidelines_Banner_Secondary**
116
-
117
- ---
118
-
119
- ---
120
-
121
- ### Live Instance
122
-
123
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
124
-
125
- Default
126
-
127
- ---
128
-
129
- ### Banner – Primary
130
-
131
- Use Banner – Primary in instances where only one Banner will be used on the page. If using multiple, it should be the first or top Banner used, followed by the secondary variant. Continue alternating variants for as many Banners as are needed. This ensures the Banners can be differentiated without the need for space or divider lines between them.
132
-
133
- If additional context or information is needed beyond the space available on the Banner, it is recommended that a Link to an additional page with this information is included on the Banner which can be inserted using the optional content slot.
134
-
135
- When the information being communicated on the Banner is intended to remain persistent on the screen and is not manually dismissible by the user, use a persistent Banner. To allow the user to manually dismiss the Banner, use a dismissible Banner.
136
-
137
- | Default (Persistent) | Default (Dismissible) | Hover (Dismissible) |
138
- | -------------------- | --------------------- | ------------------- |
139
-
140
- **Banner_Primary_Persistent_Default**
141
-
142
- ---
143
-
144
- **Banner_Primary_Dismissible_Default**
145
-
146
- ---
147
-
148
- **Banner_Primary_Dismissible_Hover**
149
-
150
- ---
151
-
152
- ---
153
-
154
- ### Banner – Secondary
155
-
156
- Use only when accompanied by the primary variant. If using multiple, Banner – Secondary should be the second Banner used, followed by the primary variant. Continue alternating variants for as many Banners as are needed. This ensures the Banners can be differentiated without the need for space or divider lines between them.
157
-
158
- If additional context or information is needed beyond the space available on the Banner, it is recommended that a Link to an additional page with this information is included on the Banner which can be inserted using the optional content slot.
159
-
160
- When the information being communicated on the Banner is intended to remain persistent on the screen and is not manually dismissible by the user, use a persistent Banner. To allow the user to manually dismiss the Banner, use a dismissible Banner.
161
-
162
- | Default (Persistent) | Default (Dismissible) | Hover (Dismissible) |
163
- | -------------------- | --------------------- | ------------------- |
164
-
165
- **Banner_Secondary_Persistent_Default**
166
-
167
- ---
168
-
169
- **Banner_Secondary_Dismissible_Default**
170
-
171
- ---
172
-
173
- **Banner_Secondary_Dismissible_Hover**
174
-
175
- ---
176
-
177
- ---
178
-
179
- ### Banner Spacing
180
-
181
- These rules establish how much margin should exist between and around elements.
182
-
183
- **Banner spacing**
184
-
185
- ---
186
-
187
- ---
188
-
189
- ### Intent Variations
190
-
191
- There are four different intents that Banners can communicate: Info, Negative, Notice, and Positive. Each intent is communicated using color and iconography.
192
-
193
- Each intent is demonstrated below using the Dismissible variant for reference. Regardless of variant, the colors and icons used are the same.
194
-
195
- #### Primary
196
-
197
- | Info | Negative | Notice | Positive |
198
- | ---- | -------- | ------ | -------- |
199
-
200
- **Banner_Primary_Intent_Info**
201
-
202
- ---
203
-
204
- **Banner_Primary_Intent_Negative**
205
-
206
- ---
207
-
208
- **Banner_Primary_Intent_Notice**
209
-
210
- ---
211
-
212
- **Banner_Primary_Intent_Positive**
213
-
214
- ---
215
-
216
- #### Secondary
217
-
218
- | Info | Negative | Notice | Positive |
219
- | ---- | -------- | ------ | -------- |
220
-
221
- **Banner_Secondary_Intent_Info**
222
-
223
- ---
224
-
225
- **Banner_Secondary_Intent_Negative**
226
-
227
- ---
228
-
229
- **Banner_Secondary_Intent_Notice**
230
-
231
- ---
232
-
233
- **Banner_Secondary_Intent_Positive**
234
-
235
- ---
236
-
237
- ## Code
238
-
239
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
240
-
241
- ## Banner
242
-
243
- ### SDS Source Code
244
-
245
- The component's source code in the SDS codebase can be found here.
246
-
247
- ### Props
248
-
249
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
250
-
251
- | Name | Type | Default | Description |
252
- | -------------- | -------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------------------- |
253
- | `dismissed` | `bool` | `false` | If `true`, the banner has been dismissed by the user. |
254
- | `dismissible` | `bool` | `true` | If `true`, the banner can be dismissed by the user. |
255
- | `sdsType` | `"primary"` ` | "secondary"` | `primary` | The `primary` variant has a `400` background color and white text color. The `secondary` variant has a `100` background color and `primary` text color. |
256
- | `icon` | `ReactNode` | `-` | The icon to be displayed within the banner. If not provided, a`InfoCircle` icon will be displayed. |
257
- | `intent` | `"info" | "notice" | "negative" | "positive"` | `info` | The intent color of the Banner component |
258
- | `sdsIconProps` | `Partial<IconProps>` | `-` | Additional props to be passed to the icon component. |
259
- | `onClose` | `fn` | `-` | Callback fired when the component requests to be closed. When provided and no `action` prop is set, a close icon button is displayed that triggers the callback when clicked. **Signature:**`function(event: React.SyntheticEvent) => void` `event`. The event source of the callback. |
260
-
261
- ### Code examples
262
-
263
- #### Default Banner
264
-
265
- This example has the minimum props needed for the `Banner` component.
266
-
267
- **/styles.css**
268
-
269
- ```css
270
- body {
271
- font-size: 13px;
272
- font-weight: 400;
273
- letter-spacing: 0.08px;
274
- line-height: 20px;
275
- text-transform: none;
276
- font-family: "Inter", sans-serif;
277
- }
278
-
279
- h1 {
280
- font-size: 1.5rem;
281
- }
282
-
283
- .app {
284
- padding: 20px;
285
- }
286
- ```
287
-
288
- **tsconfig.json**
289
-
290
- ```json
291
- {
292
- "include": ["./**/*"],
293
- "compilerOptions": {
294
- "strict": true,
295
- "esModuleInterop": true,
296
- "lib": ["dom", "es2015"],
297
- "jsx": "react-jsx"
298
- }
299
- }
300
- ```
301
-
302
- **/App.tsx**
303
-
304
- ```tsx
305
- import { Banner } from "@czi-sds/components";
306
- import "./styles.css";
307
-
308
- function App() {
309
- return (
310
- <div className="app">
311
- <Banner sdsType="primary">
312
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
313
- </Banner>
314
- </div>
315
- );
316
- }
317
-
318
- export default App;
319
- ```
320
-
321
- **/index.tsx**
322
-
323
- ```tsx
324
- import React from "react";
325
- import { createRoot } from "react-dom/client";
326
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
327
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
328
- import { Theme } from "@czi-sds/components";
329
- import CssBaseline from "@mui/material/CssBaseline";
330
- import useMediaQuery from "@mui/material/useMediaQuery";
331
-
332
- import App from "./App";
333
-
334
- const container = document.getElementById("root");
335
- const root = createRoot(container!);
336
-
337
- const RootApp = () => {
338
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
339
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
340
-
341
- return (
342
- <StyledEngineProvider injectFirst>
343
- <ThemeProvider theme={theme}>
344
- <EmotionThemeProvider theme={theme}>
345
- <CssBaseline />
346
- <App />
347
- </EmotionThemeProvider>
348
- </ThemeProvider>
349
- </StyledEngineProvider>
350
- );
351
- };
352
-
353
- root.render(
354
- <React.StrictMode>
355
- <RootApp />
356
- </React.StrictMode>
357
- );
358
- ```
359
-
360
- **/public/index.html**
361
-
362
- ```html
363
- <!doctype html>
364
- <html lang="en">
365
- <head>
366
- <meta charset="UTF-8" />
367
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
368
- <link rel="preconnect" href="https://fonts.googleapis.com" />
369
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
370
- <link
371
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
372
- rel="stylesheet"
373
- />
374
- <link
375
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
376
- rel="stylesheet"
377
- />
378
- </head>
379
- <body>
380
- <div id="root"></div>
381
- </body>
382
- </html>
383
- ```
384
-
385
- **/package.json**
386
-
387
- ```json
388
- {
389
- "dependencies": {
390
- "react": "^18.0.0",
391
- "react-dom": "^18.0.0",
392
- "react-scripts": "^4.0.0"
393
- },
394
- "devDependencies": {
395
- "@types/react": "^18.0.0",
396
- "@types/react-dom": "^18.0.0",
397
- "typescript": "^4.0.0"
398
- },
399
- "main": "/index.tsx"
400
- }
401
- ```
402
-
403
- ---
404
-
405
- #### Persistent Banner
406
-
407
- This example showcases a `Banner` component that cannot be closed or dismissed.
408
-
409
- **/styles.css**
410
-
411
- ```css
412
- body {
413
- font-size: 13px;
414
- font-weight: 400;
415
- letter-spacing: 0.08px;
416
- line-height: 20px;
417
- text-transform: none;
418
- font-family: "Inter", sans-serif;
419
- }
420
-
421
- h1 {
422
- font-size: 1.5rem;
423
- }
424
-
425
- .app {
426
- padding: 20px;
427
- }
428
- ```
429
-
430
- **tsconfig.json**
431
-
432
- ```json
433
- {
434
- "include": ["./**/*"],
435
- "compilerOptions": {
436
- "strict": true,
437
- "esModuleInterop": true,
438
- "lib": ["dom", "es2015"],
439
- "jsx": "react-jsx"
440
- }
441
- }
442
- ```
443
-
444
- **/App.tsx**
445
-
446
- ```tsx
447
- import { Banner } from "@czi-sds/components";
448
- import "./styles.css";
449
-
450
- function App() {
451
- return (
452
- <div className="app">
453
- <Banner sdsType="primary" dismissible={false}>
454
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
455
- </Banner>
456
- </div>
457
- );
458
- }
459
-
460
- export default App;
461
- ```
462
-
463
- **/index.tsx**
464
-
465
- ```tsx
466
- import React from "react";
467
- import { createRoot } from "react-dom/client";
468
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
469
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
470
- import { Theme } from "@czi-sds/components";
471
- import CssBaseline from "@mui/material/CssBaseline";
472
- import useMediaQuery from "@mui/material/useMediaQuery";
473
-
474
- import App from "./App";
475
-
476
- const container = document.getElementById("root");
477
- const root = createRoot(container!);
478
-
479
- const RootApp = () => {
480
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
481
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
482
-
483
- return (
484
- <StyledEngineProvider injectFirst>
485
- <ThemeProvider theme={theme}>
486
- <EmotionThemeProvider theme={theme}>
487
- <CssBaseline />
488
- <App />
489
- </EmotionThemeProvider>
490
- </ThemeProvider>
491
- </StyledEngineProvider>
492
- );
493
- };
494
-
495
- root.render(
496
- <React.StrictMode>
497
- <RootApp />
498
- </React.StrictMode>
499
- );
500
- ```
501
-
502
- **/public/index.html**
503
-
504
- ```html
505
- <!doctype html>
506
- <html lang="en">
507
- <head>
508
- <meta charset="UTF-8" />
509
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
510
- <link rel="preconnect" href="https://fonts.googleapis.com" />
511
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
512
- <link
513
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
514
- rel="stylesheet"
515
- />
516
- <link
517
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
518
- rel="stylesheet"
519
- />
520
- </head>
521
- <body>
522
- <div id="root"></div>
523
- </body>
524
- </html>
525
- ```
526
-
527
- **/package.json**
528
-
529
- ```json
530
- {
531
- "dependencies": {
532
- "react": "^18.0.0",
533
- "react-dom": "^18.0.0",
534
- "react-scripts": "^4.0.0"
535
- },
536
- "devDependencies": {
537
- "@types/react": "^18.0.0",
538
- "@types/react-dom": "^18.0.0",
539
- "typescript": "^4.0.0"
540
- },
541
- "main": "/index.tsx"
542
- }
543
- ```
544
-
545
- ---
546
-
547
- #### Banner with a custom background color
548
-
549
- This example shows how to implement a `Banner` component with a custom background color.
550
-
551
- **/styles.css**
552
-
553
- ```css
554
- body {
555
- font-size: 13px;
556
- font-weight: 400;
557
- letter-spacing: 0.08px;
558
- line-height: 20px;
559
- text-transform: none;
560
- font-family: "Inter", sans-serif;
561
- }
562
-
563
- h1 {
564
- font-size: 1.5rem;
565
- }
566
-
567
- .app {
568
- padding: 20px;
569
- }
570
- ```
571
-
572
- **tsconfig.json**
573
-
574
- ```json
575
- {
576
- "include": ["./**/*"],
577
- "compilerOptions": {
578
- "strict": true,
579
- "esModuleInterop": true,
580
- "lib": ["dom", "es2015"],
581
- "jsx": "react-jsx"
582
- }
583
- }
584
- ```
585
-
586
- **/App.tsx**
587
-
588
- ```tsx
589
- import { styled } from "@mui/material/styles";
590
- import { Banner } from "@czi-sds/components";
591
- import "./styles.css";
592
-
593
- function App() {
594
- const StyledBanner = styled(Banner)`
595
- background-color: Crimson;
596
- `;
597
- return (
598
- <div className="app">
599
- <StyledBanner sdsType="primary">
600
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.
601
- </StyledBanner>
602
- </div>
603
- );
604
- }
605
-
606
- export default App;
607
- ```
608
-
609
- **/index.tsx**
610
-
611
- ```tsx
612
- import React from "react";
613
- import { createRoot } from "react-dom/client";
614
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
615
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
616
- import { Theme } from "@czi-sds/components";
617
- import CssBaseline from "@mui/material/CssBaseline";
618
- import useMediaQuery from "@mui/material/useMediaQuery";
619
-
620
- import App from "./App";
621
-
622
- const container = document.getElementById("root");
623
- const root = createRoot(container!);
624
-
625
- const RootApp = () => {
626
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
627
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
628
-
629
- return (
630
- <StyledEngineProvider injectFirst>
631
- <ThemeProvider theme={theme}>
632
- <EmotionThemeProvider theme={theme}>
633
- <CssBaseline />
634
- <App />
635
- </EmotionThemeProvider>
636
- </ThemeProvider>
637
- </StyledEngineProvider>
638
- );
639
- };
640
-
641
- root.render(
642
- <React.StrictMode>
643
- <RootApp />
644
- </React.StrictMode>
645
- );
646
- ```
647
-
648
- **/public/index.html**
649
-
650
- ```html
651
- <!doctype html>
652
- <html lang="en">
653
- <head>
654
- <meta charset="UTF-8" />
655
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
656
- <link rel="preconnect" href="https://fonts.googleapis.com" />
657
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
658
- <link
659
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
660
- rel="stylesheet"
661
- />
662
- <link
663
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
664
- rel="stylesheet"
665
- />
666
- </head>
667
- <body>
668
- <div id="root"></div>
669
- </body>
670
- </html>
671
- ```
672
-
673
- **/package.json**
674
-
675
- ```json
676
- {
677
- "dependencies": {
678
- "react": "^18.0.0",
679
- "react-dom": "^18.0.0",
680
- "react-scripts": "^4.0.0"
681
- },
682
- "devDependencies": {
683
- "@types/react": "^18.0.0",
684
- "@types/react-dom": "^18.0.0",
685
- "typescript": "^4.0.0"
686
- },
687
- "main": "/index.tsx"
688
- }
689
- ```
690
-
691
- ---