@zendeskgarden/react-theming 8.57.1 → 8.59.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.
package/dist/index.cjs.js CHANGED
@@ -19,170 +19,22 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
19
19
 
20
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
21
 
22
- function ownKeys(object, enumerableOnly) {
23
- var keys = Object.keys(object);
24
-
25
- if (Object.getOwnPropertySymbols) {
26
- var symbols = Object.getOwnPropertySymbols(object);
27
- enumerableOnly && (symbols = symbols.filter(function (sym) {
28
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
29
- })), keys.push.apply(keys, symbols);
30
- }
31
-
32
- return keys;
33
- }
34
-
35
- function _objectSpread2(target) {
36
- for (var i = 1; i < arguments.length; i++) {
37
- var source = null != arguments[i] ? arguments[i] : {};
38
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
39
- _defineProperty(target, key, source[key]);
40
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
41
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
42
- });
43
- }
44
-
45
- return target;
46
- }
47
-
48
- function _typeof(obj) {
49
- "@babel/helpers - typeof";
50
-
51
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
52
- return typeof obj;
53
- } : function (obj) {
54
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
55
- }, _typeof(obj);
56
- }
57
-
58
- function _defineProperty(obj, key, value) {
59
- if (key in obj) {
60
- Object.defineProperty(obj, key, {
61
- value: value,
62
- enumerable: true,
63
- configurable: true,
64
- writable: true
65
- });
66
- } else {
67
- obj[key] = value;
68
- }
69
-
70
- return obj;
71
- }
72
-
73
22
  function _extends() {
74
23
  _extends = Object.assign ? Object.assign.bind() : function (target) {
75
24
  for (var i = 1; i < arguments.length; i++) {
76
25
  var source = arguments[i];
77
-
78
26
  for (var key in source) {
79
27
  if (Object.prototype.hasOwnProperty.call(source, key)) {
80
28
  target[key] = source[key];
81
29
  }
82
30
  }
83
31
  }
84
-
85
32
  return target;
86
33
  };
87
34
  return _extends.apply(this, arguments);
88
35
  }
89
36
 
90
- function _objectWithoutPropertiesLoose(source, excluded) {
91
- if (source == null) return {};
92
- var target = {};
93
- var sourceKeys = Object.keys(source);
94
- var key, i;
95
-
96
- for (i = 0; i < sourceKeys.length; i++) {
97
- key = sourceKeys[i];
98
- if (excluded.indexOf(key) >= 0) continue;
99
- target[key] = source[key];
100
- }
101
-
102
- return target;
103
- }
104
-
105
- function _objectWithoutProperties(source, excluded) {
106
- if (source == null) return {};
107
-
108
- var target = _objectWithoutPropertiesLoose(source, excluded);
109
-
110
- var key, i;
111
-
112
- if (Object.getOwnPropertySymbols) {
113
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
114
-
115
- for (i = 0; i < sourceSymbolKeys.length; i++) {
116
- key = sourceSymbolKeys[i];
117
- if (excluded.indexOf(key) >= 0) continue;
118
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
119
- target[key] = source[key];
120
- }
121
- }
122
-
123
- return target;
124
- }
125
-
126
- function _slicedToArray(arr, i) {
127
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
128
- }
129
-
130
- function _arrayWithHoles(arr) {
131
- if (Array.isArray(arr)) return arr;
132
- }
133
-
134
- function _iterableToArrayLimit(arr, i) {
135
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
136
-
137
- if (_i == null) return;
138
- var _arr = [];
139
- var _n = true;
140
- var _d = false;
141
-
142
- var _s, _e;
143
-
144
- try {
145
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
146
- _arr.push(_s.value);
147
-
148
- if (i && _arr.length === i) break;
149
- }
150
- } catch (err) {
151
- _d = true;
152
- _e = err;
153
- } finally {
154
- try {
155
- if (!_n && _i["return"] != null) _i["return"]();
156
- } finally {
157
- if (_d) throw _e;
158
- }
159
- }
160
-
161
- return _arr;
162
- }
163
-
164
- function _unsupportedIterableToArray(o, minLen) {
165
- if (!o) return;
166
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
167
- var n = Object.prototype.toString.call(o).slice(8, -1);
168
- if (n === "Object" && o.constructor) n = o.constructor.name;
169
- if (n === "Map" || n === "Set") return Array.from(o);
170
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
171
- }
172
-
173
- function _arrayLikeToArray(arr, len) {
174
- if (len == null || len > arr.length) len = arr.length;
175
-
176
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
177
-
178
- return arr2;
179
- }
180
-
181
- function _nonIterableRest() {
182
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
183
- }
184
-
185
- var PALETTE = {
37
+ const PALETTE = {
186
38
  black: '#000',
187
39
  white: '#fff',
188
40
  product: {
@@ -324,30 +176,30 @@ var PALETTE = {
324
176
  }
325
177
  };
326
178
 
327
- var BASE = 4;
328
- var borderRadii = {
329
- sm: "".concat(BASE / 2, "px"),
330
- md: "".concat(BASE, "px")
179
+ const BASE = 4;
180
+ const borderRadii = {
181
+ sm: `${BASE / 2}px`,
182
+ md: `${BASE}px`
331
183
  };
332
- var borderStyles = {
184
+ const borderStyles = {
333
185
  solid: 'solid'
334
186
  };
335
- var borderWidths = {
187
+ const borderWidths = {
336
188
  sm: '1px',
337
189
  md: '3px'
338
190
  };
339
- var borders = {
340
- sm: "".concat(borderWidths.sm, " ").concat(borderStyles.solid),
341
- md: "".concat(borderWidths.md, " ").concat(borderStyles.solid)
191
+ const borders = {
192
+ sm: `${borderWidths.sm} ${borderStyles.solid}`,
193
+ md: `${borderWidths.md} ${borderStyles.solid}`
342
194
  };
343
- var breakpoints = {
195
+ const breakpoints = {
344
196
  xs: '0px',
345
- sm: "".concat(BASE * 144, "px"),
346
- md: "".concat(BASE * 192, "px"),
347
- lg: "".concat(BASE * 248, "px"),
348
- xl: "".concat(BASE * 300, "px")
197
+ sm: `${BASE * 144}px`,
198
+ md: `${BASE * 192}px`,
199
+ lg: `${BASE * 248}px`,
200
+ xl: `${BASE * 300}px`
349
201
  };
350
- var colors = {
202
+ const colors = {
351
203
  background: PALETTE.white,
352
204
  foreground: PALETTE.grey[800],
353
205
  primaryHue: 'blue',
@@ -357,22 +209,11 @@ var colors = {
357
209
  neutralHue: 'grey',
358
210
  chromeHue: 'kale'
359
211
  };
360
- var fonts = {
361
- mono: ['SFMono-Regular'
362
- , 'Consolas'
363
- , '"Liberation Mono"'
364
- , 'Menlo', 'Courier', 'monospace'].join(','),
365
- system: ['system-ui'
366
- , '-apple-system'
367
- , 'BlinkMacSystemFont'
368
- , '"Segoe UI"'
369
- , 'Roboto'
370
- , 'Oxygen-Sans'
371
- , 'Ubuntu'
372
- , 'Cantarell'
373
- , '"Helvetica Neue"', 'Arial', 'sans-serif'].join(',')
212
+ const fonts = {
213
+ mono: ['SFMono-Regular' , 'Consolas' , '"Liberation Mono"' , 'Menlo', 'Courier', 'monospace'].join(','),
214
+ system: ['system-ui' , '-apple-system' , 'BlinkMacSystemFont' , '"Segoe UI"' , 'Roboto' , 'Oxygen-Sans' , 'Ubuntu' , 'Cantarell' , '"Helvetica Neue"', 'Arial', 'sans-serif'].join(',')
374
215
  };
375
- var fontSizes = {
216
+ const fontSizes = {
376
217
  xs: '10px',
377
218
  sm: '12px',
378
219
  md: '14px',
@@ -381,7 +222,7 @@ var fontSizes = {
381
222
  xxl: '26px',
382
223
  xxxl: '36px'
383
224
  };
384
- var fontWeights = {
225
+ const fontWeights = {
385
226
  thin: 100,
386
227
  extralight: 200,
387
228
  light: 300,
@@ -392,74 +233,68 @@ var fontWeights = {
392
233
  extrabold: 800,
393
234
  black: 900
394
235
  };
395
- var iconSizes = {
236
+ const iconSizes = {
396
237
  sm: '12px',
397
238
  md: '16px',
398
239
  lg: '26px'
399
240
  };
400
- var lineHeights = {
401
- sm: "".concat(BASE * 4, "px"),
402
- md: "".concat(BASE * 5, "px"),
403
- lg: "".concat(BASE * 6, "px"),
404
- xl: "".concat(BASE * 7, "px"),
405
- xxl: "".concat(BASE * 8, "px"),
406
- xxxl: "".concat(BASE * 11, "px")
241
+ const lineHeights = {
242
+ sm: `${BASE * 4}px`,
243
+ md: `${BASE * 5}px`,
244
+ lg: `${BASE * 6}px`,
245
+ xl: `${BASE * 7}px`,
246
+ xxl: `${BASE * 8}px`,
247
+ xxxl: `${BASE * 11}px`
248
+ };
249
+ const palette = {
250
+ ...PALETTE
407
251
  };
408
- var palette = _objectSpread2({}, PALETTE);
409
252
  delete palette.product;
410
- var shadowWidths = {
253
+ const shadowWidths = {
411
254
  sm: '2px',
412
255
  md: '3px'
413
256
  };
414
- var shadows = {
415
- sm: function sm(color) {
416
- return "0 0 0 ".concat(shadowWidths.sm, " ").concat(color);
417
- },
418
- md: function md(color) {
419
- return "0 0 0 ".concat(shadowWidths.md, " ").concat(color);
420
- },
421
- lg: function lg(offsetY, blurRadius, color) {
422
- return "0 ".concat(offsetY, " ").concat(blurRadius, " 0 ").concat(color);
423
- }
257
+ const shadows = {
258
+ sm: color => `0 0 0 ${shadowWidths.sm} ${color}`,
259
+ md: color => `0 0 0 ${shadowWidths.md} ${color}`,
260
+ lg: (offsetY, blurRadius, color) => `0 ${offsetY} ${blurRadius} 0 ${color}`
424
261
  };
425
- var space = {
262
+ const space = {
426
263
  base: BASE,
427
- xxs: "".concat(BASE, "px"),
428
- xs: "".concat(BASE * 2, "px"),
429
- sm: "".concat(BASE * 3, "px"),
430
- md: "".concat(BASE * 5, "px"),
431
- lg: "".concat(BASE * 8, "px"),
432
- xl: "".concat(BASE * 10, "px"),
433
- xxl: "".concat(BASE * 12, "px")
264
+ xxs: `${BASE}px`,
265
+ xs: `${BASE * 2}px`,
266
+ sm: `${BASE * 3}px`,
267
+ md: `${BASE * 5}px`,
268
+ lg: `${BASE * 8}px`,
269
+ xl: `${BASE * 10}px`,
270
+ xxl: `${BASE * 12}px`
434
271
  };
435
- var DEFAULT_THEME = {
436
- borders: borders,
437
- borderRadii: borderRadii,
438
- borderStyles: borderStyles,
439
- borderWidths: borderWidths,
440
- breakpoints: breakpoints,
441
- colors: _objectSpread2({
442
- base: 'light'
443
- }, colors),
272
+ const DEFAULT_THEME = {
273
+ borders,
274
+ borderRadii,
275
+ borderStyles,
276
+ borderWidths,
277
+ breakpoints,
278
+ colors: {
279
+ base: 'light',
280
+ ...colors
281
+ },
444
282
  components: {},
445
- fonts: fonts,
446
- fontSizes: fontSizes,
447
- fontWeights: fontWeights,
448
- iconSizes: iconSizes,
449
- lineHeights: lineHeights,
450
- palette: palette,
283
+ fonts,
284
+ fontSizes,
285
+ fontWeights,
286
+ iconSizes,
287
+ lineHeights,
288
+ palette,
451
289
  rtl: false,
452
- shadowWidths: shadowWidths,
453
- shadows: shadows,
454
- space: space
290
+ shadowWidths,
291
+ shadows,
292
+ space
455
293
  };
456
294
 
457
- var useDocument = function useDocument(theme) {
458
- var _useState = React.useState(),
459
- _useState2 = _slicedToArray(_useState, 2),
460
- controlledDocument = _useState2[0],
461
- setControlledDocument = _useState2[1];
462
- React.useEffect(function () {
295
+ const useDocument = theme => {
296
+ const [controlledDocument, setControlledDocument] = React.useState();
297
+ React.useEffect(() => {
463
298
  if (theme && theme.document) {
464
299
  setControlledDocument(theme.document);
465
300
  } else {
@@ -469,18 +304,19 @@ var useDocument = function useDocument(theme) {
469
304
  return controlledDocument;
470
305
  };
471
306
 
472
- var _excluded = ["theme", "focusVisibleRef", "children"];
473
- var ThemeProvider = function ThemeProvider(_ref) {
474
- var theme = _ref.theme,
475
- focusVisibleRef = _ref.focusVisibleRef,
476
- children = _ref.children,
477
- other = _objectWithoutProperties(_ref, _excluded);
478
- var scopeRef = React.useRef(null);
479
- var relativeDocument = useDocument(theme);
480
- var controlledScopeRef = focusVisibleRef === null ? React__default["default"].createRef() : containerUtilities.getControlledValue(focusVisibleRef, scopeRef);
307
+ const ThemeProvider = _ref => {
308
+ let {
309
+ theme,
310
+ focusVisibleRef,
311
+ children,
312
+ ...other
313
+ } = _ref;
314
+ const scopeRef = React.useRef(null);
315
+ const relativeDocument = useDocument(theme);
316
+ const controlledScopeRef = focusVisibleRef === null ? React__default["default"].createRef() : containerUtilities.getControlledValue(focusVisibleRef, scopeRef);
481
317
  containerFocusvisible.useFocusVisible({
482
318
  scope: controlledScopeRef,
483
- relativeDocument: relativeDocument
319
+ relativeDocument
484
320
  });
485
321
  return React__default["default"].createElement(styledComponents.ThemeProvider, _extends({
486
322
  theme: theme
@@ -493,17 +329,18 @@ ThemeProvider.defaultProps = {
493
329
  };
494
330
 
495
331
  function isRtl() {
496
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
497
- theme = _ref.theme;
332
+ let {
333
+ theme
334
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
498
335
  return Boolean(theme && theme.rtl);
499
336
  }
500
337
 
501
338
  function retrieveComponentStyles(componentId, props) {
502
- var components = props.theme && props.theme.components;
339
+ const components = props.theme && props.theme.components;
503
340
  if (!components) {
504
341
  return undefined;
505
342
  }
506
- var componentStyles = components[componentId];
343
+ const componentStyles = components[componentId];
507
344
  if (typeof componentStyles === 'function') {
508
345
  return componentStyles(props);
509
346
  }
@@ -515,30 +352,31 @@ function withTheme(WrappedComponent) {
515
352
  }
516
353
 
517
354
  function getDocument() {
518
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
519
- theme = _ref.theme;
355
+ let {
356
+ theme
357
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
520
358
  return theme && theme.document || document;
521
359
  }
522
360
 
523
- var DEFAULT_SHADE = 600;
524
- var adjust = function adjust(color, expected, actual) {
361
+ const DEFAULT_SHADE = 600;
362
+ const adjust = (color, expected, actual) => {
525
363
  if (expected !== actual) {
526
- var amount = Math.abs(expected - actual) / 100 * 0.05;
364
+ const amount = Math.abs(expected - actual) / 100 * 0.05;
527
365
  return expected > actual ? polished.darken(amount, color) : polished.lighten(amount, color);
528
366
  }
529
367
  return color;
530
368
  };
531
369
  function getColor(hue) {
532
- var shade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_SHADE;
533
- var theme = arguments.length > 2 ? arguments[2] : undefined;
534
- var transparency = arguments.length > 3 ? arguments[3] : undefined;
535
- var retVal;
370
+ let shade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_SHADE;
371
+ let theme = arguments.length > 2 ? arguments[2] : undefined;
372
+ let transparency = arguments.length > 3 ? arguments[3] : undefined;
373
+ let retVal;
536
374
  if (isNaN(shade)) {
537
375
  return undefined;
538
376
  }
539
- var palette = theme && theme.palette ? theme.palette : DEFAULT_THEME.palette;
540
- var colors = theme && theme.colors ? theme.colors : DEFAULT_THEME.colors;
541
- var _hue;
377
+ const palette = theme && theme.palette ? theme.palette : DEFAULT_THEME.palette;
378
+ const colors = theme && theme.colors ? theme.colors : DEFAULT_THEME.colors;
379
+ let _hue;
542
380
  if (typeof hue === 'string') {
543
381
  _hue = colors[hue] || hue;
544
382
  } else {
@@ -547,12 +385,10 @@ function getColor(hue) {
547
385
  if (Object.prototype.hasOwnProperty.call(palette, _hue)) {
548
386
  _hue = palette[_hue];
549
387
  }
550
- if (_typeof(_hue) === 'object') {
388
+ if (typeof _hue === 'object') {
551
389
  retVal = _hue[shade];
552
390
  if (!retVal) {
553
- var _shade = Object.keys(_hue).map(function (hueKey) {
554
- return parseInt(hueKey, 10);
555
- }).reduce(function (previous, current) {
391
+ const _shade = Object.keys(_hue).map(hueKey => parseInt(hueKey, 10)).reduce((previous, current) => {
556
392
  return Math.abs(current - shade) < Math.abs(previous - shade) ? current : previous;
557
393
  });
558
394
  retVal = adjust(_hue[_shade], shade, _shade);
@@ -567,40 +403,34 @@ function getColor(hue) {
567
403
  }
568
404
 
569
405
  function getLineHeight(height, fontSize) {
570
- var _getValueAndUnit = polished.getValueAndUnit(height.toString()),
571
- _getValueAndUnit2 = _slicedToArray(_getValueAndUnit, 2),
572
- heightValue = _getValueAndUnit2[0],
573
- heightUnit = _getValueAndUnit2[1];
574
- var _getValueAndUnit3 = polished.getValueAndUnit(fontSize.toString()),
575
- _getValueAndUnit4 = _slicedToArray(_getValueAndUnit3, 2),
576
- fontSizeValue = _getValueAndUnit4[0],
577
- fontSizeUnit = _getValueAndUnit4[1];
578
- var PIXELS = 'px';
406
+ const [heightValue, heightUnit] = polished.getValueAndUnit(height.toString());
407
+ const [fontSizeValue, fontSizeUnit] = polished.getValueAndUnit(fontSize.toString());
408
+ const PIXELS = 'px';
579
409
  if (heightUnit && heightUnit !== PIXELS) {
580
- throw new Error("Unexpected `height` with '".concat(heightUnit, "' units."));
410
+ throw new Error(`Unexpected \`height\` with '${heightUnit}' units.`);
581
411
  }
582
412
  if (fontSizeUnit && fontSizeUnit !== PIXELS) {
583
- throw new Error("Unexpected `fontSize` with '".concat(fontSizeUnit, "' units."));
413
+ throw new Error(`Unexpected \`fontSize\` with '${fontSizeUnit}' units.`);
584
414
  }
585
415
  return heightValue / fontSizeValue;
586
416
  }
587
417
 
588
- var maxWidth = function maxWidth(breakpoints, breakpoint) {
589
- var keys = Object.keys(breakpoints);
590
- var index = keys.indexOf(breakpoint) + 1;
418
+ const maxWidth = (breakpoints, breakpoint) => {
419
+ const keys = Object.keys(breakpoints);
420
+ const index = keys.indexOf(breakpoint) + 1;
591
421
  if (keys[index]) {
592
- var dimension = polished.getValueAndUnit(breakpoints[keys[index]]);
593
- var value = dimension[0] - 0.02;
594
- var unit = dimension[1];
595
- return "".concat(value).concat(unit);
422
+ const dimension = polished.getValueAndUnit(breakpoints[keys[index]]);
423
+ const value = dimension[0] - 0.02;
424
+ const unit = dimension[1];
425
+ return `${value}${unit}`;
596
426
  }
597
427
  return undefined;
598
428
  };
599
429
  function mediaQuery(query, breakpoint, theme) {
600
- var retVal;
601
- var min;
602
- var max;
603
- var breakpoints = theme && theme.breakpoints ? theme.breakpoints : DEFAULT_THEME.breakpoints;
430
+ let retVal;
431
+ let min;
432
+ let max;
433
+ const breakpoints = theme && theme.breakpoints ? theme.breakpoints : DEFAULT_THEME.breakpoints;
604
434
  if (typeof breakpoint === 'string') {
605
435
  if (query === 'up') {
606
436
  min = breakpoints[breakpoint];
@@ -619,26 +449,24 @@ function mediaQuery(query, breakpoint, theme) {
619
449
  max = maxWidth(breakpoints, breakpoint[1]);
620
450
  }
621
451
  if (min) {
622
- retVal = "@media (min-width: ".concat(min, ")");
452
+ retVal = `@media (min-width: ${min})`;
623
453
  if (max) {
624
- retVal = "".concat(retVal, " and (max-width: ").concat(max, ")");
454
+ retVal = `${retVal} and (max-width: ${max})`;
625
455
  }
626
456
  } else if (max) {
627
- retVal = "@media (max-width: ".concat(max, ")");
457
+ retVal = `@media (max-width: ${max})`;
628
458
  } else {
629
- throw new Error("Unexpected query and breakpoint combination: '".concat(query, "', '").concat(breakpoint, "'."));
459
+ throw new Error(`Unexpected query and breakpoint combination: '${query}', '${breakpoint}'.`);
630
460
  }
631
461
  return retVal;
632
462
  }
633
463
 
634
- var exponentialSymbols = {
464
+ const exponentialSymbols = {
635
465
  symbols: {
636
466
  sqrt: {
637
467
  func: {
638
468
  symbol: 'sqrt',
639
- f: function f(a) {
640
- return Math.sqrt(a);
641
- },
469
+ f: a => Math.sqrt(a),
642
470
  notation: 'func',
643
471
  precedence: 0,
644
472
  rightToLeft: 0,
@@ -649,17 +477,17 @@ var exponentialSymbols = {
649
477
  }
650
478
  }
651
479
  };
652
- var animationStyles$1 = function animationStyles(position, modifier) {
653
- var property = position.split('-')[0];
654
- var animationName = styledComponents.keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
480
+ const animationStyles$1 = (position, modifier) => {
481
+ const property = position.split('-')[0];
482
+ const animationName = styledComponents.keyframes(["0%,66%{", ":2px;border:transparent;}"], property);
655
483
  return styledComponents.css(["&", "::before,&", "::after{animation:0.3s ease-in-out ", ";}"], modifier, modifier, animationName);
656
484
  };
657
- var positionStyles = function positionStyles(position, size, inset) {
658
- var margin = polished.math("".concat(size, " / -2"));
659
- var placement = polished.math("".concat(margin, " + ").concat(inset));
660
- var clipPath;
661
- var positionCss;
662
- var propertyRadius;
485
+ const positionStyles = (position, size, inset) => {
486
+ const margin = polished.math(`${size} / -2`);
487
+ const placement = polished.math(`${margin} + ${inset}`);
488
+ let clipPath;
489
+ let positionCss;
490
+ let propertyRadius;
663
491
  if (position.startsWith('top')) {
664
492
  propertyRadius = 'border-bottom-right-radius';
665
493
  clipPath = 'polygon(100% 0, 100% 1px, 1px 100%, 0 100%, 0 0)';
@@ -680,23 +508,23 @@ var positionStyles = function positionStyles(position, size, inset) {
680
508
  return styledComponents.css(["&::before{", ":100%;clip-path:", ";}&::before,&::after{", "}"], propertyRadius, clipPath, positionCss);
681
509
  };
682
510
  function arrowStyles(position) {
683
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
684
- var size = options.size || '6px';
685
- var inset = options.inset || '0';
686
- var squareSize = polished.math("".concat(size, " * 2 / sqrt(2)"), exponentialSymbols);
511
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
512
+ const size = options.size || '6px';
513
+ const inset = options.inset || '0';
514
+ const squareSize = polished.math(`${size} * 2 / sqrt(2)`, exponentialSymbols);
687
515
  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));
688
516
  }
689
517
 
690
- var useText = function useText(component, props, name, text) {
691
- var value = props[name];
692
- return React.useMemo(function () {
518
+ const useText = (component, props, name, text) => {
519
+ const value = props[name];
520
+ return React.useMemo(() => {
693
521
  if (name === 'children') {
694
522
  throw new Error('Error: `children` is not a valid `getText` prop.');
695
523
  } else if (value === null || value === '') {
696
- throw new Error(component.displayName ? "Error: you must provide a valid `".concat(name, "` text value for <").concat(component.displayName, ">.") : "Error: you must provide a valid `".concat(name, "` text value."));
524
+ throw new Error(component.displayName ? `Error: you must provide a valid \`${name}\` text value for <${component.displayName}>.` : `Error: you must provide a valid \`${name}\` text value.`);
697
525
  } else if (value === undefined) {
698
526
  if (process.env.NODE_ENV === 'development') {
699
- console.warn(component.displayName ? "Warning: you did not provide a customized/translated `".concat(name, "` text value for <").concat(component.displayName, ">. Zendesk Garden is rendering <").concat(component.displayName, " ").concat(name, "=\"").concat(text, "\"> by default.") : "Warning: you did not provide a customized/translated `".concat(name, "` text value. Zendesk Garden is rendering ").concat(name, "=\"").concat(text, "\" by default."));
527
+ console.warn(component.displayName ? `Warning: you did not provide a customized/translated \`${name}\` text value for <${component.displayName}>. Zendesk Garden is rendering <${component.displayName} ${name}="${text}"> by default.` : `Warning: you did not provide a customized/translated \`${name}\` text value. Zendesk Garden is rendering ${name}="${text}" by default.`);
700
528
  }
701
529
  return text;
702
530
  }
@@ -704,32 +532,32 @@ var useText = function useText(component, props, name, text) {
704
532
  }, [component.displayName, value, name, text]);
705
533
  };
706
534
 
707
- var animationStyles = function animationStyles(position, options) {
708
- var theme = options.theme || DEFAULT_THEME;
709
- var translateValue = "".concat(theme.space.base * 5, "px");
710
- var transformFunction;
535
+ const animationStyles = (position, options) => {
536
+ const theme = options.theme || DEFAULT_THEME;
537
+ let translateValue = `${theme.space.base * 5}px`;
538
+ let transformFunction;
711
539
  if (position === 'top') {
712
540
  transformFunction = 'translateY';
713
541
  } else if (position === 'right') {
714
542
  transformFunction = 'translateX';
715
- translateValue = "-".concat(translateValue);
543
+ translateValue = `-${translateValue}`;
716
544
  } else if (position === 'bottom') {
717
545
  transformFunction = 'translateY';
718
- translateValue = "-".concat(translateValue);
546
+ translateValue = `-${translateValue}`;
719
547
  } else {
720
548
  transformFunction = 'translateX';
721
549
  }
722
- var animationName = styledComponents.keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
550
+ const animationName = styledComponents.keyframes(["0%{transform:", "(", ");}"], transformFunction, translateValue);
723
551
  return styledComponents.css(["&", " ", "{animation:0.2s cubic-bezier(0.15,0.85,0.35,1.2) ", ";}"], options.animationModifier, options.childSelector || '> *', animationName);
724
552
  };
725
- var hiddenStyles = function hiddenStyles(options) {
726
- var transition = 'opacity 0.2s ease-in-out, 0.2s visibility 0s linear';
553
+ const hiddenStyles = options => {
554
+ const transition = 'opacity 0.2s ease-in-out, 0.2s visibility 0s linear';
727
555
  return styledComponents.css(["transition:", ";visibility:hidden;opacity:0;"], options.animationModifier && transition);
728
556
  };
729
557
  function menuStyles(position) {
730
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
731
- var theme = options.theme || DEFAULT_THEME;
732
- var marginProperty;
558
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
559
+ const theme = options.theme || DEFAULT_THEME;
560
+ let marginProperty;
733
561
  if (position === 'top') {
734
562
  marginProperty = 'margin-bottom';
735
563
  } else if (position === 'right') {
@@ -739,11 +567,11 @@ function menuStyles(position) {
739
567
  } else {
740
568
  marginProperty = 'margin-right';
741
569
  }
742
- 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, getColor('neutralHue', 300, theme), theme.borderRadii.md, theme.shadows.lg("".concat(theme.space.base * 5, "px"), "".concat(theme.space.base * 7.5, "px"), getColor('chromeHue', 600, theme, 0.15)), theme.colors.background, theme.rtl ? 'right' : 'left', theme.fontSizes.md, theme.fontWeights.regular, theme.rtl && 'rtl', options.animationModifier && animationStyles(position, options), options.hidden && hiddenStyles(options));
570
+ 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, getColor('neutralHue', 300, theme), theme.borderRadii.md, theme.shadows.lg(`${theme.space.base * 5}px`, `${theme.space.base * 7.5}px`, getColor('chromeHue', 600, theme, 0.15)), theme.colors.background, theme.rtl ? 'right' : 'left', theme.fontSizes.md, theme.fontWeights.regular, theme.rtl && 'rtl', options.animationModifier && animationStyles(position, options), options.hidden && hiddenStyles(options));
743
571
  }
744
572
 
745
- var ARROW_POSITION = ['top', 'top-left', 'top-right', 'right', 'right-top', 'right-bottom', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom'];
746
- var MENU_POSITION = ['top', 'right', 'bottom', 'left'];
573
+ const ARROW_POSITION = ['top', 'top-left', 'top-right', 'right', 'right-top', 'right-bottom', 'bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom'];
574
+ const MENU_POSITION = ['top', 'right', 'bottom', 'left'];
747
575
 
748
576
  exports.ARRAY_ARROW_POSITION = ARROW_POSITION;
749
577
  exports.ARRAY_MENU_POSITION = MENU_POSITION;