@kaizen/design-tokens 3.1.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 (129) hide show
  1. package/CHANGELOG.md +773 -0
  2. package/LICENSE +21 -0
  3. package/README.md +66 -0
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +23 -0
  7. package/dist/react/ThemeProvider.d.ts +13 -0
  8. package/dist/react/ThemeProvider.d.ts.map +1 -0
  9. package/dist/react/ThemeProvider.js +42 -0
  10. package/dist/react/index.d.ts +2 -0
  11. package/dist/react/index.d.ts.map +1 -0
  12. package/dist/react/index.js +13 -0
  13. package/dist/src/ThemeManager.d.ts +23 -0
  14. package/dist/src/ThemeManager.d.ts.map +1 -0
  15. package/dist/src/ThemeManager.js +70 -0
  16. package/dist/src/lib/addExtraThemeEntries.d.ts +25 -0
  17. package/dist/src/lib/addExtraThemeEntries.d.ts.map +1 -0
  18. package/dist/src/lib/addExtraThemeEntries.js +56 -0
  19. package/dist/src/lib/cssVariables.d.ts +23 -0
  20. package/dist/src/lib/cssVariables.d.ts.map +1 -0
  21. package/dist/src/lib/cssVariables.js +33 -0
  22. package/dist/src/lib/makeCssVariableDefinitionsMap.d.ts +30 -0
  23. package/dist/src/lib/makeCssVariableDefinitionsMap.d.ts.map +1 -0
  24. package/dist/src/lib/makeCssVariableDefinitionsMap.js +57 -0
  25. package/dist/src/lib/makeCssVariableTheme.d.ts +35 -0
  26. package/dist/src/lib/makeCssVariableTheme.d.ts.map +1 -0
  27. package/dist/src/lib/makeCssVariableTheme.js +54 -0
  28. package/dist/src/lib/mapLeafsOfObject.d.ts +23 -0
  29. package/dist/src/lib/mapLeafsOfObject.d.ts.map +1 -0
  30. package/dist/src/lib/mapLeafsOfObject.js +59 -0
  31. package/dist/src/themes/heart.d.ts +3 -0
  32. package/dist/src/themes/heart.d.ts.map +1 -0
  33. package/dist/src/themes/heart.js +286 -0
  34. package/dist/src/themes/index.d.ts +4 -0
  35. package/dist/src/themes/index.d.ts.map +1 -0
  36. package/dist/src/themes/index.js +9 -0
  37. package/dist/src/themes/zen.d.ts +3 -0
  38. package/dist/src/themes/zen.d.ts.map +1 -0
  39. package/dist/src/themes/zen.js +293 -0
  40. package/dist/src/types.d.ts +205 -0
  41. package/dist/src/types.d.ts.map +1 -0
  42. package/dist/src/types.js +2 -0
  43. package/elm/Kaizen/Theme.elm +29 -0
  44. package/index.ts +9 -0
  45. package/less/animation.less +49 -0
  46. package/less/border.less +47 -0
  47. package/less/color.less +210 -0
  48. package/less/layout.less +8 -0
  49. package/less/shadow.less +12 -0
  50. package/less/spacing.less +20 -0
  51. package/less/typography.less +526 -0
  52. package/package.json +63 -0
  53. package/react/ThemeProvider.d.ts +12 -0
  54. package/react/ThemeProvider.js +43 -0
  55. package/react/ThemeProvider.js.map +1 -0
  56. package/react/ThemeProvider.tsx +39 -0
  57. package/react/index.d.ts +1 -0
  58. package/react/index.js +14 -0
  59. package/react/index.js.map +1 -0
  60. package/react/index.tsx +1 -0
  61. package/sass/animation.scss +49 -0
  62. package/sass/border.scss +47 -0
  63. package/sass/color.scss +210 -0
  64. package/sass/layout.scss +8 -0
  65. package/sass/shadow.scss +12 -0
  66. package/sass/spacing.scss +20 -0
  67. package/sass/typography.scss +526 -0
  68. package/src/ThemeManager.d.ts +22 -0
  69. package/src/ThemeManager.js +71 -0
  70. package/src/ThemeManager.js.map +1 -0
  71. package/src/ThemeManager.ts +70 -0
  72. package/src/lib/__tests__/themeForTesting.d.ts +38 -0
  73. package/src/lib/__tests__/themeForTesting.js +21 -0
  74. package/src/lib/__tests__/themeForTesting.js.map +1 -0
  75. package/src/lib/__tests__/themeForTesting.ts +17 -0
  76. package/src/lib/addExtraThemeEntries.d.ts +24 -0
  77. package/src/lib/addExtraThemeEntries.js +57 -0
  78. package/src/lib/addExtraThemeEntries.js.map +1 -0
  79. package/src/lib/addExtraThemeEntries.ts +56 -0
  80. package/src/lib/cssVariables.d.ts +22 -0
  81. package/src/lib/cssVariables.js +34 -0
  82. package/src/lib/cssVariables.js.map +1 -0
  83. package/src/lib/cssVariables.ts +27 -0
  84. package/src/lib/makeCssVariableDefinitionsMap.d.ts +29 -0
  85. package/src/lib/makeCssVariableDefinitionsMap.js +58 -0
  86. package/src/lib/makeCssVariableDefinitionsMap.js.map +1 -0
  87. package/src/lib/makeCssVariableDefinitionsMap.ts +55 -0
  88. package/src/lib/makeCssVariableTheme.d.ts +34 -0
  89. package/src/lib/makeCssVariableTheme.js +55 -0
  90. package/src/lib/makeCssVariableTheme.js.map +1 -0
  91. package/src/lib/makeCssVariableTheme.ts +63 -0
  92. package/src/lib/mapLeafsOfObject.d.ts +22 -0
  93. package/src/lib/mapLeafsOfObject.js +60 -0
  94. package/src/lib/mapLeafsOfObject.js.map +1 -0
  95. package/src/lib/mapLeafsOfObject.ts +50 -0
  96. package/src/lib/patterns.d.ts +2 -0
  97. package/src/lib/patterns.js +6 -0
  98. package/src/lib/patterns.js.map +1 -0
  99. package/src/lib/patterns.ts +2 -0
  100. package/src/themes/heart.d.ts +2 -0
  101. package/src/themes/heart.js +287 -0
  102. package/src/themes/heart.js.map +1 -0
  103. package/src/themes/heart.ts +285 -0
  104. package/src/themes/index.d.ts +3 -0
  105. package/src/themes/index.js +17 -0
  106. package/src/themes/index.js.map +1 -0
  107. package/src/themes/index.ts +4 -0
  108. package/src/themes/zen.d.ts +2 -0
  109. package/src/themes/zen.js +294 -0
  110. package/src/themes/zen.js.map +1 -0
  111. package/src/themes/zen.ts +292 -0
  112. package/src/types.d.ts +204 -0
  113. package/src/types.js +3 -0
  114. package/src/types.js.map +1 -0
  115. package/src/types.ts +225 -0
  116. package/tokens/animation.json +34 -0
  117. package/tokens/animation.json.d.ts +12 -0
  118. package/tokens/border.json +44 -0
  119. package/tokens/border.json.d.ts +12 -0
  120. package/tokens/color.json +228 -0
  121. package/tokens/color.json.d.ts +12 -0
  122. package/tokens/layout.json +9 -0
  123. package/tokens/layout.json.d.ts +12 -0
  124. package/tokens/shadow.json +12 -0
  125. package/tokens/shadow.json.d.ts +12 -0
  126. package/tokens/spacing.json +22 -0
  127. package/tokens/spacing.json.d.ts +12 -0
  128. package/tokens/typography.json +236 -0
  129. package/tokens/typography.json.d.ts +12 -0
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zenTheme = void 0;
4
+ exports.zenTheme = {
5
+ themeKey: "zen",
6
+ animation: {
7
+ easingFunction: {
8
+ easeInOut: "cubic-bezier(0.455, 0.03, 0.515, 0.955)",
9
+ easeIn: "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
10
+ easeOut: "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
11
+ linear: "linear",
12
+ bounceIn: "cubic-bezier(0.485, 0.155, 0.24, 1.245)",
13
+ bounceOut: "cubic-bezier(0.485, 0.155, 0.515, 0.845)",
14
+ bounceInOut: "cubic-bezier(0.76, -0.245, 0.24, 1.245)",
15
+ },
16
+ duration: {
17
+ instant: "0ms",
18
+ immediate: "100ms",
19
+ rapid: "200ms",
20
+ fast: "300ms",
21
+ slow: "400ms",
22
+ deliberate: "700ms",
23
+ },
24
+ },
25
+ border: {
26
+ solid: {
27
+ borderWidth: "2px",
28
+ borderRadius: "7px",
29
+ borderStyle: "solid",
30
+ borderColor: "#e1e2ea",
31
+ },
32
+ dashed: {
33
+ borderWidth: "2px",
34
+ borderRadius: "7px",
35
+ borderStyle: "dashed",
36
+ },
37
+ borderless: {
38
+ borderWidth: "2px",
39
+ borderRadius: "7px",
40
+ borderStyle: "solid",
41
+ borderColor: "transparent",
42
+ },
43
+ focusRing: {
44
+ borderWidth: "2px",
45
+ borderRadius: "10px",
46
+ borderStyle: "solid",
47
+ },
48
+ },
49
+ color: {
50
+ purple: {
51
+ 100: "#f0f1f4",
52
+ 200: "#e1e2ea",
53
+ 300: "#c4c5d4",
54
+ 400: "#a7a9c1",
55
+ 500: "#898ba9",
56
+ 600: "#6b6e94",
57
+ 700: "#4b4d68",
58
+ 800: "#35374a",
59
+ },
60
+ blue: {
61
+ 100: "#e6f0f7",
62
+ 200: "#cce1f0",
63
+ 300: "#99c3e1",
64
+ 400: "#4d95ca",
65
+ 500: "#0168b3",
66
+ 600: "#00518c",
67
+ // Duplicate from Heart because it's new
68
+ 700: "#003157",
69
+ },
70
+ green: {
71
+ 100: "#e9f6f3",
72
+ 200: "#bce3dc",
73
+ 300: "#90d1c5",
74
+ 400: "#64bfae",
75
+ 500: "#21a38b",
76
+ 600: "#177261",
77
+ // Duplicate from Heart because it's new
78
+ 700: "#22594a",
79
+ },
80
+ yellow: {
81
+ 100: "#fffae8",
82
+ 200: "#fff5d2",
83
+ 300: "#ffeba5",
84
+ 400: "#ffe278",
85
+ 500: "#ffce1e",
86
+ // Duplicate from Heart because it's new
87
+ 600: "#c68600",
88
+ // Duplicate from Heart because it's new
89
+ 700: "#876400",
90
+ },
91
+ red: {
92
+ 100: "#fcedef",
93
+ 200: "#fccfd4",
94
+ 300: "#fcaeb6",
95
+ 400: "#fc7c89",
96
+ 500: "#e22b3e",
97
+ 600: "#b02130",
98
+ // Duplicate from Heart because it's new
99
+ 700: "#6c1e20",
100
+ },
101
+ orange: {
102
+ 100: "#fff1ee",
103
+ 200: "#fdd6cd",
104
+ 300: "#fdbaab",
105
+ 400: "#fc9e8a",
106
+ 500: "#fa7558",
107
+ 600: "#b85d4a",
108
+ // Duplicate from Heart because it's new
109
+ 700: "#903c00",
110
+ },
111
+ // Should only exist in Heart but we need a consistent type.
112
+ gray: {
113
+ 100: "#f9f9f9",
114
+ 200: "#f4f4f5",
115
+ 300: "#eaeaec",
116
+ 400: "#cdcdd0",
117
+ 500: "#8c8c97",
118
+ 600: "#524e56",
119
+ },
120
+ white: "#ffffff",
121
+ },
122
+ dataViz: {
123
+ favorable: "#6b6e94",
124
+ unfavorable: "#fccfd4",
125
+ },
126
+ layout: {
127
+ contentMaxWidth: "1392px",
128
+ contentSideMargin: "72px",
129
+ mobileActionsDrawerHeight: "60px",
130
+ navigationBarHeight: "72px",
131
+ breakpoints: {
132
+ medium: "768px",
133
+ large: "1080px",
134
+ },
135
+ },
136
+ shadow: {
137
+ small: {
138
+ boxShadow: "0 0 4px rgba(0, 0, 0, 0.09)",
139
+ },
140
+ large: {
141
+ boxShadow: "0 0 12px rgba(0, 0, 0, 0.19)",
142
+ },
143
+ },
144
+ spacing: {
145
+ xs: "0.375rem",
146
+ sm: "0.75rem",
147
+ md: "1.5rem",
148
+ lg: "2.25rem",
149
+ xl: "3rem",
150
+ xxl: "3.75rem",
151
+ xxxl: "4.5rem",
152
+ xxxxl: "5.25rem",
153
+ xxxxxl: "6rem",
154
+ },
155
+ typography: {
156
+ dataLarge: {
157
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
158
+ fontWeight: 700,
159
+ fontSize: "5.25rem",
160
+ lineHeight: "5.25rem",
161
+ letterSpacing: "normal",
162
+ },
163
+ dataLargeUnits: {
164
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
165
+ fontWeight: 700,
166
+ fontSize: "2.625rem",
167
+ lineHeight: "5.25rem",
168
+ letterSpacing: "normal",
169
+ },
170
+ dataMedium: {
171
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
172
+ fontWeight: 700,
173
+ fontSize: "3rem",
174
+ lineHeight: "5rem",
175
+ letterSpacing: "normal",
176
+ },
177
+ dataMediumUnits: {
178
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
179
+ fontWeight: 700,
180
+ fontSize: "1.5rem",
181
+ lineHeight: "5rem",
182
+ letterSpacing: "normal",
183
+ },
184
+ dataSmall: {
185
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
186
+ fontWeight: 700,
187
+ fontSize: "1.5rem",
188
+ lineHeight: "1.5rem",
189
+ letterSpacing: "normal",
190
+ },
191
+ dataSmallUnits: {
192
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
193
+ fontWeight: 700,
194
+ fontSize: "1.125rem",
195
+ lineHeight: "1.5rem",
196
+ letterSpacing: "normal",
197
+ },
198
+ display0: {
199
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
200
+ fontWeight: 700,
201
+ fontSize: "4.5rem",
202
+ lineHeight: "4.5rem",
203
+ letterSpacing: "-0.03em",
204
+ },
205
+ heading1: {
206
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
207
+ fontWeight: 700,
208
+ fontSize: "2.25rem",
209
+ lineHeight: "2.25rem",
210
+ letterSpacing: "-0.03em",
211
+ },
212
+ heading2: {
213
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
214
+ fontWeight: 700,
215
+ fontSize: "1.875rem",
216
+ lineHeight: "2.25rem",
217
+ letterSpacing: "-0.03em",
218
+ },
219
+ heading3: {
220
+ fontFamily: '"Greycliff CF", "Noto Sans", Helvetica, Arial, sans-serif',
221
+ fontWeight: 700,
222
+ fontSize: "1.375rem",
223
+ lineHeight: "1.5rem",
224
+ letterSpacing: "-0.03em",
225
+ },
226
+ heading4: {
227
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
228
+ fontWeight: 600,
229
+ fontSize: "1.125rem",
230
+ lineHeight: "1.5rem",
231
+ letterSpacing: "normal",
232
+ },
233
+ heading5: {
234
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
235
+ fontWeight: 600,
236
+ fontSize: "1rem",
237
+ lineHeight: "1.5rem",
238
+ letterSpacing: "normal",
239
+ },
240
+ heading6: {
241
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
242
+ fontWeight: 700,
243
+ fontSize: "0.875rem",
244
+ lineHeight: "1.5rem",
245
+ letterSpacing: "normal",
246
+ },
247
+ paragraphIntroLede: {
248
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
249
+ fontWeight: 400,
250
+ fontSize: "1.25rem",
251
+ lineHeight: "1.875rem",
252
+ letterSpacing: "-0.5px",
253
+ },
254
+ paragraphBody: {
255
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
256
+ fontWeight: 400,
257
+ fontSize: "1rem",
258
+ lineHeight: "1.5rem",
259
+ letterSpacing: "normal",
260
+ },
261
+ paragraphSmall: {
262
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
263
+ fontWeight: 400,
264
+ fontSize: "0.875rem",
265
+ lineHeight: "1.125rem",
266
+ letterSpacing: "normal",
267
+ },
268
+ paragraphExtraSmall: {
269
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
270
+ fontWeight: 400,
271
+ fontSize: "0.75rem",
272
+ lineHeight: "1.125rem",
273
+ letterSpacing: "normal",
274
+ },
275
+ paragraphBold: {
276
+ fontWeight: 600,
277
+ },
278
+ buttonPrimary: {
279
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
280
+ fontWeight: 700,
281
+ fontSize: "1.125rem",
282
+ lineHeight: "1.5rem",
283
+ letterSpacing: "normal",
284
+ },
285
+ buttonSecondary: {
286
+ fontFamily: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif',
287
+ fontWeight: 500,
288
+ fontSize: "1rem",
289
+ lineHeight: "1.5rem",
290
+ letterSpacing: "normal",
291
+ },
292
+ },
293
+ };
@@ -0,0 +1,205 @@
1
+ import type { CSSProperties as ReactCSSProperties } from "react";
2
+ /**
3
+ * Use a custom type for CSS properties becauase we should eventually write a more strongly typed version using template literal types.
4
+ * 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
5
+ * For example:
6
+ * ```ts
7
+ * type Font = {
8
+ * fontSize: `${number}rem`,
9
+ *
10
+ * }
11
+ * type HexDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F ;
12
+ * type Color = `rgba(${number}, ${number}, ${number}, ${number}) | #${HexDigit}${HexDigit}${HexDigit}` // You get the point
13
+ *
14
+ * ```
15
+ * */
16
+ declare type KaizenCSSProperties = ReactCSSProperties;
17
+ declare type Hex = string;
18
+ export declare type TypographyFont = {
19
+ fontFamily: KaizenCSSProperties["fontFamily"];
20
+ fontWeight: KaizenCSSProperties["fontWeight"];
21
+ fontSize: KaizenCSSProperties["fontSize"];
22
+ lineHeight: KaizenCSSProperties["lineHeight"];
23
+ letterSpacing: KaizenCSSProperties["letterSpacing"];
24
+ };
25
+ export declare type ThemeKey = "zen" | "heart" | "custom";
26
+ export declare type Theme = {
27
+ themeKey: ThemeKey;
28
+ border: {
29
+ solid: {
30
+ borderWidth: KaizenCSSProperties["borderWidth"];
31
+ borderRadius: KaizenCSSProperties["borderRadius"];
32
+ borderStyle: KaizenCSSProperties["borderStyle"];
33
+ borderColor: KaizenCSSProperties["borderColor"];
34
+ };
35
+ dashed: {
36
+ borderWidth: KaizenCSSProperties["borderWidth"];
37
+ borderRadius: KaizenCSSProperties["borderRadius"];
38
+ borderStyle: KaizenCSSProperties["borderStyle"];
39
+ };
40
+ borderless: {
41
+ borderWidth: KaizenCSSProperties["borderWidth"];
42
+ borderRadius: KaizenCSSProperties["borderRadius"];
43
+ borderStyle: KaizenCSSProperties["borderStyle"];
44
+ borderColor: KaizenCSSProperties["borderColor"];
45
+ };
46
+ focusRing: {
47
+ borderWidth: KaizenCSSProperties["borderWidth"];
48
+ borderRadius: KaizenCSSProperties["borderRadius"];
49
+ borderStyle: KaizenCSSProperties["borderStyle"];
50
+ };
51
+ };
52
+ animation: {
53
+ easingFunction: {
54
+ easeInOut: string;
55
+ easeIn: string;
56
+ easeOut: string;
57
+ linear: string;
58
+ bounceIn: string;
59
+ bounceOut: string;
60
+ bounceInOut: string;
61
+ };
62
+ duration: {
63
+ instant: string;
64
+ immediate: string;
65
+ rapid: string;
66
+ fast: string;
67
+ slow: string;
68
+ deliberate: string;
69
+ };
70
+ };
71
+ color: {
72
+ purple: {
73
+ "100": Hex;
74
+ "200": Hex;
75
+ "300": Hex;
76
+ "400": Hex;
77
+ "500": Hex;
78
+ "600": Hex;
79
+ "700": Hex;
80
+ "800": Hex;
81
+ };
82
+ blue: {
83
+ "100": Hex;
84
+ "200": Hex;
85
+ "300": Hex;
86
+ "400": Hex;
87
+ "500": Hex;
88
+ "600": Hex;
89
+ "700": Hex;
90
+ };
91
+ green: {
92
+ "100": Hex;
93
+ "200": Hex;
94
+ "300": Hex;
95
+ "400": Hex;
96
+ "500": Hex;
97
+ "600": Hex;
98
+ "700": Hex;
99
+ };
100
+ yellow: {
101
+ "100": Hex;
102
+ "200": Hex;
103
+ "300": Hex;
104
+ "400": Hex;
105
+ "500": Hex;
106
+ "600": Hex;
107
+ "700": Hex;
108
+ };
109
+ red: {
110
+ "100": Hex;
111
+ "200": Hex;
112
+ "300": Hex;
113
+ "400": Hex;
114
+ "500": Hex;
115
+ "600": Hex;
116
+ "700": Hex;
117
+ };
118
+ orange: {
119
+ "100": Hex;
120
+ "200": Hex;
121
+ "300": Hex;
122
+ "400": Hex;
123
+ "500": Hex;
124
+ "600": Hex;
125
+ "700": Hex;
126
+ };
127
+ gray: {
128
+ "100": Hex;
129
+ "200": Hex;
130
+ "300": Hex;
131
+ "400": Hex;
132
+ "500": Hex;
133
+ "600": Hex;
134
+ };
135
+ white: Hex;
136
+ };
137
+ dataViz: {
138
+ favorable: Hex;
139
+ unfavorable: Hex;
140
+ };
141
+ layout: {
142
+ contentMaxWidth: string;
143
+ contentSideMargin: string;
144
+ mobileActionsDrawerHeight: string;
145
+ navigationBarHeight: string;
146
+ breakpoints: {
147
+ medium: string;
148
+ large: string;
149
+ };
150
+ };
151
+ shadow: {
152
+ small: {
153
+ boxShadow: string;
154
+ };
155
+ large: {
156
+ boxShadow: string;
157
+ };
158
+ };
159
+ spacing: {
160
+ xs: string;
161
+ sm: string;
162
+ md: string;
163
+ lg: string;
164
+ xl: string;
165
+ xxl: string;
166
+ xxxl: string;
167
+ xxxxl: string;
168
+ xxxxxl: string;
169
+ };
170
+ typography: {
171
+ dataLarge: TypographyFont;
172
+ dataLargeUnits: TypographyFont;
173
+ dataMedium: TypographyFont;
174
+ dataMediumUnits: TypographyFont;
175
+ dataSmall: TypographyFont;
176
+ dataSmallUnits: TypographyFont;
177
+ display0: TypographyFont;
178
+ heading1: TypographyFont;
179
+ heading2: TypographyFont;
180
+ heading3: TypographyFont;
181
+ heading4: TypographyFont;
182
+ heading5: TypographyFont;
183
+ heading6: TypographyFont;
184
+ paragraphIntroLede: TypographyFont;
185
+ paragraphBody: TypographyFont;
186
+ paragraphSmall: TypographyFont;
187
+ paragraphExtraSmall: TypographyFont;
188
+ paragraphBold: {
189
+ fontWeight: KaizenCSSProperties["fontWeight"];
190
+ };
191
+ buttonPrimary: TypographyFont;
192
+ buttonSecondary: TypographyFont;
193
+ };
194
+ };
195
+ export declare type DeepMapObjectLeafs<T, LeafType> = T extends string | number | bigint | boolean | symbol | null | undefined | ((...params: any[]) => any) ? LeafType : T extends Record<any, any> ? {
196
+ [Key in keyof T]: DeepMapObjectLeafs<T[Key], LeafType>;
197
+ } : T;
198
+ /**
199
+ * Apologies for the complex types.
200
+ * 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.
201
+ * 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)`.
202
+ */
203
+ export declare type CSSVariableTheme = DeepMapObjectLeafs<Theme, string>;
204
+ export {};
205
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAEhE;;;;;;;;;;;;;KAaK;AACL,aAAK,m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C,CAAA;CACF,CAAA;AAGD,oBAAY,kBAAkB,CAAC,CAAC,EAAE,QAAQ,IAAI,CAAC,SAC3C,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,IAAI,GACJ,SAAS,GACT,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAC3B,QAAQ,GACR,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAC1B;KACG,GAAG,IAAI,MAAM,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;CACvD,GACD,CAAC,CAAA;AAEL;;;;GAIG;AACH,oBAAY,gBAAgB,GAAG,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ module Kaizen.Theme exposing (Theme(..), defaultTheme, themeDecoder)
2
+
3
+ import Json.Decode as Decode exposing (Decoder)
4
+
5
+
6
+ type Theme
7
+ = Heart
8
+ | Zen
9
+
10
+
11
+ defaultTheme =
12
+ Heart
13
+
14
+
15
+ themeDecoder : Decoder Theme
16
+ themeDecoder =
17
+ Decode.string
18
+ |> Decode.map
19
+ (\themeString ->
20
+ case themeString of
21
+ "zen" ->
22
+ Zen
23
+
24
+ "heart" ->
25
+ Heart
26
+
27
+ _ ->
28
+ defaultTheme
29
+ )
package/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ // These are exposed at the top level because it seems like they are the most useful and relevent to usage of design tokens.
2
+ export * from "./src/themes"
3
+ export * from "./src/types"
4
+ export * from "./src/ThemeManager"
5
+ export * from "./react"
6
+
7
+ export { makeCssVariableDefinitionsMap } from "./src/lib/makeCssVariableDefinitionsMap"
8
+ export { makeCSSVariableTheme } from "./src/lib/makeCssVariableTheme"
9
+ export { mapLeafsOfObject } from "./src/lib/mapLeafsOfObject"
@@ -0,0 +1,49 @@
1
+ /** THIS IS AN AUTOGENERATED FILE **/
2
+
3
+ @animation-easing-function-ease-in-out: var(
4
+ --animation-easing-function-ease-in-out,
5
+ cubic-bezier(0.455, 0.03, 0.515, 0.955)
6
+ );
7
+ @animation-easing-function-ease-in-out-id: --animation-easing-function-ease-in-out;
8
+ @animation-easing-function-ease-in: var(
9
+ --animation-easing-function-ease-in,
10
+ cubic-bezier(0.55, 0.085, 0.68, 0.53)
11
+ );
12
+ @animation-easing-function-ease-in-id: --animation-easing-function-ease-in;
13
+ @animation-easing-function-ease-out: var(
14
+ --animation-easing-function-ease-out,
15
+ cubic-bezier(0.25, 0.46, 0.45, 0.94)
16
+ );
17
+ @animation-easing-function-ease-out-id: --animation-easing-function-ease-out;
18
+ @animation-easing-function-linear: var(
19
+ --animation-easing-function-linear,
20
+ linear
21
+ );
22
+ @animation-easing-function-linear-id: --animation-easing-function-linear;
23
+ @animation-easing-function-bounce-in: var(
24
+ --animation-easing-function-bounce-in,
25
+ cubic-bezier(0.485, 0.155, 0.24, 1.245)
26
+ );
27
+ @animation-easing-function-bounce-in-id: --animation-easing-function-bounce-in;
28
+ @animation-easing-function-bounce-out: var(
29
+ --animation-easing-function-bounce-out,
30
+ cubic-bezier(0.485, 0.155, 0.515, 0.845)
31
+ );
32
+ @animation-easing-function-bounce-out-id: --animation-easing-function-bounce-out;
33
+ @animation-easing-function-bounce-in-out: var(
34
+ --animation-easing-function-bounce-in-out,
35
+ cubic-bezier(0.76, -0.245, 0.24, 1.245)
36
+ );
37
+ @animation-easing-function-bounce-in-out-id: --animation-easing-function-bounce-in-out;
38
+ @animation-duration-instant: var(--animation-duration-instant, 0ms);
39
+ @animation-duration-instant-id: --animation-duration-instant;
40
+ @animation-duration-immediate: var(--animation-duration-immediate, 100ms);
41
+ @animation-duration-immediate-id: --animation-duration-immediate;
42
+ @animation-duration-rapid: var(--animation-duration-rapid, 200ms);
43
+ @animation-duration-rapid-id: --animation-duration-rapid;
44
+ @animation-duration-fast: var(--animation-duration-fast, 300ms);
45
+ @animation-duration-fast-id: --animation-duration-fast;
46
+ @animation-duration-slow: var(--animation-duration-slow, 400ms);
47
+ @animation-duration-slow-id: --animation-duration-slow;
48
+ @animation-duration-deliberate: var(--animation-duration-deliberate, 700ms);
49
+ @animation-duration-deliberate-id: --animation-duration-deliberate;
@@ -0,0 +1,47 @@
1
+ /** THIS IS AN AUTOGENERATED FILE **/
2
+
3
+ @border-solid-border-width: var(--border-solid-border-width, 2px);
4
+ @border-solid-border-width-id: --border-solid-border-width;
5
+ @border-solid-border-radius: var(--border-solid-border-radius, 7px);
6
+ @border-solid-border-radius-id: --border-solid-border-radius;
7
+ @border-solid-border-style: var(--border-solid-border-style, solid);
8
+ @border-solid-border-style-id: --border-solid-border-style;
9
+ @border-solid-border-color: var(--border-solid-border-color, #e1e2ea);
10
+ @border-solid-border-color-rgb: var(
11
+ --border-solid-border-color-rgb,
12
+ 225,
13
+ 226,
14
+ 234
15
+ );
16
+ @border-solid-border-color-rgb-id: --border-solid-border-color-rgb;
17
+ @border-solid-border-color-id: --border-solid-border-color;
18
+ @border-dashed-border-width: var(--border-dashed-border-width, 2px);
19
+ @border-dashed-border-width-id: --border-dashed-border-width;
20
+ @border-dashed-border-radius: var(--border-dashed-border-radius, 7px);
21
+ @border-dashed-border-radius-id: --border-dashed-border-radius;
22
+ @border-dashed-border-style: var(--border-dashed-border-style, dashed);
23
+ @border-dashed-border-style-id: --border-dashed-border-style;
24
+ @border-borderless-border-width: var(--border-borderless-border-width, 2px);
25
+ @border-borderless-border-width-id: --border-borderless-border-width;
26
+ @border-borderless-border-radius: var(--border-borderless-border-radius, 7px);
27
+ @border-borderless-border-radius-id: --border-borderless-border-radius;
28
+ @border-borderless-border-style: var(--border-borderless-border-style, solid);
29
+ @border-borderless-border-style-id: --border-borderless-border-style;
30
+ @border-borderless-border-color: var(
31
+ --border-borderless-border-color,
32
+ transparent
33
+ );
34
+ @border-borderless-border-color-rgb: var(
35
+ --border-borderless-border-color-rgb,
36
+ 0,
37
+ 0,
38
+ 0
39
+ );
40
+ @border-borderless-border-color-rgb-id: --border-borderless-border-color-rgb;
41
+ @border-borderless-border-color-id: --border-borderless-border-color;
42
+ @border-focus-ring-border-width: var(--border-focus-ring-border-width, 2px);
43
+ @border-focus-ring-border-width-id: --border-focus-ring-border-width;
44
+ @border-focus-ring-border-radius: var(--border-focus-ring-border-radius, 10px);
45
+ @border-focus-ring-border-radius-id: --border-focus-ring-border-radius;
46
+ @border-focus-ring-border-style: var(--border-focus-ring-border-style, solid);
47
+ @border-focus-ring-border-style-id: --border-focus-ring-border-style;