@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,1190 +0,0 @@
1
- # Navigation
2
-
3
- Navigation components enable users to move around an application, either between pages or within the same page, and help facilitate user's ability to find relevant content and tools.
4
-
5
- ## Overview
6
-
7
- ## Jump-to Navigation
8
-
9
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
10
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
11
-
12
- The Jump-to Navigation component can contain as many Nav Items as necessary though must have a minimum of two. Each Nav Item is tied to a a section of the page and functions as a jump link to that page section. It is positioned on the right side of the page, anchored to the top of the page’s first paragraph and remains sticky on the page as the user scrolls; once the user scrolls into a new section, the active indicator on that section is highlighted until the user scrolls beyond it and into the next (or previous) at which point the indictor moves again. When the user clicks on any of the Nav Items, the page will smooth scroll to that section of the page.
13
-
14
- | **Default / Active** | **Hover** |
15
- | -------------------- | --------- |
16
-
17
- **NavigationJumpTo**
18
-
19
- ---
20
-
21
- **NavigationJumpTo**
22
-
23
- ---
24
-
25
- ---
26
-
27
- ### Jump-to Navigation Spacing
28
-
29
- These rules establish how much margin should exist between and around elements.
30
-
31
- **Jump-to Navigation spacing**
32
-
33
- ---
34
-
35
- ## Code
36
-
37
- ## Jump-to Navigation Component
38
-
39
- | Below you will find an interactive Storybook iframe for the Jump-to Navigation. 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:** NavigationJumpTo |
40
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------- |
41
-
42
- ---
43
-
44
- > 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.
45
-
46
- ### NavigationJumpTo
47
-
48
- Default
49
-
50
- ---
51
-
52
- Navigation components enable users to move around an application, either between pages or within the same page, and help facilitate user's ability to find relevant content and tools.
53
-
54
- ## Overview
55
-
56
- ## Jump-to Navigation
57
-
58
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
59
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
60
-
61
- The Jump-to Navigation component can contain as many Nav Items as necessary though must have a minimum of two. Each Nav Item is tied to a a section of the page and functions as a jump link to that page section. It is positioned on the right side of the page, anchored to the top of the page’s first paragraph and remains sticky on the page as the user scrolls; once the user scrolls into a new section, the active indicator on that section is highlighted until the user scrolls beyond it and into the next (or previous) at which point the indictor moves again. When the user clicks on any of the Nav Items, the page will smooth scroll to that section of the page.
62
-
63
- Use a positive pixel value in the `offset` prop to adjust where on the page the user is navigated to in relation to the top of each section.
64
-
65
- | **Default / Active** | **Hover** |
66
- | -------------------- | --------- |
67
-
68
- **NavigationJumpTo**
69
-
70
- ---
71
-
72
- **NavigationJumpTo**
73
-
74
- ---
75
-
76
- ---
77
-
78
- ### Jump-to Navigation Spacing
79
-
80
- These rules establish how much margin should exist between and around elements.
81
-
82
- **Jump-to Navigation spacing**
83
-
84
- ---
85
-
86
- ---
87
-
88
- ### Indicator Variations
89
-
90
- The color of the position indicator can be adjusted using the `indicatorColor` prop, allowing designers to customize the designs based on their needs.
91
-
92
- Each color option is demonstrated below:
93
-
94
- | **Beta** | **Error** | **Gray** | **Info** |
95
- | -------- | --------- | -------- | -------- |
96
-
97
- **Jump-to Nav_Beta**
98
-
99
- ---
100
-
101
- **Jump-to Nav_Error**
102
-
103
- ---
104
-
105
- **Jump-to Nav_Gray**
106
-
107
- ---
108
-
109
- **Jump-to Nav_Info**
110
-
111
- ---
112
-
113
- | **Primary** | **Success** | **Warning** |
114
- | ----------- | ----------- | ----------- |
115
-
116
- **Jump-to Nav_Primary**
117
-
118
- ---
119
-
120
- **Jump-to Nav_Success**
121
-
122
- ---
123
-
124
- **Jump-to Nav_Warning**
125
-
126
- ---
127
-
128
- ## Code
129
-
130
- ## Jump-to Navigation Component
131
-
132
- | Below you will find an interactive Storybook iframe for the Jump-to Navigation. 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:** NavigationJumpTo |
133
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------- |
134
-
135
- ---
136
-
137
- ### NavigationJumpTo
138
-
139
- Default
140
-
141
- ---
142
-
143
- Navigation components enable users to move around an application, either between pages or within the same page, and help facilitate users' abilities to find relevant content and tools.
144
-
145
- ## Guidelines
146
-
147
- ## Navigation Components
148
-
149
- | Header and Footer Navigation provide the primary means for users to move between the top-level pages of an application as well as access important sections and links to relevant external content; they always sit at the top and bottom of the page respectively. Jump-to Navigation enables users to move between main sections on a single page, making it easy for users to traverse large amounts of content. | | **Jump to component:** Header Navigation Footer Navigation Jump-to Navigation |
150
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------------------------------------- |
151
-
152
- ### Visual Preview
153
-
154
- **Preview_Guidelines_NavigationHeader**
155
-
156
- ---
157
-
158
- **Preview_Guidelines_NavigationFooter**
159
-
160
- ---
161
-
162
- **Preview_Guidelines_NavigationJumpTo**
163
-
164
- ---
165
-
166
- ---
167
-
168
- ## Header Navigation
169
-
170
- | | In Figma | | | Meets Accessibility | | | In Code |
171
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
172
-
173
- ### Live Instance
174
-
175
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
176
-
177
- Default
178
-
179
- ---
180
-
181
- ### Header Navigation Anatomy
182
-
183
- Header Navigation contains the following elements:
184
-
185
- - Logo – when clicked, brings users back to the main landing page of the application
186
- - Primary navigation group – contains navigation items that serve as the way users move between the main pages of the application
187
- - Secondary navigation group – contains navigation items that are used to link out to relevant external sites, help or FAQ pages, tutorials, additional resources, etc.
188
- - Optionally, secondary navigation items can display sub-navigation items when additional navigation options within the same category are needed
189
- - Buttons – can be used for application-level tasks, account login and management, etc.
190
- - Search Input – searches across the entire application
191
-
192
- All elements besides the logo section are optional and their usage should be determined by the application's information architecture.
193
-
194
- Header Navigation can optionally be displayed using an inverted color scheme for better contrast or for stylistic reasons.
195
-
196
- #### Wide
197
-
198
- **NavigationHeader anatomy_wide**
199
-
200
- ---
201
-
202
- #### Narrow
203
-
204
- **NavigationHeader anatomy_narrow**
205
-
206
- ---
207
-
208
- ---
209
-
210
- ### Header Navigation Types
211
-
212
- Once implemented into an application, the Header Navigation type displayed will be automatically determined by the user's viewport width; the point at which one type is displayed over the other can be manually adjusted in code.
213
-
214
- **NavigationHeader_wide**
215
-
216
- ---
217
-
218
- **NavigationHeader_narrow**
219
-
220
- ---
221
-
222
- ---
223
-
224
- ### Header Navigation – Wide
225
-
226
- Use Wide when pages are being displayed at a **Large** or **Medium** breakpoint (though in some cases Header Navigation – Narrow may be preferable for Medium breakpoints; see Responsive Design for more information).
227
-
228
- The arrangement of the primary navigation group and the Search Input can be flipped depending on the application's navigation needs.
229
-
230
- | Default | Default (inverted) |
231
- | ------- | ------------------ |
232
-
233
- **NavigationHeader_wide_default**
234
-
235
- ---
236
-
237
- **NavigationHeader_wide_inverted**
238
-
239
- ---
240
-
241
- #### Primary Navigation Items
242
-
243
- | Default | Default (expandable) | Hover | Hover (expandable) | Selected | Open (expandable) |
244
- | ------- | -------------------- | ----- | ------------------ | -------- | ----------------- |
245
-
246
- **NavigationHeader_NavItem_Primary_wide_default**
247
-
248
- ---
249
-
250
- **NavigationHeader_NavItem_Primary_wide_default_expandable**
251
-
252
- ---
253
-
254
- **NavigationHeader_NavItem_Primary_wide_hover**
255
-
256
- ---
257
-
258
- **NavigationHeader_NavItem_Primary_wide\_\_hover_expandable**
259
-
260
- ---
261
-
262
- **NavigationHeader_NavItem_Primary_wide_active**
263
-
264
- ---
265
-
266
- **NavigationHeader_NavItem_Primary_wide_active_expandable**
267
-
268
- ---
269
-
270
- #### Secondary Navigation Items
271
-
272
- | Default | Default (expandable) | Hover | Hover (expandable) | Pressed | Open (expandable) |
273
- | ------- | -------------------- | ----- | ------------------ | ------- | ----------------- |
274
-
275
- **NavigationHeader_NavItem_Secondary_wide_default**
276
-
277
- ---
278
-
279
- **NavigationHeader_NavItem_Secondary_wide_expandable_default**
280
-
281
- ---
282
-
283
- **NavigationHeader_NavItem_Secondary_wide_hover**
284
-
285
- ---
286
-
287
- **NavigationHeader_NavItem_Secondary_wide_expandable_hover**
288
-
289
- ---
290
-
291
- **NavigationHeader_NavItem_Secondary_wide_pressed**
292
-
293
- ---
294
-
295
- **NavigationHeader_NavItem_Secondary_wide_expandable_open**
296
-
297
- ---
298
-
299
- ---
300
-
301
- ### Header Navigation – Narrow
302
-
303
- Use Narrow when pages are being displayed at a **Small** breakpoint (though in some cases a Header Navigation – Narrow may be preferable for Medium breakpoints; see Responsive Design for more information).
304
-
305
- | Default (closed) | Default (closed; inverted) | Default (open) | Default (open; inverted) |
306
- | ---------------- | -------------------------- | -------------- | ------------------------ |
307
-
308
- **NavigationHeader_narrow_closed_default**
309
-
310
- ---
311
-
312
- **NavigationHeader_narrow_closed_inverted**
313
-
314
- ---
315
-
316
- **NavigationHeader_narrow_open_default**
317
-
318
- ---
319
-
320
- **NavigationHeader_narrow_open_inverted**
321
-
322
- ---
323
-
324
- #### Primary Navigation Items
325
-
326
- | Default | Default (collapsed) | Default (expanded) | Hover | Hover (collapsed) | Hover (expanded) | Active |
327
- | ------- | ------------------- | ------------------ | ----- | ----------------- | ---------------- | ------ |
328
-
329
- **NavigationHeader_NavItem_Primary_narrow_default**
330
-
331
- ---
332
-
333
- **NavigationHeader_NavItem_Primary_narrow_default_expandable**
334
-
335
- ---
336
-
337
- **NavigationHeader_NavItem_Primary_narrow_default_expanded**
338
-
339
- ---
340
-
341
- **NavigationHeader_NavItem_Primary_narrow_hover**
342
-
343
- ---
344
-
345
- **NavigationHeader_NavItem_Primary_narrow_hover_expandable_closed**
346
-
347
- ---
348
-
349
- **NavigationHeader_NavItem_Primary_narrow_hover_expandable_open**
350
-
351
- ---
352
-
353
- **NavigationHeader_NavItem_Primary_narrow_active**
354
-
355
- ---
356
-
357
- #### Primary Sub-navigation Items
358
-
359
- | Default | Hover |
360
- | ------- | ----- |
361
-
362
- **NavigationHeader_NavSubitem_Primary_narrow_default**
363
-
364
- ---
365
-
366
- **NavigationHeader_NavSubitem_Primary_narrow_hover**
367
-
368
- ---
369
-
370
- #### Secondary Navigation Items
371
-
372
- | Default | Default (collapsed) | Default (expanded) | Hover | Hover (collapsed) | Hover (expanded) |
373
- | ------- | ------------------- | ------------------ | ----- | ----------------- | ---------------- |
374
-
375
- **NavigationHeader_NavItem_Secondary_narrow_default**
376
-
377
- ---
378
-
379
- **NavigationHeader_NavItem_Secondary_narrow_expandable_closed_default**
380
-
381
- ---
382
-
383
- **NavigationHeader_NavItem_Secondary_narrow_expandable_open_default**
384
-
385
- ---
386
-
387
- **NavigationHeader_NavItem_Secondary_narrow_hover**
388
-
389
- ---
390
-
391
- **NavigationHeader_NavItem_Secondary_narrow_expandable_closed_hover**
392
-
393
- ---
394
-
395
- **NavigationHeader_NavItem_Secondary_narrow_expandable_open_hover**
396
-
397
- ---
398
-
399
- #### Secondary Sub-navigation Items
400
-
401
- | Default | Hover |
402
- | ------- | ----- |
403
-
404
- **NavigationHeader_NavSubitem_Secondary_narrow_default**
405
-
406
- ---
407
-
408
- **NavigationHeader_NavSubitem_Secondary_narrow_hover**
409
-
410
- ---
411
-
412
- ---
413
-
414
- ## Footer Navigation
415
-
416
- | | In Figma | | | Meets Accessibility | | | In Code |
417
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
418
-
419
- ### Live Instance
420
-
421
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
422
-
423
- Default
424
-
425
- ---
426
-
427
- ### Footer Navigation Anatomy
428
-
429
- Footer Navigation contains the following elements:
430
-
431
- - Primary logo – when clicked, brings users back to the main landing page of the application
432
- - Secondary logo group – for logos of partner institutions or other entities
433
- - Navigation group – contains navigation items that serve as the way users move between the pages of the application
434
- - It is recommended, though not required, that the Navigation Items in Navigation Footer match the Navigation Items found in the Primary Navigation group in Navigation Header, making for unified navigation across the application
435
- - Link group – contains links to tertiary pages like Terms of Service, Privacy Policies, etc.
436
-
437
- All elements besides the logo section are optional and their usage should be determined by the application's information architecture.
438
-
439
- Header Navigation can optionally be displayed using an inverted color scheme for better contrast or for stylistic reasons.
440
-
441
- #### Wide
442
-
443
- **NavigationFooter anatomy_wide**
444
-
445
- ---
446
-
447
- #### Narrow
448
-
449
- **NavigationFooter anatomy_narrow**
450
-
451
- ---
452
-
453
- ---
454
-
455
- ### Footer Navigation Types
456
-
457
- Once implemented into an application, the Footer Navigation type displayed will be automatically determined by the user's viewport width; the point at which one type is displayed over the other can be manually adjusted in code.
458
-
459
- **NavigationFooter_wide**
460
-
461
- ---
462
-
463
- **NavigationFooter_narrow**
464
-
465
- ---
466
-
467
- ---
468
-
469
- ### Footer Navigation – Wide
470
-
471
- Use Wide when pages are being displayed at a **Large** or **Medium** breakpoint (though in some cases Footer Navigation – Narrow may be preferable for Medium breakpoints; see Responsive Design for more information).
472
-
473
- | Default | Default (inverted) |
474
- | ------- | ------------------ |
475
-
476
- **NavigationFooter_wide_default**
477
-
478
- ---
479
-
480
- **NavigationFooter_wide_inverted**
481
-
482
- ---
483
-
484
- #### Navigation Items
485
-
486
- | Default | Hover | Pressed |
487
- | ------- | ----- | ------- |
488
-
489
- **NavigationFooter_NavItem_wide_default**
490
-
491
- ---
492
-
493
- **NavigationFooter_NavItem_wide_hover**
494
-
495
- ---
496
-
497
- **NavigationFooter_NavItem_wide_pressed**
498
-
499
- ---
500
-
501
- #### Link Items
502
-
503
- | Default | Hover | Pressed |
504
- | ------- | ----- | ------- |
505
-
506
- **NavigationFooter_LinkItem_wide_default**
507
-
508
- ---
509
-
510
- **NavigationFooter_LinkItem_wide_hover**
511
-
512
- ---
513
-
514
- **NavigationFooter_LinkItem_wide_pressed**
515
-
516
- ---
517
-
518
- ---
519
-
520
- ### Footer Navigation – Narrow
521
-
522
- Use Narrow when pages are being displayed at a **Small** breakpoint (though in some cases a Footer Navigation – Narrow may be preferable for Medium breakpoints; see Responsive Design for more information).
523
-
524
- | Default | Default (inverted) |
525
- | ------- | ------------------ |
526
-
527
- **NavigationFooter_narrow_default**
528
-
529
- ---
530
-
531
- **NavigationFooter_narrow_inverted**
532
-
533
- ---
534
-
535
- #### Navigation Items
536
-
537
- | Default | Hover | Pressed |
538
- | ------- | ----- | ------- |
539
-
540
- **NavigationFooter_NavItem_narrow_default**
541
-
542
- ---
543
-
544
- **NavigationFooter_NavItem_narrow_hover**
545
-
546
- ---
547
-
548
- **NavigationFooter_NavItem_narrow_pressed**
549
-
550
- ---
551
-
552
- #### Link Items
553
-
554
- | Default | Hover | Pressed |
555
- | ------- | ----- | ------- |
556
-
557
- **NavigationFooter_LinkItem_narrow_default**
558
-
559
- ---
560
-
561
- **NavigationFooter_LinkItem_narrow_hover**
562
-
563
- ---
564
-
565
- **NavigationFooter_LinkItem_narrow_pressed**
566
-
567
- ---
568
-
569
- ---
570
-
571
- ## Jump-to Navigation
572
-
573
- | | In Figma | | | Meets Accessibility | | | In Code |
574
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
575
-
576
- ### Live Instance
577
-
578
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
579
-
580
- Default
581
-
582
- ---
583
-
584
- ### Overview
585
-
586
- The Jump-to Navigation component can contain as many Nav Items as necessary though must have a minimum of two. Each Nav Item is tied to a a section of the page and functions as a jump link to that page section. It is positioned on the right side of the page, anchored to the top of the page’s first paragraph and remains sticky on the page as the user scrolls; once the user scrolls into a new section, the active indicator on that section is highlighted until the user scrolls beyond it and into the next (or previous) at which point the indictor moves again. When the user clicks on any of the Nav Items, the page will smooth scroll to that section of the page.
587
-
588
- | Default / Active | Hover |
589
- | ---------------- | ----- |
590
-
591
- **Jump-to Nav_Default_Active**
592
-
593
- ---
594
-
595
- **Jump-to Nav_Hover**
596
-
597
- ---
598
-
599
- ---
600
-
601
- ### Jump-to Navigation Spacing
602
-
603
- These rules establish how much margin should exist between and around elements.
604
-
605
- **Jump-to Navigation spacing**
606
-
607
- ---
608
-
609
- ## Code
610
-
611
- ## Navigation Components
612
-
613
- | Header and Footer Navigation provide the primary means for users to move between the top-level pages of an application as well as access important sections and links to relevant external content; they always sit at the top and bottom of the page respectively. Jump-to Navigation enables users to move between main sections on a single page, making it easy for users to traverse large amounts of content. | | **Jump to component:** NavigationHeader NavigationFooter NavigationJumpTo |
614
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------- |
615
-
616
- ### Visual Preview
617
-
618
- **Preview_Code_NavigationHeader**
619
-
620
- ---
621
-
622
- **Preview_Code_NavigationFooter**
623
-
624
- ---
625
-
626
- **Preview_Code_NavigationJumpTo**
627
-
628
- ---
629
-
630
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
631
-
632
- ---
633
-
634
- ## NavigationHeader
635
-
636
- ### SDS Source Code
637
-
638
- The component's source code in the SDS codebase can be found here.
639
-
640
- ### Props
641
-
642
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
643
-
644
- | Name | Type | Default | Description |
645
- | ------------------------ | ------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------ | --------- | ------------------- | ------------------------- | --------- | --------------------------- |
646
- | `activePrimaryNavKey` | `string` | - | The key of the currently active primary navigation item. |
647
- | `setActivePrimaryNavKey` | `(key: string) => void` | - | Callback function to set the active primary navigation key. |
648
- | `buttons` | `ButtonProps[]` | - | An array of buttons displayed in the header. |
649
- | `hasInvertedStyle` | `boolean` | `false` | When set to `true`, applies an inverted color scheme to the header component. |
650
- | `logo` | `ReactNode` | - | The logo displayed in the header. Can be an image, icon, svg or any ReactNode. |
651
- | `logoUrl` | `string` | - | URL for the logo link. If provided, clicking the logo navigates to this URL. |
652
- | `logoLinkComponent` | `ElementType` | `a` | Specifies the component to use for the logo link. |
653
- | `logoLinkProps` | `LinkProps` | - | Props to pass to the logo link component. |
654
- | `primaryNavItems` | `NavigationHeaderPrimaryNavItem<T>[]` | - | List of items for the primary navigation section. |
655
- | `primaryNavPosition` | `"left"` | `"right"` | `"left"` | Position of the primaryNavItems list. If set to `"left"`, the items appear to the left of the search bar. If set to `"right"`, they are positioned next to the secondaryNavItems on the right. |
656
- | `isSticky` | `boolean` | `true` | When true, the navigation header sticks to the top of the page on scroll. When false, it scrolls up with the rest of the page. |
657
- | `showSearch` | `boolean` | `true` | Whether to display the search input in the header. |
658
- | `searchProps` | `Partial<InputSearchProps>` | - | Props passed to the search input component. |
659
- | `secondaryNavItems` | `NavigationHeaderSecondaryNavItem[]` | - | List of items for the secondary navigation section. |
660
- | `scrollElevation` | `boolean` | `true` | Controls whether a shadow is shown under the Nav when scrolling. |
661
- | `tag` | `string` | - | A small label displayed next to the title. |
662
- | `tagColor` | ` | "info"` ` | "positive"` ` | "notice"` ` | "negative"` ` | "neutral"` ` | "beta"` ` | [string, string]` ` | [string, string, string]` | `neutral` | The color of the tag label. |
663
- | `title` | `string` | - | The main title displayed in the header. |
664
-
665
- > **Important Note!**
666
- >
667
- > The NavigationHeader component automatically switches to a mobile-friendly version when there isn’t enough space to display the full header.
668
-
669
- ### Code examples
670
-
671
- The example below shows a NavigationHeader component with all the possible sections available.
672
-
673
- > **Note:** Due to a bug in Zeroheight we are unable to publish code examples at this time; we will update this section once a fix is released.
674
-
675
- ---
676
-
677
- ## NavigationFooter
678
-
679
- ### SDS Source Code
680
-
681
- The component's source code in the SDS codebase can be found here.
682
-
683
- ### Props
684
-
685
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
686
-
687
- | Name | Type | Default | Description |
688
- | ------------------ | --------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------- |
689
- | `hasInvertedStyle` | `boolean` | `false` | If true, applies an inverted (dark-on-light) color scheme to the footer. |
690
- | `images` | `FooterImage[]` | `-` | An array of images displayed in the footer. Each item includes an image, optional link URL, and component. |
691
- | `logo` | `ReactNode` | `-` | The logo displayed in the footer. Can be any valid React node such as an image, icon, or SVG. |
692
- | `logoUrl` | `string` | `-` | If provided, clicking the logo will navigate to this URL. |
693
- | `logoComponent` | `ElementType` | `"a"` | Specifies the component to use for the logo link. Defaults to an anchor tag. |
694
- | `logoLinkProps` | `Record<string, unknown>` | `-` | Additional props passed to the logo link component. |
695
- | `navItems` | `NavigationFooterNavItem[]` | `-` | List of navigation items displayed next to the logo. |
696
- | `navLinks` | `NavigationFooterNavItem[]` | `-` | List of secondary links shown at the bottom section of the footer. |
697
- | `tag` | `string` | `-` | A small label displayed next to the title. |
698
- | `tagColor` | `TagProps["tagColor"]` | `"neutral"` | The color of the tag. Accepts predefined tag color values from the Tag component. |
699
- | `title` | `string` | `-` | The main title displayed in the footer. |
700
-
701
- ### FooterImage
702
-
703
- | Name | Type | Default | Description |
704
- | ----------- | ------------------------- | ------- | -------------------------------------------------------------------------------- |
705
- | `image` | `ReactNode` | `-` | The image element to be displayed. Can be an icon, image, SVG, or any ReactNode. |
706
- | `url` | `string` | `-` | Optional URL to navigate to when the image is clicked. |
707
- | `component` | `ElementType` | `"a"` | Custom link component to use for navigation (e.g., a router link). |
708
- | `linkProps` | `Record<string, unknown>` | `-` | Additional props passed to the link component. |
709
-
710
- ### NavigationFooterNavItem
711
-
712
- | Name | Type | Default | Description |
713
- | ----------- | ------------------------- | ------- | --------------------------------------------------------- |
714
- | `label` | `string` | `-` | The text label displayed for the navigation item. |
715
- | `url` | `string` | `-` | Optional URL the item links to. |
716
- | `component` | `ElementType` | `"a"` | Custom component to render the link (e.g., Next.js Link). |
717
- | `linkProps` | `Record<string, unknown>` | `-` | Props forwarded to the link component. |
718
-
719
- ### Code examples
720
-
721
- > **Note:** Due to a bug in Zeroheight we are unable to publish code examples at this time; we will update this section once a fix is released.
722
-
723
- ---
724
-
725
- ## NavigationJumpTo
726
-
727
- ### SDS Source Code
728
-
729
- The component's source code in the SDS codebase can be found here.
730
-
731
- ### SDS vs MUI
732
-
733
- SDS's `NavigationJumpTo` uses MUI's `Tab` component under the hood. `NavigationJumpTo` acts as an indicator of where a user is on a page as well as allowing them to navigate to different page sections. It differs from MUI's `Tab` component in a few main ways:
734
-
735
- **`orientation`\*\***:\*\* SDS's `NavigationJumpTo` design only supports `orientation="vertical"`, which is baked into its code by default, whereas the default `orientation` value for MUI's `Tab` component is `horizontal`. Setting `orientation="horizontal"` on `NaviagationJumpTo` is not recommended.
736
-
737
- **`textColor`\*\***:\*\* Changing the text color of a tab within `NavigationJumpTo` is not currently supported. However, you can still change the `indicatorColor`; it will take any of the SDS colors (`beta`, `error`, `gray`, `info`, `primary`, `success`, `warning`).
738
-
739
- **`icon`\*\***:\*\* `NavigationJumpTo` does not support the inclusion of icons.
740
-
741
- **`offsetTop`\*\***:\*\* This prop is exclusive to `NavigationJumpTo` and takes a number between 0 to 100. It means that a section indicator will turn on when the top of that section is the specified number of pixels below the top of the window. This is used to adjust when the section indicator moves to a different section based on the preference of a team.
742
-
743
- ### MUI Documentation
744
-
745
- Documentation for the underlying MUI component can be found here.
746
-
747
- ### Props
748
-
749
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
750
-
751
- | Name | Type | Default | Description |
752
- | ----------- | -------------------------------------------------------------------------- | --------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
753
- | `items` | `Array<{` `title: string;` `elementRef: React.MutableRefObject<HTMLElement | null>;` `}>;` | `-` | An array of items to be displayed in the NavigationJumpTo component. |
754
- | `offsetTop` | `number` | `-` | The top offset for scrolling, measured in pixels comes before the target element during scrolling. |
755
- | `onChange` | `(` `value: number,` `event?: React.SyntheticEvent,` `type?: "click" | "scroll"``) => void;` | `-` | Defines the action to be taken when the value changes. |
756
-
757
- ### Code examples
758
-
759
- #### Default Navigation Menu
760
-
761
- This example shows the default props needed to render `NavigationJumpTo`.
762
-
763
- **/styles.css**
764
-
765
- ```css
766
- body {
767
- font-size: 13px;
768
- font-weight: 400;
769
- letter-spacing: 0.08px;
770
- line-height: 20px;
771
- text-transform: none;
772
- font-family: "Inter", sans-serif;
773
- }
774
-
775
- h1 {
776
- font-size: 1.5rem;
777
- }
778
-
779
- .app {
780
- padding: 20px;
781
- }
782
- ```
783
-
784
- **tsconfig.json**
785
-
786
- ```json
787
- {
788
- "include": ["./**/*"],
789
- "compilerOptions": {
790
- "strict": true,
791
- "esModuleInterop": true,
792
- "lib": ["dom", "es2015"],
793
- "jsx": "react-jsx"
794
- }
795
- }
796
- ```
797
-
798
- **/App.tsx**
799
-
800
- ```tsx
801
- import { NavigationJumpTo } from "@czi-sds/components";
802
- import "./styles.css";
803
-
804
- function App() {
805
- return (
806
- <div className="app">
807
- <NavigationJumpTo
808
- items={[
809
- { elementRef: { current: null }, title: "Item 1" },
810
- { elementRef: { current: null }, title: "Item 2" },
811
- { elementRef: { current: null }, title: "Item 3" },
812
- { elementRef: { current: null }, title: "Item 4" },
813
- { elementRef: { current: null }, title: "Item 5" },
814
- ]}
815
- />
816
- </div>
817
- );
818
- }
819
-
820
- export default App;
821
- ```
822
-
823
- **/index.tsx**
824
-
825
- ```tsx
826
- import React from "react";
827
- import { createRoot } from "react-dom/client";
828
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
829
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
830
- import { Theme } from "@czi-sds/components";
831
- import CssBaseline from "@mui/material/CssBaseline";
832
- import useMediaQuery from "@mui/material/useMediaQuery";
833
-
834
- import App from "./App";
835
-
836
- const container = document.getElementById("root");
837
- const root = createRoot(container!);
838
-
839
- const RootApp = () => {
840
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
841
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
842
-
843
- return (
844
- <StyledEngineProvider injectFirst>
845
- <ThemeProvider theme={theme}>
846
- <EmotionThemeProvider theme={theme}>
847
- <CssBaseline />
848
- <App />
849
- </EmotionThemeProvider>
850
- </ThemeProvider>
851
- </StyledEngineProvider>
852
- );
853
- };
854
-
855
- root.render(
856
- <React.StrictMode>
857
- <RootApp />
858
- </React.StrictMode>
859
- );
860
- ```
861
-
862
- **/public/index.html**
863
-
864
- ```html
865
- <!doctype html>
866
- <html lang="en">
867
- <head>
868
- <meta charset="UTF-8" />
869
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
870
- <link rel="preconnect" href="https://fonts.googleapis.com" />
871
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
872
- <link
873
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
874
- rel="stylesheet"
875
- />
876
- <link
877
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
878
- rel="stylesheet"
879
- />
880
- </head>
881
- <body>
882
- <div id="root"></div>
883
- </body>
884
- </html>
885
- ```
886
-
887
- **/package.json**
888
-
889
- ```json
890
- {
891
- "dependencies": {
892
- "react": "^18.0.0",
893
- "react-dom": "^18.0.0",
894
- "react-scripts": "^4.0.0"
895
- },
896
- "devDependencies": {
897
- "@types/react": "^18.0.0",
898
- "@types/react-dom": "^18.0.0",
899
- "typescript": "^4.0.0"
900
- },
901
- "main": "/index.tsx"
902
- }
903
- ```
904
-
905
- ---
906
-
907
- #### Full NavigationJumpTo demo with corresponding sections
908
-
909
- This comprehensive example demonstrates the functionality of `NavigationJumpTo` within a dynamic web page layout. The example features a series of sections with varying heights, creating a scrolling effect. Users can easily navigate between these sections using the `NavigationJumpTo` component.
910
-
911
- **/styles.css**
912
-
913
- ```css
914
- body {
915
- font-size: 13px;
916
- font-weight: 400;
917
- letter-spacing: 0.08px;
918
- line-height: 20px;
919
- text-transform: none;
920
- font-family: "Inter", sans-serif;
921
- }
922
-
923
- h1 {
924
- font-size: 1.5rem;
925
- }
926
-
927
- .app {
928
- padding: 20px;
929
- }
930
- ```
931
-
932
- **tsconfig.json**
933
-
934
- ```json
935
- {
936
- "include": ["./**/*"],
937
- "compilerOptions": {
938
- "strict": true,
939
- "esModuleInterop": true,
940
- "lib": ["dom", "es2015"],
941
- "jsx": "react-jsx"
942
- }
943
- }
944
- ```
945
-
946
- **/App.tsx**
947
-
948
- ```tsx
949
- import { forwardRef, useState, useRef } from "react";
950
- import {
951
- InputSlider,
952
- NavigationJumpTo,
953
- getSemanticColors,
954
- } from "@czi-sds/components";
955
- import { useTheme } from "@mui/material";
956
- import { Box } from "@mui/material";
957
- import "./styles.css";
958
-
959
- interface TabPanelPropsExtra extends TabPanelProps {
960
- sdsDemoHeight: number;
961
- }
962
-
963
- const TabPanel = forwardRef<HTMLDivElement, TabPanelPropsExtra>(
964
- (props, ref) => {
965
- const { children, sdsDemoHeight, ...other } = props;
966
- const theme = useTheme();
967
- const semanticColors = getSemanticColors({ theme });
968
-
969
- return (
970
- <div
971
- ref={ref}
972
- role="tabpanel"
973
- style={{
974
- alignItems: "center",
975
- backgroundColor: "rgba(0, 0, 0, 0.05)",
976
- color: "black",
977
- display: "flex",
978
- fontFamily: "Open Sans, sans-serif",
979
- fontSize: "36px",
980
- fontWeight: 100,
981
- justifyContent: "center",
982
- margin: "0px 22px 22px 6px",
983
- minHeight: `${sdsDemoHeight}vh`,
984
- textAlign: "center",
985
- }}
986
- {...other}
987
- >
988
- <Box sx={{ p: 3 }}>
989
- {children}
990
- <p style={{ fontSize: 14, margin: "5px 0 0 0" }}>
991
- height: {sdsDemoHeight} vh
992
- </p>
993
- </Box>
994
- </div>
995
- );
996
- }
997
- );
998
-
999
- function App() {
1000
- const [navPanelHeight, setNavPanelHeight] = useState(100);
1001
- const sectionRef0 = useRef(null);
1002
- const sectionRef1 = useRef(null);
1003
- const sectionRef2 = useRef(null);
1004
- const sectionRef3 = useRef(null);
1005
- const sectionRef4 = useRef(null);
1006
-
1007
- return (
1008
- <div className="app">
1009
- <Box
1010
- sx={{
1011
- fontFamily: "Open Sans, sans-serif",
1012
- margin: "0 0 30px 6px",
1013
- width: 250,
1014
- }}
1015
- >
1016
- <p id="nav-item-height-slider" style={{ marginBottom: "5px" }}>
1017
- Section panel height:
1018
- </p>
1019
- <InputSlider
1020
- aria-labelledby="nav-item-height-slider"
1021
- min={20}
1022
- max={120}
1023
- step={1}
1024
- onChange={(_, value) => {
1025
- setNavPanelHeight(value as number);
1026
- }}
1027
- defaultValue={100}
1028
- marks={[
1029
- { label: "20", value: 20 },
1030
- { label: "40", value: 40 },
1031
- { label: "60", value: 60 },
1032
- { label: "80", value: 80 },
1033
- { label: "100", value: 100 },
1034
- { label: "120", value: 120 },
1035
- ]}
1036
- />
1037
- </Box>
1038
-
1039
- <Box
1040
- sx={{
1041
- display: "flex",
1042
- flexDirection: "row-reverse",
1043
- position: "relative",
1044
- width: "100%",
1045
- }}
1046
- >
1047
- <Box sx={{ width: 150 }}>
1048
- <NavigationJumpTo
1049
- items={[
1050
- { elementRef: sectionRef0, title: "Section 1" },
1051
- { elementRef: sectionRef1, title: "Section 2" },
1052
- { elementRef: sectionRef2, title: "Section 3" },
1053
- { elementRef: sectionRef3, title: "Section 4" },
1054
- { elementRef: sectionRef4, title: "Section 5" },
1055
- ]}
1056
- />
1057
- </Box>
1058
- <Box
1059
- sx={{
1060
- position: "relative",
1061
- width: "100%",
1062
- }}
1063
- >
1064
- <TabPanel
1065
- id="navigation-panel-1"
1066
- ref={sectionRef0}
1067
- sdsDemoHeight={navPanelHeight}
1068
- >
1069
- Section #1
1070
- </TabPanel>
1071
- <TabPanel
1072
- id="navigation-panel-2"
1073
- ref={sectionRef1}
1074
- sdsDemoHeight={navPanelHeight}
1075
- >
1076
- Section #2
1077
- </TabPanel>
1078
- <TabPanel
1079
- id="navigation-panel-3"
1080
- ref={sectionRef2}
1081
- sdsDemoHeight={navPanelHeight}
1082
- >
1083
- Section #3
1084
- </TabPanel>
1085
- <TabPanel
1086
- id="navigation-panel-4"
1087
- ref={sectionRef3}
1088
- sdsDemoHeight={navPanelHeight}
1089
- >
1090
- Section #4
1091
- </TabPanel>
1092
- <TabPanel
1093
- id="navigation-panel-5"
1094
- ref={sectionRef4}
1095
- sdsDemoHeight={navPanelHeight}
1096
- >
1097
- Section #5
1098
- </TabPanel>
1099
- </Box>
1100
- </Box>
1101
- </div>
1102
- );
1103
- }
1104
-
1105
- export default App;
1106
- ```
1107
-
1108
- **/index.tsx**
1109
-
1110
- ```tsx
1111
- import React from "react";
1112
- import { createRoot } from "react-dom/client";
1113
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1114
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1115
- import { Theme } from "@czi-sds/components";
1116
- import CssBaseline from "@mui/material/CssBaseline";
1117
- import useMediaQuery from "@mui/material/useMediaQuery";
1118
-
1119
- import App from "./App";
1120
-
1121
- const container = document.getElementById("root");
1122
- const root = createRoot(container!);
1123
-
1124
- const RootApp = () => {
1125
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1126
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1127
-
1128
- return (
1129
- <StyledEngineProvider injectFirst>
1130
- <ThemeProvider theme={theme}>
1131
- <EmotionThemeProvider theme={theme}>
1132
- <CssBaseline />
1133
- <App />
1134
- </EmotionThemeProvider>
1135
- </ThemeProvider>
1136
- </StyledEngineProvider>
1137
- );
1138
- };
1139
-
1140
- root.render(
1141
- <React.StrictMode>
1142
- <RootApp />
1143
- </React.StrictMode>
1144
- );
1145
- ```
1146
-
1147
- **/public/index.html**
1148
-
1149
- ```html
1150
- <!doctype html>
1151
- <html lang="en">
1152
- <head>
1153
- <meta charset="UTF-8" />
1154
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1155
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1156
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1157
- <link
1158
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1159
- rel="stylesheet"
1160
- />
1161
- <link
1162
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1163
- rel="stylesheet"
1164
- />
1165
- </head>
1166
- <body>
1167
- <div id="root"></div>
1168
- </body>
1169
- </html>
1170
- ```
1171
-
1172
- **/package.json**
1173
-
1174
- ```json
1175
- {
1176
- "dependencies": {
1177
- "react": "^18.0.0",
1178
- "react-dom": "^18.0.0",
1179
- "react-scripts": "^4.0.0"
1180
- },
1181
- "devDependencies": {
1182
- "@types/react": "^18.0.0",
1183
- "@types/react-dom": "^18.0.0",
1184
- "typescript": "^4.0.0"
1185
- },
1186
- "main": "/index.tsx"
1187
- }
1188
- ```
1189
-
1190
- ---