@zendeskgarden/react-theming 9.0.0-next.4 → 9.0.0-next.6

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.
@@ -4,7 +4,6 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- /** @ignore */
8
7
  declare const PALETTE: {
9
8
  black: string;
10
9
  white: string;
@@ -28,6 +27,10 @@ declare const PALETTE: {
28
27
  600: string;
29
28
  700: string;
30
29
  800: string;
30
+ 900: string;
31
+ 1000: string;
32
+ 1100: string;
33
+ 1200: string;
31
34
  };
32
35
  blue: {
33
36
  100: string;
@@ -38,6 +41,10 @@ declare const PALETTE: {
38
41
  600: string;
39
42
  700: string;
40
43
  800: string;
44
+ 900: string;
45
+ 1000: string;
46
+ 1100: string;
47
+ 1200: string;
41
48
  };
42
49
  red: {
43
50
  100: string;
@@ -48,6 +55,10 @@ declare const PALETTE: {
48
55
  600: string;
49
56
  700: string;
50
57
  800: string;
58
+ 900: string;
59
+ 1000: string;
60
+ 1100: string;
61
+ 1200: string;
51
62
  };
52
63
  yellow: {
53
64
  100: string;
@@ -58,6 +69,10 @@ declare const PALETTE: {
58
69
  600: string;
59
70
  700: string;
60
71
  800: string;
72
+ 900: string;
73
+ 1000: string;
74
+ 1100: string;
75
+ 1200: string;
61
76
  };
62
77
  green: {
63
78
  100: string;
@@ -68,6 +83,10 @@ declare const PALETTE: {
68
83
  600: string;
69
84
  700: string;
70
85
  800: string;
86
+ 900: string;
87
+ 1000: string;
88
+ 1100: string;
89
+ 1200: string;
71
90
  };
72
91
  kale: {
73
92
  100: string;
@@ -78,73 +97,186 @@ declare const PALETTE: {
78
97
  600: string;
79
98
  700: string;
80
99
  800: string;
100
+ 900: string;
101
+ 1000: string;
102
+ 1100: string;
103
+ 1200: string;
81
104
  };
82
105
  fuschia: {
106
+ 100: string;
107
+ 200: string;
108
+ 300: string;
83
109
  400: string;
110
+ 500: string;
84
111
  600: string;
112
+ 700: string;
113
+ 800: string;
114
+ 900: string;
115
+ 1000: string;
116
+ 1100: string;
117
+ 1200: string;
85
118
  M400: string;
86
119
  M600: string;
87
120
  };
88
121
  pink: {
122
+ 100: string;
123
+ 200: string;
124
+ 300: string;
89
125
  400: string;
126
+ 500: string;
90
127
  600: string;
128
+ 700: string;
129
+ 800: string;
130
+ 900: string;
131
+ 1000: string;
132
+ 1100: string;
133
+ 1200: string;
91
134
  M400: string;
92
135
  M600: string;
93
136
  };
94
137
  crimson: {
138
+ 100: string;
139
+ 200: string;
140
+ 300: string;
95
141
  400: string;
142
+ 500: string;
96
143
  600: string;
144
+ 700: string;
145
+ 800: string;
146
+ 900: string;
147
+ 1000: string;
148
+ 1100: string;
149
+ 1200: string;
97
150
  M400: string;
98
151
  M600: string;
99
152
  };
100
153
  orange: {
154
+ 100: string;
155
+ 200: string;
156
+ 300: string;
101
157
  400: string;
158
+ 500: string;
102
159
  600: string;
160
+ 700: string;
161
+ 800: string;
162
+ 900: string;
163
+ 1000: string;
164
+ 1100: string;
165
+ 1200: string;
103
166
  M400: string;
104
167
  M600: string;
105
168
  };
106
169
  lemon: {
170
+ 100: string;
171
+ 200: string;
172
+ 300: string;
107
173
  400: string;
174
+ 500: string;
108
175
  600: string;
176
+ 700: string;
177
+ 800: string;
178
+ 900: string;
179
+ 1000: string;
180
+ 1100: string;
181
+ 1200: string;
109
182
  M400: string;
110
183
  M600: string;
111
184
  };
112
185
  lime: {
186
+ 100: string;
187
+ 200: string;
188
+ 300: string;
113
189
  400: string;
190
+ 500: string;
114
191
  600: string;
192
+ 700: string;
193
+ 800: string;
194
+ 900: string;
195
+ 1000: string;
196
+ 1100: string;
197
+ 1200: string;
115
198
  M400: string;
116
199
  M600: string;
117
200
  };
118
201
  mint: {
202
+ 100: string;
203
+ 200: string;
204
+ 300: string;
119
205
  400: string;
206
+ 500: string;
120
207
  600: string;
208
+ 700: string;
209
+ 800: string;
210
+ 900: string;
211
+ 1000: string;
212
+ 1100: string;
213
+ 1200: string;
121
214
  M400: string;
122
215
  M600: string;
123
216
  };
124
217
  teal: {
218
+ 100: string;
219
+ 200: string;
220
+ 300: string;
125
221
  400: string;
222
+ 500: string;
126
223
  600: string;
224
+ 700: string;
225
+ 800: string;
226
+ 900: string;
227
+ 1000: string;
228
+ 1100: string;
229
+ 1200: string;
127
230
  M400: string;
128
231
  M600: string;
129
232
  };
130
233
  azure: {
234
+ 100: string;
235
+ 200: string;
236
+ 300: string;
131
237
  400: string;
238
+ 500: string;
132
239
  600: string;
240
+ 700: string;
241
+ 800: string;
242
+ 900: string;
243
+ 1000: string;
244
+ 1100: string;
245
+ 1200: string;
133
246
  M400: string;
134
247
  M600: string;
135
248
  };
136
249
  royal: {
250
+ 100: string;
251
+ 200: string;
252
+ 300: string;
137
253
  400: string;
254
+ 500: string;
138
255
  600: string;
256
+ 700: string;
257
+ 800: string;
258
+ 900: string;
259
+ 1000: string;
260
+ 1100: string;
261
+ 1200: string;
139
262
  M400: string;
140
263
  M600: string;
141
264
  };
142
265
  purple: {
266
+ 100: string;
267
+ 200: string;
268
+ 300: string;
143
269
  400: string;
270
+ 500: string;
144
271
  600: string;
272
+ 700: string;
273
+ 800: string;
274
+ 900: string;
275
+ 1000: string;
276
+ 1100: string;
277
+ 1200: string;
145
278
  M400: string;
146
279
  M600: string;
147
280
  };
148
281
  };
149
- /** @component */
150
282
  export default PALETTE;
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /** @deprecated INTERNAL ONLY – DO NOT USE */
8
+ declare const PALETTE_V8: {
9
+ black: string;
10
+ white: string;
11
+ product: {
12
+ support: string;
13
+ message: string;
14
+ explore: string;
15
+ gather: string;
16
+ guide: string;
17
+ connect: string;
18
+ chat: string;
19
+ talk: string;
20
+ sell: string;
21
+ };
22
+ grey: {
23
+ 100: string;
24
+ 200: string;
25
+ 300: string;
26
+ 400: string;
27
+ 500: string;
28
+ 600: string;
29
+ 700: string;
30
+ 800: string;
31
+ };
32
+ blue: {
33
+ 100: string;
34
+ 200: string;
35
+ 300: string;
36
+ 400: string;
37
+ 500: string;
38
+ 600: string;
39
+ 700: string;
40
+ 800: string;
41
+ };
42
+ red: {
43
+ 100: string;
44
+ 200: string;
45
+ 300: string;
46
+ 400: string;
47
+ 500: string;
48
+ 600: string;
49
+ 700: string;
50
+ 800: string;
51
+ };
52
+ yellow: {
53
+ 100: string;
54
+ 200: string;
55
+ 300: string;
56
+ 400: string;
57
+ 500: string;
58
+ 600: string;
59
+ 700: string;
60
+ 800: string;
61
+ };
62
+ green: {
63
+ 100: string;
64
+ 200: string;
65
+ 300: string;
66
+ 400: string;
67
+ 500: string;
68
+ 600: string;
69
+ 700: string;
70
+ 800: string;
71
+ };
72
+ kale: {
73
+ 100: string;
74
+ 200: string;
75
+ 300: string;
76
+ 400: string;
77
+ 500: string;
78
+ 600: string;
79
+ 700: string;
80
+ 800: string;
81
+ };
82
+ fuschia: {
83
+ 400: string;
84
+ 600: string;
85
+ M400: string;
86
+ M600: string;
87
+ };
88
+ pink: {
89
+ 400: string;
90
+ 600: string;
91
+ M400: string;
92
+ M600: string;
93
+ };
94
+ crimson: {
95
+ 400: string;
96
+ 600: string;
97
+ M400: string;
98
+ M600: string;
99
+ };
100
+ orange: {
101
+ 400: string;
102
+ 600: string;
103
+ M400: string;
104
+ M600: string;
105
+ };
106
+ lemon: {
107
+ 400: string;
108
+ 600: string;
109
+ M400: string;
110
+ M600: string;
111
+ };
112
+ lime: {
113
+ 400: string;
114
+ 600: string;
115
+ M400: string;
116
+ M600: string;
117
+ };
118
+ mint: {
119
+ 400: string;
120
+ 600: string;
121
+ M400: string;
122
+ M600: string;
123
+ };
124
+ teal: {
125
+ 400: string;
126
+ 600: string;
127
+ M400: string;
128
+ M600: string;
129
+ };
130
+ azure: {
131
+ 400: string;
132
+ 600: string;
133
+ M400: string;
134
+ M600: string;
135
+ };
136
+ royal: {
137
+ 400: string;
138
+ 600: string;
139
+ M400: string;
140
+ M600: string;
141
+ };
142
+ purple: {
143
+ 400: string;
144
+ 600: string;
145
+ M400: string;
146
+ M600: string;
147
+ };
148
+ };
149
+ export default PALETTE_V8;
@@ -6,5 +6,4 @@
6
6
  */
7
7
  import { IGardenTheme } from '../../types';
8
8
  declare const DEFAULT_THEME: IGardenTheme;
9
- /** @component */
10
9
  export default DEFAULT_THEME;
@@ -7,9 +7,11 @@
7
7
  export { ThemeProvider } from './elements/ThemeProvider';
8
8
  export { default as DEFAULT_THEME } from './elements/theme';
9
9
  export { default as PALETTE } from './elements/palette';
10
+ export { default as PALETTE_V8 } from './elements/palette/v8';
10
11
  export { default as retrieveComponentStyles } from './utils/retrieveComponentStyles';
11
12
  export { getArrowPosition } from './utils/getArrowPosition';
12
13
  export { getColor } from './utils/getColor';
14
+ export { getColorV8 } from './utils/getColorV8';
13
15
  export { getFloatingPlacements } from './utils/getFloatingPlacements';
14
16
  export { getFocusBoxShadow } from './utils/getFocusBoxShadow';
15
17
  export { default as getLineHeight } from './utils/getLineHeight';
@@ -12,7 +12,7 @@ export declare const MENU_POSITION: readonly ["top", "right", "bottom", "left"];
12
12
  export type MenuPosition = (typeof MENU_POSITION)[number];
13
13
  export declare const PLACEMENT: readonly ["top", "top-start", "top-end", "bottom", "bottom-start", "bottom-end", "end", "end-top", "end-bottom", "start", "start-top", "start-bottom"];
14
14
  export type Placement = (typeof PLACEMENT)[number];
15
- type Hue = Record<number | string, string> | string;
15
+ export type Hue = Record<number | string, string> | string;
16
16
  export interface IGardenTheme {
17
17
  rtl: boolean;
18
18
  document?: any;
@@ -41,14 +41,24 @@ export interface IGardenTheme {
41
41
  };
42
42
  colors: {
43
43
  base: 'light' | 'dark';
44
- background: string;
45
- foreground: string;
46
44
  primaryHue: string;
47
45
  dangerHue: string;
48
46
  warningHue: string;
49
47
  successHue: string;
50
48
  neutralHue: string;
51
49
  chromeHue: string;
50
+ variables: {
51
+ dark: {
52
+ background: Record<string, string>;
53
+ border: Record<string, string>;
54
+ foreground: Record<string, string>;
55
+ };
56
+ light: {
57
+ background: Record<string, string>;
58
+ border: Record<string, string>;
59
+ foreground: Record<string, string>;
60
+ };
61
+ };
52
62
  };
53
63
  components: Record<string, any>;
54
64
  fonts: {
@@ -88,6 +98,7 @@ export interface IGardenTheme {
88
98
  xxl: string;
89
99
  xxxl: string;
90
100
  };
101
+ palette: Record<string, Hue>;
91
102
  shadowWidths: {
92
103
  xs: string;
93
104
  sm: string;
@@ -109,7 +120,6 @@ export interface IGardenTheme {
109
120
  xl: string;
110
121
  xxl: string;
111
122
  };
112
- palette: Record<string, Hue>;
113
123
  }
114
124
  export interface IThemeProviderProps extends Partial<ThemeProviderProps<IGardenTheme>> {
115
125
  /**
@@ -126,4 +136,3 @@ export interface IThemeProviderProps extends Partial<ThemeProviderProps<IGardenT
126
136
  */
127
137
  focusVisibleRef?: React.RefObject<HTMLElement> | null;
128
138
  }
129
- export {};
@@ -5,21 +5,47 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  /// <reference types="lodash" />
8
- import { DefaultTheme } from 'styled-components';
9
- export type Hue = Record<number | string, string> | string;
10
- export declare const DEFAULT_SHADE = 600;
8
+ import { IGardenTheme } from '../types';
9
+ type ColorParameters = {
10
+ dark?: {
11
+ hue?: string;
12
+ offset?: number;
13
+ shade?: number;
14
+ transparency?: number;
15
+ };
16
+ hue?: string;
17
+ light?: {
18
+ hue?: string;
19
+ offset?: number;
20
+ shade?: number;
21
+ transparency?: number;
22
+ };
23
+ offset?: number;
24
+ shade?: number;
25
+ theme: IGardenTheme;
26
+ transparency?: number;
27
+ variable?: string;
28
+ };
11
29
  /**
12
- * Get the palette color for the given hue, shade, and theme.
30
+ * Get a color value from the theme. Variable lookup takes precedence, followed
31
+ * by `dark` and `light` object values. If none of these are provided, `hue`,
32
+ * `shade`, `offset`, and `transparency` are used as fallbacks to determine the
33
+ * color.
13
34
  *
14
- * @param {string|Object} hue A `theme.palette` hue or one of the following `theme.colors` keys:
35
+ * @param {Object} [options.theme] Provides values used to resolve the desired color
36
+ * @param {string} [options.variable] A variable key (i.e. `'background.default'`) used to resolve a color value for the theme color base
37
+ * @param {Object} [options.dark] An object with `hue`, `shade`, `offset`, and `transparency` values to be used in dark mode
38
+ * @param {Object} [options.light] An object with `hue`, `shade`, `offset`, and `transparency` values to be used in light mode
39
+ * @param {string} [options.hue] A `theme.palette` hue or one of the following `theme.colors` keys:
15
40
  * - `'primaryHue'` = `theme.colors.primaryHue`
16
41
  * - `'dangerHue'` = `theme.colors.dangerHue`
17
42
  * - `'warningHue'` = `theme.colors.warningHue`
18
43
  * - `'successHue'` = `theme.colors.successHue`
19
44
  * - `'neutralHue'` = `theme.colors.neutralHue`
20
45
  * - `'chromeHue'` = `theme.colors.chromeHue`
21
- * @param {number} [shade=DEFAULT_SHADE] A hue shade.
22
- * @param {Object} theme Context `theme` object.
23
- * @param {Number} [transparency] An alpha-channel value between 0 and 1.
46
+ * @param {number} [options.shade] A hue shade
47
+ * @param {number} [options.offset] A positive or negative value to adjust the shade
48
+ * @param {number} [options.transparency] An alpha-channel value between 0 and 1
24
49
  */
25
- export declare const getColor: ((hue: Hue, shade?: number, theme?: DefaultTheme, transparency?: number) => string | undefined) & import("lodash").MemoizedFunction;
50
+ export declare const getColor: (({ dark, hue, light, offset, shade, theme, transparency, variable }: ColorParameters) => string) & import("lodash").MemoizedFunction;
51
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright Zendesk, Inc.
3
+ *
4
+ * Use of this source code is governed under the Apache License, Version 2.0
5
+ * found at http://www.apache.org/licenses/LICENSE-2.0.
6
+ */
7
+ /// <reference types="lodash" />
8
+ import { Hue } from '../types';
9
+ import { DefaultTheme } from 'styled-components';
10
+ export declare const DEFAULT_SHADE = 600;
11
+ /**
12
+ * @deprecated Use `getColor` instead.
13
+ *
14
+ * Get the palette color for the given hue, shade, and theme.
15
+ *
16
+ * @param {string|Object} hue A `theme.palette` hue or one of the following `theme.colors` keys:
17
+ * - `'primaryHue'` = `theme.colors.primaryHue`
18
+ * - `'dangerHue'` = `theme.colors.dangerHue`
19
+ * - `'warningHue'` = `theme.colors.warningHue`
20
+ * - `'successHue'` = `theme.colors.successHue`
21
+ * - `'neutralHue'` = `theme.colors.neutralHue`
22
+ * - `'chromeHue'` = `theme.colors.chromeHue`
23
+ * @param {number} [shade=DEFAULT_SHADE] A hue shade.
24
+ * @param {Object} theme Context `theme` object.
25
+ * @param {Number} [transparency] An alpha-channel value between 0 and 1.
26
+ */
27
+ export declare const getColorV8: ((hue: Hue, shade?: number, theme?: DefaultTheme, transparency?: number) => string | undefined) & import("lodash").MemoizedFunction;
@@ -4,8 +4,7 @@
4
4
  * Use of this source code is governed under the Apache License, Version 2.0
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
- import { IGardenTheme } from '../types';
8
- import { Hue } from './getColor';
7
+ import { Hue, IGardenTheme } from '../types';
9
8
  export type FocusBoxShadowParameters = {
10
9
  boxShadow?: string;
11
10
  inset?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-theming",
3
- "version": "9.0.0-next.4",
3
+ "version": "9.0.0-next.6",
4
4
  "description": "Theming utilities and components within the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -24,6 +24,8 @@
24
24
  "@floating-ui/react-dom": "^2.0.0",
25
25
  "@zendeskgarden/container-focusvisible": "^2.0.0",
26
26
  "@zendeskgarden/container-utilities": "^2.0.0",
27
+ "chroma-js": "^2.4.2",
28
+ "lodash.get": "^4.4.2",
27
29
  "lodash.memoize": "^4.1.2",
28
30
  "polished": "^4.0.0",
29
31
  "prop-types": "^15.5.7"
@@ -31,9 +33,11 @@
31
33
  "peerDependencies": {
32
34
  "react": ">=16.8.0",
33
35
  "react-dom": ">=16.8.0",
34
- "styled-components": "^4.2.0 || ^5.1.0"
36
+ "styled-components": "^4.2.0 || ^5.3.1"
35
37
  },
36
38
  "devDependencies": {
39
+ "@types/chroma-js": "2.4.4",
40
+ "@types/lodash.get": "4.4.9",
37
41
  "@types/lodash.memoize": "4.1.9"
38
42
  },
39
43
  "keywords": [
@@ -46,5 +50,5 @@
46
50
  "access": "public"
47
51
  },
48
52
  "zendeskgarden:src": "src/index.ts",
49
- "gitHead": "749220247e3a22d2d502dcb3691d81e6a3d52b02"
53
+ "gitHead": "45c56ad1c73af40afba8e5415f529a2c9601c83f"
50
54
  }