@czi-sds/mcp 0.2.2 → 0.4.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 (147) hide show
  1. package/data/component-props/Accordion.json +14 -15
  2. package/data/component-props/Alert.json +2 -44
  3. package/data/component-props/Autocomplete.json +14 -32
  4. package/data/component-props/Banner.json +11 -12
  5. package/data/component-props/Button.json +17 -82
  6. package/data/component-props/ButtonDropdown.json +26 -0
  7. package/data/component-props/ButtonIcon.json +4 -60
  8. package/data/component-props/ButtonToggle.json +2 -66
  9. package/data/component-props/Callout.json +11 -65
  10. package/data/component-props/CellBasic.json +28 -56
  11. package/data/component-props/CellComponent.json +4 -32
  12. package/data/component-props/CellHeader.json +13 -49
  13. package/data/component-props/ComplexFilter.json +24 -4
  14. package/data/component-props/ContentCard.json +66 -2
  15. package/data/component-props/Dialog.json +26 -0
  16. package/data/component-props/Dropdown.json +29 -67
  17. package/data/component-props/DropdownMenu.json +16 -56
  18. package/data/component-props/HeatmapChart.json +6 -87
  19. package/data/component-props/Icon.json +3 -8
  20. package/data/component-props/InputCheckbox.json +5 -53
  21. package/data/component-props/InputDropdown.json +11 -33
  22. package/data/component-props/InputRadio.json +5 -53
  23. package/data/component-props/InputSearch.json +6 -70
  24. package/data/component-props/InputSlider.json +21 -35
  25. package/data/component-props/InputText.json +7 -63
  26. package/data/component-props/InputToggle.json +5 -54
  27. package/data/component-props/Link.json +18 -0
  28. package/data/component-props/LoadingIndicator.json +1 -2
  29. package/data/component-props/MenuItem.json +11 -41
  30. package/data/component-props/MenuSelect.json +4 -67
  31. package/data/component-props/NavigationFooter.json +0 -8
  32. package/data/component-props/NavigationHeader.json +14 -65
  33. package/data/component-props/NavigationJumpTo.json +0 -40
  34. package/data/component-props/Notification.json +14 -58
  35. package/data/component-props/Pagination.json +8 -33
  36. package/data/component-props/Panel.json +4 -54
  37. package/data/component-props/SegmentedControl.json +0 -55
  38. package/data/component-props/TableRow.json +10 -38
  39. package/data/component-props/Tabs.json +18 -0
  40. package/data/component-props/Tag.json +10 -56
  41. package/data/component-props/TagFilter.json +0 -47
  42. package/data/component-props/Tooltip.json +12 -61
  43. package/data/component-props/TooltipCondensed.json +18 -0
  44. package/data/component-props/TooltipTable.json +0 -4
  45. package/data/zeroheight-cache.json +5195 -0
  46. package/data/zeroheight-exports/Accordion.md +717 -0
  47. package/data/zeroheight-exports/Banner.md +599 -0
  48. package/data/zeroheight-exports/Borders.md +117 -0
  49. package/data/zeroheight-exports/Buttons.md +2305 -0
  50. package/data/zeroheight-exports/Callout.md +778 -0
  51. package/data/zeroheight-exports/Colors.md +632 -0
  52. package/data/zeroheight-exports/Content-Card.md +161 -0
  53. package/data/zeroheight-exports/Contributing-to-SDS.md +98 -0
  54. package/data/zeroheight-exports/Control-Inputs.md +2121 -0
  55. package/data/zeroheight-exports/Corners.md +111 -0
  56. package/data/zeroheight-exports/Cover-page.md +3 -0
  57. package/data/zeroheight-exports/Dialog.md +1191 -0
  58. package/data/zeroheight-exports/Downloads.md +120 -0
  59. package/data/zeroheight-exports/Drop-Shadows.md +79 -0
  60. package/data/zeroheight-exports/Dropdown-Input.md +1180 -0
  61. package/data/zeroheight-exports/Dropdown-Menu.md +3883 -0
  62. package/data/zeroheight-exports/Element-Status-Tracker.md +267 -0
  63. package/data/zeroheight-exports/Field-Inputs.md +984 -0
  64. package/data/zeroheight-exports/Filters.md +888 -0
  65. package/data/zeroheight-exports/Getting-Started.md +1159 -0
  66. package/data/zeroheight-exports/Hero.md +262 -0
  67. package/data/zeroheight-exports/Icons.md +431 -0
  68. package/data/zeroheight-exports/Intent.md +46 -0
  69. package/data/zeroheight-exports/Introduction-to-Bases.md +35 -0
  70. package/data/zeroheight-exports/Introduction-to-Cells.md +35 -0
  71. package/data/zeroheight-exports/Introduction-to-DNA.md +35 -0
  72. package/data/zeroheight-exports/Introduction-to-Genes.md +35 -0
  73. package/data/zeroheight-exports/Introduction.md +115 -0
  74. package/data/zeroheight-exports/Link.md +386 -0
  75. package/data/zeroheight-exports/Lists.md +632 -0
  76. package/data/zeroheight-exports/Loading-Indicator.md +37 -0
  77. package/data/zeroheight-exports/Navigation.md +874 -0
  78. package/data/zeroheight-exports/Notification.md +888 -0
  79. package/data/zeroheight-exports/Panel.md +978 -0
  80. package/data/zeroheight-exports/README.md +124 -0
  81. package/data/zeroheight-exports/Responsive-Design.md +278 -0
  82. package/data/zeroheight-exports/Search-Input.md +53 -0
  83. package/data/zeroheight-exports/Search.md +592 -0
  84. package/data/zeroheight-exports/Segmented-Control.md +584 -0
  85. package/data/zeroheight-exports/Spacing.md +297 -0
  86. package/data/zeroheight-exports/Table.md +4944 -0
  87. package/data/zeroheight-exports/Tabs.md +801 -0
  88. package/data/zeroheight-exports/Tags.md +1055 -0
  89. package/data/zeroheight-exports/Text-Link.md +184 -0
  90. package/data/zeroheight-exports/Theming.md +332 -0
  91. package/data/zeroheight-exports/Tooltips.md +1580 -0
  92. package/data/zeroheight-exports/Typography.md +768 -0
  93. package/dist/stdio.js +193 -93
  94. package/package.json +4 -4
  95. package/data/component-props/Chip.json +0 -73
  96. package/data/component-props/List.json +0 -43
  97. package/data/component-props/Menu.json +0 -48
  98. package/data/component-props/Table.json +0 -26
  99. package/data/component-props-storybook/Accordion-storybook.json +0 -45
  100. package/data/component-props-storybook/Alert-storybook.json +0 -30
  101. package/data/component-props-storybook/Autocomplete-storybook.json +0 -67
  102. package/data/component-props-storybook/Banner-storybook.json +0 -78
  103. package/data/component-props-storybook/Button-storybook.json +0 -115
  104. package/data/component-props-storybook/ButtonDropdown-storybook.json +0 -73
  105. package/data/component-props-storybook/ButtonIcon-storybook.json +0 -60
  106. package/data/component-props-storybook/ButtonToggle-storybook.json +0 -68
  107. package/data/component-props-storybook/Callout-storybook.json +0 -90
  108. package/data/component-props-storybook/CellBasic-storybook.json +0 -138
  109. package/data/component-props-storybook/CellComponent-storybook.json +0 -48
  110. package/data/component-props-storybook/CellHeader-storybook.json +0 -71
  111. package/data/component-props-storybook/Chip-storybook.json +0 -26
  112. package/data/component-props-storybook/ComplexFilter-storybook.json +0 -60
  113. package/data/component-props-storybook/ContentCard-storybook.json +0 -175
  114. package/data/component-props-storybook/Dialog-storybook.json +0 -56
  115. package/data/component-props-storybook/Dropdown-storybook.json +0 -93
  116. package/data/component-props-storybook/DropdownMenu-storybook.json +0 -73
  117. package/data/component-props-storybook/HeatmapChart-storybook.json +0 -55
  118. package/data/component-props-storybook/Icon-storybook.json +0 -75
  119. package/data/component-props-storybook/InputCheckbox-storybook.json +0 -57
  120. package/data/component-props-storybook/InputDropdown-storybook.json +0 -80
  121. package/data/component-props-storybook/InputRadio-storybook.json +0 -56
  122. package/data/component-props-storybook/InputSearch-storybook.json +0 -55
  123. package/data/component-props-storybook/InputSlider-storybook.json +0 -55
  124. package/data/component-props-storybook/InputText-storybook.json +0 -59
  125. package/data/component-props-storybook/InputToggle-storybook.json +0 -42
  126. package/data/component-props-storybook/Link-storybook.json +0 -50
  127. package/data/component-props-storybook/List-storybook.json +0 -26
  128. package/data/component-props-storybook/LoadingIndicator-storybook.json +0 -34
  129. package/data/component-props-storybook/Menu-storybook.json +0 -26
  130. package/data/component-props-storybook/MenuItem-storybook.json +0 -74
  131. package/data/component-props-storybook/MenuSelect-storybook.json +0 -38
  132. package/data/component-props-storybook/NavigationFooter-storybook.json +0 -67
  133. package/data/component-props-storybook/NavigationHeader-storybook.json +0 -115
  134. package/data/component-props-storybook/NavigationJumpTo-storybook.json +0 -41
  135. package/data/component-props-storybook/Notification-storybook.json +0 -89
  136. package/data/component-props-storybook/Pagination-storybook.json +0 -50
  137. package/data/component-props-storybook/Panel-storybook.json +0 -52
  138. package/data/component-props-storybook/SegmentedControl-storybook.json +0 -30
  139. package/data/component-props-storybook/Table-storybook.json +0 -26
  140. package/data/component-props-storybook/TableHeader-storybook.json +0 -26
  141. package/data/component-props-storybook/TableRow-storybook.json +0 -62
  142. package/data/component-props-storybook/Tabs-storybook.json +0 -45
  143. package/data/component-props-storybook/Tag-storybook.json +0 -78
  144. package/data/component-props-storybook/TagFilter-storybook.json +0 -30
  145. package/data/component-props-storybook/Tooltip-storybook.json +0 -85
  146. package/data/component-props-storybook/TooltipCondensed-storybook.json +0 -38
  147. package/data/component-props-storybook/TooltipTable-storybook.json +0 -47
@@ -0,0 +1,184 @@
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
+ ---
20
+
21
+ ### Text Link Spacing
22
+
23
+ These rules establish how much margin should exist between and around elements.
24
+
25
+
26
+
27
+
28
+
29
+ ## Code
30
+
31
+ ## Text Link Component
32
+
33
+ | 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 |
34
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------- |
35
+
36
+ ---
37
+
38
+ > 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.
39
+
40
+ ### Link
41
+
42
+ Storybook
43
+
44
+
45
+
46
+ ---
47
+
48
+ Text Links are interactive elements that, when clicked, navigate the user away from the page they are currently viewing to another page or screen.
49
+
50
+ ## Overview
51
+
52
+ ## Text Link Variants
53
+
54
+ | 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 |
55
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
56
+
57
+ ---
58
+
59
+ ## Text Link
60
+
61
+ | | In Figma | | | Meets Accessibility | | | In CZ GEN EPI Codebase |
62
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ---------------------- |
63
+
64
+ ### Default Text Link
65
+
66
+ 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.
67
+
68
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
69
+
70
+ | **Default** | **Hover** | **Pressed** |
71
+ | ----------- | --------- | ----------- |
72
+
73
+
74
+
75
+ ### Dashed Text Link
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ | **Default** | **Hover** | **Pressed** |
82
+ | ----------- | --------- | ----------- |
83
+
84
+ ### Dashed Text Link Color Examples
85
+
86
+ 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.
87
+
88
+ | **Black Text** | **Gray500 Text** | **White Text** |
89
+ | -------------- | ---------------- | -------------- |
90
+
91
+ ---
92
+
93
+ ### Text Link Spacing
94
+
95
+ These rules establish how much margin should exist between and around elements.
96
+
97
+ 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.
98
+
99
+
100
+
101
+ ## Code
102
+
103
+ ## Text Link Component
104
+
105
+ | 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 |
106
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------- |
107
+
108
+ ---
109
+
110
+ > 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.
111
+
112
+ ### Link
113
+
114
+ Storybook
115
+
116
+ ---
117
+
118
+ Text Links are interactive elements that, when clicked, navigate the user away from the page they are currently viewing to another page or screen.
119
+
120
+ ## Overview
121
+
122
+ ## Text Link Variants
123
+
124
+ | 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 |
125
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- | ----------------------------------- |
126
+
127
+ ---
128
+
129
+ ## Text Link
130
+
131
+ | | In Figma | | | Meets Accessibility | | | In CZ ID Codebase |
132
+ | --- | -------- | --- | --- | ------------------- | --- | --- | ----------------- |
133
+
134
+ ### Default Text Link
135
+
136
+ 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.
137
+
138
+ Click on each state below to enter inspect view and get details on its code attributes and any global styles it uses.
139
+
140
+ | **Default** | **Hover** | **Pressed** |
141
+ | ----------- | --------- | ----------- |
142
+
143
+
144
+
145
+ ### Dashed Text Link
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ | **Default** | **Hover** | **Pressed** |
152
+ | ----------- | --------- | ----------- |
153
+
154
+
155
+
156
+ ### Dashed Text Link Color Examples
157
+
158
+ 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.
159
+
160
+ | **Black Text** | **Gray500 Text** | **White Text** |
161
+ | -------------- | ---------------- | -------------- |
162
+
163
+ ---
164
+
165
+ ### Text Link Spacing
166
+
167
+ These rules establish how much margin should exist between and around elements.
168
+
169
+ 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.
170
+
171
+ ## Code
172
+
173
+ ## Text Link Component
174
+
175
+ | 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 |
176
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------- |
177
+
178
+ ---
179
+
180
+ ### Link
181
+
182
+ Storybook
183
+
184
+
@@ -0,0 +1,332 @@
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
+ 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.
21
+
22
+ | Light Mode | Dark Mode |
23
+ | :--------: | :-------: |
24
+
25
+ ### Differences in Light Mode vs Dark Mode
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ | Light Mode | Dark Mode |
32
+ | :--------: | :-------: |
33
+
34
+ ### Inverted Style
35
+
36
+ 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.
37
+
38
+ See the individual component pages for more details and visual examples.
39
+
40
+ | Default (Light Mode) | Inverted (Light Mode) |
41
+ | :------------------: | :-------------------: |
42
+
43
+ ## Code
44
+
45
+ ## Dark Mode
46
+
47
+ 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.
48
+
49
+ > **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.
50
+
51
+ ### Dark Mode by Default
52
+
53
+ 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.
54
+
55
+ Adding `<CssBaseline />` inside of the `<ThemeProvider>` component will also enable dark mode for the app's background.
56
+
57
+ **/styles.css**
58
+
59
+ ```css
60
+ body {
61
+ font-size: 13px;
62
+ font-weight: 400;
63
+ letter-spacing: 0.08px;
64
+ line-height: 20px;
65
+ text-transform: none;
66
+ font-family: "Inter", sans-serif;
67
+ }
68
+
69
+ h1 {
70
+ font-size: 1.5rem;
71
+ }
72
+
73
+ .app {
74
+ padding: 20px;
75
+ }
76
+ ```
77
+
78
+ **tsconfig.json**
79
+
80
+ ```json
81
+ {
82
+ "include": ["./**/*"],
83
+ "compilerOptions": {
84
+ "strict": true,
85
+ "esModuleInterop": true,
86
+ "lib": ["dom", "es2015"],
87
+ "jsx": "react-jsx"
88
+ }
89
+ }
90
+ ```
91
+
92
+ **/App.tsx**
93
+
94
+ ```tsx
95
+ import { Button } from "@czi-sds/components";
96
+ import "./styles.css";
97
+
98
+ function App() {
99
+ return (
100
+ <div className="app">
101
+ <Button sdsType="primary" sdsStyle="square">
102
+ Label
103
+ </Button>
104
+ </div>
105
+ );
106
+ }
107
+
108
+ export default App;
109
+ ```
110
+
111
+ **/index.tsx**
112
+
113
+ ```tsx
114
+ import React from "react";
115
+ import { createRoot } from "react-dom/client";
116
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
117
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
118
+ import { Theme } from "@czi-sds/components";
119
+ import CssBaseline from "@mui/material/CssBaseline";
120
+
121
+ import App from "./App";
122
+
123
+ const container = document.getElementById("root");
124
+ const root = createRoot(container!);
125
+
126
+ root.render(
127
+ <React.StrictMode>
128
+ <StyledEngineProvider injectFirst>
129
+ <ThemeProvider theme={Theme("dark")}>
130
+ <EmotionThemeProvider theme={Theme("dark")}>
131
+ <CssBaseline />
132
+ <App />
133
+ </EmotionThemeProvider>
134
+ </ThemeProvider>
135
+ </StyledEngineProvider>
136
+ </React.StrictMode>
137
+ );
138
+ ```
139
+
140
+ **/public/index.html**
141
+
142
+ ```html
143
+ <!doctype html>
144
+ <html lang="en">
145
+ <head>
146
+ <meta charset="UTF-8" />
147
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
148
+ <title>Theming</title>
149
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
150
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
151
+ <link
152
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
153
+ rel="stylesheet"
154
+ />
155
+ <link
156
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
157
+ rel="stylesheet"
158
+ />
159
+ </head>
160
+ <body>
161
+ <div id="root"></div>
162
+ </body>
163
+ </html>
164
+ ```
165
+
166
+ **/package.json**
167
+
168
+ ```json
169
+ {
170
+ "dependencies": {
171
+ "react": "^18.0.0",
172
+ "react-dom": "^18.0.0",
173
+ "react-scripts": "^4.0.0"
174
+ },
175
+ "devDependencies": {
176
+ "@types/react": "^18.0.0",
177
+ "@types/react-dom": "^18.0.0",
178
+ "typescript": "^4.0.0"
179
+ },
180
+ "main": "/index.tsx"
181
+ }
182
+ ```
183
+
184
+ ---
185
+
186
+ ### Dark Mode Based on System Preference
187
+
188
+ Users might have a preference for Light or Dark Mode set through their operating system—either systemwide, or for a single user agent.
189
+
190
+ You can ensure this preference is used in your application with the useMediaQuery hook and the prefers-color-scheme media query.
191
+
192
+ The following demo shows how to enable Dark Mode automatically by checking for the user's preference in their OS or browser settings:
193
+
194
+ **/styles.css**
195
+
196
+ ```css
197
+ body {
198
+ font-size: 13px;
199
+ font-weight: 400;
200
+ letter-spacing: 0.08px;
201
+ line-height: 20px;
202
+ text-transform: none;
203
+ font-family: "Inter", sans-serif;
204
+ }
205
+
206
+ h1 {
207
+ font-size: 1.5rem;
208
+ }
209
+
210
+ .app {
211
+ padding: 20px;
212
+ }
213
+ ```
214
+
215
+ **tsconfig.json**
216
+
217
+ ```json
218
+ {
219
+ "include": ["./**/*"],
220
+ "compilerOptions": {
221
+ "strict": true,
222
+ "esModuleInterop": true,
223
+ "lib": ["dom", "es2015"],
224
+ "jsx": "react-jsx"
225
+ }
226
+ }
227
+ ```
228
+
229
+ **/App.tsx**
230
+
231
+ ```tsx
232
+ import { Button } from "@czi-sds/components";
233
+ import "./styles.css";
234
+
235
+ function App() {
236
+ return (
237
+ <div className="app">
238
+ <Button sdsType="primary" sdsStyle="square">
239
+ Label
240
+ </Button>
241
+ </div>
242
+ );
243
+ }
244
+
245
+ export default App;
246
+ ```
247
+
248
+ **/index.tsx**
249
+
250
+ ```tsx
251
+ import React from "react";
252
+ import { createRoot } from "react-dom/client";
253
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
254
+ import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
255
+ import { Theme } from "@czi-sds/components";
256
+ import CssBaseline from "@mui/material/CssBaseline";
257
+ import useMediaQuery from "@mui/material/useMediaQuery";
258
+
259
+ import App from "./App";
260
+
261
+ const container = document.getElementById("root");
262
+ const root = createRoot(container!);
263
+
264
+ // Create a wrapper component to handle theme and useMediaQuery
265
+ const RootApp = () => {
266
+ const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
267
+ const theme = prefersDarkMode ? Theme("dark") : Theme("light");
268
+
269
+ return (
270
+ <StyledEngineProvider injectFirst>
271
+ <ThemeProvider theme={theme}>
272
+ <EmotionThemeProvider theme={theme}>
273
+ <CssBaseline />
274
+ <App />
275
+ </EmotionThemeProvider>
276
+ </ThemeProvider>
277
+ </StyledEngineProvider>
278
+ );
279
+ };
280
+
281
+ root.render(
282
+ <React.StrictMode>
283
+ <RootApp />
284
+ </React.StrictMode>
285
+ );
286
+ ```
287
+
288
+ **/public/index.html**
289
+
290
+ ```html
291
+ <!doctype html>
292
+ <html lang="en">
293
+ <head>
294
+ <meta charset="UTF-8" />
295
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
296
+ <title>Theming</title>
297
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
298
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
299
+ <link
300
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
301
+ rel="stylesheet"
302
+ />
303
+ <link
304
+ href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap"
305
+ rel="stylesheet"
306
+ />
307
+ </head>
308
+ <body>
309
+ <div id="root"></div>
310
+ </body>
311
+ </html>
312
+ ```
313
+
314
+ **/package.json**
315
+
316
+ ```json
317
+ {
318
+ "dependencies": {
319
+ "react": "^18.0.0",
320
+ "react-dom": "^18.0.0",
321
+ "react-scripts": "^4.0.0"
322
+ },
323
+ "devDependencies": {
324
+ "@types/react": "^18.0.0",
325
+ "@types/react-dom": "^18.0.0",
326
+ "typescript": "^4.0.0"
327
+ },
328
+ "main": "/index.tsx"
329
+ }
330
+ ```
331
+
332
+ ---