@czi-sds/mcp 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +2 -1
  2. package/data/component-docs/Accordion.md +291 -0
  3. package/data/component-docs/Autocomplete.md +525 -0
  4. package/data/component-docs/Banner.md +231 -0
  5. package/data/component-docs/Button.md +224 -0
  6. package/data/component-docs/ButtonDropdown.md +256 -0
  7. package/data/component-docs/ButtonGroup.md +320 -0
  8. package/data/component-docs/ButtonToggle.md +397 -0
  9. package/data/component-docs/Callout.md +268 -0
  10. package/data/component-docs/CellBasic.md +122 -0
  11. package/data/component-docs/CellComponent.md +63 -0
  12. package/data/component-docs/CellHeader.md +128 -0
  13. package/data/component-docs/ComplexFilter.md +294 -0
  14. package/data/component-docs/ContentCard.md +406 -0
  15. package/data/component-docs/Dialog.md +651 -0
  16. package/data/component-docs/Dropdown.md +155 -0
  17. package/data/component-docs/DropdownMenu.md +949 -0
  18. package/data/component-docs/HeatmapChart.md +782 -0
  19. package/data/component-docs/Hero.md +363 -0
  20. package/data/component-docs/Icon.md +283 -0
  21. package/data/component-docs/InputCheckbox.md +205 -0
  22. package/data/component-docs/InputDropdown.md +482 -0
  23. package/data/component-docs/InputRadio.md +173 -0
  24. package/data/component-docs/InputSearch.md +81 -0
  25. package/data/component-docs/InputSlider.md +189 -0
  26. package/data/component-docs/InputText.md +110 -0
  27. package/data/component-docs/InputToggle.md +141 -0
  28. package/data/component-docs/IntentMessage.md +293 -0
  29. package/data/component-docs/Legend.md +442 -0
  30. package/data/component-docs/Link.md +23 -0
  31. package/data/component-docs/List.md +300 -0
  32. package/data/component-docs/LoadingIndicator.md +198 -0
  33. package/data/component-docs/Menu.md +298 -0
  34. package/data/component-docs/MenuItem.md +100 -0
  35. package/data/component-docs/NavigationFooter.md +165 -0
  36. package/data/component-docs/NavigationHeader.md +500 -0
  37. package/data/component-docs/NavigationJumpTo.md +414 -0
  38. package/data/component-docs/Notification.md +288 -0
  39. package/data/component-docs/Pagination.md +67 -0
  40. package/data/component-docs/Panel.md +636 -0
  41. package/data/component-docs/Popover.md +448 -0
  42. package/data/component-docs/PreComposedTable.md +2947 -0
  43. package/data/component-docs/ProteinStructureViewer.md +1044 -0
  44. package/data/component-docs/SegmentedControl.md +396 -0
  45. package/data/component-docs/StackedBarChart.md +475 -0
  46. package/data/component-docs/Table.md +2000 -0
  47. package/data/component-docs/TableHeader.md +53 -0
  48. package/data/component-docs/TableRow.md +74 -0
  49. package/data/component-docs/Tabs.md +455 -0
  50. package/data/component-docs/Tag.md +647 -0
  51. package/data/component-docs/TagFilter.md +131 -0
  52. package/data/component-docs/Tooltip.md +561 -0
  53. package/data/component-docs/TooltipCondensed.md +203 -0
  54. package/data/component-docs/TooltipTable.md +145 -0
  55. package/data/component-docs/index.json +267 -0
  56. package/data/component-list.json +2 -5
  57. package/data/component-props/Accordion.json +31 -11
  58. package/data/component-props/Alert.json +3 -3
  59. package/data/component-props/Autocomplete.json +150 -15
  60. package/data/component-props/Banner.json +31 -17
  61. package/data/component-props/Button.json +45 -20
  62. package/data/component-props/ButtonDropdown.json +36 -17
  63. package/data/component-props/ButtonDropdownLegacy.json +11 -11
  64. package/data/component-props/ButtonGroup.json +32 -11
  65. package/data/component-props/ButtonIcon.json +10 -10
  66. package/data/component-props/ButtonLegacy.json +19 -19
  67. package/data/component-props/ButtonToggle.json +32 -19
  68. package/data/component-props/ButtonToggleLegacy.json +11 -11
  69. package/data/component-props/Callout.json +58 -17
  70. package/data/component-props/CellBasic.json +94 -41
  71. package/data/component-props/CellComponent.json +23 -7
  72. package/data/component-props/CellHeader.json +62 -19
  73. package/data/component-props/ComplexFilter.json +52 -21
  74. package/data/component-props/ContentCard.json +70 -47
  75. package/data/component-props/Dialog.json +47 -14
  76. package/data/component-props/Dropdown.json +68 -31
  77. package/data/component-props/DropdownMenu.json +128 -23
  78. package/data/component-props/HeatmapChart.json +88 -12
  79. package/data/component-props/Hero.json +80 -39
  80. package/data/component-props/Icon.json +20 -9
  81. package/data/component-props/InputCheckbox.json +36 -14
  82. package/data/component-props/InputDropdown.json +75 -27
  83. package/data/component-props/InputRadio.json +31 -13
  84. package/data/component-props/InputSearch.json +41 -18
  85. package/data/component-props/InputSlider.json +46 -19
  86. package/data/component-props/InputText.json +26 -19
  87. package/data/component-props/InputToggle.json +26 -9
  88. package/data/component-props/IntentMessage.json +38 -9
  89. package/data/component-props/Link.json +13 -7
  90. package/data/component-props/LoadingIndicator.json +11 -3
  91. package/data/component-props/MenuItem.json +38 -19
  92. package/data/component-props/MenuSelect.json +8 -8
  93. package/data/component-props/NavigationFooter.json +49 -19
  94. package/data/component-props/NavigationHeader.json +150 -37
  95. package/data/component-props/NavigationJumpTo.json +33 -7
  96. package/data/component-props/Notification.json +39 -21
  97. package/data/component-props/Pagination.json +39 -11
  98. package/data/component-props/Panel.json +62 -9
  99. package/data/component-props/Popover.json +80 -7
  100. package/data/component-props/PreComposedTable.json +99 -27
  101. package/data/component-props/ProteinStructureViewer.json +117 -0
  102. package/data/component-props/SegmentedControl.json +42 -3
  103. package/data/component-props/StackedBarChart.json +116 -42
  104. package/data/component-props/TableRow.json +38 -19
  105. package/data/component-props/Tabs.json +66 -9
  106. package/data/component-props/Tag.json +34 -17
  107. package/data/component-props/TagFilter.json +10 -3
  108. package/data/component-props/Tooltip.json +49 -18
  109. package/data/component-props/TooltipCondensed.json +18 -9
  110. package/data/component-props/TooltipTable.json +17 -7
  111. package/data/resources/{zeroheight-rules.md → documentation-rules.md} +43 -30
  112. package/data/resources/figma-rules.md +2 -2
  113. package/data/tailwind.json +20 -14
  114. package/dist/stdio.js +112 -208
  115. package/package.json +9 -5
  116. package/data/component-props/ButtonDropdownV2.json +0 -34
  117. package/data/component-props/ButtonNew.json +0 -47
  118. package/data/component-props/ButtonToggleV2.json +0 -44
  119. package/data/component-props/ButtonV2.json +0 -43
  120. package/data/zeroheight-cache.json +0 -10259
  121. package/data/zeroheight-exports/Accordion.md +0 -774
  122. package/data/zeroheight-exports/Banner.md +0 -691
  123. package/data/zeroheight-exports/Borders.md +0 -117
  124. package/data/zeroheight-exports/Buttons.md +0 -1854
  125. package/data/zeroheight-exports/Callout.md +0 -931
  126. package/data/zeroheight-exports/Colors.md +0 -1755
  127. package/data/zeroheight-exports/Content-Card.md +0 -309
  128. package/data/zeroheight-exports/Contributing-to-SDS.md +0 -98
  129. package/data/zeroheight-exports/Control-Inputs.md +0 -2818
  130. package/data/zeroheight-exports/Corners.md +0 -104
  131. package/data/zeroheight-exports/Cover-page.md +0 -3
  132. package/data/zeroheight-exports/Dialog.md +0 -1367
  133. package/data/zeroheight-exports/Downloads.md +0 -236
  134. package/data/zeroheight-exports/Drop-Shadows.md +0 -79
  135. package/data/zeroheight-exports/Dropdown-Input.md +0 -1776
  136. package/data/zeroheight-exports/Dropdown-Menus.md +0 -913
  137. package/data/zeroheight-exports/Element-Status-Tracker.md +0 -267
  138. package/data/zeroheight-exports/Field-Inputs.md +0 -1405
  139. package/data/zeroheight-exports/Filters.md +0 -1111
  140. package/data/zeroheight-exports/Getting-Started.md +0 -1157
  141. package/data/zeroheight-exports/Hero.md +0 -414
  142. package/data/zeroheight-exports/Icons.md +0 -2067
  143. package/data/zeroheight-exports/Intent.md +0 -86
  144. package/data/zeroheight-exports/Introduction-to-Bases.md +0 -35
  145. package/data/zeroheight-exports/Introduction-to-Cells.md +0 -35
  146. package/data/zeroheight-exports/Introduction-to-DNA.md +0 -35
  147. package/data/zeroheight-exports/Introduction-to-Genes.md +0 -35
  148. package/data/zeroheight-exports/Introduction.md +0 -115
  149. package/data/zeroheight-exports/Link.md +0 -432
  150. package/data/zeroheight-exports/Lists.md +0 -986
  151. package/data/zeroheight-exports/Loading-Indicator.md +0 -41
  152. package/data/zeroheight-exports/Navigation.md +0 -1190
  153. package/data/zeroheight-exports/Notification.md +0 -1038
  154. package/data/zeroheight-exports/Panel.md +0 -1030
  155. package/data/zeroheight-exports/README.md +0 -122
  156. package/data/zeroheight-exports/Responsive-Design.md +0 -330
  157. package/data/zeroheight-exports/Search-Input.md +0 -91
  158. package/data/zeroheight-exports/Search.md +0 -822
  159. package/data/zeroheight-exports/Segmented-Control.md +0 -609
  160. package/data/zeroheight-exports/Spacing.md +0 -297
  161. package/data/zeroheight-exports/Table.md +0 -5345
  162. package/data/zeroheight-exports/Tabs.md +0 -1324
  163. package/data/zeroheight-exports/Tags.md +0 -1545
  164. package/data/zeroheight-exports/Text-Link.md +0 -268
  165. package/data/zeroheight-exports/Theming.md +0 -362
  166. package/data/zeroheight-exports/Tooltips.md +0 -2015
  167. package/data/zeroheight-exports/Typography.md +0 -800
@@ -1,268 +0,0 @@
1
- # Text Link
2
-
3
- Text Links are interactive elements that, when clicked, navigate the user away from the page they are currently viewing to another page or screen.
4
-
5
- ## Overview
6
-
7
- | | In Figma | | | Meets Accessibility | | | In napari hub + .org Codebases |
8
- | --- | -------- | --- | --- | ------------------- | --- | --- | ------------------------------ |
9
-
10
- Use Text Links to navigate the user away from the page they are currently viewing to another page or screen. They can be used inline or separate from a paragraph of text. There are four Text Link sizes available—`bodyM`, `bodyS`, `bodyXs`, `bodyXxs`—each corresponding to the four sizes of body copy available in the napari hub and napari.org codebases.
11
-
12
- Note: Designers, when including an inline Text Link in your design, styles must be manually applied as there is no way to save the Text Link style in Figma as a text style. You may use the Text Link Figma component for links that are not inline.
13
-
14
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
15
-
16
- | **bodyM** | **bodyS** | **bodyXs** | **bodyXxs** |
17
- | --------- | --------- | ---------- | ----------- |
18
-
19
- **Link**
20
-
21
- ---
22
-
23
- **Link**
24
-
25
- ---
26
-
27
- **Link**
28
-
29
- ---
30
-
31
- **Link**
32
-
33
- ---
34
-
35
- ---
36
-
37
- ### Text Link Spacing
38
-
39
- These rules establish how much margin should exist between and around elements.
40
-
41
- **Text Link spacing**
42
-
43
- ---
44
-
45
- ## Code
46
-
47
- ## Text Link Component
48
-
49
- | Below you will find an interactive Storybook iframe for Text Links. 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:** Link |
50
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------- |
51
-
52
- ---
53
-
54
- > 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.
55
-
56
- ### Link
57
-
58
- Storybook
59
-
60
- ---
61
-
62
- Text Links are interactive elements that, when clicked, navigate the user away from the page they are currently viewing to another page or screen.
63
-
64
- ## Overview
65
-
66
- ## Text Link Variants
67
-
68
- | There are two Text Link variants available for designers to use depending on the background on top of which they are placed and whether that background provides enough contrast for the Default Text Link to be seen. Text links can be used inline or separate from a paragraph of text. Though visually similar to Minimal Buttons, Text Links navigate the user away from the page they are currently viewing to another page. This is in contrast to Minimal Buttons, which keep the user on the same page and facilitate on-screen actions such as opening Dialogs or indicating less-emphasized actions. Note: Designers, when including an inline Text Link in your design, styles must be manually applied as there is no way to save the Text Link style in Figma as a text style. You may use the Text Link Figma component for links that are not inline. Follow the usage criteria accompanying each variant as a guide for selecting the correct Text Link for any given use case. | | **Jump to variant:** Default Dashed |
69
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
70
-
71
- ---
72
-
73
- ## Text Link
74
-
75
- | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
76
- | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
77
-
78
- ### Default Text Link
79
-
80
- Use the Default Text Link when the Text Link is placed on `white`, `gray100`, or `gray200` backgrounds to ensure there is enough contrast to pass visual accessibility standards.
81
-
82
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
83
-
84
- | **Default** | **Hover** | **Pressed** |
85
- | ----------- | --------- | ----------- |
86
-
87
- **Default Visual Example_Default**
88
-
89
- ---
90
-
91
- **Default Visual Example_Hover**
92
-
93
- ---
94
-
95
- **Default visual example_Pressed**
96
-
97
- ---
98
-
99
- ### Dashed Text Link
100
-
101
- Use the Dashed Text Link when the Text Link is placed on a background where the Default Text Link does not provide enough contrast to pass visual accessibility standards. The color of the link and its underline is inherited from the color used in the paragraph it is part of, see Dashed Text Link Color Examples below.
102
-
103
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses. See Borders section for Link Underline details.
104
-
105
- | **Default** | **Hover** | **Pressed** |
106
- | ----------- | --------- | ----------- |
107
-
108
- **Dashed Visual Example_Default**
109
-
110
- ---
111
-
112
- **Dashed Visual Example_Hover**
113
-
114
- ---
115
-
116
- **Dashed Visual Example_Pressed**
117
-
118
- ---
119
-
120
- ### Dashed Text Link Color Examples
121
-
122
- See below for visual examples of how the Dashed Text Link should be used in different colors depending on the color of the background it is placed upon.
123
-
124
- | **Black Text** | **Gray500 Text** | **White Text** |
125
- | -------------- | ---------------- | -------------- |
126
-
127
- **Dashed Visual Example_Black Text**
128
-
129
- ---
130
-
131
- **Dashed Visual Example_Gray500 text**
132
-
133
- ---
134
-
135
- **Dashed Visual Example_White text**
136
-
137
- ---
138
-
139
- ---
140
-
141
- ### Text Link Spacing
142
-
143
- These rules establish how much margin should exist between and around elements.
144
-
145
- Note: Default Text Links fall in line with the rest of the text in the paragraph it is part of. Dashed Text Links are spaced lower than a default underline text-decoration.
146
-
147
- **Dashed Text Link spacing**
148
-
149
- ---
150
-
151
- ## Code
152
-
153
- ## Text Link Component
154
-
155
- | Below you will find an interactive Storybook iframe for Text Links. 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:** Link |
156
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------- |
157
-
158
- ---
159
-
160
- > 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.
161
-
162
- ### Link
163
-
164
- Storybook
165
-
166
- ---
167
-
168
- Text Links are interactive elements that, when clicked, navigate the user away from the page they are currently viewing to another page or screen.
169
-
170
- ## Overview
171
-
172
- ## Text Link Variants
173
-
174
- | There are two Text Link variants available for designers to use depending on the background on top of which they are placed and whether that background provides enough contrast for the Default Text Link to be seen. Text links can be used inline or separate from a paragraph of text. Though visually similar to Minimal Buttons, Text Links navigate the user away from the page they are currently viewing to another page. This is in contrast to Minimal Buttons, which keep the user on the same page and facilitate on-screen actions such as opening Dialogs or indicating less-emphasized actions. Note: Designers, when including an inline Text Link in your design, styles must be manually applied as there is no way to save the Text Link style in Figma as a text style. You may use the Text Link Figma component for links that are not inline. Follow the usage criteria accompanying each variant as a guide for selecting the correct Text Link for any given use case. | | **Jump to variant:** Default Dashed |
175
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
176
-
177
- ---
178
-
179
- ## Text Link
180
-
181
- | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
182
- | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
183
-
184
- ### Default Text Link
185
-
186
- Use the Default Text Link when the Text Link is placed on `white`, `gray100`, or `gray200` backgrounds to ensure there is enough contrast to pass visual accessibility standards.
187
-
188
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
189
-
190
- | **Default** | **Hover** | **Pressed** |
191
- | ----------- | --------- | ----------- |
192
-
193
- **Default Visual Example_Default**
194
-
195
- ---
196
-
197
- **Default Visual Example_Hover**
198
-
199
- ---
200
-
201
- **Default visual example_Pressed**
202
-
203
- ---
204
-
205
- ### Dashed Text Link
206
-
207
- Use the Dashed Text Link when the Text Link is placed on a background where the Default Text Link does not provide enough contrast to pass visual accessibility standards. The color of the link and its underline is inherited from the color used in the paragraph it is part of, see Dashed Text Link Color Examples below.
208
-
209
- Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses. See Borders section for Link Underline details.
210
-
211
- | **Default** | **Hover** | **Pressed** |
212
- | ----------- | --------- | ----------- |
213
-
214
- **Dashed Visual Example_Default**
215
-
216
- ---
217
-
218
- **Dashed Visual Example_Hover**
219
-
220
- ---
221
-
222
- **Dashed Visual Example_Pressed**
223
-
224
- ---
225
-
226
- ### Dashed Text Link Color Examples
227
-
228
- See below for visual examples of how the Dashed Text Link should be used in different colors depending on the color of the background it is placed upon.
229
-
230
- | **Black Text** | **Gray500 Text** | **White Text** |
231
- | -------------- | ---------------- | -------------- |
232
-
233
- **Dashed Visual Example_Black Text**
234
-
235
- ---
236
-
237
- **Dashed Visual Example_Gray500 text**
238
-
239
- ---
240
-
241
- **Dashed Visual Example_White text**
242
-
243
- ---
244
-
245
- ---
246
-
247
- ### Text Link Spacing
248
-
249
- These rules establish how much margin should exist between and around elements.
250
-
251
- Note: Default Text Links fall in line with the rest of the text in the paragraph it is part of. Dashed Text Links are spaced lower than a default underline text-decoration.
252
-
253
- **Dashed Text Link spacing**
254
-
255
- ---
256
-
257
- ## Code
258
-
259
- ## Text Link Component
260
-
261
- | Below you will find an interactive Storybook iframe for Text Links. 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:** Link |
262
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------- |
263
-
264
- ---
265
-
266
- ### Link
267
-
268
- Storybook
@@ -1,362 +0,0 @@
1
- # Theming
2
-
3
- Themes enable visual changes to be made across the UI, affecting all elements in a consistent way such as in the case of Light and Dark Mode or individual product themes
4
-
5
- ## Guidelines
6
-
7
- ## Dark Mode
8
-
9
- SDS supports both Light and Dark Mode and they can be implemented to allow users to toggle between them or set either as the application's primary color mode. Every primitive color variable has a Dark Mode equivalent and each semantic color variable has a Dark Mode primitive mapped to it; for specific hex codes and primitive color mappings, see the Semantic Colors and Primitive Colors documentation.
10
-
11
- > **Note:** the semantic color variable mappings in the Bases color set are not always one-to-one between Light and Dark Modes, see Differences in Light Mode vs Dark Mode for more details.
12
-
13
- ### Color Indexes
14
-
15
- The color indexes used in SDS primitive color names (e.g., `gray100`, `gray200`, etc.) refer to the level of contrast of that color against the background it is viewed upon. As a result, primitive colors have a different appearance between Light and Dark Mode, but they have a consistent _functional_ appearance relative to their backgrounds. This is why `gray100` in Light Mode is a light gray color, whereas `gray100` in Dark Mode is a dark gray color—both have low contrasts when viewed in relation to their corresponding background colors.
16
-
17
- | Light Mode | Dark Mode |
18
- | :--------: | :-------: |
19
-
20
- **Color_Dark Mode_Color Indexes_gray100_Light**
21
-
22
- ---
23
-
24
- **Color_Dark Mode_Color Indexes_gray100_Dark**
25
-
26
- ---
27
-
28
- In most cases, each semantic variable will have the same primitive value mapped to it regardless of the mode of that primitive value. For example, the semantic variable `Base.text-primary` has `gray900` mapped to it; in Light Mode `gray900` = `#000000`(black), but in Dark Mode `gray900` = `#ffffff` (white). This means that in both modes primary text is highly visible against the background it is placed on top of, whether a light background in Light Mode or a dark background in Dark Mode.
29
-
30
- | Light Mode | Dark Mode |
31
- | :--------: | :-------: |
32
-
33
- **Color_Dark Mode_Color Indexes_text-primary_Light**
34
-
35
- ---
36
-
37
- **Color_Dark Mode_Color Indexes_text-primary_Dark**
38
-
39
- ---
40
-
41
- ### Differences in Light Mode vs Dark Mode
42
-
43
- The only instances where the primitive variables mapped to semantic variables differ between modes is `background-primary`, `surface`, and `fill-primary`. Where Light Mode uses `gray50` (white) for all of these, Dark Mode has to use two separate shades of dark gray to adhere to visual accessibility best practices.
44
-
45
- In Dark Mode, `background-primary` is `gray75` (not quite pure black which has poor visual accessibility when used across large areas) and `surface` and `fill-primary` are both `gray100` (shades of dark gray that are visible when viewed on top of `gray75` backgrounds). One of the main reasons for this is that drop shadows can't be leveraged in Dark Mode to separate layers in the same way that they can be in Light Mode since shadows are not nearly as visible when viewed on dark backgrounds.
46
-
47
- | Light Mode | Dark Mode |
48
- | :--------: | :-------: |
49
-
50
- **Color_Dark Mode_Differences_Light**
51
-
52
- ---
53
-
54
- **Color_Dark Mode_Differences_Dark**
55
-
56
- ---
57
-
58
- ### Inverted Style
59
-
60
- There are a few components (Header Navigation, Footer Navigation, Tooltip, and Condensed Tooltip) that can be displayed with light or dark backgrounds regardless of which color mode the user's application is set to. Enable this using the prop `hasInvertedStyle` which by default is set to `false`. In Light Mode the component will have a light background and in Dark Mode the component will have a dark background. When set to `true`, the colors will be inverted and in Light Mode the component will have a dark background and in Dark Mode the component will have a light background.
61
-
62
- See the individual component pages for more details and visual examples.
63
-
64
- | Default (Light Mode) | Inverted (Light Mode) |
65
- | :------------------: | :-------------------: |
66
-
67
- **Color_Inverted Style_Default**
68
-
69
- ---
70
-
71
- **Color_Inverted Style_Inverted**
72
-
73
- ---
74
-
75
- ## Code
76
-
77
- ## Dark Mode
78
-
79
- SDS supports both Light and Dark Mode and they can be implemented to allow users to toggle between them or set either as the application's primary color mode. Every primitive color variable has a Dark Mode equivalent and each semantic color variable has a Dark Mode primitive mapped to it; for specific hex codes and primitive color mappings, see the Semantic Colors and Primitive Colors documentation.
80
-
81
- > **Note:** the semantic color variable mappings in the Bases color set are not always one-to-one between Light and Dark Modes, see Differences in Light Mode vs Dark Mode for more details.
82
-
83
- ### Dark Mode by Default
84
-
85
- You can make your application use Dark Mode as the default theme—regardless of the user's preference—by passing `'dark'` to the `Theme` helper.
86
-
87
- Adding `<CssBaseline />` inside of the `<ThemeProvider>` component will also enable dark mode for the app's background.
88
-
89
- **/styles.css**
90
-
91
- ```css
92
- body {
93
- font-size: 13px;
94
- font-weight: 400;
95
- letter-spacing: 0.08px;
96
- line-height: 20px;
97
- text-transform: none;
98
- font-family: "Inter", sans-serif;
99
- }
100
-
101
- h1 {
102
- font-size: 1.5rem;
103
- }
104
-
105
- .app {
106
- padding: 20px;
107
- }
108
- ```
109
-
110
- **tsconfig.json**
111
-
112
- ```json
113
- {
114
- "include": ["./**/*"],
115
- "compilerOptions": {
116
- "strict": true,
117
- "esModuleInterop": true,
118
- "lib": ["dom", "es2015"],
119
- "jsx": "react-jsx"
120
- }
121
- }
122
- ```
123
-
124
- **/App.tsx**
125
-
126
- ```tsx
127
- import { Button } from "@czi-sds/components";
128
- import "./styles.css";
129
-
130
- function App() {
131
- return (
132
- <div className="app">
133
- <Button sdsType="primary" sdsStyle="square">
134
- Label
135
- </Button>
136
- </div>
137
- );
138
- }
139
-
140
- export default App;
141
- ```
142
-
143
- **/index.tsx**
144
-
145
- ```tsx
146
- import React from "react";
147
- import { createRoot } from "react-dom/client";
148
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
149
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
150
- import { Theme } from "@czi-sds/components";
151
- import CssBaseline from "@mui/material/CssBaseline";
152
-
153
- import App from "./App";
154
-
155
- const container = document.getElementById("root");
156
- const root = createRoot(container!);
157
-
158
- root.render(
159
- <React.StrictMode>
160
- <StyledEngineProvider injectFirst>
161
- <ThemeProvider theme={Theme("dark")}>
162
- <EmotionThemeProvider theme={Theme("dark")}>
163
- <CssBaseline />
164
- <App />
165
- </EmotionThemeProvider>
166
- </ThemeProvider>
167
- </StyledEngineProvider>
168
- </React.StrictMode>
169
- );
170
- ```
171
-
172
- **/public/index.html**
173
-
174
- ```html
175
- <!doctype html>
176
- <html lang="en">
177
- <head>
178
- <meta charset="UTF-8" />
179
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
180
- <link rel="preconnect" href="https://fonts.googleapis.com" />
181
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
182
- <link
183
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
184
- rel="stylesheet"
185
- />
186
- <link
187
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
188
- rel="stylesheet"
189
- />
190
- </head>
191
- <body>
192
- <div id="root"></div>
193
- </body>
194
- </html>
195
- ```
196
-
197
- **/package.json**
198
-
199
- ```json
200
- {
201
- "dependencies": {
202
- "react": "^18.0.0",
203
- "react-dom": "^18.0.0",
204
- "react-scripts": "^4.0.0"
205
- },
206
- "devDependencies": {
207
- "@types/react": "^18.0.0",
208
- "@types/react-dom": "^18.0.0",
209
- "typescript": "^4.0.0"
210
- },
211
- "main": "/index.tsx"
212
- }
213
- ```
214
-
215
- ---
216
-
217
- ### Dark Mode Based on System Preference
218
-
219
- Users might have a preference for Light or Dark Mode set through their operating system—either systemwide, or for a single user agent.
220
-
221
- You can ensure this preference is used in your application with the useMediaQuery hook and the prefers-color-scheme media query.
222
-
223
- The following demo shows how to enable Dark Mode automatically by checking for the user's preference in their OS or browser settings:
224
-
225
- **/styles.css**
226
-
227
- ```css
228
- body {
229
- font-size: 13px;
230
- font-weight: 400;
231
- letter-spacing: 0.08px;
232
- line-height: 20px;
233
- text-transform: none;
234
- font-family: "Inter", sans-serif;
235
- }
236
-
237
- h1 {
238
- font-size: 1.5rem;
239
- }
240
-
241
- .app {
242
- padding: 20px;
243
- }
244
- ```
245
-
246
- **tsconfig.json**
247
-
248
- ```json
249
- {
250
- "include": ["./**/*"],
251
- "compilerOptions": {
252
- "strict": true,
253
- "esModuleInterop": true,
254
- "lib": ["dom", "es2015"],
255
- "jsx": "react-jsx"
256
- }
257
- }
258
- ```
259
-
260
- **/App.tsx**
261
-
262
- ```tsx
263
- import { Button } from "@czi-sds/components";
264
- import "./styles.css";
265
-
266
- function App() {
267
- return (
268
- <div className="app">
269
- <Button sdsType="primary" sdsStyle="square">
270
- Label
271
- </Button>
272
- </div>
273
- );
274
- }
275
-
276
- export default App;
277
- ```
278
-
279
- **/index.tsx**
280
-
281
- ```tsx
282
- import React from "react";
283
- import { createRoot } from "react-dom/client";
284
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
285
- import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
286
- import { Theme } from "@czi-sds/components";
287
- import CssBaseline from "@mui/material/CssBaseline";
288
- import useMediaQuery from "@mui/material/useMediaQuery";
289
-
290
- import App from "./App";
291
-
292
- const container = document.getElementById("root");
293
- const root = createRoot(container!);
294
-
295
- // Create a wrapper component to handle theme and useMediaQuery
296
- const RootApp = () => {
297
- const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
298
- const theme = prefersDarkMode ? Theme("dark") : Theme("light");
299
-
300
- return (
301
- <StyledEngineProvider injectFirst>
302
- <ThemeProvider theme={theme}>
303
- <EmotionThemeProvider theme={theme}>
304
- <CssBaseline />
305
- <App />
306
- </EmotionThemeProvider>
307
- </ThemeProvider>
308
- </StyledEngineProvider>
309
- );
310
- };
311
-
312
- root.render(
313
- <React.StrictMode>
314
- <RootApp />
315
- </React.StrictMode>
316
- );
317
- ```
318
-
319
- **/public/index.html**
320
-
321
- ```html
322
- <!doctype html>
323
- <html lang="en">
324
- <head>
325
- <meta charset="UTF-8" />
326
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
327
- <link rel="preconnect" href="https://fonts.googleapis.com" />
328
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
329
- <link
330
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
331
- rel="stylesheet"
332
- />
333
- <link
334
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
335
- rel="stylesheet"
336
- />
337
- </head>
338
- <body>
339
- <div id="root"></div>
340
- </body>
341
- </html>
342
- ```
343
-
344
- **/package.json**
345
-
346
- ```json
347
- {
348
- "dependencies": {
349
- "react": "^18.0.0",
350
- "react-dom": "^18.0.0",
351
- "react-scripts": "^4.0.0"
352
- },
353
- "devDependencies": {
354
- "@types/react": "^18.0.0",
355
- "@types/react-dom": "^18.0.0",
356
- "typescript": "^4.0.0"
357
- },
358
- "main": "/index.tsx"
359
- }
360
- ```
361
-
362
- ---