@czi-sds/mcp 0.16.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 +68 -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 +112 -208
  112. package/package.json +9 -5
  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,2015 +0,0 @@
1
- # Tooltips
2
-
3
- Tooltips are used throughout the UI and appear whenever users hover over elements that require additional context, instructions, or details.
4
-
5
- ## Overview
6
-
7
- ## Tooltip Variants
8
-
9
- | Tooltips are always used in conjunction with other elements when there is a need to clarify the element's function further, provide instructions, or display additional details to the user. The variant used depends on the element it is tied to and the area in the UI in which it is located. Follow the usage criteria accompanying each variant as a guide for selecting the correct Tooltip for any given use case. | | **Jump to variant:** Tooltip Condensed |
10
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------- |
11
-
12
- ---
13
-
14
- ## Tooltip
15
-
16
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
17
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
18
-
19
- Use to display supplementary information such as definitions, instructions, or expanded details for elements, such as in combination with Tags to provide definitions of the parameter on the Tag.
20
-
21
- Use the `title` and `footer` props to add optional text to the Tooltip to communicate additional usage or clarifying details such as further instructions for using the element the Tooltip is connected to.
22
-
23
- Use the `placement` prop to indicate from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of the Tooltip, pointing down at the element. See the Placement Variations section for more details.
24
-
25
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
26
-
27
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
28
-
29
- ---
30
-
31
- **Default**
32
-
33
- ---
34
-
35
- ---
36
-
37
- **Default + Title**
38
-
39
- ---
40
-
41
- ---
42
-
43
- **Default + Footer**
44
-
45
- ---
46
-
47
- ---
48
-
49
- **Default + Title + Footer**
50
-
51
- ---
52
-
53
- ---
54
-
55
- ### Tooltip Spacing
56
-
57
- These rules establish how much margin should exist between and around elements.
58
-
59
- **Tooltip Spacing**
60
-
61
- ---
62
-
63
- ---
64
-
65
- ### Placement Variations
66
-
67
- The `placement` prop indicates from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of the Tooltip, pointing down at the element. There are 12 possible variations to choose from depending on the design's need.
68
-
69
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
70
-
71
- | **Bottom-start** | **Bottom** | **Bottom-End** |
72
- | ---------------- | ---------- | -------------- |
73
-
74
- **Tooltip**
75
-
76
- ---
77
-
78
- **Tooltip**
79
-
80
- ---
81
-
82
- **Tooltip**
83
-
84
- ---
85
-
86
- | **Left-start** | **Left** | **Left-end** |
87
- | -------------- | -------- | ------------ |
88
-
89
- **Tooltip**
90
-
91
- ---
92
-
93
- **Tooltip**
94
-
95
- ---
96
-
97
- **Tooltip**
98
-
99
- ---
100
-
101
- | **Right-start** | **Right** | **Right-end** |
102
- | --------------- | --------- | ------------- |
103
-
104
- **Tooltip**
105
-
106
- ---
107
-
108
- **Tooltip**
109
-
110
- ---
111
-
112
- **Tooltip**
113
-
114
- ---
115
-
116
- | **Top-Start** | **Top** | **Top-end** |
117
- | ------------- | ------- | ----------- |
118
-
119
- **Tooltip**
120
-
121
- ---
122
-
123
- **Tooltip**
124
-
125
- ---
126
-
127
- **Tooltip**
128
-
129
- ---
130
-
131
- ---
132
-
133
- ## Condensed Tooltip
134
-
135
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
136
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
137
-
138
- Use to display smaller bits of text, not full sentences or descriptions, similar to a label, but only viewable on hover. Most often used in Charts, Tables, and Data Visualizations (documentation coming soon).
139
-
140
- A colored indicator can be included using the `indicator` prop when using color will help clarify for users what the label is connected to.
141
-
142
- The Condensed Tooltip is positioned relative to the user's cursor as opposed to the on-screen element it's connected to.
143
-
144
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
145
-
146
- **Default**
147
-
148
- ---
149
-
150
- ---
151
-
152
- **Default + Indicator**
153
-
154
- ---
155
-
156
- ---
157
-
158
- ### Condensed Tooltip Spacing
159
-
160
- These rules establish how much margin should exist between and around elements.
161
-
162
- **Condensed Tooltip spacing**
163
-
164
- ---
165
-
166
- ## Code
167
-
168
- ## Dropdown Input Component
169
-
170
- | Below you will find an interactive Storybook iframe for Tooltips. 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:** Tooltip TooltipCondensed |
171
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------- |
172
-
173
- ---
174
-
175
- > These components appear as they are 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.
176
-
177
- ### Tooltip
178
-
179
- Storybook
180
-
181
- ---
182
-
183
- ### TooltipCondensed
184
-
185
- Storybook
186
-
187
- ---
188
-
189
- Tooltips are used throughout the UI and appear whenever users hover over elements that require additional context, instructions, or details.
190
-
191
- ## Overview
192
-
193
- ## Tooltip Variants
194
-
195
- | Tooltips are always used in conjunction with other elements when there is a need to further clarify the element's function, provide instructions, or display additional details to the user. The variant used depends on the element it is tied to and the area in the UI in which it is located. Follow the usage criteria accompanying each variant as a guide for selecting the correct Tooltip for any given use case. | | **Jump to variant:** Dark Light Condensed Table |
196
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------- |
197
-
198
- ### Visual Preview
199
-
200
- Use the links below to jump to information on a specific Tooltip variant:
201
-
202
- **Tooltip**
203
-
204
- ---
205
-
206
- **Tooltip**
207
-
208
- ---
209
-
210
- **TooltipCondensed**
211
-
212
- ---
213
-
214
- **TooltipTable**
215
-
216
- ---
217
-
218
- ---
219
-
220
- ## Tooltip
221
-
222
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
223
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
224
-
225
- ### Dark Tooltip
226
-
227
- Use in conjunction with actionary UI elements such as Icon Buttons or Segmented Control to display information on what that element does, especially when there is only an icon being used to communicate UI action.
228
-
229
- Use the `subtitle` prop to add optional text to the Tooltip to communicate additional usage or clarifying details such as further instructions for using the element the Tooltip is connected to.
230
-
231
- Use the `placement` prop to indicate from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of Tooltip, pointing down at the element. See Placement Variations section for more details.
232
-
233
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
234
-
235
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
236
-
237
- **Default**
238
-
239
- ---
240
-
241
- ---
242
-
243
- **Default + Subtitle**
244
-
245
- ---
246
-
247
- ### Light Tooltip
248
-
249
- Use to display supplementary information such as definitions, instructions, or expanded details which require more text in the Tooltip. The white background on the Tooltip makes longer blocks of copy easier for the user to read. Use the `width` prop to expand the width of the Light Tooltip to a max-width of 550px if there is a need to display particularly long blocks of copy.
250
-
251
- Use the `placement` prop to indicate from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of Tooltip, pointing down at the element. See Placement Variations section for more details.
252
-
253
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
254
-
255
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
256
-
257
- **Default**
258
-
259
- ---
260
-
261
- ---
262
-
263
- **Default (Wide)**
264
-
265
- ---
266
-
267
- ---
268
-
269
- ### Tooltip Spacing
270
-
271
- These rules establish how much margin should exist between and around elements.
272
-
273
- **Tooltip spacing**
274
-
275
- ---
276
-
277
- ---
278
-
279
- ### Placement Variations
280
-
281
- The `placement` prop indicates from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of the Tooltip, pointing down at the element. There are 12 possible variations to choose from depending on the design's need.
282
-
283
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
284
-
285
- | **Bottom-start** | **Bottom** | **Bottom-End** |
286
- | ---------------- | ---------- | -------------- |
287
-
288
- **Tooltip**
289
-
290
- ---
291
-
292
- **Tooltip**
293
-
294
- ---
295
-
296
- **Tooltip**
297
-
298
- ---
299
-
300
- | **Left-start** | **Left** | **Left-end** |
301
- | -------------- | -------- | ------------ |
302
-
303
- **Tooltip**
304
-
305
- ---
306
-
307
- **Tooltip**
308
-
309
- ---
310
-
311
- **Tooltip**
312
-
313
- ---
314
-
315
- | **Right-start** | **Right** | **Right-end** |
316
- | --------------- | --------- | ------------- |
317
-
318
- **Tooltip**
319
-
320
- ---
321
-
322
- **Tooltip**
323
-
324
- ---
325
-
326
- **Tooltip**
327
-
328
- ---
329
-
330
- | **Top-Start** | **Top** | **Top-end** |
331
- | ------------- | ------- | ----------- |
332
-
333
- **Tooltip**
334
-
335
- ---
336
-
337
- **Tooltip**
338
-
339
- ---
340
-
341
- **Tooltip**
342
-
343
- ---
344
-
345
- ---
346
-
347
- ## Condensed Tooltip
348
-
349
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
350
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
351
-
352
- Use to display smaller bits of text, not full sentences or descriptions, similar to a label, but only viewable on hover. Most often used in Charts, Tables, and Data Visualizations.
353
-
354
- Use the Condensed Tooltip without an indicator in CZ GEN EPI to display detailed information on Data Visualizations.
355
-
356
- A colored indicator can be included using the `indicator` prop when using color will help clarify for users what the label is connected to. Use the Condensed Tooltip with an indicator in CZ GEN EPI to display legend information on Data Visualizations.
357
-
358
- The Condensed Tooltip is positioned relative to the user's cursor as opposed to the on-screen element it's connected to.
359
-
360
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
361
-
362
- **Default**
363
-
364
- ---
365
-
366
- ---
367
-
368
- **Default + Indicator**
369
-
370
- ---
371
-
372
- ---
373
-
374
- ### Condensed Tooltip Spacing
375
-
376
- These rules establish how much margin should exist between and around elements.
377
-
378
- **Condensed Tooltip spacing**
379
-
380
- ---
381
-
382
- ---
383
-
384
- ## Table Tooltip
385
-
386
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
387
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
388
-
389
- Used in CZ GEN EPI to display complex, dense information that would benefit from being shown in a table format such as additional data or context connected to datasets in Charts, Tables, and Data Visualizations.
390
-
391
- The content in the Table Tooltip is determined by the `[array]` passed into the `data` prop. The `[array]` will determine optional section headers, whether a section is disabled or not, as well as each content row's label and item value. There can be as many sections and content rows per section as needed. See the Data Format section below for details about configuring the `[array]`.
392
-
393
- The Table Tooltip is positioned relative to the user's cursor as opposed to the on-screen element it's connected to.
394
-
395
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
396
-
397
- **Default (1 Section)**
398
-
399
- ---
400
-
401
- ---
402
-
403
- **Default (1 Section) + Section Headers**
404
-
405
- ---
406
-
407
- ---
408
-
409
- **Default (2 Sections) + Section Headers**
410
-
411
- ---
412
-
413
- ---
414
-
415
- **Default (3 Sections) + Section Headers**
416
-
417
- ---
418
-
419
- ---
420
-
421
- ### Data Format
422
-
423
- Use the following configuration for the `[array]` passed into the `data` prop:
424
-
425
- ```js
426
- data = [
427
- {
428
- // section with a header
429
- dataRows: [
430
- {
431
- label: "Label",
432
- value: "Item",
433
- },
434
- {
435
- label: "Label",
436
- value: "Item",
437
- },
438
- {
439
- label: "Label",
440
- value: "Item",
441
- },
442
- ],
443
- label: "Section One", // optional
444
- },
445
- {
446
- // section with no header
447
- dataRows: [
448
- {
449
- label: "Label",
450
- value: "Item",
451
- },
452
- {
453
- label: "Label",
454
- value: "Item",
455
- },
456
- {
457
- label: "Label",
458
- value: "Item",
459
- },
460
- ],
461
- },
462
- {
463
- // disabled section with no header
464
- dataRows: [
465
- {
466
- label: "Label",
467
- value: "Item",
468
- },
469
- {
470
- label: "Label",
471
- value: "Item",
472
- },
473
- {
474
- label: "Label",
475
- value: "Item",
476
- },
477
- ],
478
- disabled: true,
479
- },
480
- ];
481
- ```
482
-
483
- ---
484
-
485
- ### Table Tooltip Spacing
486
-
487
- These rules establish how much margin should exist between and around elements.
488
-
489
- **Table Tooltip spacing**
490
-
491
- ---
492
-
493
- ## Code
494
-
495
- ## Dropdown Input Component
496
-
497
- | Below you will find an interactive Storybook iframe for Tooltips. 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:** Tooltip TooltipCondensed TooltipTable |
498
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------ |
499
-
500
- ---
501
-
502
- > This component appears as it is in the default SDS codebase. Once imported into the CZ GEN EPI codebase, use a theme file to enable the CZ GEN EPI visual appearance customization.
503
-
504
- ### Tooltip
505
-
506
- Storybook
507
-
508
- ---
509
-
510
- ### TooltipCondensed
511
-
512
- Storybook
513
-
514
- ---
515
-
516
- ### TooltipTable
517
-
518
- Storybook
519
-
520
- ---
521
-
522
- Tooltips are used throughout the UI and appear whenever users hover over elements that require additional context, instructions, or details.
523
-
524
- ## Overview
525
-
526
- ## Tooltip Variants
527
-
528
- | Tooltips are always used in conjunction with other elements when there is a need to further clarify the element's function, provide instructions, or display additional details to the user. The variant used depends on the element it is tied to and the area in the UI in which it is located. Follow the usage criteria accompanying each variant as a guide for selecting the correct Tooltip for any given use case. | | **Jump to variant:** Dark Light Condensed Table |
529
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ----------------------------------------------- |
530
-
531
- ### Visual Preview
532
-
533
- Use the links below to jump to information on a specific Tooltip variant:
534
-
535
- **Tooltip**
536
-
537
- ---
538
-
539
- **Tooltip**
540
-
541
- ---
542
-
543
- **TooltipCondensed**
544
-
545
- ---
546
-
547
- **TooltipTable**
548
-
549
- ---
550
-
551
- ---
552
-
553
- ## Tooltip
554
-
555
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
556
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
557
-
558
- ### Dark Tooltip
559
-
560
- Use in conjunction with actionary UI elements such as Icon Buttons or Segmented Control to display information on what that element does, especially when there is only an icon being used to communicate UI action.
561
-
562
- Use the `subtitle` prop to add optional text to the Tooltip to communicate additional usage or clarifying details such as further instructions for using the element the Tooltip is connected to.
563
-
564
- Use the `placement` prop to indicate from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of Tooltip, pointing down at the element. See Placement Variations section for more details.
565
-
566
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
567
-
568
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
569
-
570
- **Default**
571
-
572
- ---
573
-
574
- ---
575
-
576
- **Default + Subtitle**
577
-
578
- ---
579
-
580
- ### Light Tooltip
581
-
582
- Use to display supplementary information such as definitions, instructions, or expanded details which require more text in the Tooltip. The white background on the Tooltip makes longer blocks of copy easier for the user to read. Use the `width` prop to expand the width of the Light Tooltip to a max width of 550px if there is a need to display particularly long blocks of copy.
583
-
584
- Use the `placement` prop to indicate from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of Tooltip, pointing down at the element. See Placement Variations section for more details.
585
-
586
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
587
-
588
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
589
-
590
- **Default**
591
-
592
- ---
593
-
594
- ---
595
-
596
- **Default (Wide)**
597
-
598
- ---
599
-
600
- ---
601
-
602
- ### Tooltip Spacing
603
-
604
- These rules establish how much margin should exist between and around elements.
605
-
606
- **Tooltip spacing**
607
-
608
- ---
609
-
610
- ---
611
-
612
- ### Placement Variations
613
-
614
- The `placement` prop indicates from which direction the Tooltip will appear on hover in relation to the element it is connected to. For example, `placement: top` will result in the Tooltip appearing above the element with its directional arrow in the center of the Tooltip, pointing down at the element. There are 12 possible variations to choose from depending on the design's need.
615
-
616
- The Tooltip is positioned relative to the on-screen element as opposed to relative to the user's cursor.
617
-
618
- | **Bottom-start** | **Bottom** | **Bottom-End** |
619
- | ---------------- | ---------- | -------------- |
620
-
621
- **Tooltip**
622
-
623
- ---
624
-
625
- **Tooltip**
626
-
627
- ---
628
-
629
- **Tooltip**
630
-
631
- ---
632
-
633
- | **Left-start** | **Left** | **Left-end** |
634
- | -------------- | -------- | ------------ |
635
-
636
- **Tooltip**
637
-
638
- ---
639
-
640
- **Tooltip**
641
-
642
- ---
643
-
644
- **Tooltip**
645
-
646
- ---
647
-
648
- | **Right-start** | **Right** | **Right-end** |
649
- | --------------- | --------- | ------------- |
650
-
651
- **Tooltip**
652
-
653
- ---
654
-
655
- **Tooltip**
656
-
657
- ---
658
-
659
- **Tooltip**
660
-
661
- ---
662
-
663
- | **Top-Start** | **Top** | **Top-end** |
664
- | ------------- | ------- | ----------- |
665
-
666
- **Tooltip**
667
-
668
- ---
669
-
670
- **Tooltip**
671
-
672
- ---
673
-
674
- **Tooltip**
675
-
676
- ---
677
-
678
- ---
679
-
680
- ## Condensed Tooltip
681
-
682
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
683
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
684
-
685
- Use to display smaller bits of text, not full sentences or descriptions, similar to a label, but only viewable on hover. Most often used in Charts, Tables, and Data Visualizations.
686
-
687
- Use the Condensed Tooltip without an indicator in CZ ID to display detailed information on Data Visualizations.
688
-
689
- A colored indicator can be included using the `indicator` prop when using color will help clarify for users what the label is connected to. Use the Condensed Tooltip with an indicator in CZ ID to display legend information on Data Visualizations.
690
-
691
- The Condensed Tooltip is positioned relative to the user's cursor as opposed to the on-screen element it's connected to.
692
-
693
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
694
-
695
- **Default**
696
-
697
- ---
698
-
699
- ---
700
-
701
- **Default + Indicator**
702
-
703
- ---
704
-
705
- ---
706
-
707
- ### Condensed Tooltip Spacing
708
-
709
- These rules establish how much margin should exist between and around elements.
710
-
711
- **Condensed Tooltip spacing**
712
-
713
- ---
714
-
715
- ---
716
-
717
- ## Table Tooltip
718
-
719
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
720
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
721
-
722
- Used in CZ ID to display complex, dense information that would benefit from being shown in a table format such as additional data or context connected to datasets in Charts, Tables, and Data Visualizations.
723
-
724
- The content in the Table Tooltip is determined by the `[array]` passed into the `data` prop. The `[array]` will determine optional section headers, whether a section is disabled or not, as well as each content row's label and item value. There can be as many sections and content rows per section as needed. See the Data Format section below for details about configuring the `[array]`.
725
-
726
- The Table Tooltip is positioned relative to the user's cursor as opposed to the on-screen element it's connected to.
727
-
728
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
729
-
730
- **Default (1 Section)**
731
-
732
- ---
733
-
734
- ---
735
-
736
- **Default (1 Section) + Section Headers**
737
-
738
- ---
739
-
740
- ---
741
-
742
- **Default (2 Sections) + Section Headers**
743
-
744
- ---
745
-
746
- ---
747
-
748
- **Default (3 Sections) + Section Headers**
749
-
750
- ---
751
-
752
- ---
753
-
754
- ### Data Format
755
-
756
- Use the following configuration for the `[array]` passed into the `data` prop:
757
-
758
- ```js
759
- data = [
760
- {
761
- // section with a header
762
- dataRows: [
763
- {
764
- label: "Label",
765
- value: "Item",
766
- },
767
- {
768
- label: "Label",
769
- value: "Item",
770
- },
771
- {
772
- label: "Label",
773
- value: "Item",
774
- },
775
- ],
776
- label: "Section One", // optional
777
- },
778
- {
779
- // section with no header
780
- dataRows: [
781
- {
782
- label: "Label",
783
- value: "Item",
784
- },
785
- {
786
- label: "Label",
787
- value: "Item",
788
- },
789
- {
790
- label: "Label",
791
- value: "Item",
792
- },
793
- ],
794
- },
795
- {
796
- // disabled section with no header
797
- dataRows: [
798
- {
799
- label: "Label",
800
- value: "Item",
801
- },
802
- {
803
- label: "Label",
804
- value: "Item",
805
- },
806
- {
807
- label: "Label",
808
- value: "Item",
809
- },
810
- ],
811
- disabled: true,
812
- },
813
- ];
814
- ```
815
-
816
- ---
817
-
818
- ### Table Tooltip Spacing
819
-
820
- These rules establish how much margin should exist between and around elements.
821
-
822
- **Table Tooltip spacing**
823
-
824
- ---
825
-
826
- ## Code
827
-
828
- ## Dropdown Input Component
829
-
830
- | Below you will find an interactive Storybook iframe for Tooltips. 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:** Tooltip TooltipCondensed TooltipTable |
831
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------ |
832
-
833
- ---
834
-
835
- ### Tooltip
836
-
837
- Storybook
838
-
839
- ---
840
-
841
- ### TooltipCondensed
842
-
843
- Storybook
844
-
845
- ---
846
-
847
- ### TooltipTable
848
-
849
- Storybook
850
-
851
- ---
852
-
853
- Tooltips are used throughout the UI and appear whenever users hover over elements that require additional context, instructions, or details.
854
-
855
- ## Guidelines
856
-
857
- ## Tooltip Components
858
-
859
- | Tooltips are always used in conjunction with other elements when there is a need to further clarify the element's function, provide instructions, or display additional details to the user. The variant used depends on the element that triggers it and where it's located in the interface. | | **Jump to variant:** Tooltip Condensed Tooltip Table Tooltip |
860
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------ |
861
-
862
- ### Visual Preview
863
-
864
- **Preview_Guidelines_Tooltip**
865
-
866
- ---
867
-
868
- **Preview_Guidelines_TooltipCondensed**
869
-
870
- ---
871
-
872
- **Preview_Guidelines_TooltipTable**
873
-
874
- ---
875
-
876
- ---
877
-
878
- ## Tooltip
879
-
880
- | | In Figma | | | Meets Accessibility | | | In Code |
881
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
882
-
883
- ### Tooltip Types
884
-
885
- There are two available Tooltip types: Short and Long.
886
-
887
- Each Tooltip type can optionally be displayed using an inverted color scheme for better contrast on certain backgrounds.
888
-
889
- **Tooltip_Short**
890
-
891
- ---
892
-
893
- **Tooltip_Long**
894
-
895
- ---
896
-
897
- ---
898
-
899
- ### Live Instance
900
-
901
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
902
-
903
- Default
904
-
905
- ---
906
-
907
- ### Tooltip – Short
908
-
909
- Use in conjunction with action UI elements like Buttons or Segmented Control to display information about interacting with that element.
910
-
911
- A subtitle may be added to communicate additional details, like instructions for using the element connected to the Tooltip.
912
-
913
- | Default | Default (inverted) | Default + Subtitle | Default + Subtitle (inverted) |
914
- | ------- | ------------------ | ------------------ | ----------------------------- |
915
-
916
- **Tooltip_Short_default**
917
-
918
- ---
919
-
920
- **Tooltip_Short_inverted**
921
-
922
- ---
923
-
924
- **Tooltip_Short_Subtitle_default**
925
-
926
- ---
927
-
928
- **Tooltip_Short_Subtitle_inverted**
929
-
930
- ---
931
-
932
- ---
933
-
934
- ### Tooltip – Long
935
-
936
- Use to display supplementary information like definitions, instructions, or expanded details which require more space for text. The width can be increased up to `550px`.
937
-
938
- | Default | Default (inverted) |
939
- | ------- | ------------------ |
940
-
941
- **Tooltip_Long**
942
-
943
- ---
944
-
945
- **Tooltip_Long_inverted**
946
-
947
- ---
948
-
949
- ---
950
-
951
- ### Tooltip Spacing
952
-
953
- The Tooltip and its triggering element have a standard margin between them.
954
-
955
- **Tooltip spacing**
956
-
957
- ---
958
-
959
- ---
960
-
961
- ### Placement Variations
962
-
963
- A Tooltip appears in one of twelve positions relative to the element it is tied to. For example, a position of `bottom` will appear **below** the trigger element.
964
-
965
- | Bottom-start | Bottom | Bottom-end |
966
- | ------------ | ------ | ---------- |
967
-
968
- **Tooltip**
969
-
970
- ---
971
-
972
- **Tooltip**
973
-
974
- ---
975
-
976
- **Tooltip**
977
-
978
- ---
979
-
980
- | Left-start | Left | Left-end |
981
- | ---------- | ---- | -------- |
982
-
983
- **Tooltip**
984
-
985
- ---
986
-
987
- **Tooltip**
988
-
989
- ---
990
-
991
- **Tooltip**
992
-
993
- ---
994
-
995
- | Right-start | Right | Right-end |
996
- | ----------- | ----- | --------- |
997
-
998
- **Tooltip**
999
-
1000
- ---
1001
-
1002
- **Tooltip**
1003
-
1004
- ---
1005
-
1006
- **Tooltip**
1007
-
1008
- ---
1009
-
1010
- | Top-start | Top | Top-end |
1011
- | --------- | --- | ------- |
1012
-
1013
- **Tooltip**
1014
-
1015
- ---
1016
-
1017
- **Tooltip**
1018
-
1019
- ---
1020
-
1021
- **Tooltip**
1022
-
1023
- ---
1024
-
1025
- ---
1026
-
1027
- ## Condensed Tooltip
1028
-
1029
- | | In Figma | | | Meets Accessibility | | | In Code |
1030
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
1031
-
1032
- ### Live Instance
1033
-
1034
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
1035
-
1036
- Default
1037
-
1038
- ---
1039
-
1040
- ### Overview
1041
-
1042
- Use Condensed Tooltip to display small amounts of text, not full sentences or descriptions. It's similar to a label, but only viewable on hover — most often used in data visualizations and Tables.
1043
-
1044
- The Condensed Tooltip is positioned relative to the user's cursor rather than its triggering element. A colored indicator can be included in the Tooltip to help clarify what element the Tooltip is related to.
1045
-
1046
- The Condensed Tooltip can optionally be displayed using an inverted color scheme for better contrast on certain backgrounds.
1047
-
1048
- | Default | Default (inverted) | Default + Indicator | Default + Indicator (inverted) |
1049
- | ------- | ------------------ | ------------------- | ------------------------------ |
1050
-
1051
- **TooltipCondensed_No Indicator_default**
1052
-
1053
- ---
1054
-
1055
- **TooltipCondensed_No Indicator_inverted**
1056
-
1057
- ---
1058
-
1059
- **TooltipCondensed_Indicator_default**
1060
-
1061
- ---
1062
-
1063
- **TooltipCondensed_Indicator_inverted**
1064
-
1065
- ---
1066
-
1067
- ---
1068
-
1069
- ### Condensed Tooltip Spacing
1070
-
1071
- The Condensed Tooltip and its triggering element have a standard margin between them.
1072
-
1073
- **Condensed Tooltip spacing**
1074
-
1075
- ---
1076
-
1077
- ---
1078
-
1079
- ## Table Tooltip
1080
-
1081
- | | In Figma | | | Meets Accessibility | | | In Code |
1082
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------- |
1083
-
1084
- ### Live Instance
1085
-
1086
- Interact with the live instance below and adjust the available props to better conceptualize how it will appear in product:
1087
-
1088
- Live Preview
1089
-
1090
- ---
1091
-
1092
- ### Overview
1093
-
1094
- Use Table Tooltip to display complex information that benefits from being shown in a table format. A Table Tooltip can contain as many sections as necessary and can optionally include section headers.
1095
-
1096
- By default, Item values are aligned right but can be aligned left.
1097
-
1098
- The Table Tooltip is positioned relative to the user's cursor rather than its triggering element
1099
-
1100
- | 1 Section | 1 Section + Section Headers | 2 Sections + Section Headers |
1101
- | --------- | --------------------------- | ---------------------------- |
1102
-
1103
- **Table Tooltip_One Section**
1104
-
1105
- ---
1106
-
1107
- **Table Tooltip_One Section_Section Headers**
1108
-
1109
- ---
1110
-
1111
- **Table Tooltip_Two Sections_No Headers**
1112
-
1113
- ---
1114
-
1115
- ---
1116
-
1117
- ### Table Tooltip Spacing
1118
-
1119
- The Table Tooltip and its triggering element have a standard margin between them.
1120
-
1121
- **Table Tooltip spacing**
1122
-
1123
- ---
1124
-
1125
- ## Code
1126
-
1127
- ## Tooltip Components
1128
-
1129
- | `Tooltips` are always used in conjunction with other elements when there is a need to further clarify the element's function, provide instructions, or display additional details to the user. The variant used depends on the element that triggers it and where it's located in the interface. | | **Jump to variant:** Tooltip TooltipCondensed TooltipTable |
1130
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ---------------------------------------------------------- |
1131
-
1132
- ### Visual Preview
1133
-
1134
- **Preview_Code_Tooltip**
1135
-
1136
- ---
1137
-
1138
- **Preview_Code_TooltipCondensed**
1139
-
1140
- ---
1141
-
1142
- **Preview_Code_TooltipTable**
1143
-
1144
- ---
1145
-
1146
- > **Note:** The code examples below must install dependencies before displaying and may take extra time to load
1147
-
1148
- ---
1149
-
1150
- ## Tooltip
1151
-
1152
- ### SDS Source Code
1153
-
1154
- The component's source code in the SDS codebase can be found here.
1155
-
1156
- ### SDS vs MUI
1157
-
1158
- The SDS `Tooltip` component has a number of preset options in addition to, or that modify, the MUI options:
1159
-
1160
- - **`sdsStyle`** **:** This prop takes either `light` (the default if not specified), or `dark`. Each of these "unlocks" additional options for other props; see below bullets:
1161
- - **`width`\*\***:\*\* SDS `Tooltip`'s `width` prop accepts `"default"`(unsurprisingly, the default!) which limits the maximum width to 250px. Additionally, only if `sdsStyle="light"` then it also accepts a value of `"wide"`, which translates to a maximum width of 550px. Compare these string options to MUI's `width` prop, which takes a number for the width in pixels.
1162
- - **`subtitle`\*\***:\*\* This SDS-specific prop is only available for dark-styled `Tooltips` (`sdsStyle="dark"`) . It takes a string value that displays below the text set by the `title` prop.
1163
- - **`arrowOffset`\*\***:\*\* This SDS-only prop takes a negative or positive value equivalent to the number of pixels by which to move the arrow (if `arrow={true}`) either left or right, respectively. It is possible though for this to move the arrow outside of the `Tooltip` edge itself, so be aware of the `width` setting as well as the length of text within the `Tooltip`.
1164
-
1165
- ### MUI Documentation
1166
-
1167
- Documentation for the underlying MUI component can be found here.
1168
-
1169
- ### Props
1170
-
1171
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1172
-
1173
- | Name | Type | Default | Description |
1174
- | ------------- | ------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | ---------- | -------------- | ----------------- | ----------- | --------------- | --------------- | --------- | ---------- | ---------- | ------------------ |
1175
- | `arrow` | `boolean` | `false` | If `true`, adds an arrow to the tooltip. |
1176
- | `arrowOffset` | `number` | `0` | ArrowOffset changes the position of the tooltip arrow and can be any numeric value within `[-120, 120]`. Exceeding the tooltip width removes the arrow. |
1177
- | `placement` | `"bottom-start"` ` | "bottom"` ` | "bottom-end"` ` | "left-start"` ` | "left"` ` | "left-end"` ` | "right-start"` ` | "right"` ` | "right-end"` ` | "top-start"` ` | "top"` ` | "top-end"` | `"bottom"` | Tooltip placement. |
1178
- | `sdsStyle` | `"light" | "dark"` | `"light"` | Style of the component. |
1179
- | `subtitle` | `string` | `-` | Tooltip subtitle text. |
1180
- | `title` | `Node` | `-` | Tooltip title. Zero-length titles string, undefined, null and false are never displayed. |
1181
- | `width` | `"default" | "wide"` | `"default"` | If set to `wide`, the tooltip is wider. |
1182
-
1183
- ### Code examples
1184
-
1185
- #### **Tooltip – Dark**
1186
-
1187
- This example demonstrates a dark-themed `Tooltip` that includes both a title and a subtitle.
1188
-
1189
- **/styles.css**
1190
-
1191
- ```css
1192
- body {
1193
- font-size: 13px;
1194
- font-weight: 400;
1195
- letter-spacing: 0.08px;
1196
- line-height: 20px;
1197
- text-transform: none;
1198
- font-family: "Inter", sans-serif;
1199
- }
1200
-
1201
- h1 {
1202
- font-size: 1.5rem;
1203
- }
1204
-
1205
- .app {
1206
- padding: 20px;
1207
- display: flex;
1208
- justify-content: center;
1209
- }
1210
- ```
1211
-
1212
- **tsconfig.json**
1213
-
1214
- ```json
1215
- {
1216
- "include": ["./**/*"],
1217
- "compilerOptions": {
1218
- "strict": true,
1219
- "esModuleInterop": true,
1220
- "lib": ["dom", "es2015"],
1221
- "jsx": "react-jsx"
1222
- }
1223
- }
1224
- ```
1225
-
1226
- **/App.tsx**
1227
-
1228
- ```tsx
1229
- import { ButtonIcon, Tooltip } from "@czi-sds/components";
1230
- import "./styles.css";
1231
-
1232
- function App() {
1233
- return (
1234
- <div className="app">
1235
- <Tooltip
1236
- arrow
1237
- sdsStyle="dark"
1238
- subtitle="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi."
1239
- title="Tooltip title"
1240
- >
1241
- <ButtonIcon sdsType="secondary" sdsSize="large" sdsIcon="InfoCircle" />
1242
- </Tooltip>
1243
- </div>
1244
- );
1245
- }
1246
-
1247
- export default App;
1248
- ```
1249
-
1250
- **/index.tsx**
1251
-
1252
- ```tsx
1253
- import React from "react";
1254
- import { createRoot } from "react-dom/client";
1255
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1256
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1257
- import { Theme } from "@czi-sds/components";
1258
- import CssBaseline from "@mui/material/CssBaseline";
1259
- import useMediaQuery from "@mui/material/useMediaQuery";
1260
-
1261
- import App from "./App";
1262
-
1263
- const container = document.getElementById("root");
1264
- const root = createRoot(container!);
1265
-
1266
- const RootApp = () => {
1267
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1268
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1269
-
1270
- return (
1271
- <StyledEngineProvider injectFirst>
1272
- <ThemeProvider theme={theme}>
1273
- <EmotionThemeProvider theme={theme}>
1274
- <CssBaseline />
1275
- <App />
1276
- </EmotionThemeProvider>
1277
- </ThemeProvider>
1278
- </StyledEngineProvider>
1279
- );
1280
- };
1281
-
1282
- root.render(
1283
- <React.StrictMode>
1284
- <RootApp />
1285
- </React.StrictMode>
1286
- );
1287
- ```
1288
-
1289
- **/public/index.html**
1290
-
1291
- ```html
1292
- <!doctype html>
1293
- <html lang="en">
1294
- <head>
1295
- <meta charset="UTF-8" />
1296
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1297
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1298
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1299
- <link
1300
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1301
- rel="stylesheet"
1302
- />
1303
- <link
1304
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1305
- rel="stylesheet"
1306
- />
1307
- </head>
1308
- <body>
1309
- <div id="root"></div>
1310
- </body>
1311
- </html>
1312
- ```
1313
-
1314
- **/package.json**
1315
-
1316
- ```json
1317
- {
1318
- "dependencies": {
1319
- "react": "^18.0.0",
1320
- "react-dom": "^18.0.0",
1321
- "react-scripts": "^4.0.0"
1322
- },
1323
- "devDependencies": {
1324
- "@types/react": "^18.0.0",
1325
- "@types/react-dom": "^18.0.0",
1326
- "typescript": "^4.0.0"
1327
- },
1328
- "main": "/index.tsx"
1329
- }
1330
- ```
1331
-
1332
- ---
1333
-
1334
- #### **Tooltip – Light**
1335
-
1336
- This example showcases a light-themed `Tooltip`.
1337
-
1338
- **/styles.css**
1339
-
1340
- ```css
1341
- body {
1342
- font-size: 13px;
1343
- font-weight: 400;
1344
- letter-spacing: 0.08px;
1345
- line-height: 20px;
1346
- text-transform: none;
1347
- font-family: "Inter", sans-serif;
1348
- }
1349
-
1350
- h1 {
1351
- font-size: 1.5rem;
1352
- }
1353
-
1354
- .app {
1355
- padding: 20px;
1356
- height: 100vh;
1357
- display: flex;
1358
- justify-content: center;
1359
- align-items: center;
1360
- }
1361
- ```
1362
-
1363
- **tsconfig.json**
1364
-
1365
- ```json
1366
- {
1367
- "include": ["./**/*"],
1368
- "compilerOptions": {
1369
- "strict": true,
1370
- "esModuleInterop": true,
1371
- "lib": ["dom", "es2015"],
1372
- "jsx": "react-jsx"
1373
- }
1374
- }
1375
- ```
1376
-
1377
- **/App.tsx**
1378
-
1379
- ```tsx
1380
- import { ButtonIcon, Tooltip } from "@czi-sds/components";
1381
- import "./styles.css";
1382
-
1383
- function App() {
1384
- return (
1385
- <div className="app">
1386
- <Tooltip
1387
- arrow
1388
- title="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi."
1389
- >
1390
- <ButtonIcon sdsType="secondary" sdsSize="large" sdsIcon="InfoCircle" />
1391
- </Tooltip>
1392
- </div>
1393
- );
1394
- }
1395
-
1396
- export default App;
1397
- ```
1398
-
1399
- **/index.tsx**
1400
-
1401
- ```tsx
1402
- import React from "react";
1403
- import { createRoot } from "react-dom/client";
1404
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1405
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1406
- import { Theme } from "@czi-sds/components";
1407
- import CssBaseline from "@mui/material/CssBaseline";
1408
- import useMediaQuery from "@mui/material/useMediaQuery";
1409
-
1410
- import App from "./App";
1411
-
1412
- const container = document.getElementById("root");
1413
- const root = createRoot(container!);
1414
-
1415
- const RootApp = () => {
1416
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1417
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1418
-
1419
- return (
1420
- <StyledEngineProvider injectFirst>
1421
- <ThemeProvider theme={theme}>
1422
- <EmotionThemeProvider theme={theme}>
1423
- <CssBaseline />
1424
- <App />
1425
- </EmotionThemeProvider>
1426
- </ThemeProvider>
1427
- </StyledEngineProvider>
1428
- );
1429
- };
1430
-
1431
- root.render(
1432
- <React.StrictMode>
1433
- <RootApp />
1434
- </React.StrictMode>
1435
- );
1436
- ```
1437
-
1438
- **/public/index.html**
1439
-
1440
- ```html
1441
- <!doctype html>
1442
- <html lang="en">
1443
- <head>
1444
- <meta charset="UTF-8" />
1445
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1446
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1447
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1448
- <link
1449
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1450
- rel="stylesheet"
1451
- />
1452
- <link
1453
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1454
- rel="stylesheet"
1455
- />
1456
- </head>
1457
- <body>
1458
- <div id="root"></div>
1459
- </body>
1460
- </html>
1461
- ```
1462
-
1463
- **/package.json**
1464
-
1465
- ```json
1466
- {
1467
- "dependencies": {
1468
- "react": "^18.0.0",
1469
- "react-dom": "^18.0.0",
1470
- "react-scripts": "^4.0.0"
1471
- },
1472
- "devDependencies": {
1473
- "@types/react": "^18.0.0",
1474
- "@types/react-dom": "^18.0.0",
1475
- "typescript": "^4.0.0"
1476
- },
1477
- "main": "/index.tsx"
1478
- }
1479
- ```
1480
-
1481
- ---
1482
-
1483
- **Tooltip for disabled components**
1484
-
1485
- This example demonstrates how to add a tooltip to a disabled component, commonly a button.
1486
-
1487
- > **Note for Tooltips on** **`Disabled`** **elements**
1488
- >
1489
- > If the tooltip wraps a disabled component, please make sure to wrap the children in a `<span>` tag.
1490
- >
1491
- > https://mui.com/components/tooltips/#disabled-elements
1492
-
1493
- **/styles.css**
1494
-
1495
- ```css
1496
- body {
1497
- font-size: 13px;
1498
- font-weight: 400;
1499
- letter-spacing: 0.08px;
1500
- line-height: 20px;
1501
- text-transform: none;
1502
- font-family: "Inter", sans-serif;
1503
- }
1504
-
1505
- h1 {
1506
- font-size: 1.5rem;
1507
- }
1508
-
1509
- .app {
1510
- padding: 20px;
1511
- height: 100vh;
1512
- display: flex;
1513
- justify-content: center;
1514
- align-items: center;
1515
- }
1516
- ```
1517
-
1518
- **tsconfig.json**
1519
-
1520
- ```json
1521
- {
1522
- "include": ["./**/*"],
1523
- "compilerOptions": {
1524
- "strict": true,
1525
- "esModuleInterop": true,
1526
- "lib": ["dom", "es2015"],
1527
- "jsx": "react-jsx"
1528
- }
1529
- }
1530
- ```
1531
-
1532
- **/App.tsx**
1533
-
1534
- ```tsx
1535
- import { ButtonIcon, Tooltip } from "@czi-sds/components";
1536
- import "./styles.css";
1537
-
1538
- function App() {
1539
- return (
1540
- <div className="app">
1541
- <Tooltip arrow title="This Button is disabled!">
1542
- <span>
1543
- <ButtonIcon
1544
- sdsType="secondary"
1545
- sdsSize="large"
1546
- sdsIcon="Widget"
1547
- disabled
1548
- />
1549
- </span>
1550
- </Tooltip>
1551
- </div>
1552
- );
1553
- }
1554
-
1555
- export default App;
1556
- ```
1557
-
1558
- **/index.tsx**
1559
-
1560
- ```tsx
1561
- import React from "react";
1562
- import { createRoot } from "react-dom/client";
1563
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1564
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1565
- import { Theme } from "@czi-sds/components";
1566
- import CssBaseline from "@mui/material/CssBaseline";
1567
- import useMediaQuery from "@mui/material/useMediaQuery";
1568
-
1569
- import App from "./App";
1570
-
1571
- const container = document.getElementById("root");
1572
- const root = createRoot(container!);
1573
-
1574
- const RootApp = () => {
1575
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1576
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1577
-
1578
- return (
1579
- <StyledEngineProvider injectFirst>
1580
- <ThemeProvider theme={theme}>
1581
- <EmotionThemeProvider theme={theme}>
1582
- <CssBaseline />
1583
- <App />
1584
- </EmotionThemeProvider>
1585
- </ThemeProvider>
1586
- </StyledEngineProvider>
1587
- );
1588
- };
1589
-
1590
- root.render(
1591
- <React.StrictMode>
1592
- <RootApp />
1593
- </React.StrictMode>
1594
- );
1595
- ```
1596
-
1597
- **/public/index.html**
1598
-
1599
- ```html
1600
- <!doctype html>
1601
- <html lang="en">
1602
- <head>
1603
- <meta charset="UTF-8" />
1604
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1605
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1606
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1607
- <link
1608
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1609
- rel="stylesheet"
1610
- />
1611
- <link
1612
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1613
- rel="stylesheet"
1614
- />
1615
- </head>
1616
- <body>
1617
- <div id="root"></div>
1618
- </body>
1619
- </html>
1620
- ```
1621
-
1622
- **/package.json**
1623
-
1624
- ```json
1625
- {
1626
- "dependencies": {
1627
- "react": "^18.0.0",
1628
- "react-dom": "^18.0.0",
1629
- "react-scripts": "^4.0.0"
1630
- },
1631
- "devDependencies": {
1632
- "@types/react": "^18.0.0",
1633
- "@types/react-dom": "^18.0.0",
1634
- "typescript": "^4.0.0"
1635
- },
1636
- "main": "/index.tsx"
1637
- }
1638
- ```
1639
-
1640
- ---
1641
-
1642
- ---
1643
-
1644
- ## TooltipCondensed
1645
-
1646
- ### SDS Source Code
1647
-
1648
- The component's source code in the SDS codebase can be found here.
1649
-
1650
- ### SDS vs MUI
1651
-
1652
- Like the regular SDS `Tooltip` component, the `TooltipCondensed` component is built on MUI's `Tooltip` component, and has its own SDS-specific props and options (which are different from SDS's `Tooltip` component's SDS-only options):
1653
-
1654
- - **`indicator`\*\***:\*\* This boolean prop determines whether or not the `Tooltip` text should be preceded by a colored dot.
1655
- - **`indicatorColor`\*\***:\*\* Sets the color of the `indicator`, if included.
1656
- - **`followCursor`\*\***:\*\* Additionally, `TooltipCondensed` has the `followCursor` behavior, and setting the `followCursor` prop to `false` has no effect.
1657
-
1658
- ### MUI Documentation
1659
-
1660
- Documentation for the underlying MUI component can be found here.
1661
-
1662
- ### Props
1663
-
1664
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1665
-
1666
- | Name | Type | Default | Description |
1667
- | ---------------- | --------- | ------- | ------------------------------------------------------------------------------------------------- |
1668
- | `indicator` | `boolean` | `false` | This boolean prop determines whether or not the Tooltip text should be preceded by a colored dot. |
1669
- | `indicatorColor` | `color` | `-` | Sets the color of the indicator, if included. |
1670
- | `title` | `Node` | `-` | Tooltip title. Zero-length titles string, undefined, null and false are never displayed. |
1671
-
1672
- ### Code examples
1673
-
1674
- #### TooltipCondensed with indicator
1675
-
1676
- This example illustrates the minimum required props to render `TooltipCondensed` with an indicator.
1677
-
1678
- **/styles.css**
1679
-
1680
- ```css
1681
- body {
1682
- font-size: 13px;
1683
- font-weight: 400;
1684
- letter-spacing: 0.08px;
1685
- line-height: 20px;
1686
- text-transform: none;
1687
- font-family: "Inter", sans-serif;
1688
- }
1689
-
1690
- h1 {
1691
- font-size: 1.5rem;
1692
- }
1693
-
1694
- .app {
1695
- padding: 20px;
1696
- height: 100vh;
1697
- display: flex;
1698
- justify-content: center;
1699
- align-items: center;
1700
- }
1701
- ```
1702
-
1703
- **tsconfig.json**
1704
-
1705
- ```json
1706
- {
1707
- "include": ["./**/*"],
1708
- "compilerOptions": {
1709
- "strict": true,
1710
- "esModuleInterop": true,
1711
- "lib": ["dom", "es2015"],
1712
- "jsx": "react-jsx"
1713
- }
1714
- }
1715
- ```
1716
-
1717
- **/App.tsx**
1718
-
1719
- ```tsx
1720
- import { ButtonIcon, TooltipCondensed } from "@czi-sds/components";
1721
- import "./styles.css";
1722
-
1723
- function App() {
1724
- return (
1725
- <div className="app">
1726
- <TooltipCondensed
1727
- indicator
1728
- indicatorColor="DodgerBlue"
1729
- title="Tooltip title"
1730
- >
1731
- <ButtonIcon sdsType="secondary" sdsSize="large" sdsIcon="InfoCircle" />
1732
- </TooltipCondensed>
1733
- </div>
1734
- );
1735
- }
1736
-
1737
- export default App;
1738
- ```
1739
-
1740
- **/index.tsx**
1741
-
1742
- ```tsx
1743
- import React from "react";
1744
- import { createRoot } from "react-dom/client";
1745
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1746
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1747
- import { Theme } from "@czi-sds/components";
1748
- import CssBaseline from "@mui/material/CssBaseline";
1749
- import useMediaQuery from "@mui/material/useMediaQuery";
1750
-
1751
- import App from "./App";
1752
-
1753
- const container = document.getElementById("root");
1754
- const root = createRoot(container!);
1755
-
1756
- const RootApp = () => {
1757
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1758
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1759
-
1760
- return (
1761
- <StyledEngineProvider injectFirst>
1762
- <ThemeProvider theme={theme}>
1763
- <EmotionThemeProvider theme={theme}>
1764
- <CssBaseline />
1765
- <App />
1766
- </EmotionThemeProvider>
1767
- </ThemeProvider>
1768
- </StyledEngineProvider>
1769
- );
1770
- };
1771
-
1772
- root.render(
1773
- <React.StrictMode>
1774
- <RootApp />
1775
- </React.StrictMode>
1776
- );
1777
- ```
1778
-
1779
- **/public/index.html**
1780
-
1781
- ```html
1782
- <!doctype html>
1783
- <html lang="en">
1784
- <head>
1785
- <meta charset="UTF-8" />
1786
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1787
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1788
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1789
- <link
1790
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1791
- rel="stylesheet"
1792
- />
1793
- <link
1794
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1795
- rel="stylesheet"
1796
- />
1797
- </head>
1798
- <body>
1799
- <div id="root"></div>
1800
- </body>
1801
- </html>
1802
- ```
1803
-
1804
- **/package.json**
1805
-
1806
- ```json
1807
- {
1808
- "dependencies": {
1809
- "react": "^18.0.0",
1810
- "react-dom": "^18.0.0",
1811
- "react-scripts": "^4.0.0"
1812
- },
1813
- "devDependencies": {
1814
- "@types/react": "^18.0.0",
1815
- "@types/react-dom": "^18.0.0",
1816
- "typescript": "^4.0.0"
1817
- },
1818
- "main": "/index.tsx"
1819
- }
1820
- ```
1821
-
1822
- ---
1823
-
1824
- ---
1825
-
1826
- ## TooltipTable
1827
-
1828
- ### SDS Source Code
1829
-
1830
- The component's source code in the SDS codebase can be found here.
1831
-
1832
- ### SDS vs MUI
1833
-
1834
- The SDS `TooltipTable` is built off of the MUI `Tooltip` component, but it has a built-in way to add tabular data:
1835
-
1836
- - **`data`\*\***:\*\* This prop takes an array of objects to be formatted within the `TooltipTable` with two columns, one for `label` and one for `value`.
1837
- - **`itemAlign`\*\***:\*\* This prop specific to SDS positions the `value` contents of each row either the `right` or `left` of their column.
1838
- - **`contentAlert`\*\***:\*\* This SDS-specific prop takes a value of `String` (a message), `Element` (such as a link), or `None` (the default).
1839
-
1840
- ### MUI Documentation
1841
-
1842
- Documentation for the underlying MUI component can be found here.
1843
-
1844
- ### Props
1845
-
1846
- Any custom SDS props and MUI props required for implementation are found on the table below. See the MUI documentation for additional optional props.
1847
-
1848
- | Name | Type | Default | Description |
1849
- | -------------- | ------------------------------------------------------------------------- | ---------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------ |
1850
- | `contentAlert` | `string | JSX.Element` | `-` | This SDS-specific prop takes a value of String (a message), Element (such as a link), or None (the default) |
1851
- | `data` | `Array<{` `label?: string;` `dataRows: {` `label: string;` `value: string | number;` `}[];` `disabled?: boolean;` `}>` | `-` | This prop takes an array of objects to be formatted within the TooltipTable with two columns, one for label and one for value. |
1852
- | `itemAlign` | `"left" | "right"` | `"right"` | This prop specific to SDS positions the value contents of each row either the `right` or `left` of their column. |
1853
-
1854
- ### Code examples
1855
-
1856
- #### Default TooltipTable
1857
-
1858
- This example showcases the implementation of a `TooltipTable` component.
1859
-
1860
- **/styles.css**
1861
-
1862
- ```css
1863
- body {
1864
- font-size: 13px;
1865
- font-weight: 400;
1866
- letter-spacing: 0.08px;
1867
- line-height: 20px;
1868
- text-transform: none;
1869
- font-family: "Inter", sans-serif;
1870
- }
1871
-
1872
- h1 {
1873
- font-size: 1.5rem;
1874
- }
1875
-
1876
- .app {
1877
- padding: 20px;
1878
- display: flex;
1879
- justify-content: center;
1880
- }
1881
- ```
1882
-
1883
- **tsconfig.json**
1884
-
1885
- ```json
1886
- {
1887
- "include": ["./**/*"],
1888
- "compilerOptions": {
1889
- "strict": true,
1890
- "esModuleInterop": true,
1891
- "lib": ["dom", "es2015"],
1892
- "jsx": "react-jsx"
1893
- }
1894
- }
1895
- ```
1896
-
1897
- **/App.tsx**
1898
-
1899
- ```tsx
1900
- import { ButtonIcon, Tooltip, TooltipTable } from "@czi-sds/components";
1901
- import "./styles.css";
1902
-
1903
- function App() {
1904
- const data = [
1905
- {
1906
- dataRows: [
1907
- { label: "First", value: 1 },
1908
- { label: "Second", value: 2 },
1909
- ],
1910
- label: "Section 1",
1911
- },
1912
- {
1913
- dataRows: [{ label: "Third", value: 3 }],
1914
- label: "Section 2",
1915
- },
1916
- ];
1917
- return (
1918
- <div className="app">
1919
- <Tooltip
1920
- arrow
1921
- title={<TooltipTable itemAlign="right" data={data} />}
1922
- placement="right-end"
1923
- >
1924
- <ButtonIcon sdsType="secondary" sdsSize="large" sdsIcon="InfoCircle" />
1925
- </Tooltip>
1926
- </div>
1927
- );
1928
- }
1929
-
1930
- export default App;
1931
- ```
1932
-
1933
- **/index.tsx**
1934
-
1935
- ```tsx
1936
- import React from "react";
1937
- import { createRoot } from "react-dom/client";
1938
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1939
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
1940
- import { Theme } from "@czi-sds/components";
1941
- import CssBaseline from "@mui/material/CssBaseline";
1942
- import useMediaQuery from "@mui/material/useMediaQuery";
1943
-
1944
- import App from "./App";
1945
-
1946
- const container = document.getElementById("root");
1947
- const root = createRoot(container!);
1948
-
1949
- const RootApp = () => {
1950
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
1951
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
1952
-
1953
- return (
1954
- <StyledEngineProvider injectFirst>
1955
- <ThemeProvider theme={theme}>
1956
- <EmotionThemeProvider theme={theme}>
1957
- <CssBaseline />
1958
- <App />
1959
- </EmotionThemeProvider>
1960
- </ThemeProvider>
1961
- </StyledEngineProvider>
1962
- );
1963
- };
1964
-
1965
- root.render(
1966
- <React.StrictMode>
1967
- <RootApp />
1968
- </React.StrictMode>
1969
- );
1970
- ```
1971
-
1972
- **/public/index.html**
1973
-
1974
- ```html
1975
- <!doctype html>
1976
- <html lang="en">
1977
- <head>
1978
- <meta charset="UTF-8" />
1979
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
1980
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1981
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1982
- <link
1983
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1984
- rel="stylesheet"
1985
- />
1986
- <link
1987
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1988
- rel="stylesheet"
1989
- />
1990
- </head>
1991
- <body>
1992
- <div id="root"></div>
1993
- </body>
1994
- </html>
1995
- ```
1996
-
1997
- **/package.json**
1998
-
1999
- ```json
2000
- {
2001
- "dependencies": {
2002
- "react": "^18.0.0",
2003
- "react-dom": "^18.0.0",
2004
- "react-scripts": "^4.0.0"
2005
- },
2006
- "devDependencies": {
2007
- "@types/react": "^18.0.0",
2008
- "@types/react-dom": "^18.0.0",
2009
- "typescript": "^4.0.0"
2010
- },
2011
- "main": "/index.tsx"
2012
- }
2013
- ```
2014
-
2015
- ---