@kaizen/components 1.4.16 → 1.4.18

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 (42) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/KaizenProvider/ThemeProvider/index.d.ts +7 -16
  3. package/dist/KaizenProvider/ThemeProvider/index.js +11 -2
  4. package/dist/KaizenProvider/ThemeProvider/themes/heart.d.ts +6 -0
  5. package/dist/KaizenProvider/ThemeProvider/themes/heart.js +8 -0
  6. package/dist/KaizenProvider/ThemeProvider/themes/index.d.ts +8 -0
  7. package/dist/KaizenProvider/ThemeProvider/themes/index.js +11 -0
  8. package/dist/KaizenProvider/ThemeProvider/themes/types.d.ts +231 -0
  9. package/dist/KaizenProvider/ThemeProvider/themes/types.js +1 -0
  10. package/dist/KaizenProvider/index.d.ts +5 -1
  11. package/dist/KaizenProvider/index.js +23 -4
  12. package/dist/ThemeProvider-7786826c.d.ts +17 -0
  13. package/dist/chunk-7T4E5A7M.js +315 -0
  14. package/dist/{chunk-HO4BDPVX.js → chunk-7ZAJ7755.js} +2 -2
  15. package/dist/chunk-FBL47PXS.js +1 -0
  16. package/dist/{chunk-RZK3BIEO.js → chunk-MXW3YHBE.js} +5 -3
  17. package/dist/chunk-WDAFEOSV.js +10 -0
  18. package/dist/esm/KaizenProvider/ThemeProvider/index.js +10 -1
  19. package/dist/esm/KaizenProvider/ThemeProvider/themes/heart.js +8 -0
  20. package/dist/esm/KaizenProvider/ThemeProvider/themes/index.js +11 -0
  21. package/dist/esm/KaizenProvider/ThemeProvider/themes/types.js +1 -0
  22. package/dist/esm/KaizenProvider/index.js +23 -4
  23. package/dist/esm/chunk-7T4E5A7M.js +315 -0
  24. package/dist/esm/{chunk-HO4BDPVX.js → chunk-7ZAJ7755.js} +1 -1
  25. package/dist/esm/chunk-FBL47PXS.js +0 -0
  26. package/dist/esm/{chunk-RZK3BIEO.js → chunk-MXW3YHBE.js} +3 -1
  27. package/dist/esm/chunk-WDAFEOSV.js +10 -0
  28. package/dist/esm/index.js +23 -6
  29. package/dist/iife/{Input.module-6PN2B7VB.scss → Input.module-FBWZRX37.scss} +4 -0
  30. package/dist/iife/KaizenProvider/ThemeProvider/ThemeManager.js +2968 -62
  31. package/dist/iife/KaizenProvider/ThemeProvider/ThemeManager.spec.js +2968 -369
  32. package/dist/iife/KaizenProvider/ThemeProvider/index.js +824 -124
  33. package/dist/iife/KaizenProvider/ThemeProvider/themes/heart.js +313 -0
  34. package/dist/iife/KaizenProvider/ThemeProvider/themes/index.js +315 -0
  35. package/dist/iife/KaizenProvider/ThemeProvider/themes/types.js +3 -0
  36. package/dist/iife/KaizenProvider/index.js +825 -124
  37. package/dist/iife/__future__/index.js +11 -7
  38. package/dist/iife/index.js +2527 -1955
  39. package/dist/index.d.ts +5 -3
  40. package/dist/index.js +23 -6
  41. package/dist/styles.css +98 -0
  42. package/package.json +12 -12
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.4.18](https://github.com/cultureamp/kaizen-design-system/compare/@kaizen/components@1.4.17...@kaizen/components@1.4.18) (2023-02-28)
7
+
8
+ **Note:** Version bump only for package @kaizen/components
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.4.17](https://github.com/cultureamp/kaizen-design-system/compare/@kaizen/components@1.4.16...@kaizen/components@1.4.17) (2023-02-28)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * design-tokens-aio-import ([#3323](https://github.com/cultureamp/kaizen-design-system/issues/3323)) ([9dcf307](https://github.com/cultureamp/kaizen-design-system/commit/9dcf30761a5c8886c64b207ddb9484e8f8fb3962))
20
+
21
+
22
+
23
+
24
+
6
25
  ## [1.4.16](https://github.com/cultureamp/kaizen-design-system/compare/@kaizen/components@1.4.15...@kaizen/components@1.4.16) (2023-02-27)
7
26
 
8
27
 
@@ -1,16 +1,7 @@
1
- import React, { Context } from 'react';
2
- import { Theme } from '@kaizen/design-tokens';
3
- import { ThemeManager } from './ThemeManager.js';
4
-
5
- declare const ThemeContext: Context<Theme>;
6
- /**
7
- * Wrap your application in this provider using a ThemeManager, to synchronise it with a react context.
8
- * This allows child react elements to more easily use theme variables, using the {@link useTheme} hook.
9
- */
10
- declare const ThemeProvider: ({ themeManager, ...props }: {
11
- themeManager?: ThemeManager<Theme> | undefined;
12
- children: React.ReactNode;
13
- }) => JSX.Element;
14
- declare const useTheme: () => Theme;
15
-
16
- export { ThemeContext, ThemeManager, ThemeProvider, useTheme };
1
+ export { T as ThemeContext, a as ThemeProvider, u as useTheme } from '../../ThemeProvider-7786826c.js';
2
+ export { ThemeManager } from './ThemeManager.js';
3
+ export { defaultTheme } from './themes/index.js';
4
+ export { default as heartTheme } from './themes/heart.js';
5
+ export { CSSVariableTheme, DeepMapObjectLeafs, Theme, ThemeKey, TypographyFont } from './themes/types.js';
6
+ import '@kaizen/design-tokens';
7
+ import 'react';
@@ -2,13 +2,22 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkRZK3BIEOjs = require('../../chunk-RZK3BIEO.js');
5
+ var _chunkMXW3YHBEjs = require('../../chunk-MXW3YHBE.js');
6
+
7
+
8
+ var _chunkWDAFEOSVjs = require('../../chunk-WDAFEOSV.js');
9
+ require('../../chunk-FBL47PXS.js');
6
10
 
7
11
 
8
12
  var _chunkJ42JQYBYjs = require('../../chunk-J42JQYBY.js');
9
13
 
10
14
 
15
+ var _chunk7T4E5A7Mjs = require('../../chunk-7T4E5A7M.js');
16
+
17
+
18
+
19
+
11
20
 
12
21
 
13
22
 
14
- exports.ThemeContext = _chunkRZK3BIEOjs.ThemeContext; exports.ThemeManager = _chunkJ42JQYBYjs.ThemeManager; exports.ThemeProvider = _chunkRZK3BIEOjs.ThemeProvider; exports.useTheme = _chunkRZK3BIEOjs.useTheme;
23
+ exports.ThemeContext = _chunkMXW3YHBEjs.ThemeContext; exports.ThemeManager = _chunkJ42JQYBYjs.ThemeManager; exports.ThemeProvider = _chunkMXW3YHBEjs.ThemeProvider; exports.defaultTheme = _chunkWDAFEOSVjs.defaultTheme; exports.heartTheme = _chunk7T4E5A7Mjs.heartTheme; exports.useTheme = _chunkMXW3YHBEjs.useTheme;
@@ -0,0 +1,6 @@
1
+ import { Theme } from './types.js';
2
+ import 'react';
3
+
4
+ declare const heartTheme: Theme;
5
+
6
+ export { heartTheme as default, heartTheme };
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunk7T4E5A7Mjs = require('../../../chunk-7T4E5A7M.js');
5
+
6
+
7
+
8
+ exports.default = _chunk7T4E5A7Mjs.heart_default; exports.heartTheme = _chunk7T4E5A7Mjs.heartTheme;
@@ -0,0 +1,8 @@
1
+ import { Theme } from './types.js';
2
+ export { CSSVariableTheme, DeepMapObjectLeafs, ThemeKey, TypographyFont } from './types.js';
3
+ export { default as heartTheme } from './heart.js';
4
+ import 'react';
5
+
6
+ declare const defaultTheme: Theme;
7
+
8
+ export { Theme, defaultTheme };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkWDAFEOSVjs = require('../../../chunk-WDAFEOSV.js');
4
+ require('../../../chunk-FBL47PXS.js');
5
+
6
+
7
+ var _chunk7T4E5A7Mjs = require('../../../chunk-7T4E5A7M.js');
8
+
9
+
10
+
11
+ exports.defaultTheme = _chunkWDAFEOSVjs.defaultTheme; exports.heartTheme = _chunk7T4E5A7Mjs.heartTheme;
@@ -0,0 +1,231 @@
1
+ import { CSSProperties } 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 = CSSProperties;
18
+ type Hex = string;
19
+ type TypographyFont = {
20
+ fontFamily: KaizenCSSProperties["fontFamily"];
21
+ fontWeight: KaizenCSSProperties["fontWeight"];
22
+ fontSize: KaizenCSSProperties["fontSize"];
23
+ lineHeight: KaizenCSSProperties["lineHeight"];
24
+ letterSpacing: KaizenCSSProperties["letterSpacing"];
25
+ };
26
+ type ThemeKey = "heart" | "custom";
27
+ type Theme = {
28
+ themeKey: ThemeKey;
29
+ border: {
30
+ solid: {
31
+ borderWidth: KaizenCSSProperties["borderWidth"];
32
+ borderRadius: KaizenCSSProperties["borderRadius"];
33
+ borderStyle: KaizenCSSProperties["borderStyle"];
34
+ borderColor: KaizenCSSProperties["borderColor"];
35
+ };
36
+ dashed: {
37
+ borderWidth: KaizenCSSProperties["borderWidth"];
38
+ borderRadius: KaizenCSSProperties["borderRadius"];
39
+ borderStyle: KaizenCSSProperties["borderStyle"];
40
+ };
41
+ borderless: {
42
+ borderWidth: KaizenCSSProperties["borderWidth"];
43
+ borderRadius: KaizenCSSProperties["borderRadius"];
44
+ borderStyle: KaizenCSSProperties["borderStyle"];
45
+ borderColor: KaizenCSSProperties["borderColor"];
46
+ };
47
+ focusRing: {
48
+ borderWidth: KaizenCSSProperties["borderWidth"];
49
+ borderRadius: KaizenCSSProperties["borderRadius"];
50
+ borderStyle: KaizenCSSProperties["borderStyle"];
51
+ };
52
+ };
53
+ animation: {
54
+ easingFunction: {
55
+ easeInOut: string;
56
+ easeIn: string;
57
+ easeOut: string;
58
+ linear: string;
59
+ bounceIn: string;
60
+ bounceOut: string;
61
+ bounceInOut: string;
62
+ };
63
+ duration: {
64
+ instant: string;
65
+ immediate: string;
66
+ rapid: string;
67
+ fast: string;
68
+ slow: string;
69
+ deliberate: string;
70
+ };
71
+ };
72
+ color: {
73
+ purple: {
74
+ "100": Hex;
75
+ "200": Hex;
76
+ "300": Hex;
77
+ "400": Hex;
78
+ "500": Hex;
79
+ "600": Hex;
80
+ "700": Hex;
81
+ "800": Hex;
82
+ };
83
+ blue: {
84
+ "100": Hex;
85
+ "200": Hex;
86
+ "300": Hex;
87
+ "400": Hex;
88
+ "500": Hex;
89
+ "600": Hex;
90
+ "700": Hex;
91
+ };
92
+ green: {
93
+ "100": Hex;
94
+ "200": Hex;
95
+ "300": Hex;
96
+ "400": Hex;
97
+ "500": Hex;
98
+ "600": Hex;
99
+ "700": Hex;
100
+ };
101
+ yellow: {
102
+ "100": Hex;
103
+ "200": Hex;
104
+ "300": Hex;
105
+ "400": Hex;
106
+ "500": Hex;
107
+ "600": Hex;
108
+ "700": Hex;
109
+ };
110
+ red: {
111
+ "100": Hex;
112
+ "200": Hex;
113
+ "300": Hex;
114
+ "400": Hex;
115
+ "500": Hex;
116
+ "600": Hex;
117
+ "700": Hex;
118
+ };
119
+ orange: {
120
+ "100": Hex;
121
+ "200": Hex;
122
+ "300": Hex;
123
+ "400": Hex;
124
+ "500": Hex;
125
+ "600": Hex;
126
+ "700": Hex;
127
+ };
128
+ gray: {
129
+ "100": Hex;
130
+ "200": Hex;
131
+ "300": Hex;
132
+ "400": Hex;
133
+ "500": Hex;
134
+ "600": Hex;
135
+ };
136
+ white: Hex;
137
+ };
138
+ dataViz: {
139
+ favorable: Hex;
140
+ unfavorable: Hex;
141
+ };
142
+ layout: {
143
+ contentMaxWidth: string;
144
+ contentMaxWidthWithSidebar: string;
145
+ contentSideMargin: string;
146
+ mobileActionsDrawerHeight: string;
147
+ navigationBarHeight: string;
148
+ breakpoints: {
149
+ medium: string;
150
+ large: string;
151
+ };
152
+ };
153
+ shadow: {
154
+ small: {
155
+ boxShadow: string;
156
+ };
157
+ large: {
158
+ boxShadow: string;
159
+ };
160
+ };
161
+ spacing: {
162
+ xs: string;
163
+ sm: string;
164
+ md: string;
165
+ lg: string;
166
+ xl: string;
167
+ xxl: string;
168
+ xxxl: string;
169
+ xxxxl: string;
170
+ xxxxxl: string;
171
+ 0: string;
172
+ 1: string;
173
+ 2: string;
174
+ 4: string;
175
+ 6: string;
176
+ 8: string;
177
+ 12: string;
178
+ 16: string;
179
+ 24: string;
180
+ 32: string;
181
+ 40: string;
182
+ 48: string;
183
+ 56: string;
184
+ 64: string;
185
+ 72: string;
186
+ 80: string;
187
+ 96: string;
188
+ 112: string;
189
+ 128: string;
190
+ 160: string;
191
+ 200: string;
192
+ 240: string;
193
+ 280: string;
194
+ 320: string;
195
+ };
196
+ typography: {
197
+ dataLarge: TypographyFont;
198
+ dataLargeUnits: TypographyFont;
199
+ dataMedium: TypographyFont;
200
+ dataMediumUnits: TypographyFont;
201
+ dataSmall: TypographyFont;
202
+ dataSmallUnits: TypographyFont;
203
+ display0: TypographyFont;
204
+ heading1: TypographyFont;
205
+ heading2: TypographyFont;
206
+ heading3: TypographyFont;
207
+ heading4: TypographyFont;
208
+ heading5: TypographyFont;
209
+ heading6: TypographyFont;
210
+ paragraphIntroLede: TypographyFont;
211
+ paragraphBody: TypographyFont;
212
+ paragraphSmall: TypographyFont;
213
+ paragraphExtraSmall: TypographyFont;
214
+ paragraphBold: {
215
+ fontWeight: KaizenCSSProperties["fontWeight"];
216
+ };
217
+ buttonPrimary: TypographyFont;
218
+ buttonSecondary: TypographyFont;
219
+ };
220
+ };
221
+ type DeepMapObjectLeafs<T, LeafType> = T extends string | number | bigint | boolean | symbol | null | undefined | ((...params: any[]) => any) ? LeafType : T extends Record<any, any> ? {
222
+ [Key in keyof T]: DeepMapObjectLeafs<T[Key], LeafType>;
223
+ } : T;
224
+ /**
225
+ * Apologies for the complex types.
226
+ * 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.
227
+ * 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)`.
228
+ */
229
+ type CSSVariableTheme = DeepMapObjectLeafs<Theme, string>;
230
+
231
+ export { CSSVariableTheme, DeepMapObjectLeafs, Theme, ThemeKey, TypographyFont };
@@ -0,0 +1 @@
1
+ "use strict";require('../../../chunk-FBL47PXS.js');
@@ -1,4 +1,8 @@
1
1
  export { a as KaizenProvider, K as KaizenProviderProps } from '../KaizenProvider-af031107.js';
2
+ export { T as ThemeContext, a as ThemeProvider, u as useTheme } from '../ThemeProvider-7786826c.js';
3
+ export { ThemeManager } from './ThemeProvider/ThemeManager.js';
4
+ export { defaultTheme } from './ThemeProvider/themes/index.js';
5
+ export { default as heartTheme } from './ThemeProvider/themes/heart.js';
6
+ export { CSSVariableTheme, DeepMapObjectLeafs, Theme, ThemeKey, TypographyFont } from './ThemeProvider/themes/types.js';
2
7
  import 'react';
3
- import './ThemeProvider/ThemeManager.js';
4
8
  import '@kaizen/design-tokens';
@@ -1,8 +1,27 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkHO4BDPVXjs = require('../chunk-HO4BDPVX.js');
4
- require('../chunk-RZK3BIEO.js');
5
- require('../chunk-J42JQYBY.js');
3
+ var _chunk7ZAJ7755js = require('../chunk-7ZAJ7755.js');
6
4
 
7
5
 
8
- exports.KaizenProvider = _chunkHO4BDPVXjs.KaizenProvider;
6
+
7
+
8
+ var _chunkMXW3YHBEjs = require('../chunk-MXW3YHBE.js');
9
+
10
+
11
+ var _chunkWDAFEOSVjs = require('../chunk-WDAFEOSV.js');
12
+ require('../chunk-FBL47PXS.js');
13
+
14
+
15
+ var _chunkJ42JQYBYjs = require('../chunk-J42JQYBY.js');
16
+
17
+
18
+ var _chunk7T4E5A7Mjs = require('../chunk-7T4E5A7M.js');
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+ exports.KaizenProvider = _chunk7ZAJ7755js.KaizenProvider; exports.ThemeContext = _chunkMXW3YHBEjs.ThemeContext; exports.ThemeManager = _chunkJ42JQYBYjs.ThemeManager; exports.ThemeProvider = _chunkMXW3YHBEjs.ThemeProvider; exports.defaultTheme = _chunkWDAFEOSVjs.defaultTheme; exports.heartTheme = _chunk7T4E5A7Mjs.heartTheme; exports.useTheme = _chunkMXW3YHBEjs.useTheme;
@@ -0,0 +1,17 @@
1
+ import * as _kaizen_design_tokens from '@kaizen/design-tokens';
2
+ import React, { Context } from 'react';
3
+ import { ThemeManager } from './KaizenProvider/ThemeProvider/ThemeManager.js';
4
+ import { Theme } from './KaizenProvider/ThemeProvider/themes/types.js';
5
+
6
+ declare const ThemeContext: Context<Theme>;
7
+ /**
8
+ * Wrap your application in this provider using a ThemeManager, to synchronise it with a react context.
9
+ * This allows child react elements to more easily use theme variables, using the {@link useTheme} hook.
10
+ */
11
+ declare const ThemeProvider: ({ themeManager, ...props }: {
12
+ themeManager?: ThemeManager<_kaizen_design_tokens.Theme> | undefined;
13
+ children: React.ReactNode;
14
+ }) => JSX.Element;
15
+ declare const useTheme: () => Theme;
16
+
17
+ export { ThemeContext as T, ThemeProvider as a, useTheme as u };