@kaizen/design-tokens 10.3.13 → 10.3.14
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.
- package/css/variables.css +5 -0
- package/dist/ThemeManager.d.ts +5 -0
- package/dist/ThemeManager.d.ts.map +1 -1
- package/dist/ThemeManager.js +5 -0
- package/dist/ThemeManager.js.map +1 -1
- package/dist/lib/makeCssVariableDefinitionsMap.d.ts +3 -0
- package/dist/lib/makeCssVariableDefinitionsMap.d.ts.map +1 -1
- package/dist/lib/makeCssVariableDefinitionsMap.js +3 -0
- package/dist/lib/makeCssVariableDefinitionsMap.js.map +1 -1
- package/dist/lib/makeCssVariableTheme.d.ts +3 -0
- package/dist/lib/makeCssVariableTheme.d.ts.map +1 -1
- package/dist/lib/makeCssVariableTheme.js +3 -0
- package/dist/lib/makeCssVariableTheme.js.map +1 -1
- package/dist/lib/mapLeafsOfObject.d.ts +3 -0
- package/dist/lib/mapLeafsOfObject.d.ts.map +1 -1
- package/dist/lib/mapLeafsOfObject.js +3 -0
- package/dist/lib/mapLeafsOfObject.js.map +1 -1
- package/dist/react/ThemeProvider.d.ts +3 -1
- package/dist/react/ThemeProvider.d.ts.map +1 -1
- package/dist/react/ThemeProvider.js +3 -1
- package/dist/react/ThemeProvider.js.map +1 -1
- package/dist/themes/heart.d.ts +5 -0
- package/dist/themes/heart.d.ts.map +1 -1
- package/dist/themes/heart.js +5 -0
- package/dist/themes/heart.js.map +1 -1
- package/dist/themes/index.d.ts +5 -0
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +5 -0
- package/dist/themes/index.js.map +1 -1
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -1
- package/js/index.ts +2 -0
- package/js/tokens.ts +315 -0
- package/js/types.ts +249 -0
- package/package.json +9 -7
- package/tokens/animation.json +0 -34
- package/tokens/animation.json.d.ts +0 -11
- package/tokens/border.json +0 -44
- package/tokens/border.json.d.ts +0 -11
- package/tokens/color.json +0 -228
- package/tokens/color.json.d.ts +0 -11
- package/tokens/layout.json +0 -10
- package/tokens/layout.json.d.ts +0 -11
- package/tokens/shadow.json +0 -12
- package/tokens/shadow.json.d.ts +0 -11
- package/tokens/spacing.json +0 -70
- package/tokens/spacing.json.d.ts +0 -11
- package/tokens/typography.json +0 -244
- package/tokens/typography.json.d.ts +0 -11
package/js/tokens.ts
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { TokenStructure } from "./types"
|
|
2
|
+
|
|
3
|
+
export const tokens: TokenStructure = {
|
|
4
|
+
animation: {
|
|
5
|
+
easingFunction: {
|
|
6
|
+
easeInOut: "cubic-bezier(0.455, 0.03, 0.515, 0.955)",
|
|
7
|
+
easeIn: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
|
|
8
|
+
easeOut: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
9
|
+
linear: "linear",
|
|
10
|
+
bounceIn: "cubic-bezier(0.485, 0.155, 0.24, 1.245)",
|
|
11
|
+
bounceOut: "cubic-bezier(0.485, 0.155, 0.515, 0.845)",
|
|
12
|
+
bounceInOut: "cubic-bezier(0.76, -0.245, 0.24, 1.245)",
|
|
13
|
+
},
|
|
14
|
+
duration: {
|
|
15
|
+
instant: "0ms",
|
|
16
|
+
immediate: "100ms",
|
|
17
|
+
rapid: "200ms",
|
|
18
|
+
fast: "300ms",
|
|
19
|
+
slow: "400ms",
|
|
20
|
+
deliberate: "700ms",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
border: {
|
|
24
|
+
solid: {
|
|
25
|
+
borderWidth: "2px",
|
|
26
|
+
borderRadius: "7px",
|
|
27
|
+
borderStyle: "solid",
|
|
28
|
+
borderColor: "#e1e2ea",
|
|
29
|
+
},
|
|
30
|
+
dashed: {
|
|
31
|
+
borderWidth: "2px",
|
|
32
|
+
borderRadius: "7px",
|
|
33
|
+
borderStyle: "dashed",
|
|
34
|
+
},
|
|
35
|
+
borderless: {
|
|
36
|
+
borderWidth: "2px",
|
|
37
|
+
borderRadius: "7px",
|
|
38
|
+
borderStyle: "solid",
|
|
39
|
+
borderColor: "transparent",
|
|
40
|
+
},
|
|
41
|
+
focusRing: {
|
|
42
|
+
borderWidth: "2px",
|
|
43
|
+
borderRadius: "10px",
|
|
44
|
+
borderStyle: "solid",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
color: {
|
|
48
|
+
purple: {
|
|
49
|
+
100: "#f4edf8",
|
|
50
|
+
200: "#dfc9ea",
|
|
51
|
+
300: "#c9a5dd",
|
|
52
|
+
400: "#ae67b1",
|
|
53
|
+
500: "#844587",
|
|
54
|
+
600: "#5f3361",
|
|
55
|
+
700: "#4a234d",
|
|
56
|
+
800: "#2f2438",
|
|
57
|
+
},
|
|
58
|
+
blue: {
|
|
59
|
+
100: "#e6f6ff",
|
|
60
|
+
200: "#bde2f5",
|
|
61
|
+
300: "#73c0e8",
|
|
62
|
+
400: "#008bd6",
|
|
63
|
+
500: "#0168b3",
|
|
64
|
+
600: "#004970",
|
|
65
|
+
700: "#003157",
|
|
66
|
+
},
|
|
67
|
+
green: {
|
|
68
|
+
100: "#e8f8f4",
|
|
69
|
+
200: "#c4ede2",
|
|
70
|
+
300: "#8fdbc7",
|
|
71
|
+
400: "#5dcbad",
|
|
72
|
+
500: "#44a289",
|
|
73
|
+
600: "#2c7d67",
|
|
74
|
+
700: "#22594a",
|
|
75
|
+
},
|
|
76
|
+
yellow: {
|
|
77
|
+
100: "#fff9e4",
|
|
78
|
+
200: "#ffeeb3",
|
|
79
|
+
300: "#ffe36e",
|
|
80
|
+
400: "#ffca4d",
|
|
81
|
+
500: "#ffb600",
|
|
82
|
+
600: "#c68600",
|
|
83
|
+
700: "#876400",
|
|
84
|
+
},
|
|
85
|
+
red: {
|
|
86
|
+
100: "#fdeaee",
|
|
87
|
+
200: "#f9c2cb",
|
|
88
|
+
300: "#f597a8",
|
|
89
|
+
400: "#e0707d",
|
|
90
|
+
500: "#c93b55",
|
|
91
|
+
600: "#a82433",
|
|
92
|
+
700: "#6c1e20",
|
|
93
|
+
},
|
|
94
|
+
orange: {
|
|
95
|
+
100: "#fff0e8",
|
|
96
|
+
200: "#ffd1b9",
|
|
97
|
+
300: "#ffb08a",
|
|
98
|
+
400: "#ff9461",
|
|
99
|
+
500: "#e96c2f",
|
|
100
|
+
600: "#b74302",
|
|
101
|
+
700: "#903c00",
|
|
102
|
+
},
|
|
103
|
+
gray: {
|
|
104
|
+
100: "#f9f9f9",
|
|
105
|
+
200: "#f4f4f5",
|
|
106
|
+
300: "#eaeaec",
|
|
107
|
+
400: "#cdcdd0",
|
|
108
|
+
500: "#8c8c97",
|
|
109
|
+
600: "#524e56",
|
|
110
|
+
},
|
|
111
|
+
white: "#ffffff",
|
|
112
|
+
},
|
|
113
|
+
dataViz: {
|
|
114
|
+
favorable: "#7dd5bd",
|
|
115
|
+
unfavorable: "#e68d97",
|
|
116
|
+
},
|
|
117
|
+
layout: {
|
|
118
|
+
contentMaxWidth: "1392px",
|
|
119
|
+
contentMaxWidthWithSidebar: "1080px",
|
|
120
|
+
contentSideMargin: "72px",
|
|
121
|
+
mobileActionsDrawerHeight: "60px",
|
|
122
|
+
navigationBarHeight: "72px",
|
|
123
|
+
breakpoints: {
|
|
124
|
+
medium: "768px",
|
|
125
|
+
large: "1080px",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
shadow: {
|
|
129
|
+
small: {
|
|
130
|
+
boxShadow:
|
|
131
|
+
"0px 3px 16px rgba(0, 0, 0, 0.06), 0px 1px 3px rgba(0, 0, 0, 0.1)",
|
|
132
|
+
},
|
|
133
|
+
large: {
|
|
134
|
+
boxShadow:
|
|
135
|
+
"0px 8px 40px rgba(0, 0, 0, 0.08), 0px 3px 9px rgba(0, 0, 0, 0.1)",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
spacing: {
|
|
139
|
+
xs: "0.375rem",
|
|
140
|
+
sm: "0.75rem",
|
|
141
|
+
md: "1.5rem",
|
|
142
|
+
lg: "2.25rem",
|
|
143
|
+
xl: "3rem",
|
|
144
|
+
xxl: "3.75rem",
|
|
145
|
+
xxxl: "4.5rem",
|
|
146
|
+
xxxxl: "5.25rem",
|
|
147
|
+
xxxxxl: "6rem",
|
|
148
|
+
0: "0",
|
|
149
|
+
1: ".0625rem",
|
|
150
|
+
2: ".125rem",
|
|
151
|
+
4: ".25rem",
|
|
152
|
+
6: ".375rem",
|
|
153
|
+
8: ".5rem",
|
|
154
|
+
12: ".75rem",
|
|
155
|
+
16: "1rem",
|
|
156
|
+
24: "1.5rem",
|
|
157
|
+
32: "2rem",
|
|
158
|
+
40: "2.5rem",
|
|
159
|
+
48: "3rem",
|
|
160
|
+
56: "3.5rem",
|
|
161
|
+
64: "4rem",
|
|
162
|
+
72: "4.5rem",
|
|
163
|
+
80: "5rem",
|
|
164
|
+
96: "6rem",
|
|
165
|
+
112: "7rem",
|
|
166
|
+
128: "8rem",
|
|
167
|
+
160: "10rem",
|
|
168
|
+
200: "12.5rem",
|
|
169
|
+
240: "15rem",
|
|
170
|
+
280: "17.5rem",
|
|
171
|
+
320: "20rem",
|
|
172
|
+
},
|
|
173
|
+
typography: {
|
|
174
|
+
dataLarge: {
|
|
175
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
176
|
+
fontWeight: 700,
|
|
177
|
+
fontSize: "5.25rem",
|
|
178
|
+
lineHeight: "5.25rem",
|
|
179
|
+
letterSpacing: "normal",
|
|
180
|
+
},
|
|
181
|
+
dataLargeUnits: {
|
|
182
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
183
|
+
fontWeight: 700,
|
|
184
|
+
fontSize: "2.625rem",
|
|
185
|
+
lineHeight: "5.25rem",
|
|
186
|
+
letterSpacing: "normal",
|
|
187
|
+
},
|
|
188
|
+
dataMedium: {
|
|
189
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
190
|
+
fontWeight: 700,
|
|
191
|
+
fontSize: "3rem",
|
|
192
|
+
lineHeight: "5rem",
|
|
193
|
+
letterSpacing: "normal",
|
|
194
|
+
},
|
|
195
|
+
dataMediumUnits: {
|
|
196
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
197
|
+
fontWeight: 700,
|
|
198
|
+
fontSize: "1.5rem",
|
|
199
|
+
lineHeight: "5rem",
|
|
200
|
+
letterSpacing: "normal",
|
|
201
|
+
},
|
|
202
|
+
dataSmall: {
|
|
203
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
204
|
+
fontWeight: 700,
|
|
205
|
+
fontSize: "1.5rem",
|
|
206
|
+
lineHeight: "1.5rem",
|
|
207
|
+
letterSpacing: "normal",
|
|
208
|
+
},
|
|
209
|
+
dataSmallUnits: {
|
|
210
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
211
|
+
fontWeight: 700,
|
|
212
|
+
fontSize: "1.125rem",
|
|
213
|
+
lineHeight: "1.5rem",
|
|
214
|
+
letterSpacing: "normal",
|
|
215
|
+
},
|
|
216
|
+
display0: {
|
|
217
|
+
fontFamily: '"Tiempos Headline", Georgia, serif',
|
|
218
|
+
fontWeight: 800,
|
|
219
|
+
fontSize: "4.5rem",
|
|
220
|
+
lineHeight: "5.25rem",
|
|
221
|
+
letterSpacing: "0em",
|
|
222
|
+
},
|
|
223
|
+
heading1: {
|
|
224
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
225
|
+
fontWeight: 700,
|
|
226
|
+
fontSize: "2.125rem",
|
|
227
|
+
lineHeight: "2.625rem",
|
|
228
|
+
letterSpacing: "normal",
|
|
229
|
+
},
|
|
230
|
+
heading2: {
|
|
231
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
232
|
+
fontWeight: 700,
|
|
233
|
+
fontSize: "1.75rem",
|
|
234
|
+
lineHeight: "2.25rem",
|
|
235
|
+
letterSpacing: "normal",
|
|
236
|
+
},
|
|
237
|
+
heading3: {
|
|
238
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
239
|
+
fontWeight: 700,
|
|
240
|
+
fontSize: "1.375rem",
|
|
241
|
+
lineHeight: "1.875rem",
|
|
242
|
+
letterSpacing: "normal",
|
|
243
|
+
},
|
|
244
|
+
heading4: {
|
|
245
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
246
|
+
fontWeight: 600,
|
|
247
|
+
fontSize: "1.125rem",
|
|
248
|
+
lineHeight: "1.5rem",
|
|
249
|
+
letterSpacing: "normal",
|
|
250
|
+
},
|
|
251
|
+
heading5: {
|
|
252
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
253
|
+
fontWeight: 600,
|
|
254
|
+
fontSize: "1rem",
|
|
255
|
+
lineHeight: "1.5rem",
|
|
256
|
+
letterSpacing: "normal",
|
|
257
|
+
},
|
|
258
|
+
heading6: {
|
|
259
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
260
|
+
fontWeight: 700,
|
|
261
|
+
fontSize: "0.875rem",
|
|
262
|
+
lineHeight: "1.5rem",
|
|
263
|
+
letterSpacing: "normal",
|
|
264
|
+
},
|
|
265
|
+
paragraphIntroLede: {
|
|
266
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
267
|
+
fontWeight: 400,
|
|
268
|
+
fontSize: "1.25rem",
|
|
269
|
+
lineHeight: "1.875rem",
|
|
270
|
+
letterSpacing: "0",
|
|
271
|
+
maxWidth: "975px",
|
|
272
|
+
},
|
|
273
|
+
paragraphBody: {
|
|
274
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
275
|
+
fontWeight: 400,
|
|
276
|
+
fontSize: "1rem",
|
|
277
|
+
lineHeight: "1.5rem",
|
|
278
|
+
letterSpacing: "normal",
|
|
279
|
+
maxWidth: "780px",
|
|
280
|
+
},
|
|
281
|
+
paragraphSmall: {
|
|
282
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
283
|
+
fontWeight: 400,
|
|
284
|
+
fontSize: "0.875rem",
|
|
285
|
+
lineHeight: "1.125rem",
|
|
286
|
+
letterSpacing: "normal",
|
|
287
|
+
maxWidth: "680px",
|
|
288
|
+
},
|
|
289
|
+
paragraphExtraSmall: {
|
|
290
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
291
|
+
fontWeight: 400,
|
|
292
|
+
fontSize: "0.75rem",
|
|
293
|
+
lineHeight: "1.125rem",
|
|
294
|
+
letterSpacing: "normal",
|
|
295
|
+
maxWidth: "600px",
|
|
296
|
+
},
|
|
297
|
+
paragraphBold: {
|
|
298
|
+
fontWeight: 600,
|
|
299
|
+
},
|
|
300
|
+
buttonPrimary: {
|
|
301
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
302
|
+
fontWeight: 700,
|
|
303
|
+
fontSize: "1.125rem",
|
|
304
|
+
lineHeight: "1.5rem",
|
|
305
|
+
letterSpacing: "normal",
|
|
306
|
+
},
|
|
307
|
+
buttonSecondary: {
|
|
308
|
+
fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
|
|
309
|
+
fontWeight: 500,
|
|
310
|
+
fontSize: "1rem",
|
|
311
|
+
lineHeight: "1.5rem",
|
|
312
|
+
letterSpacing: "normal",
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
}
|
package/js/types.ts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import type { CSSProperties as ReactCSSProperties } from "react"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Use a custom type for CSS properties becauase we should eventually write a more strongly typed version using template literal types.
|
|
5
|
+
* This could definitely be contributed back to the community too. An example starting point here https://github.com/ghoullier/awesome-template-literal-types#css-parser
|
|
6
|
+
* For example:
|
|
7
|
+
* ```ts
|
|
8
|
+
* type Font = {
|
|
9
|
+
* fontSize: `${number}rem`,
|
|
10
|
+
*
|
|
11
|
+
* }
|
|
12
|
+
* type HexDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F ;
|
|
13
|
+
* type Color = `rgba(${number}, ${number}, ${number}, ${number}) | #${HexDigit}${HexDigit}${HexDigit}` // You get the point
|
|
14
|
+
*
|
|
15
|
+
* ```
|
|
16
|
+
* */
|
|
17
|
+
type KaizenCSSProperties = ReactCSSProperties
|
|
18
|
+
|
|
19
|
+
type Hex = string
|
|
20
|
+
// Once TypeScript is upgraded in the repo, you can use Lowercase<>
|
|
21
|
+
// type Hex = Lowercase<string>
|
|
22
|
+
|
|
23
|
+
export type TypographyFont = {
|
|
24
|
+
fontFamily: KaizenCSSProperties["fontFamily"]
|
|
25
|
+
fontWeight: KaizenCSSProperties["fontWeight"]
|
|
26
|
+
fontSize: KaizenCSSProperties["fontSize"]
|
|
27
|
+
lineHeight: KaizenCSSProperties["lineHeight"]
|
|
28
|
+
letterSpacing: KaizenCSSProperties["letterSpacing"]
|
|
29
|
+
maxWidth?: KaizenCSSProperties["maxWidth"]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type TokenStructure = {
|
|
33
|
+
border: {
|
|
34
|
+
solid: {
|
|
35
|
+
borderWidth: KaizenCSSProperties["borderWidth"]
|
|
36
|
+
borderRadius: KaizenCSSProperties["borderRadius"]
|
|
37
|
+
borderStyle: KaizenCSSProperties["borderStyle"]
|
|
38
|
+
borderColor: KaizenCSSProperties["borderColor"]
|
|
39
|
+
}
|
|
40
|
+
dashed: {
|
|
41
|
+
borderWidth: KaizenCSSProperties["borderWidth"]
|
|
42
|
+
borderRadius: KaizenCSSProperties["borderRadius"]
|
|
43
|
+
borderStyle: KaizenCSSProperties["borderStyle"]
|
|
44
|
+
}
|
|
45
|
+
borderless: {
|
|
46
|
+
borderWidth: KaizenCSSProperties["borderWidth"]
|
|
47
|
+
borderRadius: KaizenCSSProperties["borderRadius"]
|
|
48
|
+
borderStyle: KaizenCSSProperties["borderStyle"]
|
|
49
|
+
borderColor: KaizenCSSProperties["borderColor"]
|
|
50
|
+
}
|
|
51
|
+
focusRing: {
|
|
52
|
+
borderWidth: KaizenCSSProperties["borderWidth"]
|
|
53
|
+
borderRadius: KaizenCSSProperties["borderRadius"]
|
|
54
|
+
borderStyle: KaizenCSSProperties["borderStyle"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
animation: {
|
|
58
|
+
easingFunction: {
|
|
59
|
+
easeInOut: string
|
|
60
|
+
easeIn: string
|
|
61
|
+
easeOut: string
|
|
62
|
+
linear: string
|
|
63
|
+
bounceIn: string
|
|
64
|
+
bounceOut: string
|
|
65
|
+
bounceInOut: string
|
|
66
|
+
}
|
|
67
|
+
duration: {
|
|
68
|
+
instant: string
|
|
69
|
+
immediate: string
|
|
70
|
+
rapid: string
|
|
71
|
+
fast: string
|
|
72
|
+
slow: string
|
|
73
|
+
deliberate: string
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
color: {
|
|
77
|
+
purple: {
|
|
78
|
+
"100": Hex
|
|
79
|
+
"200": Hex
|
|
80
|
+
"300": Hex
|
|
81
|
+
"400": Hex
|
|
82
|
+
"500": Hex
|
|
83
|
+
"600": Hex
|
|
84
|
+
"700": Hex
|
|
85
|
+
"800": Hex
|
|
86
|
+
}
|
|
87
|
+
blue: {
|
|
88
|
+
"100": Hex
|
|
89
|
+
"200": Hex
|
|
90
|
+
"300": Hex
|
|
91
|
+
"400": Hex
|
|
92
|
+
"500": Hex
|
|
93
|
+
"600": Hex
|
|
94
|
+
"700": Hex
|
|
95
|
+
}
|
|
96
|
+
green: {
|
|
97
|
+
"100": Hex
|
|
98
|
+
"200": Hex
|
|
99
|
+
"300": Hex
|
|
100
|
+
"400": Hex
|
|
101
|
+
"500": Hex
|
|
102
|
+
"600": Hex
|
|
103
|
+
"700": Hex
|
|
104
|
+
}
|
|
105
|
+
yellow: {
|
|
106
|
+
"100": Hex
|
|
107
|
+
"200": Hex
|
|
108
|
+
"300": Hex
|
|
109
|
+
"400": Hex
|
|
110
|
+
"500": Hex
|
|
111
|
+
"600": Hex
|
|
112
|
+
"700": Hex
|
|
113
|
+
}
|
|
114
|
+
red: {
|
|
115
|
+
"100": Hex
|
|
116
|
+
"200": Hex
|
|
117
|
+
"300": Hex
|
|
118
|
+
"400": Hex
|
|
119
|
+
"500": Hex
|
|
120
|
+
"600": Hex
|
|
121
|
+
"700": Hex
|
|
122
|
+
}
|
|
123
|
+
orange: {
|
|
124
|
+
"100": Hex
|
|
125
|
+
"200": Hex
|
|
126
|
+
"300": Hex
|
|
127
|
+
"400": Hex
|
|
128
|
+
"500": Hex
|
|
129
|
+
"600": Hex
|
|
130
|
+
"700": Hex
|
|
131
|
+
}
|
|
132
|
+
gray: {
|
|
133
|
+
"100": Hex
|
|
134
|
+
"200": Hex
|
|
135
|
+
"300": Hex
|
|
136
|
+
"400": Hex
|
|
137
|
+
"500": Hex
|
|
138
|
+
"600": Hex
|
|
139
|
+
}
|
|
140
|
+
white: Hex
|
|
141
|
+
}
|
|
142
|
+
dataViz: {
|
|
143
|
+
favorable: Hex
|
|
144
|
+
unfavorable: Hex
|
|
145
|
+
}
|
|
146
|
+
layout: {
|
|
147
|
+
contentMaxWidth: string
|
|
148
|
+
contentMaxWidthWithSidebar: string
|
|
149
|
+
contentSideMargin: string
|
|
150
|
+
mobileActionsDrawerHeight: string
|
|
151
|
+
navigationBarHeight: string
|
|
152
|
+
breakpoints: {
|
|
153
|
+
medium: string
|
|
154
|
+
large: string
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
shadow: {
|
|
158
|
+
small: {
|
|
159
|
+
boxShadow: string
|
|
160
|
+
}
|
|
161
|
+
large: {
|
|
162
|
+
boxShadow: string
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
spacing: {
|
|
166
|
+
xs: string
|
|
167
|
+
sm: string
|
|
168
|
+
md: string
|
|
169
|
+
lg: string
|
|
170
|
+
xl: string
|
|
171
|
+
xxl: string
|
|
172
|
+
xxxl: string
|
|
173
|
+
xxxxl: string
|
|
174
|
+
xxxxxl: string
|
|
175
|
+
0: string
|
|
176
|
+
1: string
|
|
177
|
+
2: string
|
|
178
|
+
4: string
|
|
179
|
+
6: string
|
|
180
|
+
8: string
|
|
181
|
+
12: string
|
|
182
|
+
16: string
|
|
183
|
+
24: string
|
|
184
|
+
32: string
|
|
185
|
+
40: string
|
|
186
|
+
48: string
|
|
187
|
+
56: string
|
|
188
|
+
64: string
|
|
189
|
+
72: string
|
|
190
|
+
80: string
|
|
191
|
+
96: string
|
|
192
|
+
112: string
|
|
193
|
+
128: string
|
|
194
|
+
160: string
|
|
195
|
+
200: string
|
|
196
|
+
240: string
|
|
197
|
+
280: string
|
|
198
|
+
320: string
|
|
199
|
+
}
|
|
200
|
+
typography: {
|
|
201
|
+
dataLarge: TypographyFont
|
|
202
|
+
dataLargeUnits: TypographyFont
|
|
203
|
+
dataMedium: TypographyFont
|
|
204
|
+
dataMediumUnits: TypographyFont
|
|
205
|
+
dataSmall: TypographyFont
|
|
206
|
+
dataSmallUnits: TypographyFont
|
|
207
|
+
display0: TypographyFont
|
|
208
|
+
heading1: TypographyFont
|
|
209
|
+
heading2: TypographyFont
|
|
210
|
+
heading3: TypographyFont
|
|
211
|
+
heading4: TypographyFont
|
|
212
|
+
heading5: TypographyFont
|
|
213
|
+
heading6: TypographyFont
|
|
214
|
+
paragraphIntroLede: TypographyFont
|
|
215
|
+
paragraphBody: TypographyFont
|
|
216
|
+
paragraphSmall: TypographyFont
|
|
217
|
+
paragraphExtraSmall: TypographyFont
|
|
218
|
+
paragraphBold: {
|
|
219
|
+
fontWeight: KaizenCSSProperties["fontWeight"]
|
|
220
|
+
}
|
|
221
|
+
buttonPrimary: TypographyFont
|
|
222
|
+
buttonSecondary: TypographyFont
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// Converts all leafs (values that aren't objects) of an object tree to LeafType.
|
|
227
|
+
export type DeepMapObjectLeafs<T, LeafType> = T extends
|
|
228
|
+
| string
|
|
229
|
+
| number
|
|
230
|
+
| bigint
|
|
231
|
+
| boolean
|
|
232
|
+
| symbol
|
|
233
|
+
| null
|
|
234
|
+
| undefined
|
|
235
|
+
| ((...params: any[]) => any)
|
|
236
|
+
? LeafType
|
|
237
|
+
: T extends Record<any, any>
|
|
238
|
+
? {
|
|
239
|
+
[Key in keyof T]: DeepMapObjectLeafs<T[Key], LeafType>
|
|
240
|
+
}
|
|
241
|
+
: T
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Apologies for the complex types.
|
|
245
|
+
* This type represents the Theme type but with every leaf value in the tree mapped strictly to a string, rather than a number or a more complex type such as a string union.
|
|
246
|
+
* The reason for this is to have a more accurate type for the generated hierarchy of design tokens which are represented as CSS custom properties, e.g. `var(--color-purple-800)`.
|
|
247
|
+
*/
|
|
248
|
+
|
|
249
|
+
export type CSSVariableTheme = DeepMapObjectLeafs<TokenStructure, string>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/design-tokens",
|
|
3
3
|
"description": "Tokens used in the Kaizen Design System",
|
|
4
|
-
"version": "10.3.
|
|
4
|
+
"version": "10.3.14",
|
|
5
5
|
"homepage": "https://github.com/cultureamp/kaizen-design-system/tree/main/packages/design-tokens",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
"url": "https://github.com/cultureamp/kaizen-design-system/issues"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"tokens",
|
|
15
14
|
"sass",
|
|
16
15
|
"less",
|
|
16
|
+
"css",
|
|
17
|
+
"js",
|
|
17
18
|
"dist"
|
|
18
19
|
],
|
|
19
20
|
"main": "dist/index.js",
|
|
@@ -31,11 +32,12 @@
|
|
|
31
32
|
"prepublishOnly": "yarn build:json && yarn build:less && yarn build:sass && yarn build:ts"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"@types/lodash.flatmap": "^4.5.
|
|
35
|
-
"@types/react-highlight": "^0.12.
|
|
36
|
-
"@types/yargs": "^17.0.
|
|
35
|
+
"@types/lodash.flatmap": "^4.5.8",
|
|
36
|
+
"@types/react-highlight": "^0.12.7",
|
|
37
|
+
"@types/yargs": "^17.0.29",
|
|
37
38
|
"json-to-flat-sass": "^1.0.0",
|
|
38
39
|
"lodash.flatmap": "^4.5.0",
|
|
40
|
+
"object-to-css-variables": "^0.2.1",
|
|
39
41
|
"postcss": "^8.4.29",
|
|
40
42
|
"prettier": "*",
|
|
41
43
|
"react-highlight": "^0.15.0",
|
|
@@ -44,8 +46,8 @@
|
|
|
44
46
|
"yargs": "^17.7.2"
|
|
45
47
|
},
|
|
46
48
|
"dependencies": {
|
|
47
|
-
"@types/color-string": "^1.5.
|
|
48
|
-
"@types/lodash.kebabcase": "^4.1.
|
|
49
|
+
"@types/color-string": "^1.5.4",
|
|
50
|
+
"@types/lodash.kebabcase": "^4.1.8",
|
|
49
51
|
"color-string": "^1.9.1",
|
|
50
52
|
"lodash.kebabcase": "^4.1.1"
|
|
51
53
|
},
|
package/tokens/animation.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"animation": {
|
|
3
|
-
"easingFunction": {
|
|
4
|
-
"easeInOut": "var(--animation-easing-function-ease-in-out, cubic-bezier(0.455, 0.03, 0.515, 0.955))",
|
|
5
|
-
"easeInOut-id": "--animation-easing-function-ease-in-out",
|
|
6
|
-
"easeIn": "var(--animation-easing-function-ease-in, cubic-bezier(0.55, 0.085, 0.68, 0.53))",
|
|
7
|
-
"easeIn-id": "--animation-easing-function-ease-in",
|
|
8
|
-
"easeOut": "var(--animation-easing-function-ease-out, cubic-bezier(0.25, 0.46, 0.45, 0.94))",
|
|
9
|
-
"easeOut-id": "--animation-easing-function-ease-out",
|
|
10
|
-
"linear": "var(--animation-easing-function-linear, linear)",
|
|
11
|
-
"linear-id": "--animation-easing-function-linear",
|
|
12
|
-
"bounceIn": "var(--animation-easing-function-bounce-in, cubic-bezier(0.485, 0.155, 0.24, 1.245))",
|
|
13
|
-
"bounceIn-id": "--animation-easing-function-bounce-in",
|
|
14
|
-
"bounceOut": "var(--animation-easing-function-bounce-out, cubic-bezier(0.485, 0.155, 0.515, 0.845))",
|
|
15
|
-
"bounceOut-id": "--animation-easing-function-bounce-out",
|
|
16
|
-
"bounceInOut": "var(--animation-easing-function-bounce-in-out, cubic-bezier(0.76, -0.245, 0.24, 1.245))",
|
|
17
|
-
"bounceInOut-id": "--animation-easing-function-bounce-in-out"
|
|
18
|
-
},
|
|
19
|
-
"duration": {
|
|
20
|
-
"instant": "var(--animation-duration-instant, 0ms)",
|
|
21
|
-
"instant-id": "--animation-duration-instant",
|
|
22
|
-
"immediate": "var(--animation-duration-immediate, 100ms)",
|
|
23
|
-
"immediate-id": "--animation-duration-immediate",
|
|
24
|
-
"rapid": "var(--animation-duration-rapid, 200ms)",
|
|
25
|
-
"rapid-id": "--animation-duration-rapid",
|
|
26
|
-
"fast": "var(--animation-duration-fast, 300ms)",
|
|
27
|
-
"fast-id": "--animation-duration-fast",
|
|
28
|
-
"slow": "var(--animation-duration-slow, 400ms)",
|
|
29
|
-
"slow-id": "--animation-duration-slow",
|
|
30
|
-
"deliberate": "var(--animation-duration-deliberate, 700ms)",
|
|
31
|
-
"deliberate-id": "--animation-duration-deliberate"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DeepMapObjectLeafs, Theme } from "../src/types"
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated
|
|
4
|
-
* The preferred way to use Kaizen tokens in TypeScript/JavaScript is to use the React hook {@link useTheme} paired with a {@link ThemeProvider}
|
|
5
|
-
*/
|
|
6
|
-
export const animation: DeepMapObjectLeafs<Theme["animation"], string>
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated
|
|
9
|
-
* The preferred way to use Kaizen tokens in TypeScript/JavaScript is to use the React hook {@link useTheme} paired with a {@link ThemeProvider}
|
|
10
|
-
*/
|
|
11
|
-
export default { animation }
|
package/tokens/border.json
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"border": {
|
|
3
|
-
"solid": {
|
|
4
|
-
"borderWidth": "var(--border-solid-border-width, 2px)",
|
|
5
|
-
"borderWidth-id": "--border-solid-border-width",
|
|
6
|
-
"borderRadius": "var(--border-solid-border-radius, 7px)",
|
|
7
|
-
"borderRadius-id": "--border-solid-border-radius",
|
|
8
|
-
"borderStyle": "var(--border-solid-border-style, solid)",
|
|
9
|
-
"borderStyle-id": "--border-solid-border-style",
|
|
10
|
-
"borderColor": "var(--border-solid-border-color, #e1e2ea)",
|
|
11
|
-
"borderColor-rgb": "var(--border-solid-border-color-rgb, 225, 226, 234)",
|
|
12
|
-
"borderColor-rgb-id": "--border-solid-border-color-rgb",
|
|
13
|
-
"borderColor-id": "--border-solid-border-color"
|
|
14
|
-
},
|
|
15
|
-
"dashed": {
|
|
16
|
-
"borderWidth": "var(--border-dashed-border-width, 2px)",
|
|
17
|
-
"borderWidth-id": "--border-dashed-border-width",
|
|
18
|
-
"borderRadius": "var(--border-dashed-border-radius, 7px)",
|
|
19
|
-
"borderRadius-id": "--border-dashed-border-radius",
|
|
20
|
-
"borderStyle": "var(--border-dashed-border-style, dashed)",
|
|
21
|
-
"borderStyle-id": "--border-dashed-border-style"
|
|
22
|
-
},
|
|
23
|
-
"borderless": {
|
|
24
|
-
"borderWidth": "var(--border-borderless-border-width, 2px)",
|
|
25
|
-
"borderWidth-id": "--border-borderless-border-width",
|
|
26
|
-
"borderRadius": "var(--border-borderless-border-radius, 7px)",
|
|
27
|
-
"borderRadius-id": "--border-borderless-border-radius",
|
|
28
|
-
"borderStyle": "var(--border-borderless-border-style, solid)",
|
|
29
|
-
"borderStyle-id": "--border-borderless-border-style",
|
|
30
|
-
"borderColor": "var(--border-borderless-border-color, transparent)",
|
|
31
|
-
"borderColor-rgb": "var(--border-borderless-border-color-rgb, 0, 0, 0)",
|
|
32
|
-
"borderColor-rgb-id": "--border-borderless-border-color-rgb",
|
|
33
|
-
"borderColor-id": "--border-borderless-border-color"
|
|
34
|
-
},
|
|
35
|
-
"focusRing": {
|
|
36
|
-
"borderWidth": "var(--border-focus-ring-border-width, 2px)",
|
|
37
|
-
"borderWidth-id": "--border-focus-ring-border-width",
|
|
38
|
-
"borderRadius": "var(--border-focus-ring-border-radius, 10px)",
|
|
39
|
-
"borderRadius-id": "--border-focus-ring-border-radius",
|
|
40
|
-
"borderStyle": "var(--border-focus-ring-border-style, solid)",
|
|
41
|
-
"borderStyle-id": "--border-focus-ring-border-style"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|