@zendeskgarden/react-theming 9.0.0-next.7 → 9.0.0-next.9

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 (34) hide show
  1. package/dist/esm/elements/ThemeProvider.js +24 -0
  2. package/dist/esm/elements/palette/index.js +259 -0
  3. package/dist/esm/elements/palette/v8.js +149 -0
  4. package/dist/esm/elements/theme/index.js +224 -0
  5. package/dist/esm/index.js +28 -0
  6. package/dist/esm/types/index.js +11 -0
  7. package/dist/esm/utils/StyledBaseIcon.js +22 -0
  8. package/dist/esm/utils/arrowStyles.js +64 -0
  9. package/dist/esm/utils/focusStyles.js +43 -0
  10. package/dist/esm/utils/getArrowPosition.js +35 -0
  11. package/dist/esm/utils/getCheckeredBackground.js +40 -0
  12. package/dist/esm/utils/getColor.js +153 -0
  13. package/dist/esm/utils/getColorV8.js +72 -0
  14. package/dist/esm/utils/getFloatingPlacements.js +58 -0
  15. package/dist/esm/utils/getFocusBoxShadow.js +45 -0
  16. package/dist/esm/utils/getLineHeight.js +22 -0
  17. package/dist/esm/utils/getMenuPosition.js +11 -0
  18. package/dist/esm/utils/mediaQuery.js +56 -0
  19. package/dist/esm/utils/menuStyles.js +63 -0
  20. package/dist/esm/utils/retrieveComponentStyles.js +19 -0
  21. package/dist/esm/utils/useDocument.js +21 -0
  22. package/dist/esm/utils/useText.js +29 -0
  23. package/dist/esm/utils/useWindow.js +21 -0
  24. package/dist/index.cjs.js +372 -262
  25. package/dist/typings/elements/palette/index.d.ts +0 -24
  26. package/dist/typings/index.d.ts +3 -1
  27. package/dist/typings/types/index.d.ts +43 -1
  28. package/dist/typings/utils/StyledBaseIcon.d.ts +8 -0
  29. package/dist/typings/utils/focusStyles.d.ts +1 -8
  30. package/dist/typings/utils/getCheckeredBackground.d.ts +20 -0
  31. package/dist/typings/utils/getColor.d.ts +3 -24
  32. package/dist/typings/utils/getFocusBoxShadow.d.ts +6 -20
  33. package/package.json +3 -3
  34. package/dist/index.esm.js +0 -1145
package/dist/index.cjs.js CHANGED
@@ -1,14 +1,13 @@
1
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
-
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
+ */
8
7
  'use strict';
9
8
 
10
9
  var React = require('react');
11
- var styledComponents = require('styled-components');
10
+ var styled = require('styled-components');
12
11
  var chromaJs = require('chroma-js');
13
12
  var polished = require('polished');
14
13
  var get = require('lodash.get');
@@ -17,297 +16,259 @@ var memoize = require('lodash.memoize');
17
16
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
18
17
 
19
18
  var React__default = /*#__PURE__*/_interopDefault(React);
19
+ var styled__default = /*#__PURE__*/_interopDefault(styled);
20
20
  var get__default = /*#__PURE__*/_interopDefault(get);
21
21
  var memoize__default = /*#__PURE__*/_interopDefault(memoize);
22
22
 
23
- function _extends() {
24
- _extends = Object.assign ? Object.assign.bind() : function (target) {
25
- for (var i = 1; i < arguments.length; i++) {
26
- var source = arguments[i];
27
- for (var key in source) {
28
- if (Object.prototype.hasOwnProperty.call(source, key)) {
29
- target[key] = source[key];
30
- }
31
- }
32
- }
33
- return target;
34
- };
35
- return _extends.apply(this, arguments);
36
- }
37
-
38
23
  const PALETTE = {
39
24
  black: '#000',
40
25
  white: '#fff',
41
26
  product: {
42
27
  support: '#00a656',
43
- message: '#37b8af',
44
28
  explore: '#30aabc',
45
29
  gather: '#f6c8be',
46
30
  guide: '#eb4962',
47
- connect: '#ff6224',
48
31
  chat: '#f79a3e',
49
32
  talk: '#efc93d',
50
33
  sell: '#c38f00'
51
34
  },
52
35
  grey: {
53
- 100: '#f4f6f6',
54
- 200: '#e4e7e9',
55
- 300: '#c7cdd0',
56
- 400: '#afb7bd',
57
- 500: '#88929d',
58
- 600: '#7f8a95',
59
- 700: '#65707a',
60
- 800: '#4b565f',
61
- 900: '#2e373f',
62
- 1000: '#1e252a',
63
- 1100: '#171b1f',
64
- 1200: '#101316'
36
+ 100: '#f8f9f9',
37
+ 200: '#e8eaec',
38
+ 300: '#d8dcde',
39
+ 400: '#b0b8be',
40
+ 500: '#919ca5',
41
+ 600: '#848f99',
42
+ 700: '#5c6970',
43
+ 800: '#39434b',
44
+ 900: '#293239',
45
+ 1000: '#1c2227',
46
+ 1100: '#151a1e',
47
+ 1200: '#0a0d0e'
65
48
  },
66
49
  blue: {
67
50
  100: '#edf7ff',
68
- 200: '#d9eaf7',
69
- 300: '#b3d0e7',
70
- 400: '#92bbdb',
71
- 500: '#5896c9',
72
- 600: '#4b8ec5',
51
+ 200: '#ddecf8',
52
+ 300: '#cce0f1',
53
+ 400: '#93bcdc',
54
+ 500: '#66a0cd',
55
+ 600: '#2694d6',
73
56
  700: '#1f73b7',
74
- 800: '#18578b',
75
- 900: '#103859',
76
- 1000: '#0b253b',
77
- 1100: '#081c2d',
78
- 1200: '#061420'
57
+ 800: '#13456d',
58
+ 900: '#0f3655',
59
+ 1000: '#0a2338',
60
+ 1100: '#061420',
61
+ 1200: '#040d15'
79
62
  },
80
63
  red: {
81
64
  100: '#fff2f3',
82
- 200: '#fde1e3',
83
- 300: '#f5bfc4',
84
- 400: '#f2a0a6',
85
- 500: '#e76973',
86
- 600: '#e35c67',
65
+ 200: '#fee3e5',
66
+ 300: '#f5d5d8',
67
+ 400: '#f2a1a8',
68
+ 500: '#ea7881',
69
+ 600: '#eb5c69',
87
70
  700: '#cd3642',
88
- 800: '#9d2933',
89
- 900: '#6c1219',
90
- 1000: '#431418',
91
- 1100: '#2d1315',
92
- 1200: '#1b1011'
71
+ 800: '#7e1d25',
72
+ 900: '#671219',
73
+ 1000: '#3d1418',
74
+ 1100: '#1d1011',
75
+ 1200: '#100b0c'
93
76
  },
94
77
  yellow: {
95
78
  100: '#fff3e4',
96
- 200: '#ffe2c2',
97
- 300: '#ffc079',
98
- 400: '#fba246',
99
- 500: '#d87916',
100
- 600: '#ce7117',
79
+ 200: '#ffe6cb',
80
+ 300: '#fed6a9',
81
+ 400: '#fca347',
82
+ 500: '#e38215',
83
+ 600: '#d67305',
101
84
  700: '#ac5918',
102
- 800: '#874114',
103
- 900: '#512d17',
104
- 1000: '#312016',
105
- 1100: '#221913',
106
- 1200: '#17120f'
85
+ 800: '#673515',
86
+ 900: '#4c2c17',
87
+ 1000: '#2d1e15',
88
+ 1100: '#18120f',
89
+ 1200: '#0e0c0b'
107
90
  },
108
91
  green: {
109
92
  100: '#eef8f4',
110
- 200: '#d7ede4',
111
- 300: '#b4d3c6',
112
- 400: '#91bfae',
113
- 500: '#3fa17e',
114
- 600: '#329974',
93
+ 200: '#daeee6',
94
+ 300: '#cae3d9',
95
+ 400: '#94c1b0',
96
+ 500: '#4eab89',
97
+ 600: '#26a178',
115
98
  700: '#037f52',
116
- 800: '#186045',
117
- 900: '#0b3e2b',
118
- 1000: '#0c291e',
119
- 1100: '#0b1e17',
120
- 1200: '#0a1511'
99
+ 800: '#104b35',
100
+ 900: '#0b3b29',
101
+ 1000: '#0c261c',
102
+ 1100: '#0a1511',
103
+ 1200: '#080d0c'
121
104
  },
122
105
  kale: {
123
106
  100: '#ecf9f9',
124
- 200: '#d8ebeb',
125
- 300: '#b3d2d0',
126
- 400: '#94bebd',
127
- 500: '#5e9b9c',
128
- 600: '#579394',
107
+ 200: '#daeded',
108
+ 300: '#cbe2e1',
109
+ 400: '#97bfbf',
110
+ 500: '#6ba4a5',
111
+ 600: '#4a9999',
129
112
  700: '#40787a',
130
- 800: '#275c5f',
131
- 900: '#0a3c42',
132
- 1000: '#02282d',
133
- 1100: '#041e22',
134
- 1200: '#061517'
113
+ 800: '#16494f',
114
+ 900: '#063940',
115
+ 1000: '#03252a',
116
+ 1100: '#061517',
117
+ 1200: '#060e0e'
135
118
  },
136
119
  fuschia: {
137
120
  100: '#fbf3f8',
138
- 200: '#f6e2ef',
139
- 300: '#ecc0dc',
140
- 400: '#e3a2cc',
141
- 500: '#d36faf',
142
- 600: '#cf63a8',
121
+ 200: '#f7e6f1',
122
+ 300: '#f2d5e7',
123
+ 400: '#e3a4cc',
124
+ 500: '#d77db7',
125
+ 600: '#d16aac',
143
126
  700: '#b34496',
144
- 800: '#971688',
145
- 900: '#640e59',
146
- 1000: '#430a3d',
147
- 1100: '#34072f',
148
- 1200: '#260523',
149
- M400: '#cf62a8',
150
- M600: '#a8458c'
127
+ 800: '#78116c',
128
+ 900: '#5a0d51',
129
+ 1000: '#3f0939',
130
+ 1100: '#31072c',
131
+ 1200: '#1b0418'
151
132
  },
152
133
  pink: {
153
- 100: '#fcf4f5',
154
- 200: '#f7e3e8',
155
- 300: '#edc1ca',
156
- 400: '#e4a5b3',
157
- 500: '#d57388',
158
- 600: '#e35b72',
134
+ 100: '#fcf3f4',
135
+ 200: '#f7e5e8',
136
+ 300: '#f3d6dc',
137
+ 400: '#e5a6b4',
138
+ 500: '#d98193',
139
+ 600: '#d96b81',
159
140
  700: '#d62054',
160
- 800: '#94304e',
161
- 900: '#611f32',
162
- 1000: '#401522',
163
- 1100: '#31101a',
164
- 1200: '#230b12',
165
- M400: '#d57287',
166
- M600: '#b23a5d'
141
+ 800: '#75263d',
142
+ 900: '#561d2e',
143
+ 1000: '#3c141f',
144
+ 1100: '#2e0f18',
145
+ 1200: '#17080c'
167
146
  },
168
147
  crimson: {
169
- 100: '#fbf4f3',
170
- 200: '#f6e4e1',
171
- 300: '#eac3bc',
172
- 400: '#e1a89e',
173
- 500: '#d1796a',
174
- 600: '#cd6e5d',
148
+ 100: '#fbf3f2',
149
+ 200: '#f7e7e4',
150
+ 300: '#f1d7d2',
151
+ 400: '#e2aaa0',
152
+ 500: '#d58678',
153
+ 600: '#cf7464',
175
154
  700: '#be4938',
176
- 800: '#a32217',
177
- 900: '#6b160f',
178
- 1000: '#480f0a',
179
- 1100: '#370c08',
180
- 1200: '#280806',
181
- M400: '#cc6c5b',
182
- M600: '#b24a3c'
155
+ 800: '#811b12',
156
+ 900: '#61140d',
157
+ 1000: '#440e09',
158
+ 1100: '#340b07',
159
+ 1200: '#1c0604'
183
160
  },
184
161
  orange: {
185
162
  100: '#fdf3ed',
186
- 200: '#f9e3d3',
187
- 300: '#f2c39f',
188
- 400: '#eda671',
189
- 500: '#e2721e',
190
- 600: '#d26e20',
163
+ 200: '#fae7d8',
164
+ 300: '#f7d7be',
165
+ 400: '#eda875',
166
+ 500: '#e58035',
167
+ 600: '#d57428',
191
168
  700: '#af5626',
192
- 800: '#85421d',
193
- 900: '#562b13',
194
- 1000: '#3a1c0d',
195
- 1100: '#2c150a',
196
- 1200: '#1f0f07',
197
- M400: '#d4772c',
198
- M600: '#b35827'
169
+ 800: '#693317',
170
+ 900: '#4d2711',
171
+ 1000: '#361a0c',
172
+ 1100: '#291409',
173
+ 1200: '#150a04'
199
174
  },
200
175
  lemon: {
201
- 100: '#fff6cf',
202
- 200: '#ffe682',
203
- 300: '#ffc417',
204
- 400: '#eda900',
205
- 500: '#ba8900',
206
- 600: '#b08100',
176
+ 100: '#fff7d4',
177
+ 200: '#ffea97',
178
+ 300: '#ffdc4f',
179
+ 400: '#efab00',
180
+ 500: '#c79100',
181
+ 600: '#b68500',
207
182
  700: '#8f6900',
208
- 800: '#6d5000',
209
- 900: '#463300',
210
- 1000: '#2f2200',
211
- 1100: '#231a00',
212
- 1200: '#191200',
213
- M400: '#e7a500',
214
- M600: '#c38f00'
183
+ 800: '#563e00',
184
+ 900: '#3f2e00',
185
+ 1000: '#2b2000',
186
+ 1100: '#221800',
187
+ 1200: '#110c00'
215
188
  },
216
189
  lime: {
217
- 100: '#ebfae6',
218
- 200: '#c9f2bd',
219
- 300: '#88e270',
220
- 400: '#4ecf2a',
221
- 500: '#4da42a',
222
- 600: '#489b20',
190
+ 100: '#ecfae7',
191
+ 200: '#d1f3c7',
192
+ 300: '#b3eda3',
193
+ 400: '#4fd12b',
194
+ 500: '#45b025',
195
+ 600: '#509f2d',
223
196
  700: '#3d7e19',
224
- 800: '#385f23',
225
- 900: '#243c16',
226
- 1000: '#18280f',
227
- 1100: '#121e0b',
228
- 1200: '#0d1508',
229
- M400: '#519e2d',
230
- M600: '#47782c'
197
+ 800: '#2c491b',
198
+ 900: '#203614',
199
+ 1000: '#16250e',
200
+ 1100: '#111d0a',
201
+ 1200: '#090e05'
231
202
  },
232
203
  mint: {
233
204
  100: '#d6ffeb',
234
- 200: '#83ffc3',
235
- 300: '#00ea79',
236
- 400: '#00d16d',
237
- 500: '#00a756',
238
- 600: '#279b65',
239
- 700: '#2d7d55',
240
- 800: '#225f41',
241
- 900: '#163d2a',
242
- 1000: '#0f291c',
243
- 1100: '#0b1e15',
244
- 1200: '#08150f',
245
- M400: '#299c66',
246
- M600: '#2e8057'
205
+ 200: '#9affce',
206
+ 300: '#0afe89',
207
+ 400: '#00d26d',
208
+ 500: '#01b15c',
209
+ 600: '#16a260',
210
+ 700: '#2d7e55',
211
+ 800: '#1b4b33',
212
+ 900: '#143726',
213
+ 1000: '#0e261a',
214
+ 1100: '#0b1d14',
215
+ 1200: '#050e0a'
247
216
  },
248
217
  teal: {
249
- 100: '#d6fefa',
250
- 200: '#70fdef',
251
- 300: '#03e5ce',
252
- 400: '#03ccb8',
253
- 500: '#02a392',
254
- 600: '#1f998b',
218
+ 100: '#d4fefa',
219
+ 200: '#88fdf1',
220
+ 300: '#0bf8e1',
221
+ 400: '#03cdb8',
222
+ 500: '#02ad9c',
223
+ 600: '#2a9d8f',
255
224
  700: '#367a74',
256
- 800: '#2e5c59',
257
- 900: '#1e3b39',
258
- 1000: '#142726',
259
- 1100: '#0f1d1c',
260
- 1200: '#0a1514',
261
- M400: '#2d9e8f',
262
- M600: '#3c7873'
225
+ 800: '#254846',
226
+ 900: '#1b3534',
227
+ 1000: '#122423',
228
+ 1100: '#0e1c1a',
229
+ 1200: '#070d0d'
263
230
  },
264
231
  azure: {
265
- 100: '#f0f7fe',
266
- 200: '#d7eafb',
267
- 300: '#a8d1f7',
268
- 400: '#7fbbf3',
269
- 500: '#3795ed',
270
- 600: '#598ad0',
271
- 700: '#2770c4',
272
- 800: '#2c5689',
273
- 900: '#1d3758',
274
- 1000: '#13253a',
275
- 1100: '#0e1b2c',
276
- 1200: '#0a131f',
277
- M400: '#5f8dcf',
278
- M600: '#3a70b2'
232
+ 100: '#eff7fe',
233
+ 200: '#d9ecfc',
234
+ 300: '#c4e0fa',
235
+ 400: '#82bcf4',
236
+ 500: '#4b9fee',
237
+ 600: '#3191ea',
238
+ 700: '#2770c3',
239
+ 800: '#23446b',
240
+ 900: '#1a3250',
241
+ 1000: '#122238',
242
+ 1100: '#0e1a2a',
243
+ 1200: '#070d14'
279
244
  },
280
245
  royal: {
281
- 100: '#f5f6fc',
282
- 200: '#e3e6f7',
283
- 300: '#c5cbee',
284
- 400: '#abb3e7',
285
- 500: '#7f8cda',
286
- 600: '#7182e1',
287
- 700: '#4d67d3',
288
- 800: '#1f40d8',
289
- 900: '#142a8d',
290
- 1000: '#0e1c5f',
291
- 1100: '#0a1548',
292
- 1200: '#070f34',
293
- M400: '#7986d8',
294
- M600: '#4b61c3'
246
+ 100: '#f4f5fc',
247
+ 200: '#e7e9f8',
248
+ 300: '#d8dcf4',
249
+ 400: '#acb4e7',
250
+ 500: '#8a96dd',
251
+ 600: '#7a88d9',
252
+ 700: '#4c67d3',
253
+ 800: '#1833ab',
254
+ 900: '#122680',
255
+ 1000: '#0d1a5a',
256
+ 1100: '#0a1445',
257
+ 1200: '#050a25'
295
258
  },
296
259
  purple: {
297
- 100: '#f9f4fb',
298
- 200: '#efe3f5',
299
- 300: '#ddc3e9',
300
- 400: '#cea8e0',
301
- 500: '#b57acf',
302
- 600: '#b16ecf',
260
+ 100: '#f9f3fb',
261
+ 200: '#f2e7f6',
262
+ 300: '#e9d8f1',
263
+ 400: '#d0a9e0',
264
+ 500: '#bb86d3',
265
+ 600: '#b276cd',
303
266
  700: '#9256b1',
304
- 800: '#722eb8',
305
- 900: '#491b7f',
306
- 1000: '#311256',
307
- 1100: '#250e41',
308
- 1200: '#1b0a2e',
309
- M400: '#b072cc',
310
- M600: '#9358b0'
267
+ 800: '#58209a',
268
+ 900: '#411973',
269
+ 1000: '#2e1150',
270
+ 1100: '#230d3f',
271
+ 1200: '#120720'
311
272
  }
312
273
  };
313
274
 
@@ -344,24 +305,84 @@ const colors = {
344
305
  variables: {
345
306
  dark: {
346
307
  background: {
347
- default: 'neutralHue.1100'
308
+ default: 'neutralHue.1100',
309
+ raised: 'neutralHue.1000',
310
+ recessed: 'neutralHue.1200',
311
+ subtle: 'neutralHue.1000',
312
+ emphasis: 'neutralHue.600',
313
+ primary: 'primaryHue.900',
314
+ success: 'successHue.1000',
315
+ warning: 'warningHue.1000',
316
+ danger: 'dangerHue.1000',
317
+ primaryEmphasis: 'primaryHue.600',
318
+ successEmphasis: 'successHue.600',
319
+ warningEmphasis: 'warningHue.600',
320
+ dangerEmphasis: 'dangerHue.600'
348
321
  },
349
322
  border: {
350
- default: 'neutralHue.700'
323
+ default: 'neutralHue.800',
324
+ emphasis: 'neutralHue.600',
325
+ subtle: 'neutralHue.900',
326
+ success: 'successHue.800',
327
+ warning: 'warningHue.800',
328
+ danger: 'dangerHue.800',
329
+ primaryEmphasis: 'primaryHue.600',
330
+ successEmphasis: 'successHue.600',
331
+ warningEmphasis: 'warningHue.600',
332
+ dangerEmphasis: 'dangerHue.600'
351
333
  },
352
334
  foreground: {
353
- default: 'neutralHue.300'
335
+ default: 'neutralHue.300',
336
+ subtle: 'neutralHue.500',
337
+ onEmphasis: 'neutralHue.1100',
338
+ primary: 'primaryHue.600',
339
+ success: 'successHue.400',
340
+ warning: 'warningHue.400',
341
+ danger: 'dangerHue.400',
342
+ successEmphasis: 'successHue.300',
343
+ warningEmphasis: 'warningHue.300',
344
+ dangerEmphasis: 'dangerHue.300'
354
345
  }
355
346
  },
356
347
  light: {
357
348
  background: {
358
- default: 'palette.white'
349
+ default: 'palette.white',
350
+ raised: 'palette.white',
351
+ recessed: 'neutralHue.100',
352
+ subtle: 'neutralHue.100',
353
+ emphasis: 'neutralHue.700',
354
+ primary: 'primaryHue.100',
355
+ success: 'successHue.100',
356
+ warning: 'warningHue.100',
357
+ danger: 'dangerHue.100',
358
+ primaryEmphasis: 'primaryHue.700',
359
+ successEmphasis: 'successHue.700',
360
+ warningEmphasis: 'warningHue.700',
361
+ dangerEmphasis: 'dangerHue.700'
359
362
  },
360
363
  border: {
361
- default: 'neutralHue.400'
364
+ default: 'neutralHue.300',
365
+ emphasis: 'neutralHue.600',
366
+ subtle: 'neutralHue.200',
367
+ success: 'successHue.300',
368
+ warning: 'warningHue.300',
369
+ danger: 'dangerHue.300',
370
+ primaryEmphasis: 'primaryHue.700',
371
+ successEmphasis: 'successHue.700',
372
+ warningEmphasis: 'warningHue.700',
373
+ dangerEmphasis: 'dangerHue.700'
362
374
  },
363
375
  foreground: {
364
- default: 'neutralHue.900'
376
+ default: 'neutralHue.900',
377
+ subtle: 'neutralHue.700',
378
+ onEmphasis: 'palette.white',
379
+ primary: 'primaryHue.700',
380
+ success: 'successHue.700',
381
+ warning: 'warningHue.700',
382
+ danger: 'dangerHue.700',
383
+ successEmphasis: 'successHue.900',
384
+ warningEmphasis: 'warningHue.900',
385
+ dangerEmphasis: 'dangerHue.900'
365
386
  }
366
387
  }
367
388
  }
@@ -403,6 +424,20 @@ const lineHeights = {
403
424
  xxl: `${BASE * 8}px`,
404
425
  xxxl: `${BASE * 11}px`
405
426
  };
427
+ const opacity = {
428
+ 100: 0.08,
429
+ 200: 0.16,
430
+ 300: 0.24,
431
+ 400: 0.32,
432
+ 500: 0.4,
433
+ 600: 0.48,
434
+ 700: 0.56,
435
+ 800: 0.64,
436
+ 900: 0.72,
437
+ 1000: 0.8,
438
+ 1100: 0.88,
439
+ 1200: 0.96
440
+ };
406
441
  const palette = {
407
442
  ...PALETTE
408
443
  };
@@ -444,6 +479,7 @@ const DEFAULT_THEME = {
444
479
  fontWeights,
445
480
  iconSizes,
446
481
  lineHeights,
482
+ opacity,
447
483
  palette,
448
484
  rtl: false,
449
485
  shadowWidths,
@@ -456,7 +492,7 @@ const ThemeProvider = _ref => {
456
492
  theme,
457
493
  ...other
458
494
  } = _ref;
459
- return React__default.default.createElement(styledComponents.ThemeProvider, _extends({
495
+ return React__default.default.createElement(styled.ThemeProvider, Object.assign({
460
496
  theme: theme
461
497
  }, other));
462
498
  };
@@ -677,7 +713,7 @@ const toHex = (hue, shade, offset, scheme) => {
677
713
  }
678
714
  return retVal;
679
715
  };
680
- const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
716
+ const toColor = (colors, palette, opacity, scheme, hue, shade, offset, transparency) => {
681
717
  let retVal;
682
718
  let _hue = colors[hue] || hue;
683
719
  if (Object.hasOwn(palette, _hue)) {
@@ -685,7 +721,7 @@ const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
685
721
  }
686
722
  if (typeof _hue === 'object') {
687
723
  retVal = toHex(_hue, shade, offset, scheme);
688
- } else if (chromaJs.valid(_hue)) {
724
+ } else if (_hue === 'transparent' || chromaJs.valid(_hue)) {
689
725
  if (shade === undefined) {
690
726
  retVal = _hue;
691
727
  } else {
@@ -700,7 +736,11 @@ const toColor = (colors, palette, scheme, hue, shade, offset, transparency) => {
700
736
  }
701
737
  }
702
738
  if (retVal && transparency) {
703
- retVal = polished.rgba(retVal, transparency);
739
+ const alpha = transparency > 1 ? opacity[transparency] : transparency;
740
+ if (alpha === undefined) {
741
+ throw new Error('Error: invalid `transparency` parameter');
742
+ }
743
+ retVal = polished.rgba(retVal, alpha);
704
744
  }
705
745
  return retVal;
706
746
  };
@@ -750,7 +790,8 @@ const getColor = memoize__default.default(_ref => {
750
790
  }
751
791
  }
752
792
  if (_hue) {
753
- retVal = toColor(colors, palette, scheme, _hue, _shade, _offset, _transparency);
793
+ const opacity = theme.opacity && Object.keys(theme.opacity).length > 0 ? theme.opacity : DEFAULT_THEME.opacity;
794
+ retVal = toColor(colors, palette, opacity, scheme, _hue, _shade, _offset, _transparency);
754
795
  }
755
796
  if (retVal === undefined) {
756
797
  throw new Error('Error: invalid `getColor` parameters');
@@ -780,6 +821,37 @@ const getColor = memoize__default.default(_ref => {
780
821
  });
781
822
  });
782
823
 
824
+ const getCheckeredBackground = _ref => {
825
+ let {
826
+ theme,
827
+ size,
828
+ overlay,
829
+ positionY = 0,
830
+ repeat = 'repeat'
831
+ } = _ref;
832
+ const color = getColor({
833
+ theme,
834
+ variable: 'border.default'
835
+ });
836
+ const dimensions = `${size}px ${size}px`;
837
+ const positionX1 = theme.rtl ? '100%' : '0';
838
+ const positionX2 = theme.rtl ? `calc(100% - ${size / 2}px)` : `${size / 2}px`;
839
+ const position1 = `${positionX1} ${positionY}px`;
840
+ const position2 = `${positionX2} ${size / 2 + positionY}px`;
841
+ const position3 = `${positionX2} ${positionY}px`;
842
+ const position4 = `${positionX1} ${size / -2 + positionY}px`;
843
+ let retVal = `
844
+ linear-gradient(45deg, ${color} 25%, transparent 25%) ${position1} / ${dimensions} ${repeat},
845
+ linear-gradient(45deg, transparent 75%, ${color} 75%) ${position2} / ${dimensions} ${repeat},
846
+ linear-gradient(135deg, ${color} 25%, transparent 25%) ${position3} / ${dimensions} ${repeat},
847
+ linear-gradient(135deg, transparent 75%, ${color} 75%) ${position4} / ${dimensions} ${repeat}
848
+ `;
849
+ if (overlay) {
850
+ retVal = overlay.startsWith('linear-gradient') ? `${overlay}, ${retVal}` : `linear-gradient(${overlay}, ${overlay}), ${retVal}`;
851
+ }
852
+ return retVal;
853
+ };
854
+
783
855
  const DEFAULT_SHADE = 600;
784
856
  const adjust = (color, expected, actual) => {
785
857
  if (expected !== actual) {
@@ -895,22 +967,32 @@ const getFocusBoxShadow = _ref => {
895
967
  let {
896
968
  boxShadow,
897
969
  inset = false,
898
- hue = 'primaryHue',
899
- shade = DEFAULT_SHADE,
970
+ color = {
971
+ variable: 'border.primaryEmphasis'
972
+ },
900
973
  shadowWidth = 'md',
901
- spacerHue = 'background',
902
- spacerShade = DEFAULT_SHADE,
974
+ spacerColor = {
975
+ variable: 'background.default'
976
+ },
903
977
  spacerWidth = 'xs',
904
- theme = DEFAULT_THEME
978
+ theme = DEFAULT_THEME,
979
+ ...args
905
980
  } = _ref;
906
- const color = getColorV8(hue, shade, theme);
907
- const shadow = theme.shadows[shadowWidth](color);
981
+ const _args = args;
982
+ const _color = _args.hue ? getColorV8(_args.hue, _args.shade, theme) : getColor({
983
+ ...color,
984
+ theme
985
+ });
986
+ const shadow = theme.shadows[shadowWidth](_color);
908
987
  if (spacerWidth === null) {
909
988
  return `${inset ? 'inset' : ''} ${shadow}`;
910
989
  }
911
- const spacerColor = getColorV8(spacerHue, spacerShade, theme);
990
+ const _spacerColor = _args.spacerHue ? getColorV8(_args.spacerHue, _args.spacerShade, theme) : getColor({
991
+ ...spacerColor,
992
+ theme
993
+ });
912
994
  const retVal = `
913
- ${inset ? 'inset' : ''} ${theme.shadows[spacerWidth](spacerColor)},
995
+ ${inset ? 'inset' : ''} ${theme.shadows[spacerWidth](_spacerColor)},
914
996
  ${inset ? 'inset' : ''} ${shadow}`;
915
997
  return boxShadow ? `${retVal}, ${boxShadow}` : retVal;
916
998
  };
@@ -996,8 +1078,8 @@ const exponentialSymbols = {
996
1078
  };
997
1079
  const animationStyles$1 = (position, modifier) => {
998
1080
  const property = position.split('-')[0];
999
- const animationName = styledComponents.keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
1000
- return styledComponents.css(["&", "::before,&", "::after{animation:0.3s ease-in-out ", ";}"], modifier, modifier, animationName);
1081
+ const animationName = styled.keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
1082
+ return styled.css(["&", "::before,&", "::after{animation:0.3s ease-in-out ", ";}"], modifier, modifier, animationName);
1001
1083
  };
1002
1084
  const positionStyles = (position, size, inset) => {
1003
1085
  const margin = polished.math(`${size} / -2`);
@@ -1008,28 +1090,28 @@ const positionStyles = (position, size, inset) => {
1008
1090
  if (position.startsWith('top')) {
1009
1091
  propertyRadius = 'border-bottom-right-radius';
1010
1092
  clipPath = 'polygon(100% 0, 100% 1px, 1px 100%, 0 100%, 0 0)';
1011
- positionCss = styledComponents.css(["top:", ";right:", ";left:", ";margin-left:", ";"], placement, position === 'top-right' && size, position === 'top' ? '50%' : position === 'top-left' && size, position === 'top' && margin);
1093
+ positionCss = styled.css(["top:", ";right:", ";left:", ";margin-left:", ";"], placement, position === 'top-right' && size, position === 'top' ? '50%' : position === 'top-left' && size, position === 'top' && margin);
1012
1094
  } else if (position.startsWith('right')) {
1013
1095
  propertyRadius = 'border-bottom-left-radius';
1014
1096
  clipPath = 'polygon(100% 0, 100% 100%, calc(100% - 1px) 100%, 0 1px, 0 0)';
1015
- positionCss = styledComponents.css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' && size, placement, position === 'right-bottom' && size, position === 'right' && margin);
1097
+ positionCss = styled.css(["top:", ";right:", ";bottom:", ";margin-top:", ";"], position === 'right' ? '50%' : position === 'right-top' && size, placement, position === 'right-bottom' && size, position === 'right' && margin);
1016
1098
  } else if (position.startsWith('bottom')) {
1017
1099
  propertyRadius = 'border-top-left-radius';
1018
1100
  clipPath = 'polygon(100% 0, calc(100% - 1px) 0, 0 calc(100% - 1px), 0 100%, 100% 100%)';
1019
- positionCss = styledComponents.css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' && size, placement, position === 'bottom' ? '50%' : position === 'bottom-left' && size, position === 'bottom' && margin);
1101
+ positionCss = styled.css(["right:", ";bottom:", ";left:", ";margin-left:", ";"], position === 'bottom-right' && size, placement, position === 'bottom' ? '50%' : position === 'bottom-left' && size, position === 'bottom' && margin);
1020
1102
  } else if (position.startsWith('left')) {
1021
1103
  propertyRadius = 'border-top-right-radius';
1022
1104
  clipPath = 'polygon(0 100%, 100% 100%, 100% calc(100% - 1px), 1px 0, 0 0)';
1023
- positionCss = styledComponents.css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' && size, size, placement, position === 'left' && margin);
1105
+ positionCss = styled.css(["top:", ";bottom:", ";left:", ";margin-top:", ";"], position === 'left' ? '50%' : position === 'left-top' && size, size, placement, position === 'left' && margin);
1024
1106
  }
1025
- return styledComponents.css(["&::before{", ":100%;clip-path:", ";}&::before,&::after{", "}"], propertyRadius, clipPath, positionCss);
1107
+ return styled.css(["&::before{", ":100%;clip-path:", ";}&::before,&::after{", "}"], propertyRadius, clipPath, positionCss);
1026
1108
  };
1027
1109
  function arrowStyles(position) {
1028
1110
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1029
1111
  const size = options.size || '6px';
1030
1112
  const inset = options.inset || '0';
1031
1113
  const squareSize = polished.math(`${size} * 2 / sqrt(2)`, exponentialSymbols);
1032
- return styledComponents.css(["position:relative;&::before{border-width:inherit;border-style:inherit;border-color:transparent;background-clip:content-box;}&::after{z-index:-1;border:inherit;box-shadow:inherit;}&::before,&::after{position:absolute;transform:rotate(45deg);background-color:inherit;box-sizing:inherit;width:", ";height:", ";content:'';}", ";", ";"], squareSize, squareSize, positionStyles(position, squareSize, inset), options.animationModifier && animationStyles$1(position, options.animationModifier));
1114
+ return styled.css(["position:relative;&::before{border-width:inherit;border-style:inherit;border-color:transparent;background-clip:content-box;}&::after{z-index:-1;border:inherit;box-shadow:inherit;}&::before,&::after{position:absolute;transform:rotate(45deg);background-color:inherit;box-sizing:inherit;width:", ";height:", ";content:'';}", ";", ";"], squareSize, squareSize, positionStyles(position, squareSize, inset), options.animationModifier && animationStyles$1(position, options.animationModifier));
1033
1115
  }
1034
1116
 
1035
1117
  const useDocument = theme => {
@@ -1091,12 +1173,12 @@ const animationStyles = (position, options) => {
1091
1173
  } else {
1092
1174
  transformFunction = 'translateX';
1093
1175
  }
1094
- const animationName = styledComponents.keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
1095
- return styledComponents.css(["&", " ", "{animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";}"], options.animationModifier, options.childSelector || '> *', animationName);
1176
+ const animationName = styled.keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
1177
+ return styled.css(["&", " ", "{animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";}"], options.animationModifier, options.childSelector || '> *', animationName);
1096
1178
  };
1097
1179
  const hiddenStyles = options => {
1098
1180
  const transition = 'opacity 0.2s ease-in-out, 0.2s visibility 0s linear';
1099
- return styledComponents.css(["transition:", ";visibility:hidden;opacity:0;"], options.animationModifier && transition);
1181
+ return styled.css(["transition:", ";visibility:hidden;opacity:0;"], options.animationModifier && transition);
1100
1182
  };
1101
1183
  function menuStyles(position) {
1102
1184
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -1111,7 +1193,21 @@ function menuStyles(position) {
1111
1193
  } else {
1112
1194
  marginProperty = 'margin-right';
1113
1195
  }
1114
- return styledComponents.css(["position:absolute;z-index:", ";", ":", ";line-height:0;font-size:0.01px;& ", "{display:inline-block;position:relative;margin:0;box-sizing:border-box;border:", " ", ";border-radius:", ";box-shadow:", ";background-color:", ";cursor:default;padding:0;text-align:", ";white-space:normal;font-size:", ";font-weight:", ";direction:", ";:focus{outline:none;}}", ";", ";"], options.zIndex || 0, marginProperty, options.margin, options.childSelector || '> *', theme.borders.sm, getColorV8('neutralHue', 300, theme), theme.borderRadii.md, theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7.5}px`, getColorV8('chromeHue', 600, theme, 0.15)), getColorV8('background', 600 , theme), theme.rtl ? 'right' : 'left', theme.fontSizes.md, theme.fontWeights.regular, theme.rtl && 'rtl', options.animationModifier && animationStyles(position, options), options.hidden && hiddenStyles(options));
1196
+ return styled.css(["position:absolute;z-index:", ";", ":", ";line-height:0;font-size:0.01px;& ", "{display:inline-block;position:relative;margin:0;box-sizing:border-box;border:", " ", ";border-radius:", ";box-shadow:", ";background-color:", ";cursor:default;padding:0;text-align:", ";white-space:normal;color:", ";font-size:", ";font-weight:", ";direction:", ";:focus{outline:none;}}", ";", ";"], options.zIndex || 0, marginProperty, options.margin, options.childSelector || '> *', theme.borders.sm, getColor({
1197
+ theme,
1198
+ variable: 'border.default'
1199
+ }), theme.borderRadii.md, theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7.5}px`, getColor({
1200
+ theme,
1201
+ hue: 'chromeHue',
1202
+ shade: 600,
1203
+ transparency: 0.15
1204
+ })), getColor({
1205
+ theme,
1206
+ variable: 'background.raised'
1207
+ }), theme.rtl ? 'right' : 'left', getColor({
1208
+ theme,
1209
+ variable: 'foreground.default'
1210
+ }), theme.fontSizes.md, theme.fontWeights.regular, theme.rtl && 'rtl', options.animationModifier && animationStyles(position, options), options.hidden && hiddenStyles(options));
1115
1211
  }
1116
1212
 
1117
1213
  const SELECTOR_FOCUS_VISIBLE = '&:focus-visible';
@@ -1143,9 +1239,21 @@ const focusStyles = _ref => {
1143
1239
  outline = `${polished.math(`${theme.shadowWidths[shadowWidth]} - ${theme.shadowWidths[spacerWidth]}`)} solid transparent`;
1144
1240
  outlineOffset = theme.shadowWidths[spacerWidth];
1145
1241
  }
1146
- return styledComponents.css(["&:focus{outline:none;}", "{outline:", ";outline-offset:", ";box-shadow:", ";", "}"], selector, outline, outlineOffset, _boxShadow, styles);
1242
+ return styled.css(["&:focus{outline:none;}", "{outline:", ";outline-offset:", ";box-shadow:", ";", "}"], selector, outline, outlineOffset, _boxShadow, styles);
1147
1243
  };
1148
1244
 
1245
+ const StyledBaseIcon = styled__default.default(_ref => {
1246
+ let {
1247
+ children,
1248
+ theme,
1249
+ ...props
1250
+ } = _ref;
1251
+ return React__default.default.cloneElement(React.Children.only(children), props);
1252
+ }).withConfig({
1253
+ displayName: "StyledBaseIcon",
1254
+ componentId: "sc-1moykgb-0"
1255
+ })([""]);
1256
+
1149
1257
  const ARROW_POSITION = ['top', 'top-left', 'top-right', 'right', 'right-top', 'right-bottom', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom'];
1150
1258
  const MENU_POSITION = ['top', 'right', 'bottom', 'left'];
1151
1259
  const PLACEMENT = ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
@@ -1157,10 +1265,12 @@ exports.PALETTE = PALETTE;
1157
1265
  exports.PALETTE_V8 = PALETTE_V8;
1158
1266
  exports.PLACEMENT = PLACEMENT;
1159
1267
  exports.SELECTOR_FOCUS_VISIBLE = SELECTOR_FOCUS_VISIBLE;
1268
+ exports.StyledBaseIcon = StyledBaseIcon;
1160
1269
  exports.ThemeProvider = ThemeProvider;
1161
1270
  exports.arrowStyles = arrowStyles;
1162
1271
  exports.focusStyles = focusStyles;
1163
1272
  exports.getArrowPosition = getArrowPosition;
1273
+ exports.getCheckeredBackground = getCheckeredBackground;
1164
1274
  exports.getColor = getColor;
1165
1275
  exports.getColorV8 = getColorV8;
1166
1276
  exports.getFloatingPlacements = getFloatingPlacements;