@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,1159 @@
1
+ # Getting Started
2
+
3
+ Let the following guides serve as starting points for working with the SDS. Understand how to use the design system libraries within Figma, navigate the documentation, contribute new components to the design system, access the SDS codebase, and incorporate coded components into application builds.
4
+
5
+ ## For Designers
6
+
7
+ ## Overview
8
+
9
+ | The Science Design System (SDS) brings consistency and universal standards to CZI's science products. Within Figma, the elements of the SDS are accessible to product designers via a collection of published libraries. These libraries have been built to allow for maximum flexibility depending on each product team's component needs. The SDS Documentation serves as an in-depth guide for both designers and engineers for using elements of the design system within projects. In instances where the available SDS components don't fulfill a product team's needs, there is a straightforward process for requesting additional elements for the design system. | | **Jump to section:** Figma SDS Documentation Contributing to the SDS |
10
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------- |
11
+
12
+ ---
13
+
14
+ ### Figma
15
+
16
+ #### **Library structure**
17
+
18
+ Instead of consolidating all elements into the same Figma library, the SDS team has broken out each element type into separate libraries—SDS Bases, SDS Typography, SDS Icons, and SDS Components. Each of these libraries can be turned on or off depending on the needs of the individual product team. This ensures product designers' project files aren't cluttered with unnecessary elements and they only see the pieces of the SDS that are relevant to them.
19
+
20
+ > For example, CZ ID and CZ GEN EPI use the same fonts in both of their products, whereas Single Cell and napari use their own unique typography and therefore have no need for the SDS Typography library to be enabled in their project files. All four products use the same icon set, meaning all four will have the SDS Icons library enabled in their project files.
21
+
22
+ The SDS Components library is not intended to be used by itself, but instead feeds into component sub-libraries for each product. This ensures each component is built consistently and has the same functionality and props, while allowing for visual customization of every component to align with each product's look and feel. Each product sub-library contains any product-specific colors (generally Primary and Info colors) and typography.
23
+
24
+ > For example, designers on CZ ID and CZ GEN EPI will both be using the same Button component and all of its variant options, while CZ ID's primary Button will be blue and pulled from the CZ ID Components library and CZ GEN EPI's will be purple and pulled from the CZ GEN EPI Components library.
25
+
26
+ #### **Project file set up**
27
+
28
+ When working on a project, ensure the necessary SDS libraries for your product are enabled. Figma's team settings for napari hub + .org have been adjusted to ensure any new project started in the team folder will have the necessary libraries enabled by default.
29
+
30
+ For reference, below are the libraries that should be enabled for napari hub + .org projects:
31
+
32
+ - SDS Icons
33
+ - napari hub + .org Design System
34
+
35
+ For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
36
+
37
+ ---
38
+
39
+ ### SDS Documentation
40
+
41
+ The SDS documentation should be the go-to place to learn about using elements of the design system within projects. It is not intended to be used only by designers, but by anyone on a product team looking to better familiarize themselves with all of the pieces of the design system and how it can be best leveraged in product work.
42
+
43
+ Below are a few tips around navigating the documentation:
44
+
45
+ - Visit the Element Status Tracker page for the most up-to-date view of which elements are available for use within the Figma libraries and the SDS codebase; a more detailed status spreadsheet is linked at the bottom of this page for an in-depth look at status by component variant as well as links to implementation tickets for a granular view of when to expect components to be available for use
46
+ - Most components have a Live Preview section on their Overview tabs; this displays an interactive instance of the element, providing the ability to engage with it and get a better feel for how it will work when included as part of a product build
47
+ - Each variant of every component is viewable on their Overview tabs; aside from displaying all of the available props for each variant, these views are able to be clicked on and inspected to get further design details such as typography and color styles, border radiuses, spacing, etc.
48
+ - On every component page there is a Code tab containing individual iframes imported from Storybook of each variant available to that component; each iframe has all of the same functionality found within Storybook, allowing engineers to explore props, adjust colors and text, see any event handlers, etc. all without leaving the documentation site
49
+
50
+ ---
51
+
52
+ ### Contributing to the SDS
53
+
54
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:
55
+
56
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
57
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
58
+
59
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
60
+
61
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
62
+
63
+ See a more detailed flow of the component request process here.
64
+
65
+ ## For Engineers
66
+
67
+ ## Overview
68
+
69
+ | The Science Design System (SDS) brings consistency and universal standards to CZI’s science products by offering a library of high quality, reusable components that deliver predictable, accessible and easy to learn experiences. Our goal is to democratize access to tools and technologies for scientists. | | **Jump to section:** Getting Started Usage Contributing to the SDS |
70
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------ |
71
+
72
+ ---
73
+
74
+ ### Getting Started
75
+
76
+ #### **Installation**
77
+
78
+ NPM Package:
79
+
80
+ ```sh
81
+ // with npm
82
+
83
+ npm i czifui
84
+
85
+
86
+
87
+ // with yarn
88
+
89
+ yarn add czifui
90
+ ```
91
+
92
+
93
+
94
+ SDS currently uses Material UI v5
95
+
96
+ czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
97
+
98
+ ```html
99
+ "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
100
+ "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
101
+ ```
102
+
103
+ To install the dependencies:
104
+
105
+ ```sh
106
+ // with npm
107
+
108
+ npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
109
+
110
+
111
+
112
+ // with yarn
113
+
114
+ yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
115
+ ```
116
+
117
+ ---
118
+
119
+ ### Usage
120
+
121
+ `czifui` comes with four main exports that help you build your app:
122
+
123
+ 1. **Components** - Accessible and reusable components
124
+
125
+ ```js
126
+ import React from "react";
127
+
128
+ import { Button } from "czifui";
129
+
130
+ <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
131
+ {text}
132
+ </Button>;
133
+ ```
134
+
135
+ 2. **Mixins** - Grouped styles defined by the design system
136
+
137
+ ```js
138
+ import styled from "@emotion/styled";
139
+
140
+ import { Typography } from "@material-ui/core";
141
+
142
+ import { fontHeaderXL } from "czifui";
143
+
144
+
145
+
146
+ export const Title - styled(Typography)`
147
+
148
+ ${fontHeaderXl}
149
+
150
+
151
+
152
+ // which compiles to:
153
+
154
+ font-size: 22px;
155
+
156
+ font-weight: 600;
157
+
158
+ letter-spacing: 0.3px;
159
+
160
+ line-height: 30px;
161
+
162
+ `;
163
+ ```
164
+
165
+ 3. **Selectors** - Helper functions that return theme variables based on passed props
166
+
167
+ ```js
168
+ import { css, SerializedStyles } from "@emotion/react";
169
+
170
+ import styled from "@emotion/styled";
171
+
172
+ import { getColors, getCorners } from "czifui";
173
+
174
+ export const Tag = styled.div`
175
+ // This is a callback function that returns more CSS rules, but the only way
176
+
177
+ // to access the custom theme object
178
+
179
+ ${(props) => {
180
+ // getColors() is a selector that picks out colors from the theme object
181
+
182
+ const colors = getColors(props);
183
+
184
+ // getSpaces() is a selector that picks out spacings from the theme object
185
+
186
+ const spacings = getSpaces(props);
187
+
188
+ return `
189
+
190
+ background-color: ${colors?.gray[500]};
191
+
192
+ padding-bottom: ${spacings?.m}px;
193
+
194
+ margin-bottom: ${spacings?.xxl}px;
195
+
196
+ `;
197
+ }}
198
+ `;
199
+ ```
200
+
201
+ 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
202
+
203
+ ```css
204
+ // with SCSS variables
205
+
206
+ @import "~czifui/dist/variables";
207
+
208
+
209
+
210
+ .button-primary {
211
+
212
+ background-color: $sds-color-primary-400;
213
+
214
+ padding: $sds-spaces-xxs;
215
+
216
+ }
217
+
218
+
219
+
220
+ // with CSS variables
221
+
222
+ .button-primary {
223
+
224
+ background-color: var(--sds-color-primary-400);
225
+
226
+ padding: var(--sds-spaces-xxs);
227
+
228
+ }
229
+ ```
230
+
231
+ #### **Default Theme**
232
+
233
+ To use the default theme in your React application, complete the following:
234
+
235
+ 1. Add the following HTML to your `index.html` at the `<head>`section:
236
+
237
+ ```html
238
+ // installs the sds font from google fonts
239
+
240
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
241
+
242
+ <link
243
+ href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400;1,600;1,700&display=swap"
244
+ rel="stylesheet"
245
+ />
246
+ ```
247
+
248
+ 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
249
+
250
+ ```js
251
+ import { defaultTheme } from "czifui";
252
+
253
+ import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
254
+
255
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
256
+
257
+ <StylesProvider injectFirst>
258
+ <EmotionThemeProvider theme={defaultTheme}>
259
+ <ThemeProvider theme={defaultTheme}>
260
+ <YourApp />
261
+ </ThemeProvider>
262
+ </EmotionThemeProvider>
263
+ </StylesProvider>;
264
+ ```
265
+
266
+ 3. If you need to override the default SDS theme, please follow the instructions here.
267
+
268
+ ---
269
+
270
+ ### Contributing to the SDS
271
+
272
+ If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
273
+
274
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:d
275
+
276
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
277
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
278
+
279
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
280
+
281
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
282
+
283
+ See a more detailed flow of the component request process here.
284
+
285
+ ---
286
+
287
+ Let the following guides serve as starting points for working with the SDS. Understand how to use the design system libraries within Figma, navigate the documentation, contribute new components to the design system, access the SDS codebase, and incorporate coded components into application builds.
288
+
289
+ ## For Designers
290
+
291
+ ## Overview
292
+
293
+ | The Science Design System (SDS) brings consistency and universal standards to CZI's science products. Within Figma, the elements of the SDS are accessible to product designers via a collection of published libraries. These libraries have been built to allow for maximum flexibility depending on each product team's component needs. The SDS Documentation serves as an in-depth guide for both designers and engineers for using elements of the design system within projects. In instances where the available SDS components don't fulfill a product team's needs, there is a straightforward process for requesting additional elements for the design system. | | **Jump to section:** Figma SDS Documentation Contributing to the SDS |
294
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------- |
295
+
296
+ ---
297
+
298
+ ### Figma
299
+
300
+ #### **Library structure**
301
+
302
+ Instead of consolidating all elements into the same Figma library, the SDS team has broken out each element type into separate libraries—SDS Bases, SDS Typography, SDS Icons, and SDS Components. Each of these libraries can be turned on or off depending on the needs of the individual product team. This ensures product designers' project files aren't cluttered with unnecessary elements and they only see the pieces of the SDS that are relevant to them.
303
+
304
+ > For example, CZ ID and CZ GEN EPI use the same fonts in both of their products, whereas Single Cell and Napari use their own unique typography and therefore have no need for the SDS Typography library to be enabled in their project files. All four products use the same icon set, meaning all four will have the SDS Icons library enabled in their project files.
305
+
306
+ The SDS Components library is not intended to be used by itself, but instead feeds into component sub-libraries for each product. This ensures each component is built consistently and has the same functionality and props, while allowing for visual customization of every component to align with each product's look and feel. Each product sub-library contains any product-specific colors (generally Primary and Info colors) and typography.
307
+
308
+ > For example, designers on CZ ID and CZ GEN EPI will both be using the same Button component and all of its variant options, while CZ ID's primary Button will be blue and pulled from the CZ ID Components library and CZ GEN EPI's will be purple and pulled from the CZ GEN EPI Components library.
309
+
310
+ #### **Project file set up**
311
+
312
+ When working on a project, ensure the necessary SDS libraries for your product are enabled. Figma's team settings for CZ GEN EPI have been adjusted to ensure any new project started in the team folder will have the necessary libraries enabled by default.
313
+
314
+ For reference, below are the libraries that should be enabled for CZ GEN EPI projects:
315
+
316
+ - SDS Bases
317
+ - SDS Typography
318
+ - SDS Icons
319
+ - CZ GEN EPI Design System
320
+
321
+ For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
322
+
323
+ ---
324
+
325
+ ### SDS Documentation
326
+
327
+ The SDS documentation should be the go-to place to learn about using elements of the design system within projects. It is not intended to be used only by designers, but by anyone on a product team looking to better familiarize themselves with all of the pieces of the design system and how it can be best leveraged in product work.
328
+
329
+ Below are a few tips around navigating the documentation:
330
+
331
+ - Visit the Element Status Tracker page for the most up-to-date view of which elements are available for use within the Figma libraries and the SDS codebase; a more detailed status spreadsheet is linked at the bottom of this page for an in-depth look at status by component variant as well as links to implementation tickets for a granular view of when to expect components to be available for use
332
+ - Most components have a Live Preview section on their Overview tabs; this displays an interactive instance of the element, providing the ability to engage with it and get a better feel for how it will work when included as part of a product build
333
+ - Each variant of every component is viewable on their Overview tabs; aside from displaying all of the available props for each variant, these views are able to be clicked on and inspected to get further design details such as typography and color styles, border radiuses, spacing, etc.
334
+ - On every component page there is a Code tab containing individual iframes imported from Storybook of each variant available to that component; each iframe has all of the same functionality found within Storybook, allowing engineers to explore props, adjust colors and text, see any event handlers, etc. all without leaving the documentation site
335
+
336
+ ---
337
+
338
+ ### Contributing to the SDS
339
+
340
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:
341
+
342
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
343
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
344
+
345
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
346
+
347
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
348
+
349
+ See a more detailed flow of the component request process here.
350
+
351
+ ## For Engineers
352
+
353
+ ## Overview
354
+
355
+ | The Science Design System (SDS) brings consistency and universal standards to CZI’s science products by offering a library of high quality, reusable components that deliver predictable, accessible and easy to learn experiences. Our goal is to democratize access to tools and technologies for scientists. | | **Jump to section:** Getting Started Usage Contributing to the SDS |
356
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------ |
357
+
358
+ ---
359
+
360
+ ### Getting Started
361
+
362
+ #### **Installation**
363
+
364
+ NPM Package:
365
+
366
+ ```sh
367
+ // with npm
368
+
369
+ npm i czifui
370
+
371
+
372
+
373
+ // with yarn
374
+
375
+ yarn add czifui
376
+ ```
377
+
378
+ SDS currently uses Material UI v5
379
+
380
+ czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
381
+
382
+ ```html
383
+ "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
384
+ "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
385
+ ```
386
+
387
+ To install the dependencies:
388
+
389
+ ```sh
390
+ // with npm
391
+
392
+ npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
393
+
394
+
395
+
396
+ // with yarn
397
+
398
+ yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
399
+ ```
400
+
401
+ ---
402
+
403
+ ### Usage
404
+
405
+ `czifui` comes with four main exports that help you build your app:
406
+
407
+ 1. **Components** - Accessible and reusable components
408
+
409
+ ```js
410
+ import React from "react";
411
+
412
+ import { Button } from "czifui";
413
+
414
+ <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
415
+ {text}
416
+ </Button>;
417
+ ```
418
+
419
+ 2. **Mixins** - Grouped styles defined by the design system
420
+
421
+ ```js
422
+ import styled from "@emotion/styled";
423
+
424
+ import { Typography } from "@material-ui/core";
425
+
426
+ import { fontHeaderXL } from "czifui";
427
+
428
+
429
+
430
+ export const Title - styled(Typography)`
431
+
432
+ ${fontHeaderXl}
433
+
434
+
435
+
436
+ // which compiles to:
437
+
438
+ font-size: 22px;
439
+
440
+ font-weight: 600;
441
+
442
+ letter-spacing: 0.3px;
443
+
444
+ line-height: 30px;
445
+
446
+ `;
447
+ ```
448
+
449
+ 3. **Selectors** - Helper functions that return theme variables based on passed props
450
+
451
+ ```js
452
+ import { css, SerializedStyles } from "@emotion/react";
453
+
454
+ import styled from "@emotion/styled";
455
+
456
+ import { getColors, getCorners } from "czifui";
457
+
458
+ export const Tag = styled.div`
459
+ // This is a callback function that returns more CSS rules, but the only way
460
+
461
+ // to access the custom theme object
462
+
463
+ ${(props) => {
464
+ // getColors() is a selector that picks out colors from the theme object
465
+
466
+ const colors = getColors(props);
467
+
468
+ // getSpaces() is a selector that picks out spacings from the theme object
469
+
470
+ const spacings = getSpaces(props);
471
+
472
+ return `
473
+
474
+ background-color: ${colors?.gray[500]};
475
+
476
+ padding-bottom: ${spacings?.m}px;
477
+
478
+ margin-bottom: ${spacings?.xxl}px;
479
+
480
+ `;
481
+ }}
482
+ `;
483
+ ```
484
+
485
+
486
+
487
+ 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
488
+
489
+ ```css
490
+ // with SCSS variables
491
+
492
+ @import "~czifui/dist/variables";
493
+
494
+
495
+
496
+ .button-primary {
497
+
498
+ background-color: $sds-color-primary-400;
499
+
500
+ padding: $sds-spaces-xxs;
501
+
502
+ }
503
+
504
+
505
+
506
+ // with CSS variables
507
+
508
+ .button-primary {
509
+
510
+ background-color: var(--sds-color-primary-400);
511
+
512
+ padding: var(--sds-spaces-xxs);
513
+
514
+ }
515
+ ```
516
+
517
+ #### **Default Theme**
518
+
519
+ To use the default theme in your React application, complete the following:
520
+
521
+ 1. Add the following HTML to your `index.html` at the `<head>`section:
522
+
523
+ ```html
524
+ // installs the sds font from google fonts
525
+
526
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
527
+
528
+ <link
529
+ href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400;1,600;1,700&display=swap"
530
+ rel="stylesheet"
531
+ />
532
+ ```
533
+
534
+ 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
535
+
536
+ ```js
537
+ import { defaultTheme } from "czifui";
538
+
539
+ import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
540
+
541
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
542
+
543
+ <StylesProvider injectFirst>
544
+ <EmotionThemeProvider theme={defaultTheme}>
545
+ <ThemeProvider theme={defaultTheme}>
546
+ <YourApp />
547
+ </ThemeProvider>
548
+ </EmotionThemeProvider>
549
+ </StylesProvider>;
550
+ ```
551
+
552
+
553
+
554
+ 3. If you need to override the default SDS theme, please follow the instructions here.
555
+
556
+ ---
557
+
558
+ ### Contributing to the SDS
559
+
560
+ If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
561
+
562
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:
563
+
564
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
565
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
566
+
567
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
568
+
569
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
570
+
571
+ See a more detailed flow of the component request process here.
572
+
573
+ ---
574
+
575
+ Let the following guides serve as starting points for working with the SDS. Understand how to use the design system libraries within Figma, navigate the documentation, contribute new components to the design system, access the SDS codebase, and incorporate coded components into application builds.
576
+
577
+ ## For Designers
578
+
579
+ ## Overview
580
+
581
+ | The Science Design System (SDS) brings consistency and universal standards to CZI's science products. Within Figma, the elements of the SDS are accessible to product designers via a collection of published libraries. These libraries have been built to allow for maximum flexibility depending on each product team's component needs. The SDS Documentation serves as an in-depth guide for both designers and engineers for using elements of the design system within projects. In instances where the available SDS components don't fulfill a product team's needs, there is a straightforward process for requesting additional elements for the design system. | | **Jump to section:** Figma SDS Documentation Contributing to the SDS |
582
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------- |
583
+
584
+ ---
585
+
586
+ ### Figma
587
+
588
+ #### **Library structure**
589
+
590
+ Instead of consolidating all elements into the same Figma library, the SDS team has broken out each element type into separate libraries—SDS Bases, SDS Typography, SDS Icons, and SDS Components. Each of these libraries can be turned on or off depending on the needs of the individual product team. This ensures product designers' project files aren't cluttered with unnecessary elements and they only see the pieces of the SDS that are relevant to them.
591
+
592
+ > For example, CZ ID and CZ GEN EPI use the same fonts in both of their products, whereas Single Cell and Napari use their own unique typography and therefore have no need for the SDS Typography library to be enabled in their project files. All four products use the same icon set, meaning all four will have the SDS Icons library enabled in their project files.
593
+
594
+ The SDS Components library is not intended to be used by itself, but instead feeds into component sub-libraries for each product. This ensures each component is built consistently and has the same functionality and props, while allowing for visual customization of every component to align with each product's look and feel. Each product sub-library contains any product-specific colors (generally Primary and Info colors) and typography.
595
+
596
+ > For example, designers on CZ ID and CZ GEN EPI will both be using the same Button component and all of its variant options, while CZ ID's primary Button will be blue and pulled from the CZ ID Components library and CZ GEN EPI's will be purple and pulled from the CZ GEN EPI Components library.
597
+
598
+ #### **Project file set up**
599
+
600
+ When working on a project, ensure the necessary SDS libraries for your product are enabled. Figma's team settings for CZ ID have been adjusted to ensure any new project started in the team folder will have the necessary libraries enabled by default.
601
+
602
+ For reference, below are the libraries that should be enabled for CZ ID projects:
603
+
604
+ - SDS Bases
605
+ - SDS Typography
606
+ - SDS Icons
607
+ - CZ ID Design System
608
+
609
+ For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
610
+
611
+ ---
612
+
613
+ ### SDS Documentation
614
+
615
+ The SDS documentation should be the go-to place to learn about using elements of the design system within projects. It is not intended to be used only by designers, but by anyone on a product team looking to better familiarize themselves with all of the pieces of the design system and how it can be best leveraged in product work.
616
+
617
+ Below are a few tips around navigating the documentation:
618
+
619
+ - Visit the Element Status Tracker page for the most up-to-date view of which elements are available for use within the Figma libraries and the SDS codebase; a more detailed status spreadsheet is linked at the bottom of this page for an in-depth look at status by component variant as well as links to implementation tickets for a granular view of when to expect components to be available for use
620
+ - Most components have a Live Preview section on their Overview tabs; this displays an interactive instance of the element, providing the ability to engage with it and get a better feel for how it will work when included as part of a product build
621
+ - Each variant of every component is viewable on their Overview tabs; aside from displaying all of the available props for each variant, these views are able to be clicked on and inspected to get further design details such as typography and color styles, border radiuses, spacing, etc.
622
+ - On every component page there is a Code tab containing individual iframes imported from Storybook of each variant available to that component; each iframe has all of the same functionality found within Storybook, allowing engineers to explore props, adjust colors and text, see any event handlers, etc. all without leaving the documentation site
623
+
624
+ ---
625
+
626
+ ### Contributing to the SDS
627
+
628
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:
629
+
630
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
631
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
632
+
633
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
634
+
635
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
636
+
637
+ See a more detailed flow of the component request process here.
638
+
639
+ ## For Engineers
640
+
641
+ ## Overview
642
+
643
+ | The Science Design System (SDS) brings consistency and universal standards to CZI’s science products by offering a library of high quality, reusable components that deliver predictable, accessible and easy to learn experiences. Our goal is to democratize access to tools and technologies for scientists. | | **Jump to section:** Getting Started Usage Contributing to the SDS |
644
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------ |
645
+
646
+ ---
647
+
648
+ ### Getting Started
649
+
650
+ #### **Installation**
651
+
652
+ NPM Package:
653
+
654
+ ```sh
655
+ // with npm
656
+
657
+ npm i czifui
658
+
659
+
660
+
661
+ // with yarn
662
+
663
+ yarn add czifui
664
+ ```
665
+
666
+ SDS currently uses Material UI v5
667
+
668
+ czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
669
+
670
+ ```html
671
+ "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
672
+ "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
673
+ ```
674
+
675
+ To install the dependencies:
676
+
677
+ ```sh
678
+ // with npm
679
+
680
+ npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
681
+
682
+
683
+
684
+ // with yarn
685
+
686
+ yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
687
+ ```
688
+
689
+ ---
690
+
691
+ ### Usage
692
+
693
+ `czifui` comes with four main exports that help you build your app:
694
+
695
+ 1. **Components** - Accessible and reusable components
696
+
697
+ ```js
698
+ import React from "react";
699
+
700
+ import { Button } from "czifui";
701
+
702
+ <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
703
+ {text}
704
+ </Button>;
705
+ ```
706
+
707
+ 2. **Mixins** - Grouped styles defined by the design system
708
+
709
+ ```js
710
+ import styled from "@emotion/styled";
711
+
712
+ import { Typography } from "@material-ui/core";
713
+
714
+ import { fontHeaderXL } from "czifui";
715
+
716
+
717
+
718
+ export const Title - styled(Typography)`
719
+
720
+ ${fontHeaderXl}
721
+
722
+
723
+
724
+ // which compiles to:
725
+
726
+ font-size: 22px;
727
+
728
+ font-weight: 600;
729
+
730
+ letter-spacing: 0.3px;
731
+
732
+ line-height: 30px;
733
+
734
+ `;
735
+ ```
736
+
737
+ 3. **Selectors** - Helper functions that return theme variables based on passed props
738
+
739
+ ```js
740
+ import { css, SerializedStyles } from "@emotion/react";
741
+
742
+ import styled from "@emotion/styled";
743
+
744
+ import { getColors, getCorners } from "czifui";
745
+
746
+ export const Tag = styled.div`
747
+ // This is a callback function that returns more CSS rules, but the only way
748
+
749
+ // to access the custom theme object
750
+
751
+ ${(props) => {
752
+ // getColors() is a selector that picks out colors from the theme object
753
+
754
+ const colors = getColors(props);
755
+
756
+ // getSpaces() is a selector that picks out spacings from the theme object
757
+
758
+ const spacings = getSpaces(props);
759
+
760
+ return `
761
+
762
+ background-color: ${colors?.gray[500]};
763
+
764
+ padding-bottom: ${spacings?.m}px;
765
+
766
+ margin-bottom: ${spacings?.xxl}px;
767
+
768
+ `;
769
+ }}
770
+ `;
771
+ ```
772
+
773
+ 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
774
+
775
+ ```css
776
+ // with SCSS variables
777
+
778
+ @import "~czifui/dist/variables";
779
+
780
+
781
+
782
+ .button-primary {
783
+
784
+ background-color: $sds-color-primary-400;
785
+
786
+ padding: $sds-spaces-xxs;
787
+
788
+ }
789
+
790
+
791
+
792
+ // with CSS variables
793
+
794
+ .button-primary {
795
+
796
+ background-color: var(--sds-color-primary-400);
797
+
798
+ padding: var(--sds-spaces-xxs);
799
+
800
+ }
801
+ ```
802
+
803
+ #### **Default Theme**
804
+
805
+ To use the default theme in your React application, complete the following:
806
+
807
+ 1. Add the following HTML to your `index.html` at the `<head>`section:
808
+
809
+ ```html
810
+ // installs the sds font from google fonts
811
+
812
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
813
+
814
+ <link
815
+ href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400;1,600;1,700&display=swap"
816
+ rel="stylesheet"
817
+ />
818
+ ```
819
+
820
+ 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
821
+
822
+ ```js
823
+ import { defaultTheme } from "czifui";
824
+
825
+ import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
826
+
827
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
828
+
829
+ <StylesProvider injectFirst>
830
+ <EmotionThemeProvider theme={defaultTheme}>
831
+ <ThemeProvider theme={defaultTheme}>
832
+ <YourApp />
833
+ </ThemeProvider>
834
+ </EmotionThemeProvider>
835
+ </StylesProvider>;
836
+ ```
837
+
838
+ 3.  If you need to override the default SDS theme, please follow the instructions here.
839
+
840
+ ---
841
+
842
+ ### Contributing to the SDS
843
+
844
+ If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
845
+
846
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:d
847
+
848
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
849
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
850
+
851
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
852
+
853
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
854
+
855
+ See a more detailed flow of the component request process here.
856
+
857
+ ---
858
+
859
+ Let the following guides serve as starting points for working with the SDS. Understand how to use the design system libraries within Figma, navigate the documentation, contribute new components to the design system, access the SDS codebase, and incorporate coded components into application builds.
860
+
861
+ ## For Designers
862
+
863
+ ## Overview
864
+
865
+ | The Science Design System (SDS) brings consistency and universal standards to CZI's science products. Within Figma, the elements of the SDS are accessible to product designers via a collection of published libraries. These libraries have been built to allow for maximum flexibility depending on each product team's component needs. The SDS Documentation serves as an in-depth guide for both designers and engineers for using elements of the design system within projects. In instances where the available SDS components don't fulfill a product team's needs, there is a straightforward process for requesting additional elements for the design system. | | **Jump to** **s\*\***ection:\*\* Figma SDS Documentation Contributing to the SDS |
866
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------------------- |
867
+
868
+ ---
869
+
870
+ ### Figma
871
+
872
+ #### Library structure
873
+
874
+ Instead of consolidating all elements into the same Figma library, the SDS team has broken out each element type into separate libraries—SDS Bases, SDS Typography, SDS Icons, and SDS Components. Each of these libraries can be turned on or off depending on the needs of the individual product team. This ensures product designers' project files aren't cluttered with unnecessary elements and they only see the pieces of the SDS that are relevant to them.
875
+
876
+ > For example, CZ ID and CZ GEN EPI use the same fonts in both of their products, whereas Single Cell and Napari use their own unique typography and therefore have no need for the SDS Typography library to be enabled in their project files. All four products use the same icon set, meaning all four will have the SDS Icons library enabled in their project files.
877
+
878
+ The SDS Components library is not intended to be used by itself, but instead feeds into component sub-libraries for each product. This ensures each component is built consistently and has the same functionality and props, while allowing for visual customization of every component to align with each product's look and feel. Each product sub-library contains any product-specific colors (generally Primary and Info colors) and typography.
879
+
880
+ > For example, designers on CZ ID and CZ GEN EPI will both be using the same Button component and all of its variant options, while CZ ID's primary Button will be blue and pulled from the CZ ID Components library and CZ GEN EPI's will be purple and pulled from the CZ GEN EPI Components library.
881
+
882
+ #### Project file set up
883
+
884
+ When working on a project, ensure the necessary SDS libraries for your product are enabled. Figma's team settings for CZ ID and CZ GEN EPI have been adjusted to ensure any new project started within either of these team folders will have the necessary libraries enabled by default.
885
+
886
+ Below are the libraries that should be enabled by product:
887
+
888
+ CZ ID
889
+
890
+ - SDS Bases
891
+ - SDS Typography
892
+ - SDS Icons
893
+ - CZ ID Design System
894
+
895
+ CZ GEN EPI
896
+
897
+ - SDS Bases
898
+ - SDS Typography
899
+ - SDS Icons
900
+ - CZ GEN EPI Design System
901
+
902
+ Single Cell Biology
903
+
904
+ - SDS Bases
905
+ - SDS Icons
906
+ - Single Cell Design System
907
+
908
+ Imaging
909
+
910
+ - SDS Icons
911
+ - napari hub + .org Design System
912
+
913
+ For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
914
+
915
+ ---
916
+
917
+ ### SDS Documentation
918
+
919
+ The SDS documentation should be the go-to place to learn about using elements of the design system within projects. It is not intended to be used only by designers, but by anyone on a product team looking to better familiarize themselves with all of the pieces of the design system and how it can be best leveraged in product work.
920
+
921
+ Below are a few tips around navigating the documentation:
922
+
923
+ - Visit the Element Status Tracker page for the most up-to-date view of which elements are available for use within the Figma libraries and the SDS codebase; a more detailed status spreadsheet is linked at the bottom of this page for an in-depth look at status by component variant as well as links to implementation tickets for a granular view of when to expect components to be available for use
924
+ - Most components have a Live Preview section on their Overview tabs; this displays an interactive instance of the element, providing the ability to engage with it and get a better feel for how it will work when included as part of a product build
925
+ - Each variant of every component is viewable on their Overview tabs; aside from displaying all of the available props for each variant, these views are able to be clicked on and inspected to get further design details such as typography and color styles, border radiuses, spacing, etc.
926
+ - On every component page there is a Code tab containing individual iframes imported from Storybook of each variant available to that component; each iframe has all of the same functionality found within Storybook, allowing engineers to explore props, adjust colors and text, see any event handlers, etc. all without leaving the documentation site
927
+
928
+ ---
929
+
930
+ ### Contributing to the SDS
931
+
932
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:
933
+
934
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
935
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
936
+
937
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
938
+
939
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
940
+
941
+ See a more detailed flow of the component request process here.
942
+
943
+ ## For Engineers
944
+
945
+ ## Overview
946
+
947
+ | The Science Design System (SDS) brings consistency and universal standards to CZI’s science products by offering a library of high quality, reusable components that deliver predictable, accessible and easy to learn experiences. Our goal is to democratize access to tools and technologies for scientists. | | **Jump to** **s\*\***ection:\*\* Getting Started Usage Contributing to the SDS |
948
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------------ |
949
+
950
+ ---
951
+
952
+ ### Getting Started
953
+
954
+ #### Installation
955
+
956
+ NPM Package:
957
+
958
+ ```sh
959
+ // with npm
960
+
961
+ npm i czifui
962
+
963
+
964
+
965
+ // with yarn
966
+
967
+ yarn add czifui
968
+ ```
969
+
970
+ SDS currently uses Material UI v5
971
+
972
+ czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
973
+
974
+ ```html
975
+ "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
976
+ "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
977
+ ```
978
+
979
+ To install the dependencies:
980
+
981
+ ```sh
982
+ // with npm
983
+
984
+ npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
985
+
986
+
987
+
988
+ // with yarn
989
+
990
+ yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
991
+ ```
992
+
993
+ ---
994
+
995
+ ### Usage
996
+
997
+ `czifui` comes with four main exports that help you build your app:
998
+
999
+ 1. **Components** - Accessible and reusable components
1000
+
1001
+ ```js
1002
+ import React from "react";
1003
+
1004
+ import { Button } from "czifui";
1005
+
1006
+ <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
1007
+ {text}
1008
+ </Button>;
1009
+ ```
1010
+
1011
+ 2. **Mixins** - Grouped styles defined by the design system
1012
+
1013
+ ```js
1014
+ import styled from "@emotion/styled";
1015
+
1016
+ import { Typography } from "@material-ui/core";
1017
+
1018
+ import { fontHeaderXL } from "czifui";
1019
+
1020
+
1021
+
1022
+ export const Title - styled(Typography)`
1023
+
1024
+ ${fontHeaderXl}
1025
+
1026
+
1027
+
1028
+ // which compiles to:
1029
+
1030
+ font-size: 22px;
1031
+
1032
+ font-weight: 600;
1033
+
1034
+ letter-spacing: 0.3px;
1035
+
1036
+ line-height: 30px;
1037
+
1038
+ `;
1039
+ ```
1040
+
1041
+ 3. **Selectors** - Helper functions that return theme variables based on passed props
1042
+
1043
+ ```js
1044
+ import { css, SerializedStyles } from "@emotion/react";
1045
+
1046
+ import styled from "@emotion/styled";
1047
+
1048
+ import { getColors, getCorners } from "czifui";
1049
+
1050
+ export const Tag = styled.div`
1051
+ // This is a callback function that returns more CSS rules, but the only way
1052
+
1053
+ // to access the custom theme object
1054
+
1055
+ ${(props) => {
1056
+ // getColors() is a selector that picks out colors from the theme object
1057
+
1058
+ const colors = getColors(props);
1059
+
1060
+ // getSpaces() is a selector that picks out spacings from the theme object
1061
+
1062
+ const spacings = getSpaces(props);
1063
+
1064
+ return `
1065
+
1066
+ background-color: ${colors?.gray[500]};
1067
+
1068
+ padding-bottom: ${spacings?.m}px;
1069
+
1070
+ margin-bottom: ${spacings?.xxl}px;
1071
+
1072
+ `;
1073
+ }}
1074
+ `;
1075
+ ```
1076
+
1077
+ 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
1078
+
1079
+ ```css
1080
+ // with SCSS variables
1081
+
1082
+ @import "~czifui/dist/variables";
1083
+
1084
+
1085
+
1086
+ .button-primary {
1087
+
1088
+ background-color: $sds-color-primary-400;
1089
+
1090
+ padding: $sds-spaces-xxs;
1091
+
1092
+ }
1093
+
1094
+
1095
+
1096
+ // with CSS variables
1097
+
1098
+ .button-primary {
1099
+
1100
+ background-color: var(--sds-color-primary-400);
1101
+
1102
+ padding: var(--sds-spaces-xxs);
1103
+
1104
+ }
1105
+ ```
1106
+
1107
+ #### Default Theme
1108
+
1109
+ To use the default theme in your React application, complete the following:
1110
+
1111
+ 1. Add the following HTML to your `index.html` at the `<head>`section:
1112
+
1113
+ ```html
1114
+ // installs the sds font from google fonts
1115
+
1116
+ <link rel="preconnect" href="https://fonts.gstatic.com" />
1117
+
1118
+ <link
1119
+ href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,400;1,600;1,700&display=swap"
1120
+ rel="stylesheet"
1121
+ />
1122
+ ```
1123
+
1124
+ 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
1125
+
1126
+ ```js
1127
+ import { defaultTheme } from "czifui";
1128
+
1129
+ import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
1130
+
1131
+ import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1132
+
1133
+ <StylesProvider injectFirst>
1134
+ <EmotionThemeProvider theme={defaultTheme}>
1135
+ <ThemeProvider theme={defaultTheme}>
1136
+ <YourApp />
1137
+ </ThemeProvider>
1138
+ </EmotionThemeProvider>
1139
+ </StylesProvider>;
1140
+ ```
1141
+
1142
+ 3.  If you need to override the default SDS theme, please follow the instructions here.
1143
+
1144
+ ---
1145
+
1146
+ ### Contributing to the SDS
1147
+
1148
+ If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
1149
+
1150
+ If a product need arises for a component that doesn't exist in the SDS, a request can be made to the SDS team to design and add it into the system. To do so, follow the steps below:
1151
+
1152
+ 1. Take a second look through the SDS Documentation to double check the product need can indeed not be satisfied by an existing SDS component
1153
+ 2. Post the component request to the #sci-design-system-support.) channel in Slack using the following request template to ensure all of the necessary details are captured for the SDS team:
1154
+
1155
+ Once a request is submitted, the SDS team will conduct an evaluation across all Science products to determine whether the new component would be beneficial to multiple products and should become part of the SDS. If it is determined that the requested component be added into the SDS, the SDS team will work with the requesting team to build, review, test, and incorporate the new component into the system.
1156
+
1157
+ If it is determined that the new component should not become part of the SDS, it will become the requesting product team's responsibility to design and maintain the component on their own.
1158
+
1159
+ See a more detailed flow of the component request process here.