@czi-sds/mcp 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +2 -1
  2. package/data/component-docs/Accordion.md +291 -0
  3. package/data/component-docs/Autocomplete.md +525 -0
  4. package/data/component-docs/Banner.md +231 -0
  5. package/data/component-docs/Button.md +224 -0
  6. package/data/component-docs/ButtonDropdown.md +256 -0
  7. package/data/component-docs/ButtonGroup.md +320 -0
  8. package/data/component-docs/ButtonToggle.md +397 -0
  9. package/data/component-docs/Callout.md +268 -0
  10. package/data/component-docs/CellBasic.md +122 -0
  11. package/data/component-docs/CellComponent.md +63 -0
  12. package/data/component-docs/CellHeader.md +128 -0
  13. package/data/component-docs/ComplexFilter.md +294 -0
  14. package/data/component-docs/ContentCard.md +406 -0
  15. package/data/component-docs/Dialog.md +651 -0
  16. package/data/component-docs/Dropdown.md +155 -0
  17. package/data/component-docs/DropdownMenu.md +949 -0
  18. package/data/component-docs/HeatmapChart.md +782 -0
  19. package/data/component-docs/Hero.md +363 -0
  20. package/data/component-docs/Icon.md +283 -0
  21. package/data/component-docs/InputCheckbox.md +205 -0
  22. package/data/component-docs/InputDropdown.md +482 -0
  23. package/data/component-docs/InputRadio.md +173 -0
  24. package/data/component-docs/InputSearch.md +81 -0
  25. package/data/component-docs/InputSlider.md +189 -0
  26. package/data/component-docs/InputText.md +110 -0
  27. package/data/component-docs/InputToggle.md +141 -0
  28. package/data/component-docs/IntentMessage.md +293 -0
  29. package/data/component-docs/Legend.md +442 -0
  30. package/data/component-docs/Link.md +23 -0
  31. package/data/component-docs/List.md +300 -0
  32. package/data/component-docs/LoadingIndicator.md +198 -0
  33. package/data/component-docs/Menu.md +298 -0
  34. package/data/component-docs/MenuItem.md +100 -0
  35. package/data/component-docs/NavigationFooter.md +165 -0
  36. package/data/component-docs/NavigationHeader.md +500 -0
  37. package/data/component-docs/NavigationJumpTo.md +414 -0
  38. package/data/component-docs/Notification.md +288 -0
  39. package/data/component-docs/Pagination.md +67 -0
  40. package/data/component-docs/Panel.md +636 -0
  41. package/data/component-docs/Popover.md +448 -0
  42. package/data/component-docs/PreComposedTable.md +2947 -0
  43. package/data/component-docs/SegmentedControl.md +396 -0
  44. package/data/component-docs/StackedBarChart.md +475 -0
  45. package/data/component-docs/Table.md +2000 -0
  46. package/data/component-docs/TableHeader.md +53 -0
  47. package/data/component-docs/TableRow.md +74 -0
  48. package/data/component-docs/Tabs.md +455 -0
  49. package/data/component-docs/Tag.md +647 -0
  50. package/data/component-docs/TagFilter.md +131 -0
  51. package/data/component-docs/Tooltip.md +561 -0
  52. package/data/component-docs/TooltipCondensed.md +203 -0
  53. package/data/component-docs/TooltipTable.md +145 -0
  54. package/data/component-docs/index.json +262 -0
  55. package/data/component-list.json +2 -5
  56. package/data/component-props/Accordion.json +31 -11
  57. package/data/component-props/Alert.json +3 -3
  58. package/data/component-props/Autocomplete.json +150 -15
  59. package/data/component-props/Banner.json +31 -17
  60. package/data/component-props/Button.json +45 -20
  61. package/data/component-props/ButtonDropdown.json +36 -17
  62. package/data/component-props/ButtonDropdownLegacy.json +11 -11
  63. package/data/component-props/ButtonGroup.json +32 -11
  64. package/data/component-props/ButtonIcon.json +10 -10
  65. package/data/component-props/ButtonLegacy.json +19 -19
  66. package/data/component-props/ButtonToggle.json +32 -19
  67. package/data/component-props/ButtonToggleLegacy.json +11 -11
  68. package/data/component-props/Callout.json +58 -17
  69. package/data/component-props/CellBasic.json +94 -41
  70. package/data/component-props/CellComponent.json +23 -7
  71. package/data/component-props/CellHeader.json +62 -19
  72. package/data/component-props/ComplexFilter.json +52 -21
  73. package/data/component-props/ContentCard.json +70 -47
  74. package/data/component-props/Dialog.json +47 -14
  75. package/data/component-props/Dropdown.json +67 -31
  76. package/data/component-props/DropdownMenu.json +128 -23
  77. package/data/component-props/HeatmapChart.json +88 -12
  78. package/data/component-props/Hero.json +80 -39
  79. package/data/component-props/Icon.json +20 -9
  80. package/data/component-props/InputCheckbox.json +36 -14
  81. package/data/component-props/InputDropdown.json +75 -27
  82. package/data/component-props/InputRadio.json +31 -13
  83. package/data/component-props/InputSearch.json +41 -18
  84. package/data/component-props/InputSlider.json +46 -19
  85. package/data/component-props/InputText.json +26 -19
  86. package/data/component-props/InputToggle.json +26 -9
  87. package/data/component-props/IntentMessage.json +38 -9
  88. package/data/component-props/Link.json +13 -7
  89. package/data/component-props/LoadingIndicator.json +11 -3
  90. package/data/component-props/MenuItem.json +38 -19
  91. package/data/component-props/MenuSelect.json +8 -8
  92. package/data/component-props/NavigationFooter.json +49 -19
  93. package/data/component-props/NavigationHeader.json +150 -37
  94. package/data/component-props/NavigationJumpTo.json +33 -7
  95. package/data/component-props/Notification.json +39 -21
  96. package/data/component-props/Pagination.json +39 -11
  97. package/data/component-props/Panel.json +62 -9
  98. package/data/component-props/Popover.json +80 -7
  99. package/data/component-props/PreComposedTable.json +99 -27
  100. package/data/component-props/SegmentedControl.json +42 -3
  101. package/data/component-props/StackedBarChart.json +116 -42
  102. package/data/component-props/TableRow.json +38 -19
  103. package/data/component-props/Tabs.json +66 -9
  104. package/data/component-props/Tag.json +34 -17
  105. package/data/component-props/TagFilter.json +10 -3
  106. package/data/component-props/Tooltip.json +49 -18
  107. package/data/component-props/TooltipCondensed.json +18 -9
  108. package/data/component-props/TooltipTable.json +17 -7
  109. package/data/resources/{zeroheight-rules.md → documentation-rules.md} +43 -30
  110. package/data/resources/figma-rules.md +2 -2
  111. package/dist/stdio.js +483 -780
  112. package/package.json +12 -8
  113. package/data/component-props/ButtonDropdownV2.json +0 -34
  114. package/data/component-props/ButtonNew.json +0 -47
  115. package/data/component-props/ButtonToggleV2.json +0 -44
  116. package/data/component-props/ButtonV2.json +0 -43
  117. package/data/zeroheight-cache.json +0 -10259
  118. package/data/zeroheight-exports/Accordion.md +0 -774
  119. package/data/zeroheight-exports/Banner.md +0 -691
  120. package/data/zeroheight-exports/Borders.md +0 -117
  121. package/data/zeroheight-exports/Buttons.md +0 -1854
  122. package/data/zeroheight-exports/Callout.md +0 -931
  123. package/data/zeroheight-exports/Colors.md +0 -1755
  124. package/data/zeroheight-exports/Content-Card.md +0 -309
  125. package/data/zeroheight-exports/Contributing-to-SDS.md +0 -98
  126. package/data/zeroheight-exports/Control-Inputs.md +0 -2818
  127. package/data/zeroheight-exports/Corners.md +0 -104
  128. package/data/zeroheight-exports/Cover-page.md +0 -3
  129. package/data/zeroheight-exports/Dialog.md +0 -1367
  130. package/data/zeroheight-exports/Downloads.md +0 -236
  131. package/data/zeroheight-exports/Drop-Shadows.md +0 -79
  132. package/data/zeroheight-exports/Dropdown-Input.md +0 -1776
  133. package/data/zeroheight-exports/Dropdown-Menus.md +0 -913
  134. package/data/zeroheight-exports/Element-Status-Tracker.md +0 -267
  135. package/data/zeroheight-exports/Field-Inputs.md +0 -1405
  136. package/data/zeroheight-exports/Filters.md +0 -1111
  137. package/data/zeroheight-exports/Getting-Started.md +0 -1157
  138. package/data/zeroheight-exports/Hero.md +0 -414
  139. package/data/zeroheight-exports/Icons.md +0 -2067
  140. package/data/zeroheight-exports/Intent.md +0 -86
  141. package/data/zeroheight-exports/Introduction-to-Bases.md +0 -35
  142. package/data/zeroheight-exports/Introduction-to-Cells.md +0 -35
  143. package/data/zeroheight-exports/Introduction-to-DNA.md +0 -35
  144. package/data/zeroheight-exports/Introduction-to-Genes.md +0 -35
  145. package/data/zeroheight-exports/Introduction.md +0 -115
  146. package/data/zeroheight-exports/Link.md +0 -432
  147. package/data/zeroheight-exports/Lists.md +0 -986
  148. package/data/zeroheight-exports/Loading-Indicator.md +0 -41
  149. package/data/zeroheight-exports/Navigation.md +0 -1190
  150. package/data/zeroheight-exports/Notification.md +0 -1038
  151. package/data/zeroheight-exports/Panel.md +0 -1030
  152. package/data/zeroheight-exports/README.md +0 -122
  153. package/data/zeroheight-exports/Responsive-Design.md +0 -330
  154. package/data/zeroheight-exports/Search-Input.md +0 -91
  155. package/data/zeroheight-exports/Search.md +0 -822
  156. package/data/zeroheight-exports/Segmented-Control.md +0 -609
  157. package/data/zeroheight-exports/Spacing.md +0 -297
  158. package/data/zeroheight-exports/Table.md +0 -5345
  159. package/data/zeroheight-exports/Tabs.md +0 -1324
  160. package/data/zeroheight-exports/Tags.md +0 -1545
  161. package/data/zeroheight-exports/Text-Link.md +0 -268
  162. package/data/zeroheight-exports/Theming.md +0 -362
  163. package/data/zeroheight-exports/Tooltips.md +0 -2015
  164. package/data/zeroheight-exports/Typography.md +0 -800
@@ -1,1157 +0,0 @@
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
- SDS currently uses Material UI v5
93
-
94
- czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
95
-
96
- ```html
97
- "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
98
- "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
99
- ```
100
-
101
- To install the dependencies:
102
-
103
- ```sh
104
- // with npm
105
-
106
- npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
107
-
108
-
109
-
110
- // with yarn
111
-
112
- yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
113
- ```
114
-
115
- ---
116
-
117
- ### Usage
118
-
119
- `czifui` comes with four main exports that help you build your app:
120
-
121
- 1. **Components** - Accessible and reusable components
122
-
123
- ```js
124
- import React from "react";
125
-
126
- import { Button } from "czifui";
127
-
128
- <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
129
- {text}
130
- </Button>;
131
- ```
132
-
133
- 2. **Mixins** - Grouped styles defined by the design system
134
-
135
- ```js
136
- import styled from "@emotion/styled";
137
-
138
- import { Typography } from "@material-ui/core";
139
-
140
- import { fontHeaderXL } from "czifui";
141
-
142
-
143
-
144
- export const Title - styled(Typography)`
145
-
146
- ${fontHeaderXl}
147
-
148
-
149
-
150
- // which compiles to:
151
-
152
- font-size: 22px;
153
-
154
- font-weight: 600;
155
-
156
- letter-spacing: 0.3px;
157
-
158
- line-height: 30px;
159
-
160
- `;
161
- ```
162
-
163
- 3. **Selectors** - Helper functions that return theme variables based on passed props
164
-
165
- ```js
166
- import { css, SerializedStyles } from "@emotion/react";
167
-
168
- import styled from "@emotion/styled";
169
-
170
- import { getColors, getCorners } from "czifui";
171
-
172
- export const Tag = styled.div`
173
- // This is a callback function that returns more CSS rules, but the only way
174
-
175
- // to access the custom theme object
176
-
177
- ${(props) => {
178
- // getColors() is a selector that picks out colors from the theme object
179
-
180
- const colors = getColors(props);
181
-
182
- // getSpaces() is a selector that picks out spacings from the theme object
183
-
184
- const spacings = getSpaces(props);
185
-
186
- return `
187
-
188
- background-color: ${colors?.gray[500]};
189
-
190
- padding-bottom: ${spacings?.m}px;
191
-
192
- margin-bottom: ${spacings?.xxl}px;
193
-
194
- `;
195
- }}
196
- `;
197
- ```
198
-
199
- 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
200
-
201
- ```css
202
- // with SCSS variables
203
-
204
- @import "~czifui/dist/variables";
205
-
206
-
207
-
208
- .button-primary {
209
-
210
- background-color: $sds-color-primary-400;
211
-
212
- padding: $sds-spaces-xxs;
213
-
214
- }
215
-
216
-
217
-
218
- // with CSS variables
219
-
220
- .button-primary {
221
-
222
- background-color: var(--sds-color-primary-400);
223
-
224
- padding: var(--sds-spaces-xxs);
225
-
226
- }
227
- ```
228
-
229
- #### **Default Theme**
230
-
231
- To use the default theme in your React application, complete the following:
232
-
233
- 1. Add the following HTML to your `index.html` at the `<head>`section:
234
-
235
- ```html
236
- // installs the sds font from google fonts
237
-
238
- <link rel="preconnect" href="https://fonts.gstatic.com" />
239
-
240
- <link
241
- 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"
242
- rel="stylesheet"
243
- />
244
- ```
245
-
246
- 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
247
-
248
- ```js
249
- import { defaultTheme } from "czifui";
250
-
251
- import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
252
-
253
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
254
-
255
- <StylesProvider injectFirst>
256
- <EmotionThemeProvider theme={defaultTheme}>
257
- <ThemeProvider theme={defaultTheme}>
258
- <YourApp />
259
- </ThemeProvider>
260
- </EmotionThemeProvider>
261
- </StylesProvider>;
262
- ```
263
-
264
- 3. If you need to override the default SDS theme, please follow the instructions here.
265
-
266
- ---
267
-
268
- ### Contributing to the SDS
269
-
270
- If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
271
-
272
- 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
273
-
274
- 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
275
- 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:
276
-
277
- 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.
278
-
279
- 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.
280
-
281
- See a more detailed flow of the component request process here.
282
-
283
- ---
284
-
285
- 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.
286
-
287
- ## For Designers
288
-
289
- ## Overview
290
-
291
- | 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 |
292
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------- |
293
-
294
- ---
295
-
296
- ### Figma
297
-
298
- #### **Library structure**
299
-
300
- 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.
301
-
302
- > 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.
303
-
304
- 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.
305
-
306
- > 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.
307
-
308
- #### **Project file set up**
309
-
310
- 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.
311
-
312
- For reference, below are the libraries that should be enabled for CZ GEN EPI projects:
313
-
314
- - SDS Bases
315
- - SDS Typography
316
- - SDS Icons
317
- - CZ GEN EPI Design System
318
-
319
- For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
320
-
321
- ---
322
-
323
- ### SDS Documentation
324
-
325
- 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.
326
-
327
- Below are a few tips around navigating the documentation:
328
-
329
- - 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
330
- - 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
331
- - 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.
332
- - 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
333
-
334
- ---
335
-
336
- ### Contributing to the SDS
337
-
338
- 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:
339
-
340
- 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
341
- 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:
342
-
343
- 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.
344
-
345
- 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.
346
-
347
- See a more detailed flow of the component request process here.
348
-
349
- ## For Engineers
350
-
351
- ## Overview
352
-
353
- | 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 |
354
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------ |
355
-
356
- ---
357
-
358
- ### Getting Started
359
-
360
- #### **Installation**
361
-
362
- NPM Package:
363
-
364
- ```sh
365
- // with npm
366
-
367
- npm i czifui
368
-
369
-
370
-
371
- // with yarn
372
-
373
- yarn add czifui
374
- ```
375
-
376
- SDS currently uses Material UI v5
377
-
378
- czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
379
-
380
- ```html
381
- "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
382
- "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
383
- ```
384
-
385
- To install the dependencies:
386
-
387
- ```sh
388
- // with npm
389
-
390
- npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
391
-
392
-
393
-
394
- // with yarn
395
-
396
- yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
397
- ```
398
-
399
- ---
400
-
401
- ### Usage
402
-
403
- `czifui` comes with four main exports that help you build your app:
404
-
405
- 1. **Components** - Accessible and reusable components
406
-
407
- ```js
408
- import React from "react";
409
-
410
- import { Button } from "czifui";
411
-
412
- <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
413
- {text}
414
- </Button>;
415
- ```
416
-
417
- 2. **Mixins** - Grouped styles defined by the design system
418
-
419
- ```js
420
- import styled from "@emotion/styled";
421
-
422
- import { Typography } from "@material-ui/core";
423
-
424
- import { fontHeaderXL } from "czifui";
425
-
426
-
427
-
428
- export const Title - styled(Typography)`
429
-
430
- ${fontHeaderXl}
431
-
432
-
433
-
434
- // which compiles to:
435
-
436
- font-size: 22px;
437
-
438
- font-weight: 600;
439
-
440
- letter-spacing: 0.3px;
441
-
442
- line-height: 30px;
443
-
444
- `;
445
- ```
446
-
447
- 3. **Selectors** - Helper functions that return theme variables based on passed props
448
-
449
- ```js
450
- import { css, SerializedStyles } from "@emotion/react";
451
-
452
- import styled from "@emotion/styled";
453
-
454
- import { getColors, getCorners } from "czifui";
455
-
456
- export const Tag = styled.div`
457
- // This is a callback function that returns more CSS rules, but the only way
458
-
459
- // to access the custom theme object
460
-
461
- ${(props) => {
462
- // getColors() is a selector that picks out colors from the theme object
463
-
464
- const colors = getColors(props);
465
-
466
- // getSpaces() is a selector that picks out spacings from the theme object
467
-
468
- const spacings = getSpaces(props);
469
-
470
- return `
471
-
472
- background-color: ${colors?.gray[500]};
473
-
474
- padding-bottom: ${spacings?.m}px;
475
-
476
- margin-bottom: ${spacings?.xxl}px;
477
-
478
- `;
479
- }}
480
- `;
481
- ```
482
-
483
- 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
484
-
485
- ```css
486
- // with SCSS variables
487
-
488
- @import "~czifui/dist/variables";
489
-
490
-
491
-
492
- .button-primary {
493
-
494
- background-color: $sds-color-primary-400;
495
-
496
- padding: $sds-spaces-xxs;
497
-
498
- }
499
-
500
-
501
-
502
- // with CSS variables
503
-
504
- .button-primary {
505
-
506
- background-color: var(--sds-color-primary-400);
507
-
508
- padding: var(--sds-spaces-xxs);
509
-
510
- }
511
- ```
512
-
513
- #### **Default Theme**
514
-
515
- To use the default theme in your React application, complete the following:
516
-
517
- 1. Add the following HTML to your `index.html` at the `<head>`section:
518
-
519
- ```html
520
- // installs the sds font from google fonts
521
-
522
- <link rel="preconnect" href="https://fonts.gstatic.com" />
523
-
524
- <link
525
- 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"
526
- rel="stylesheet"
527
- />
528
- ```
529
-
530
- 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
531
-
532
- ```js
533
- import { defaultTheme } from "czifui";
534
-
535
- import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
536
-
537
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
538
-
539
- <StylesProvider injectFirst>
540
- <EmotionThemeProvider theme={defaultTheme}>
541
- <ThemeProvider theme={defaultTheme}>
542
- <YourApp />
543
- </ThemeProvider>
544
- </EmotionThemeProvider>
545
- </StylesProvider>;
546
- ```
547
-
548
- 3. If you need to override the default SDS theme, please follow the instructions here.
549
-
550
- ---
551
-
552
- ### Contributing to the SDS
553
-
554
- If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
555
-
556
- 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:
557
-
558
- 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
559
- 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:
560
-
561
- 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.
562
-
563
- 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.
564
-
565
- See a more detailed flow of the component request process here.
566
-
567
- ---
568
-
569
- 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.
570
-
571
- ## For Designers
572
-
573
- ## Overview
574
-
575
- | 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 |
576
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------- |
577
-
578
- ---
579
-
580
- ### Figma
581
-
582
- #### **Library structure**
583
-
584
- 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.
585
-
586
- > 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.
587
-
588
- 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.
589
-
590
- > 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.
591
-
592
- #### **Project file set up**
593
-
594
- 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.
595
-
596
- For reference, below are the libraries that should be enabled for CZ ID projects:
597
-
598
- - SDS Bases
599
- - SDS Typography
600
- - SDS Icons
601
- - CZ ID Design System
602
-
603
- For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
604
-
605
- ---
606
-
607
- ### SDS Documentation
608
-
609
- 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.
610
-
611
- Below are a few tips around navigating the documentation:
612
-
613
- - 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
614
- - 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
615
- - 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.
616
- - 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
617
-
618
- ---
619
-
620
- ### Contributing to the SDS
621
-
622
- 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:
623
-
624
- 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
625
- 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:
626
-
627
- 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.
628
-
629
- 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.
630
-
631
- See a more detailed flow of the component request process here.
632
-
633
- ## For Engineers
634
-
635
- ## Overview
636
-
637
- | 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 |
638
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------ |
639
-
640
- ---
641
-
642
- ### Getting Started
643
-
644
- #### **Installation**
645
-
646
- NPM Package:
647
-
648
- ```sh
649
- // with npm
650
-
651
- npm i czifui
652
-
653
-
654
-
655
- // with yarn
656
-
657
- yarn add czifui
658
- ```
659
-
660
- SDS currently uses Material UI v5
661
-
662
- czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
663
-
664
- ```html
665
- "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
666
- "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
667
- ```
668
-
669
- To install the dependencies:
670
-
671
- ```sh
672
- // with npm
673
-
674
- npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
675
-
676
-
677
-
678
- // with yarn
679
-
680
- yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
681
- ```
682
-
683
- ---
684
-
685
- ### Usage
686
-
687
- `czifui` comes with four main exports that help you build your app:
688
-
689
- 1. **Components** - Accessible and reusable components
690
-
691
- ```js
692
- import React from "react";
693
-
694
- import { Button } from "czifui";
695
-
696
- <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
697
- {text}
698
- </Button>;
699
- ```
700
-
701
- 2. **Mixins** - Grouped styles defined by the design system
702
-
703
- ```js
704
- import styled from "@emotion/styled";
705
-
706
- import { Typography } from "@material-ui/core";
707
-
708
- import { fontHeaderXL } from "czifui";
709
-
710
-
711
-
712
- export const Title - styled(Typography)`
713
-
714
- ${fontHeaderXl}
715
-
716
-
717
-
718
- // which compiles to:
719
-
720
- font-size: 22px;
721
-
722
- font-weight: 600;
723
-
724
- letter-spacing: 0.3px;
725
-
726
- line-height: 30px;
727
-
728
- `;
729
- ```
730
-
731
- 3. **Selectors** - Helper functions that return theme variables based on passed props
732
-
733
- ```js
734
- import { css, SerializedStyles } from "@emotion/react";
735
-
736
- import styled from "@emotion/styled";
737
-
738
- import { getColors, getCorners } from "czifui";
739
-
740
- export const Tag = styled.div`
741
- // This is a callback function that returns more CSS rules, but the only way
742
-
743
- // to access the custom theme object
744
-
745
- ${(props) => {
746
- // getColors() is a selector that picks out colors from the theme object
747
-
748
- const colors = getColors(props);
749
-
750
- // getSpaces() is a selector that picks out spacings from the theme object
751
-
752
- const spacings = getSpaces(props);
753
-
754
- return `
755
-
756
- background-color: ${colors?.gray[500]};
757
-
758
- padding-bottom: ${spacings?.m}px;
759
-
760
- margin-bottom: ${spacings?.xxl}px;
761
-
762
- `;
763
- }}
764
- `;
765
- ```
766
-
767
- 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
768
-
769
- ```css
770
- // with SCSS variables
771
-
772
- @import "~czifui/dist/variables";
773
-
774
-
775
-
776
- .button-primary {
777
-
778
- background-color: $sds-color-primary-400;
779
-
780
- padding: $sds-spaces-xxs;
781
-
782
- }
783
-
784
-
785
-
786
- // with CSS variables
787
-
788
- .button-primary {
789
-
790
- background-color: var(--sds-color-primary-400);
791
-
792
- padding: var(--sds-spaces-xxs);
793
-
794
- }
795
- ```
796
-
797
- #### **Default Theme**
798
-
799
- To use the default theme in your React application, complete the following:
800
-
801
- 1. Add the following HTML to your `index.html` at the `<head>`section:
802
-
803
- ```html
804
- // installs the sds font from google fonts
805
-
806
- <link rel="preconnect" href="https://fonts.gstatic.com" />
807
-
808
- <link
809
- 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"
810
- rel="stylesheet"
811
- />
812
- ```
813
-
814
- 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
815
-
816
- ```js
817
- import { defaultTheme } from "czifui";
818
-
819
- import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
820
-
821
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
822
-
823
- <StylesProvider injectFirst>
824
- <EmotionThemeProvider theme={defaultTheme}>
825
- <ThemeProvider theme={defaultTheme}>
826
- <YourApp />
827
- </ThemeProvider>
828
- </EmotionThemeProvider>
829
- </StylesProvider>;
830
- ```
831
-
832
- 3.  If you need to override the default SDS theme, please follow the instructions here.
833
-
834
- ---
835
-
836
- ### Contributing to the SDS
837
-
838
- If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
839
-
840
- 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
841
-
842
- 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
843
- 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:
844
-
845
- 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.
846
-
847
- 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.
848
-
849
- See a more detailed flow of the component request process here.
850
-
851
- ---
852
-
853
- 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.
854
-
855
- ## For Designers
856
-
857
- ## Overview
858
-
859
- | 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 |
860
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | -------------------------------------------------------------------------------- |
861
-
862
- ---
863
-
864
- ### Figma
865
-
866
- #### Library structure
867
-
868
- 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.
869
-
870
- > 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.
871
-
872
- 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.
873
-
874
- > 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.
875
-
876
- #### Project file set up
877
-
878
- 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.
879
-
880
- Below are the libraries that should be enabled by product:
881
-
882
- CZ ID
883
-
884
- - SDS Bases
885
- - SDS Typography
886
- - SDS Icons
887
- - CZ ID Design System
888
-
889
- CZ GEN EPI
890
-
891
- - SDS Bases
892
- - SDS Typography
893
- - SDS Icons
894
- - CZ GEN EPI Design System
895
-
896
- Single Cell Biology
897
-
898
- - SDS Bases
899
- - SDS Icons
900
- - Single Cell Design System
901
-
902
- Imaging
903
-
904
- - SDS Icons
905
- - napari hub + .org Design System
906
-
907
- For more details around using and working with libraries in Figma, see this helpful guide from the Figma team.
908
-
909
- ---
910
-
911
- ### SDS Documentation
912
-
913
- 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.
914
-
915
- Below are a few tips around navigating the documentation:
916
-
917
- - 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
918
- - 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
919
- - 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.
920
- - 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
921
-
922
- ---
923
-
924
- ### Contributing to the SDS
925
-
926
- 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:
927
-
928
- 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
929
- 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:
930
-
931
- 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.
932
-
933
- 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.
934
-
935
- See a more detailed flow of the component request process here.
936
-
937
- ## For Engineers
938
-
939
- ## Overview
940
-
941
- | 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 |
942
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------------------------------------------------------------------------ |
943
-
944
- ---
945
-
946
- ### Getting Started
947
-
948
- #### Installation
949
-
950
- NPM Package:
951
-
952
- ```sh
953
- // with npm
954
-
955
- npm i czifui
956
-
957
-
958
-
959
- // with yarn
960
-
961
- yarn add czifui
962
- ```
963
-
964
- SDS currently uses Material UI v5
965
-
966
- czifui installs without direct dependencies to prevent version errors. Please ensure the following peer dependencies are also installed:
967
-
968
- ```html
969
- "@emotion/css" "@emotion/react" "@emotion/styled" "@material-ui/core"
970
- "@material-ui/icons" "@material-ui/lab" "react" "react-dom"
971
- ```
972
-
973
- To install the dependencies:
974
-
975
- ```sh
976
- // with npm
977
-
978
- npm i @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
979
-
980
-
981
-
982
- // with yarn
983
-
984
- yarn add @emotion/css @emotion/react @emotion/styled @material-ui/core @material-ui/icons @material-ui/lab react react-dom
985
- ```
986
-
987
- ---
988
-
989
- ### Usage
990
-
991
- `czifui` comes with four main exports that help you build your app:
992
-
993
- 1. **Components** - Accessible and reusable components
994
-
995
- ```js
996
- import React from "react";
997
-
998
- import { Button } from "czifui";
999
-
1000
- <Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary">
1001
- {text}
1002
- </Button>;
1003
- ```
1004
-
1005
- 2. **Mixins** - Grouped styles defined by the design system
1006
-
1007
- ```js
1008
- import styled from "@emotion/styled";
1009
-
1010
- import { Typography } from "@material-ui/core";
1011
-
1012
- import { fontHeaderXL } from "czifui";
1013
-
1014
-
1015
-
1016
- export const Title - styled(Typography)`
1017
-
1018
- ${fontHeaderXl}
1019
-
1020
-
1021
-
1022
- // which compiles to:
1023
-
1024
- font-size: 22px;
1025
-
1026
- font-weight: 600;
1027
-
1028
- letter-spacing: 0.3px;
1029
-
1030
- line-height: 30px;
1031
-
1032
- `;
1033
- ```
1034
-
1035
- 3. **Selectors** - Helper functions that return theme variables based on passed props
1036
-
1037
- ```js
1038
- import { css, SerializedStyles } from "@emotion/react";
1039
-
1040
- import styled from "@emotion/styled";
1041
-
1042
- import { getColors, getCorners } from "czifui";
1043
-
1044
- export const Tag = styled.div`
1045
- // This is a callback function that returns more CSS rules, but the only way
1046
-
1047
- // to access the custom theme object
1048
-
1049
- ${(props) => {
1050
- // getColors() is a selector that picks out colors from the theme object
1051
-
1052
- const colors = getColors(props);
1053
-
1054
- // getSpaces() is a selector that picks out spacings from the theme object
1055
-
1056
- const spacings = getSpaces(props);
1057
-
1058
- return `
1059
-
1060
- background-color: ${colors?.gray[500]};
1061
-
1062
- padding-bottom: ${spacings?.m}px;
1063
-
1064
- margin-bottom: ${spacings?.xxl}px;
1065
-
1066
- `;
1067
- }}
1068
- `;
1069
- ```
1070
-
1071
- 4. **CSS & SCSS Variables** - Variables for the `defaultTheme` to use if your app doesn't support `@emotion/styled`
1072
-
1073
- ```css
1074
- // with SCSS variables
1075
-
1076
- @import "~czifui/dist/variables";
1077
-
1078
-
1079
-
1080
- .button-primary {
1081
-
1082
- background-color: $sds-color-primary-400;
1083
-
1084
- padding: $sds-spaces-xxs;
1085
-
1086
- }
1087
-
1088
-
1089
-
1090
- // with CSS variables
1091
-
1092
- .button-primary {
1093
-
1094
- background-color: var(--sds-color-primary-400);
1095
-
1096
- padding: var(--sds-spaces-xxs);
1097
-
1098
- }
1099
- ```
1100
-
1101
- #### Default Theme
1102
-
1103
- To use the default theme in your React application, complete the following:
1104
-
1105
- 1. Add the following HTML to your `index.html` at the `<head>`section:
1106
-
1107
- ```html
1108
- // installs the sds font from google fonts
1109
-
1110
- <link rel="preconnect" href="https://fonts.googleapis.com" />
1111
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1112
- <link
1113
- href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
1114
- rel="stylesheet"
1115
- />
1116
- <link
1117
- href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap"
1118
- rel="stylesheet"
1119
- />
1120
- ```
1121
-
1122
- 2. Import the default theme object and use it in Material UI's `<ThemeProvider />`:
1123
-
1124
- ```js
1125
- import { defaultTheme } from "czifui";
1126
-
1127
- import { StylesProvider, ThemeProvider } from "@material-ui/core/styles";
1128
-
1129
- import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
1130
-
1131
- <StylesProvider injectFirst>
1132
- <EmotionThemeProvider theme={defaultTheme}>
1133
- <ThemeProvider theme={defaultTheme}>
1134
- <YourApp />
1135
- </ThemeProvider>
1136
- </EmotionThemeProvider>
1137
- </StylesProvider>;
1138
- ```
1139
-
1140
- 3.  If you need to override the default SDS theme, please follow the instructions here.
1141
-
1142
- ---
1143
-
1144
- ### Contributing to the SDS
1145
-
1146
- If you would like to contribute to the Science Design System by building requested components, please follow the contribution guidelines here.
1147
-
1148
- 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:
1149
-
1150
- 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
1151
- 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:
1152
-
1153
- 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.
1154
-
1155
- 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.
1156
-
1157
- See a more detailed flow of the component request process here.