@zendeskgarden/react-modals 9.11.3 → 9.12.1
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/esm/elements/TooltipDialog/TooltipDialog.js +12 -3
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +12 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/construct.js +18 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/extends.js +17 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +13 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +13 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +15 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +16 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +13 -0
- package/dist/esm/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +35 -0
- package/dist/esm/node_modules/polished/dist/polished.esm.js +694 -0
- package/dist/esm/styled/StyledBackdrop.js +1 -1
- package/dist/esm/styled/StyledBody.js +1 -1
- package/dist/esm/styled/StyledClose.js +1 -1
- package/dist/esm/styled/StyledDrawer.js +1 -1
- package/dist/esm/styled/StyledDrawerBody.js +1 -1
- package/dist/esm/styled/StyledDrawerClose.js +1 -1
- package/dist/esm/styled/StyledDrawerFooter.js +1 -1
- package/dist/esm/styled/StyledDrawerFooterItem.js +1 -1
- package/dist/esm/styled/StyledDrawerHeader.js +1 -1
- package/dist/esm/styled/StyledFooter.js +1 -1
- package/dist/esm/styled/StyledFooterItem.js +1 -1
- package/dist/esm/styled/StyledHeader.js +1 -1
- package/dist/esm/styled/StyledModal.js +1 -1
- package/dist/esm/styled/StyledTooltipDialog.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogBackdrop.js +3 -2
- package/dist/esm/styled/StyledTooltipDialogBody.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogClose.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogFooter.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogFooterItem.js +1 -1
- package/dist/esm/styled/StyledTooltipDialogTitle.js +1 -1
- package/dist/index.cjs.js +796 -26
- package/dist/typings/elements/TooltipDialog/TooltipDialog.d.ts +6 -0
- package/dist/typings/types/index.d.ts +4 -0
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -64,7 +64,7 @@ const animationStyles$1 = props => {
|
|
|
64
64
|
};
|
|
65
65
|
const StyledBackdrop = styled__default.default.div.attrs({
|
|
66
66
|
'data-garden-id': COMPONENT_ID$j,
|
|
67
|
-
'data-garden-version': '9.
|
|
67
|
+
'data-garden-version': '9.12.1'
|
|
68
68
|
}).withConfig({
|
|
69
69
|
displayName: "StyledBackdrop",
|
|
70
70
|
componentId: "sc-mzdjpo-0"
|
|
@@ -92,7 +92,7 @@ StyledBackdrop.propTypes = {
|
|
|
92
92
|
const COMPONENT_ID$i = 'modals.body';
|
|
93
93
|
const StyledBody = styled__default.default.div.attrs({
|
|
94
94
|
'data-garden-id': COMPONENT_ID$i,
|
|
95
|
-
'data-garden-version': '9.
|
|
95
|
+
'data-garden-version': '9.12.1'
|
|
96
96
|
}).withConfig({
|
|
97
97
|
displayName: "StyledBody",
|
|
98
98
|
componentId: "sc-14rzecg-0"
|
|
@@ -114,7 +114,7 @@ const BASE_MULTIPLIERS$1 = {
|
|
|
114
114
|
};
|
|
115
115
|
const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
116
116
|
'data-garden-id': COMPONENT_ID$h,
|
|
117
|
-
'data-garden-version': '9.
|
|
117
|
+
'data-garden-version': '9.12.1'
|
|
118
118
|
}).withConfig({
|
|
119
119
|
displayName: "StyledClose",
|
|
120
120
|
componentId: "sc-iseudj-0"
|
|
@@ -123,7 +123,7 @@ const StyledClose = styled__default.default(reactButtons.IconButton).attrs({
|
|
|
123
123
|
const COMPONENT_ID$g = 'modals.footer';
|
|
124
124
|
const StyledFooter = styled__default.default.div.attrs({
|
|
125
125
|
'data-garden-id': COMPONENT_ID$g,
|
|
126
|
-
'data-garden-version': '9.
|
|
126
|
+
'data-garden-version': '9.12.1'
|
|
127
127
|
}).withConfig({
|
|
128
128
|
displayName: "StyledFooter",
|
|
129
129
|
componentId: "sc-d8pfdu-0"
|
|
@@ -135,7 +135,7 @@ const StyledFooter = styled__default.default.div.attrs({
|
|
|
135
135
|
const COMPONENT_ID$f = 'modals.footer_item';
|
|
136
136
|
const StyledFooterItem = styled__default.default.span.attrs({
|
|
137
137
|
'data-garden-id': COMPONENT_ID$f,
|
|
138
|
-
'data-garden-version': '9.
|
|
138
|
+
'data-garden-version': '9.12.1'
|
|
139
139
|
}).withConfig({
|
|
140
140
|
displayName: "StyledFooterItem",
|
|
141
141
|
componentId: "sc-1mb76hl-0"
|
|
@@ -159,16 +159,16 @@ const colorStyles$2 = _ref => {
|
|
|
159
159
|
};
|
|
160
160
|
const StyledHeader = styled__default.default.div.attrs({
|
|
161
161
|
'data-garden-id': COMPONENT_ID$e,
|
|
162
|
-
'data-garden-version': '9.
|
|
162
|
+
'data-garden-version': '9.12.1'
|
|
163
163
|
}).withConfig({
|
|
164
164
|
displayName: "StyledHeader",
|
|
165
165
|
componentId: "sc-1787r9v-0"
|
|
166
166
|
})(["display:block;position:", ";margin:0;border-bottom:", ";padding:", ";", " line-height:", ";font-size:", ";font-weight:", ";", ";", ";"], props => props.$isDanger && 'relative', props => props.theme.borders.sm, props => `${props.theme.space.base * 5}px ${props.theme.space.base * 10}px`, props => props.$isCloseButtonPresent && `padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * (BASE_MULTIPLIERS$1.size + BASE_MULTIPLIERS$1.side + 2)}px;`, props => reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props => props.theme.fontSizes.md, props => props.theme.fontWeights.semibold, colorStyles$2, reactTheming.componentStyles);
|
|
167
167
|
|
|
168
168
|
var _g, _circle;
|
|
169
|
-
function _extends$
|
|
169
|
+
function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
|
|
170
170
|
var SvgAlertErrorStroke = function SvgAlertErrorStroke(props) {
|
|
171
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
171
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
172
172
|
xmlns: "http://www.w3.org/2000/svg",
|
|
173
173
|
width: 16,
|
|
174
174
|
height: 16,
|
|
@@ -232,7 +232,7 @@ const sizeStyles$2 = props => {
|
|
|
232
232
|
};
|
|
233
233
|
const StyledModal = styled__default.default.div.attrs({
|
|
234
234
|
'data-garden-id': COMPONENT_ID$d,
|
|
235
|
-
'data-garden-version': '9.
|
|
235
|
+
'data-garden-version': '9.12.1'
|
|
236
236
|
}).withConfig({
|
|
237
237
|
displayName: "StyledModal",
|
|
238
238
|
componentId: "sc-1pe1axu-0"
|
|
@@ -242,14 +242,775 @@ StyledModal.propTypes = {
|
|
|
242
242
|
$isAnimated: PropTypes__default.default.bool
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
+
function _extends$1() {
|
|
246
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
|
|
247
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
248
|
+
var t = arguments[e];
|
|
249
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
250
|
+
}
|
|
251
|
+
return n;
|
|
252
|
+
}, _extends$1.apply(null, arguments);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function _assertThisInitialized(e) {
|
|
256
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
257
|
+
return e;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function _setPrototypeOf(t, e) {
|
|
261
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
262
|
+
return t.__proto__ = e, t;
|
|
263
|
+
}, _setPrototypeOf(t, e);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function _inheritsLoose(t, o) {
|
|
267
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function _getPrototypeOf(t) {
|
|
271
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
272
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
273
|
+
}, _getPrototypeOf(t);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function _isNativeFunction(t) {
|
|
277
|
+
try {
|
|
278
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
279
|
+
} catch (n) {
|
|
280
|
+
return "function" == typeof t;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function _isNativeReflectConstruct() {
|
|
285
|
+
try {
|
|
286
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
287
|
+
} catch (t) {}
|
|
288
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
289
|
+
return !!t;
|
|
290
|
+
})();
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function _construct(t, e, r) {
|
|
294
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
295
|
+
var o = [null];
|
|
296
|
+
o.push.apply(o, e);
|
|
297
|
+
var p = new (t.bind.apply(t, o))();
|
|
298
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function _wrapNativeSuper(t) {
|
|
302
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
303
|
+
return _wrapNativeSuper = function _wrapNativeSuper(t) {
|
|
304
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
305
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
306
|
+
if (void 0 !== r) {
|
|
307
|
+
if (r.has(t)) return r.get(t);
|
|
308
|
+
r.set(t, Wrapper);
|
|
309
|
+
}
|
|
310
|
+
function Wrapper() {
|
|
311
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
312
|
+
}
|
|
313
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
314
|
+
constructor: {
|
|
315
|
+
value: Wrapper,
|
|
316
|
+
enumerable: !1,
|
|
317
|
+
writable: !0,
|
|
318
|
+
configurable: !0
|
|
319
|
+
}
|
|
320
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
321
|
+
}, _wrapNativeSuper(t);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
var ERRORS = {
|
|
325
|
+
"1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",
|
|
326
|
+
"2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
|
|
327
|
+
"3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
|
|
328
|
+
"4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
|
|
329
|
+
"5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
|
|
330
|
+
"6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",
|
|
331
|
+
"7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",
|
|
332
|
+
"8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
|
|
333
|
+
"9": "Please provide a number of steps to the modularScale helper.\n\n",
|
|
334
|
+
"10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
|
|
335
|
+
"11": "Invalid value passed as base to modularScale, expected number or em string but got \"%s\"\n\n",
|
|
336
|
+
"12": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got \"%s\" instead.\n\n",
|
|
337
|
+
"13": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got \"%s\" instead.\n\n",
|
|
338
|
+
"14": "Passed invalid pixel value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
339
|
+
"15": "Passed invalid base value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
340
|
+
"16": "You must provide a template to this method.\n\n",
|
|
341
|
+
"17": "You passed an unsupported selector state to this method.\n\n",
|
|
342
|
+
"18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
|
|
343
|
+
"19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
|
|
344
|
+
"20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
|
|
345
|
+
"21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
|
346
|
+
"22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
|
347
|
+
"23": "fontFace expects a name of a font-family.\n\n",
|
|
348
|
+
"24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
|
|
349
|
+
"25": "fontFace expects localFonts to be an array.\n\n",
|
|
350
|
+
"26": "fontFace expects fileFormats to be an array.\n\n",
|
|
351
|
+
"27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
|
|
352
|
+
"28": "Please supply a filename to retinaImage() as the first argument.\n\n",
|
|
353
|
+
"29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
|
|
354
|
+
"30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
|
355
|
+
"31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
|
|
356
|
+
"32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
|
|
357
|
+
"33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
|
|
358
|
+
"34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
|
|
359
|
+
"35": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
|
|
360
|
+
"36": "Property must be a string value.\n\n",
|
|
361
|
+
"37": "Syntax Error at %s.\n\n",
|
|
362
|
+
"38": "Formula contains a function that needs parentheses at %s.\n\n",
|
|
363
|
+
"39": "Formula is missing closing parenthesis at %s.\n\n",
|
|
364
|
+
"40": "Formula has too many closing parentheses at %s.\n\n",
|
|
365
|
+
"41": "All values in a formula must have the same unit or be unitless.\n\n",
|
|
366
|
+
"42": "Please provide a number of steps to the modularScale helper.\n\n",
|
|
367
|
+
"43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
|
|
368
|
+
"44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
|
|
369
|
+
"45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
|
|
370
|
+
"46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
|
|
371
|
+
"47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
|
|
372
|
+
"48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
|
|
373
|
+
"49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
|
|
374
|
+
"50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
|
|
375
|
+
"51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
|
|
376
|
+
"52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
|
|
377
|
+
"53": "fontFace expects localFonts to be an array.\n\n",
|
|
378
|
+
"54": "fontFace expects fileFormats to be an array.\n\n",
|
|
379
|
+
"55": "fontFace expects a name of a font-family.\n\n",
|
|
380
|
+
"56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
|
|
381
|
+
"57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
|
|
382
|
+
"58": "Please supply a filename to retinaImage() as the first argument.\n\n",
|
|
383
|
+
"59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
|
|
384
|
+
"60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
|
385
|
+
"61": "Property must be a string value.\n\n",
|
|
386
|
+
"62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
|
|
387
|
+
"63": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
|
|
388
|
+
"64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
|
|
389
|
+
"65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
|
|
390
|
+
"66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
|
|
391
|
+
"67": "You must provide a template to this method.\n\n",
|
|
392
|
+
"68": "You passed an unsupported selector state to this method.\n\n",
|
|
393
|
+
"69": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got %s instead.\n\n",
|
|
394
|
+
"70": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got %s instead.\n\n",
|
|
395
|
+
"71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
396
|
+
"72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
|
|
397
|
+
"73": "Please provide a valid CSS variable.\n\n",
|
|
398
|
+
"74": "CSS variable not found and no default was provided.\n\n",
|
|
399
|
+
"75": "important requires a valid style object, got a %s instead.\n\n",
|
|
400
|
+
"76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
|
|
401
|
+
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
402
|
+
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
403
|
+
};
|
|
404
|
+
function format() {
|
|
405
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
406
|
+
args[_key] = arguments[_key];
|
|
407
|
+
}
|
|
408
|
+
var a = args[0];
|
|
409
|
+
var b = [];
|
|
410
|
+
var c;
|
|
411
|
+
for (c = 1; c < args.length; c += 1) {
|
|
412
|
+
b.push(args[c]);
|
|
413
|
+
}
|
|
414
|
+
b.forEach(function (d) {
|
|
415
|
+
a = a.replace(/%[a-z]/, d);
|
|
416
|
+
});
|
|
417
|
+
return a;
|
|
418
|
+
}
|
|
419
|
+
var PolishedError = function (_Error) {
|
|
420
|
+
_inheritsLoose(PolishedError, _Error);
|
|
421
|
+
function PolishedError(code) {
|
|
422
|
+
var _this;
|
|
423
|
+
if (process.env.NODE_ENV === 'production') {
|
|
424
|
+
_this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
|
|
425
|
+
} else {
|
|
426
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
427
|
+
args[_key2 - 1] = arguments[_key2];
|
|
428
|
+
}
|
|
429
|
+
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
430
|
+
}
|
|
431
|
+
return _assertThisInitialized(_this);
|
|
432
|
+
}
|
|
433
|
+
return PolishedError;
|
|
434
|
+
}(_wrapNativeSuper(Error));
|
|
435
|
+
function hideVisually() {
|
|
436
|
+
return {
|
|
437
|
+
border: '0',
|
|
438
|
+
clip: 'rect(0 0 0 0)',
|
|
439
|
+
height: '1px',
|
|
440
|
+
margin: '-1px',
|
|
441
|
+
overflow: 'hidden',
|
|
442
|
+
padding: '0',
|
|
443
|
+
position: 'absolute',
|
|
444
|
+
whiteSpace: 'nowrap',
|
|
445
|
+
width: '1px'
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function colorToInt(color) {
|
|
449
|
+
return Math.round(color * 255);
|
|
450
|
+
}
|
|
451
|
+
function convertToInt(red, green, blue) {
|
|
452
|
+
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
453
|
+
}
|
|
454
|
+
function hslToRgb(hue, saturation, lightness, convert) {
|
|
455
|
+
if (convert === void 0) {
|
|
456
|
+
convert = convertToInt;
|
|
457
|
+
}
|
|
458
|
+
if (saturation === 0) {
|
|
459
|
+
return convert(lightness, lightness, lightness);
|
|
460
|
+
}
|
|
461
|
+
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
462
|
+
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
463
|
+
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
464
|
+
var red = 0;
|
|
465
|
+
var green = 0;
|
|
466
|
+
var blue = 0;
|
|
467
|
+
if (huePrime >= 0 && huePrime < 1) {
|
|
468
|
+
red = chroma;
|
|
469
|
+
green = secondComponent;
|
|
470
|
+
} else if (huePrime >= 1 && huePrime < 2) {
|
|
471
|
+
red = secondComponent;
|
|
472
|
+
green = chroma;
|
|
473
|
+
} else if (huePrime >= 2 && huePrime < 3) {
|
|
474
|
+
green = chroma;
|
|
475
|
+
blue = secondComponent;
|
|
476
|
+
} else if (huePrime >= 3 && huePrime < 4) {
|
|
477
|
+
green = secondComponent;
|
|
478
|
+
blue = chroma;
|
|
479
|
+
} else if (huePrime >= 4 && huePrime < 5) {
|
|
480
|
+
red = secondComponent;
|
|
481
|
+
blue = chroma;
|
|
482
|
+
} else if (huePrime >= 5 && huePrime < 6) {
|
|
483
|
+
red = chroma;
|
|
484
|
+
blue = secondComponent;
|
|
485
|
+
}
|
|
486
|
+
var lightnessModification = lightness - chroma / 2;
|
|
487
|
+
var finalRed = red + lightnessModification;
|
|
488
|
+
var finalGreen = green + lightnessModification;
|
|
489
|
+
var finalBlue = blue + lightnessModification;
|
|
490
|
+
return convert(finalRed, finalGreen, finalBlue);
|
|
491
|
+
}
|
|
492
|
+
var namedColorMap = {
|
|
493
|
+
aliceblue: 'f0f8ff',
|
|
494
|
+
antiquewhite: 'faebd7',
|
|
495
|
+
aqua: '00ffff',
|
|
496
|
+
aquamarine: '7fffd4',
|
|
497
|
+
azure: 'f0ffff',
|
|
498
|
+
beige: 'f5f5dc',
|
|
499
|
+
bisque: 'ffe4c4',
|
|
500
|
+
black: '000',
|
|
501
|
+
blanchedalmond: 'ffebcd',
|
|
502
|
+
blue: '0000ff',
|
|
503
|
+
blueviolet: '8a2be2',
|
|
504
|
+
brown: 'a52a2a',
|
|
505
|
+
burlywood: 'deb887',
|
|
506
|
+
cadetblue: '5f9ea0',
|
|
507
|
+
chartreuse: '7fff00',
|
|
508
|
+
chocolate: 'd2691e',
|
|
509
|
+
coral: 'ff7f50',
|
|
510
|
+
cornflowerblue: '6495ed',
|
|
511
|
+
cornsilk: 'fff8dc',
|
|
512
|
+
crimson: 'dc143c',
|
|
513
|
+
cyan: '00ffff',
|
|
514
|
+
darkblue: '00008b',
|
|
515
|
+
darkcyan: '008b8b',
|
|
516
|
+
darkgoldenrod: 'b8860b',
|
|
517
|
+
darkgray: 'a9a9a9',
|
|
518
|
+
darkgreen: '006400',
|
|
519
|
+
darkgrey: 'a9a9a9',
|
|
520
|
+
darkkhaki: 'bdb76b',
|
|
521
|
+
darkmagenta: '8b008b',
|
|
522
|
+
darkolivegreen: '556b2f',
|
|
523
|
+
darkorange: 'ff8c00',
|
|
524
|
+
darkorchid: '9932cc',
|
|
525
|
+
darkred: '8b0000',
|
|
526
|
+
darksalmon: 'e9967a',
|
|
527
|
+
darkseagreen: '8fbc8f',
|
|
528
|
+
darkslateblue: '483d8b',
|
|
529
|
+
darkslategray: '2f4f4f',
|
|
530
|
+
darkslategrey: '2f4f4f',
|
|
531
|
+
darkturquoise: '00ced1',
|
|
532
|
+
darkviolet: '9400d3',
|
|
533
|
+
deeppink: 'ff1493',
|
|
534
|
+
deepskyblue: '00bfff',
|
|
535
|
+
dimgray: '696969',
|
|
536
|
+
dimgrey: '696969',
|
|
537
|
+
dodgerblue: '1e90ff',
|
|
538
|
+
firebrick: 'b22222',
|
|
539
|
+
floralwhite: 'fffaf0',
|
|
540
|
+
forestgreen: '228b22',
|
|
541
|
+
fuchsia: 'ff00ff',
|
|
542
|
+
gainsboro: 'dcdcdc',
|
|
543
|
+
ghostwhite: 'f8f8ff',
|
|
544
|
+
gold: 'ffd700',
|
|
545
|
+
goldenrod: 'daa520',
|
|
546
|
+
gray: '808080',
|
|
547
|
+
green: '008000',
|
|
548
|
+
greenyellow: 'adff2f',
|
|
549
|
+
grey: '808080',
|
|
550
|
+
honeydew: 'f0fff0',
|
|
551
|
+
hotpink: 'ff69b4',
|
|
552
|
+
indianred: 'cd5c5c',
|
|
553
|
+
indigo: '4b0082',
|
|
554
|
+
ivory: 'fffff0',
|
|
555
|
+
khaki: 'f0e68c',
|
|
556
|
+
lavender: 'e6e6fa',
|
|
557
|
+
lavenderblush: 'fff0f5',
|
|
558
|
+
lawngreen: '7cfc00',
|
|
559
|
+
lemonchiffon: 'fffacd',
|
|
560
|
+
lightblue: 'add8e6',
|
|
561
|
+
lightcoral: 'f08080',
|
|
562
|
+
lightcyan: 'e0ffff',
|
|
563
|
+
lightgoldenrodyellow: 'fafad2',
|
|
564
|
+
lightgray: 'd3d3d3',
|
|
565
|
+
lightgreen: '90ee90',
|
|
566
|
+
lightgrey: 'd3d3d3',
|
|
567
|
+
lightpink: 'ffb6c1',
|
|
568
|
+
lightsalmon: 'ffa07a',
|
|
569
|
+
lightseagreen: '20b2aa',
|
|
570
|
+
lightskyblue: '87cefa',
|
|
571
|
+
lightslategray: '789',
|
|
572
|
+
lightslategrey: '789',
|
|
573
|
+
lightsteelblue: 'b0c4de',
|
|
574
|
+
lightyellow: 'ffffe0',
|
|
575
|
+
lime: '0f0',
|
|
576
|
+
limegreen: '32cd32',
|
|
577
|
+
linen: 'faf0e6',
|
|
578
|
+
magenta: 'f0f',
|
|
579
|
+
maroon: '800000',
|
|
580
|
+
mediumaquamarine: '66cdaa',
|
|
581
|
+
mediumblue: '0000cd',
|
|
582
|
+
mediumorchid: 'ba55d3',
|
|
583
|
+
mediumpurple: '9370db',
|
|
584
|
+
mediumseagreen: '3cb371',
|
|
585
|
+
mediumslateblue: '7b68ee',
|
|
586
|
+
mediumspringgreen: '00fa9a',
|
|
587
|
+
mediumturquoise: '48d1cc',
|
|
588
|
+
mediumvioletred: 'c71585',
|
|
589
|
+
midnightblue: '191970',
|
|
590
|
+
mintcream: 'f5fffa',
|
|
591
|
+
mistyrose: 'ffe4e1',
|
|
592
|
+
moccasin: 'ffe4b5',
|
|
593
|
+
navajowhite: 'ffdead',
|
|
594
|
+
navy: '000080',
|
|
595
|
+
oldlace: 'fdf5e6',
|
|
596
|
+
olive: '808000',
|
|
597
|
+
olivedrab: '6b8e23',
|
|
598
|
+
orange: 'ffa500',
|
|
599
|
+
orangered: 'ff4500',
|
|
600
|
+
orchid: 'da70d6',
|
|
601
|
+
palegoldenrod: 'eee8aa',
|
|
602
|
+
palegreen: '98fb98',
|
|
603
|
+
paleturquoise: 'afeeee',
|
|
604
|
+
palevioletred: 'db7093',
|
|
605
|
+
papayawhip: 'ffefd5',
|
|
606
|
+
peachpuff: 'ffdab9',
|
|
607
|
+
peru: 'cd853f',
|
|
608
|
+
pink: 'ffc0cb',
|
|
609
|
+
plum: 'dda0dd',
|
|
610
|
+
powderblue: 'b0e0e6',
|
|
611
|
+
purple: '800080',
|
|
612
|
+
rebeccapurple: '639',
|
|
613
|
+
red: 'f00',
|
|
614
|
+
rosybrown: 'bc8f8f',
|
|
615
|
+
royalblue: '4169e1',
|
|
616
|
+
saddlebrown: '8b4513',
|
|
617
|
+
salmon: 'fa8072',
|
|
618
|
+
sandybrown: 'f4a460',
|
|
619
|
+
seagreen: '2e8b57',
|
|
620
|
+
seashell: 'fff5ee',
|
|
621
|
+
sienna: 'a0522d',
|
|
622
|
+
silver: 'c0c0c0',
|
|
623
|
+
skyblue: '87ceeb',
|
|
624
|
+
slateblue: '6a5acd',
|
|
625
|
+
slategray: '708090',
|
|
626
|
+
slategrey: '708090',
|
|
627
|
+
snow: 'fffafa',
|
|
628
|
+
springgreen: '00ff7f',
|
|
629
|
+
steelblue: '4682b4',
|
|
630
|
+
tan: 'd2b48c',
|
|
631
|
+
teal: '008080',
|
|
632
|
+
thistle: 'd8bfd8',
|
|
633
|
+
tomato: 'ff6347',
|
|
634
|
+
turquoise: '40e0d0',
|
|
635
|
+
violet: 'ee82ee',
|
|
636
|
+
wheat: 'f5deb3',
|
|
637
|
+
white: 'fff',
|
|
638
|
+
whitesmoke: 'f5f5f5',
|
|
639
|
+
yellow: 'ff0',
|
|
640
|
+
yellowgreen: '9acd32'
|
|
641
|
+
};
|
|
642
|
+
function nameToHex(color) {
|
|
643
|
+
if (typeof color !== 'string') return color;
|
|
644
|
+
var normalizedColorName = color.toLowerCase();
|
|
645
|
+
return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
|
|
646
|
+
}
|
|
647
|
+
var hexRegex = /^#[a-fA-F0-9]{6}$/;
|
|
648
|
+
var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
|
|
649
|
+
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
|
|
650
|
+
var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
|
|
651
|
+
var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
|
|
652
|
+
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
653
|
+
var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
|
|
654
|
+
var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
655
|
+
function parseToRgb(color) {
|
|
656
|
+
if (typeof color !== 'string') {
|
|
657
|
+
throw new PolishedError(3);
|
|
658
|
+
}
|
|
659
|
+
var normalizedColor = nameToHex(color);
|
|
660
|
+
if (normalizedColor.match(hexRegex)) {
|
|
661
|
+
return {
|
|
662
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
663
|
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
|
664
|
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
if (normalizedColor.match(hexRgbaRegex)) {
|
|
668
|
+
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
669
|
+
return {
|
|
670
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
671
|
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
|
672
|
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
|
|
673
|
+
alpha: alpha
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
if (normalizedColor.match(reducedHexRegex)) {
|
|
677
|
+
return {
|
|
678
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
679
|
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
680
|
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
684
|
+
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
685
|
+
return {
|
|
686
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
687
|
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
688
|
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
|
|
689
|
+
alpha: _alpha
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
693
|
+
if (rgbMatched) {
|
|
694
|
+
return {
|
|
695
|
+
red: parseInt("" + rgbMatched[1], 10),
|
|
696
|
+
green: parseInt("" + rgbMatched[2], 10),
|
|
697
|
+
blue: parseInt("" + rgbMatched[3], 10)
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
701
|
+
if (rgbaMatched) {
|
|
702
|
+
return {
|
|
703
|
+
red: parseInt("" + rgbaMatched[1], 10),
|
|
704
|
+
green: parseInt("" + rgbaMatched[2], 10),
|
|
705
|
+
blue: parseInt("" + rgbaMatched[3], 10),
|
|
706
|
+
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
var hslMatched = hslRegex.exec(normalizedColor);
|
|
710
|
+
if (hslMatched) {
|
|
711
|
+
var hue = parseInt("" + hslMatched[1], 10);
|
|
712
|
+
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
713
|
+
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
714
|
+
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
715
|
+
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
716
|
+
if (!hslRgbMatched) {
|
|
717
|
+
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
718
|
+
}
|
|
719
|
+
return {
|
|
720
|
+
red: parseInt("" + hslRgbMatched[1], 10),
|
|
721
|
+
green: parseInt("" + hslRgbMatched[2], 10),
|
|
722
|
+
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
726
|
+
if (hslaMatched) {
|
|
727
|
+
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
728
|
+
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
729
|
+
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
730
|
+
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
731
|
+
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
732
|
+
if (!_hslRgbMatched) {
|
|
733
|
+
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
734
|
+
}
|
|
735
|
+
return {
|
|
736
|
+
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
737
|
+
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
738
|
+
blue: parseInt("" + _hslRgbMatched[3], 10),
|
|
739
|
+
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
throw new PolishedError(5);
|
|
743
|
+
}
|
|
744
|
+
function rgbToHsl(color) {
|
|
745
|
+
var red = color.red / 255;
|
|
746
|
+
var green = color.green / 255;
|
|
747
|
+
var blue = color.blue / 255;
|
|
748
|
+
var max = Math.max(red, green, blue);
|
|
749
|
+
var min = Math.min(red, green, blue);
|
|
750
|
+
var lightness = (max + min) / 2;
|
|
751
|
+
if (max === min) {
|
|
752
|
+
if (color.alpha !== undefined) {
|
|
753
|
+
return {
|
|
754
|
+
hue: 0,
|
|
755
|
+
saturation: 0,
|
|
756
|
+
lightness: lightness,
|
|
757
|
+
alpha: color.alpha
|
|
758
|
+
};
|
|
759
|
+
} else {
|
|
760
|
+
return {
|
|
761
|
+
hue: 0,
|
|
762
|
+
saturation: 0,
|
|
763
|
+
lightness: lightness
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
var hue;
|
|
768
|
+
var delta = max - min;
|
|
769
|
+
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
770
|
+
switch (max) {
|
|
771
|
+
case red:
|
|
772
|
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
773
|
+
break;
|
|
774
|
+
case green:
|
|
775
|
+
hue = (blue - red) / delta + 2;
|
|
776
|
+
break;
|
|
777
|
+
default:
|
|
778
|
+
hue = (red - green) / delta + 4;
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
781
|
+
hue *= 60;
|
|
782
|
+
if (color.alpha !== undefined) {
|
|
783
|
+
return {
|
|
784
|
+
hue: hue,
|
|
785
|
+
saturation: saturation,
|
|
786
|
+
lightness: lightness,
|
|
787
|
+
alpha: color.alpha
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
return {
|
|
791
|
+
hue: hue,
|
|
792
|
+
saturation: saturation,
|
|
793
|
+
lightness: lightness
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
function parseToHsl(color) {
|
|
797
|
+
return rgbToHsl(parseToRgb(color));
|
|
798
|
+
}
|
|
799
|
+
var reduceHexValue = function reduceHexValue(value) {
|
|
800
|
+
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
801
|
+
return "#" + value[1] + value[3] + value[5];
|
|
802
|
+
}
|
|
803
|
+
return value;
|
|
804
|
+
};
|
|
805
|
+
var reduceHexValue$1 = reduceHexValue;
|
|
806
|
+
function numberToHex(value) {
|
|
807
|
+
var hex = value.toString(16);
|
|
808
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
809
|
+
}
|
|
810
|
+
function colorToHex(color) {
|
|
811
|
+
return numberToHex(Math.round(color * 255));
|
|
812
|
+
}
|
|
813
|
+
function convertToHex(red, green, blue) {
|
|
814
|
+
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
815
|
+
}
|
|
816
|
+
function hslToHex(hue, saturation, lightness) {
|
|
817
|
+
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
818
|
+
}
|
|
819
|
+
function hsl(value, saturation, lightness) {
|
|
820
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
821
|
+
return hslToHex(value, saturation, lightness);
|
|
822
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
|
|
823
|
+
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
824
|
+
}
|
|
825
|
+
throw new PolishedError(1);
|
|
826
|
+
}
|
|
827
|
+
function hsla(value, saturation, lightness, alpha) {
|
|
828
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
|
|
829
|
+
return "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
830
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
|
|
831
|
+
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
832
|
+
}
|
|
833
|
+
throw new PolishedError(2);
|
|
834
|
+
}
|
|
835
|
+
function rgb(value, green, blue) {
|
|
836
|
+
if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') {
|
|
837
|
+
return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
|
|
838
|
+
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
839
|
+
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
840
|
+
}
|
|
841
|
+
throw new PolishedError(6);
|
|
842
|
+
}
|
|
843
|
+
function rgba(firstValue, secondValue, thirdValue, fourthValue) {
|
|
844
|
+
if (typeof firstValue === 'string' && typeof secondValue === 'number') {
|
|
845
|
+
var rgbValue = parseToRgb(firstValue);
|
|
846
|
+
return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
|
|
847
|
+
} else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
|
|
848
|
+
return "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
|
|
849
|
+
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
850
|
+
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
851
|
+
}
|
|
852
|
+
throw new PolishedError(7);
|
|
853
|
+
}
|
|
854
|
+
var isRgb = function isRgb(color) {
|
|
855
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
856
|
+
};
|
|
857
|
+
var isRgba = function isRgba(color) {
|
|
858
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
|
|
859
|
+
};
|
|
860
|
+
var isHsl = function isHsl(color) {
|
|
861
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
862
|
+
};
|
|
863
|
+
var isHsla = function isHsla(color) {
|
|
864
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
|
|
865
|
+
};
|
|
866
|
+
function toColorString(color) {
|
|
867
|
+
if (typeof color !== 'object') throw new PolishedError(8);
|
|
868
|
+
if (isRgba(color)) return rgba(color);
|
|
869
|
+
if (isRgb(color)) return rgb(color);
|
|
870
|
+
if (isHsla(color)) return hsla(color);
|
|
871
|
+
if (isHsl(color)) return hsl(color);
|
|
872
|
+
throw new PolishedError(8);
|
|
873
|
+
}
|
|
874
|
+
function curried(f, length, acc) {
|
|
875
|
+
return function fn() {
|
|
876
|
+
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
877
|
+
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
function curry(f) {
|
|
881
|
+
return curried(f, f.length, []);
|
|
882
|
+
}
|
|
883
|
+
function adjustHue(degree, color) {
|
|
884
|
+
if (color === 'transparent') return color;
|
|
885
|
+
var hslColor = parseToHsl(color);
|
|
886
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
887
|
+
hue: hslColor.hue + parseFloat(degree)
|
|
888
|
+
}));
|
|
889
|
+
}
|
|
890
|
+
curry (adjustHue);
|
|
891
|
+
function guard(lowerBoundary, upperBoundary, value) {
|
|
892
|
+
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
893
|
+
}
|
|
894
|
+
function darken(amount, color) {
|
|
895
|
+
if (color === 'transparent') return color;
|
|
896
|
+
var hslColor = parseToHsl(color);
|
|
897
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
898
|
+
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
899
|
+
}));
|
|
900
|
+
}
|
|
901
|
+
curry (darken);
|
|
902
|
+
function desaturate(amount, color) {
|
|
903
|
+
if (color === 'transparent') return color;
|
|
904
|
+
var hslColor = parseToHsl(color);
|
|
905
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
906
|
+
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
907
|
+
}));
|
|
908
|
+
}
|
|
909
|
+
curry (desaturate);
|
|
910
|
+
function lighten(amount, color) {
|
|
911
|
+
if (color === 'transparent') return color;
|
|
912
|
+
var hslColor = parseToHsl(color);
|
|
913
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
914
|
+
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
915
|
+
}));
|
|
916
|
+
}
|
|
917
|
+
curry (lighten);
|
|
918
|
+
function mix(weight, color, otherColor) {
|
|
919
|
+
if (color === 'transparent') return otherColor;
|
|
920
|
+
if (otherColor === 'transparent') return color;
|
|
921
|
+
if (weight === 0) return otherColor;
|
|
922
|
+
var parsedColor1 = parseToRgb(color);
|
|
923
|
+
var color1 = _extends$1({}, parsedColor1, {
|
|
924
|
+
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
925
|
+
});
|
|
926
|
+
var parsedColor2 = parseToRgb(otherColor);
|
|
927
|
+
var color2 = _extends$1({}, parsedColor2, {
|
|
928
|
+
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
929
|
+
});
|
|
930
|
+
var alphaDelta = color1.alpha - color2.alpha;
|
|
931
|
+
var x = parseFloat(weight) * 2 - 1;
|
|
932
|
+
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
933
|
+
var z = 1 + x * alphaDelta;
|
|
934
|
+
var weight1 = (y / z + 1) / 2.0;
|
|
935
|
+
var weight2 = 1 - weight1;
|
|
936
|
+
var mixedColor = {
|
|
937
|
+
red: Math.floor(color1.red * weight1 + color2.red * weight2),
|
|
938
|
+
green: Math.floor(color1.green * weight1 + color2.green * weight2),
|
|
939
|
+
blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
|
|
940
|
+
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
941
|
+
};
|
|
942
|
+
return rgba(mixedColor);
|
|
943
|
+
}
|
|
944
|
+
var curriedMix = curry (mix);
|
|
945
|
+
var mix$1 = curriedMix;
|
|
946
|
+
function opacify(amount, color) {
|
|
947
|
+
if (color === 'transparent') return color;
|
|
948
|
+
var parsedColor = parseToRgb(color);
|
|
949
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
950
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
951
|
+
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
952
|
+
});
|
|
953
|
+
return rgba(colorWithAlpha);
|
|
954
|
+
}
|
|
955
|
+
curry (opacify);
|
|
956
|
+
function saturate(amount, color) {
|
|
957
|
+
if (color === 'transparent') return color;
|
|
958
|
+
var hslColor = parseToHsl(color);
|
|
959
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
960
|
+
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
961
|
+
}));
|
|
962
|
+
}
|
|
963
|
+
curry (saturate);
|
|
964
|
+
function setHue(hue, color) {
|
|
965
|
+
if (color === 'transparent') return color;
|
|
966
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
967
|
+
hue: parseFloat(hue)
|
|
968
|
+
}));
|
|
969
|
+
}
|
|
970
|
+
curry (setHue);
|
|
971
|
+
function setLightness(lightness, color) {
|
|
972
|
+
if (color === 'transparent') return color;
|
|
973
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
974
|
+
lightness: parseFloat(lightness)
|
|
975
|
+
}));
|
|
976
|
+
}
|
|
977
|
+
curry (setLightness);
|
|
978
|
+
function setSaturation(saturation, color) {
|
|
979
|
+
if (color === 'transparent') return color;
|
|
980
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
981
|
+
saturation: parseFloat(saturation)
|
|
982
|
+
}));
|
|
983
|
+
}
|
|
984
|
+
curry (setSaturation);
|
|
985
|
+
function shade(percentage, color) {
|
|
986
|
+
if (color === 'transparent') return color;
|
|
987
|
+
return mix$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
988
|
+
}
|
|
989
|
+
curry (shade);
|
|
990
|
+
function tint(percentage, color) {
|
|
991
|
+
if (color === 'transparent') return color;
|
|
992
|
+
return mix$1(parseFloat(percentage), 'rgb(255, 255, 255)', color);
|
|
993
|
+
}
|
|
994
|
+
curry (tint);
|
|
995
|
+
function transparentize(amount, color) {
|
|
996
|
+
if (color === 'transparent') return color;
|
|
997
|
+
var parsedColor = parseToRgb(color);
|
|
998
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
999
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
1000
|
+
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
1001
|
+
});
|
|
1002
|
+
return rgba(colorWithAlpha);
|
|
1003
|
+
}
|
|
1004
|
+
curry (transparentize);
|
|
1005
|
+
|
|
245
1006
|
const COMPONENT_ID$c = 'modals.tooltip_dialog.backdrop';
|
|
246
1007
|
const StyledTooltipDialogBackdrop = styled__default.default.div.attrs({
|
|
247
1008
|
'data-garden-id': COMPONENT_ID$c,
|
|
248
|
-
'data-garden-version': '9.
|
|
1009
|
+
'data-garden-version': '9.12.1'
|
|
249
1010
|
}).withConfig({
|
|
250
1011
|
displayName: "StyledTooltipDialogBackdrop",
|
|
251
1012
|
componentId: "sc-zrk625-0"
|
|
252
|
-
})(["position:fixed;inset:0;z-index:400;overflow:hidden;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-tooltip-modal-transition-exit-active{pointer-events:none;}&.garden-tooltip-modal-transition-exit-active div{transition:opacity 200ms;opacity:0;}", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', reactTheming.componentStyles);
|
|
1013
|
+
})(["position:fixed;inset:0;z-index:400;overflow:hidden;-webkit-overflow-scrolling:touch;font-family:", ";direction:", ";&.garden-tooltip-modal-transition-exit-active{pointer-events:none;}&.garden-tooltip-modal-transition-exit-active div{transition:opacity 200ms;opacity:0;}", " ", ";"], props => props.theme.fonts.system, props => props.theme.rtl && 'rtl', props => props['aria-hidden'] && hideVisually(), reactTheming.componentStyles);
|
|
253
1014
|
|
|
254
1015
|
const StyledTooltipWrapper = styled__default.default.div.attrs(props => ({
|
|
255
1016
|
className: props.$isAnimated ? 'is-animated' : undefined
|
|
@@ -266,7 +1027,7 @@ const StyledTooltipWrapper = styled__default.default.div.attrs(props => ({
|
|
|
266
1027
|
const COMPONENT_ID$b = 'modals.tooltip_dialog.close';
|
|
267
1028
|
const StyledTooltipDialogClose = styled__default.default(StyledClose).attrs({
|
|
268
1029
|
'data-garden-id': COMPONENT_ID$b,
|
|
269
|
-
'data-garden-version': '9.
|
|
1030
|
+
'data-garden-version': '9.12.1'
|
|
270
1031
|
}).withConfig({
|
|
271
1032
|
displayName: "StyledTooltipDialogClose",
|
|
272
1033
|
componentId: "sc-18xlgfi-0"
|
|
@@ -283,7 +1044,7 @@ const sizeStyles$1 = props => `
|
|
|
283
1044
|
`;
|
|
284
1045
|
const StyledTooltipDialog = styled__default.default.div.attrs(props => ({
|
|
285
1046
|
'data-garden-id': COMPONENT_ID$a,
|
|
286
|
-
'data-garden-version': '9.
|
|
1047
|
+
'data-garden-version': '9.12.1',
|
|
287
1048
|
className: props.$isAnimated ? 'is-animated' : undefined
|
|
288
1049
|
})).withConfig({
|
|
289
1050
|
displayName: "StyledTooltipDialog",
|
|
@@ -308,7 +1069,7 @@ const sizeStyles = props => `
|
|
|
308
1069
|
`;
|
|
309
1070
|
const StyledTooltipDialogTitle = styled__default.default.div.attrs({
|
|
310
1071
|
'data-garden-id': COMPONENT_ID$9,
|
|
311
|
-
'data-garden-version': '9.
|
|
1072
|
+
'data-garden-version': '9.12.1'
|
|
312
1073
|
}).withConfig({
|
|
313
1074
|
displayName: "StyledTooltipDialogTitle",
|
|
314
1075
|
componentId: "sc-1rceixg-0"
|
|
@@ -325,7 +1086,7 @@ const StyledTooltipDialogTitle = styled__default.default.div.attrs({
|
|
|
325
1086
|
const COMPONENT_ID$8 = 'modals.tooltip_dialog.body';
|
|
326
1087
|
const StyledTooltipDialogBody = styled__default.default.div.attrs({
|
|
327
1088
|
'data-garden-id': COMPONENT_ID$8,
|
|
328
|
-
'data-garden-version': '9.
|
|
1089
|
+
'data-garden-version': '9.12.1'
|
|
329
1090
|
}).withConfig({
|
|
330
1091
|
displayName: "StyledTooltipDialogBody",
|
|
331
1092
|
componentId: "sc-132lcoq-0"
|
|
@@ -342,7 +1103,7 @@ const StyledTooltipDialogBody = styled__default.default.div.attrs({
|
|
|
342
1103
|
const COMPONENT_ID$7 = 'modals.tooltip_dialog.footer';
|
|
343
1104
|
const StyledTooltipDialogFooter = styled__default.default.div.attrs({
|
|
344
1105
|
'data-garden-id': COMPONENT_ID$7,
|
|
345
|
-
'data-garden-version': '9.
|
|
1106
|
+
'data-garden-version': '9.12.1'
|
|
346
1107
|
}).withConfig({
|
|
347
1108
|
displayName: "StyledTooltipDialogFooter",
|
|
348
1109
|
componentId: "sc-kjomsm-0"
|
|
@@ -351,7 +1112,7 @@ const StyledTooltipDialogFooter = styled__default.default.div.attrs({
|
|
|
351
1112
|
const COMPONENT_ID$6 = 'modals.tooltip_dialog.footer_item';
|
|
352
1113
|
const StyledTooltipDialogFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
353
1114
|
'data-garden-id': COMPONENT_ID$6,
|
|
354
|
-
'data-garden-version': '9.
|
|
1115
|
+
'data-garden-version': '9.12.1'
|
|
355
1116
|
}).withConfig({
|
|
356
1117
|
displayName: "StyledTooltipDialogFooterItem",
|
|
357
1118
|
componentId: "sc-u2rmo8-0"
|
|
@@ -382,7 +1143,7 @@ const colorStyles = _ref => {
|
|
|
382
1143
|
};
|
|
383
1144
|
const StyledDrawer = styled__default.default.div.attrs({
|
|
384
1145
|
'data-garden-id': COMPONENT_ID$5,
|
|
385
|
-
'data-garden-version': '9.
|
|
1146
|
+
'data-garden-version': '9.12.1'
|
|
386
1147
|
}).withConfig({
|
|
387
1148
|
displayName: "StyledDrawer",
|
|
388
1149
|
componentId: "sc-zp66t3-0"
|
|
@@ -396,7 +1157,7 @@ const BASE_MULTIPLIERS = {
|
|
|
396
1157
|
};
|
|
397
1158
|
const StyledDrawerClose = styled__default.default(StyledClose).attrs({
|
|
398
1159
|
'data-garden-id': COMPONENT_ID$4,
|
|
399
|
-
'data-garden-version': '9.
|
|
1160
|
+
'data-garden-version': '9.12.1'
|
|
400
1161
|
}).withConfig({
|
|
401
1162
|
displayName: "StyledDrawerClose",
|
|
402
1163
|
componentId: "sc-1a0xt3x-0"
|
|
@@ -405,7 +1166,7 @@ const StyledDrawerClose = styled__default.default(StyledClose).attrs({
|
|
|
405
1166
|
const COMPONENT_ID$3 = 'modals.drawer_modal.header';
|
|
406
1167
|
const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
|
|
407
1168
|
'data-garden-id': COMPONENT_ID$3,
|
|
408
|
-
'data-garden-version': '9.
|
|
1169
|
+
'data-garden-version': '9.12.1'
|
|
409
1170
|
}).withConfig({
|
|
410
1171
|
displayName: "StyledDrawerHeader",
|
|
411
1172
|
componentId: "sc-y4mgkj-0"
|
|
@@ -414,7 +1175,7 @@ const StyledDrawerHeader = styled__default.default(StyledHeader).attrs({
|
|
|
414
1175
|
const COMPONENT_ID$2 = 'modals.drawer_modal.body';
|
|
415
1176
|
const StyledDrawerBody = styled__default.default(StyledBody).attrs({
|
|
416
1177
|
'data-garden-id': COMPONENT_ID$2,
|
|
417
|
-
'data-garden-version': '9.
|
|
1178
|
+
'data-garden-version': '9.12.1'
|
|
418
1179
|
}).withConfig({
|
|
419
1180
|
displayName: "StyledDrawerBody",
|
|
420
1181
|
componentId: "sc-13qufyn-0"
|
|
@@ -423,7 +1184,7 @@ const StyledDrawerBody = styled__default.default(StyledBody).attrs({
|
|
|
423
1184
|
const COMPONENT_ID$1 = 'modals.drawer_modal.footer';
|
|
424
1185
|
const StyledDrawerFooter = styled__default.default.div.attrs({
|
|
425
1186
|
'data-garden-id': COMPONENT_ID$1,
|
|
426
|
-
'data-garden-version': '9.
|
|
1187
|
+
'data-garden-version': '9.12.1'
|
|
427
1188
|
}).withConfig({
|
|
428
1189
|
displayName: "StyledDrawerFooter",
|
|
429
1190
|
componentId: "sc-kc7e6p-0"
|
|
@@ -440,7 +1201,7 @@ const StyledDrawerFooter = styled__default.default.div.attrs({
|
|
|
440
1201
|
const COMPONENT_ID = 'modals.drawer_modal.footer_item';
|
|
441
1202
|
const StyledDrawerFooterItem = styled__default.default(StyledFooterItem).attrs({
|
|
442
1203
|
'data-garden-id': COMPONENT_ID,
|
|
443
|
-
'data-garden-version': '9.
|
|
1204
|
+
'data-garden-version': '9.12.1'
|
|
444
1205
|
}).withConfig({
|
|
445
1206
|
displayName: "StyledDrawerFooterItem",
|
|
446
1207
|
componentId: "sc-m2yul4-0"
|
|
@@ -784,6 +1545,7 @@ const TooltipDialogComponent = React__namespace.default.forwardRef((_ref, ref) =
|
|
|
784
1545
|
offset: _offset,
|
|
785
1546
|
onClose,
|
|
786
1547
|
hasArrow = true,
|
|
1548
|
+
keepMounted,
|
|
787
1549
|
isAnimated,
|
|
788
1550
|
zIndex,
|
|
789
1551
|
backdropProps,
|
|
@@ -870,16 +1632,23 @@ const TooltipDialogComponent = React__namespace.default.forwardRef((_ref, ref) =
|
|
|
870
1632
|
getCloseProps
|
|
871
1633
|
};
|
|
872
1634
|
const Node = React__namespace.default.createElement(reactTransitionGroup.CSSTransition, {
|
|
873
|
-
unmountOnExit:
|
|
1635
|
+
unmountOnExit: !keepMounted,
|
|
874
1636
|
timeout: isAnimated ? 200 : 0,
|
|
875
1637
|
in: Boolean(referenceElement),
|
|
876
1638
|
classNames: isAnimated ? 'garden-tooltip-modal-transition' : '',
|
|
877
|
-
nodeRef: transitionRef
|
|
1639
|
+
nodeRef: transitionRef,
|
|
1640
|
+
onEntered: () => {
|
|
1641
|
+
if (keepMounted && focusOnMount && modalRef.current) {
|
|
1642
|
+
modalRef.current.focus();
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
878
1645
|
}, transitionState => {
|
|
1646
|
+
const isHidden = keepMounted && transitionState === 'exited';
|
|
879
1647
|
return React__namespace.default.createElement(TooltipDialogContext.Provider, {
|
|
880
1648
|
value: value
|
|
881
1649
|
}, React__namespace.default.createElement(StyledTooltipDialogBackdrop, Object.assign({}, getBackdropProps(), backdropProps, {
|
|
882
|
-
ref: transitionRef
|
|
1650
|
+
ref: transitionRef,
|
|
1651
|
+
"aria-hidden": isHidden ? true : undefined
|
|
883
1652
|
}), React__namespace.default.createElement(StyledTooltipWrapper, {
|
|
884
1653
|
ref: setFloatingElement,
|
|
885
1654
|
style: {
|
|
@@ -907,6 +1676,7 @@ TooltipDialogComponent.propTypes = {
|
|
|
907
1676
|
fallbackPlacements: PropTypes__default.default.arrayOf(PropTypes__default.default.oneOf(PLACEMENT.filter(placement => placement !== 'auto'))),
|
|
908
1677
|
isAnimated: PropTypes__default.default.bool,
|
|
909
1678
|
hasArrow: PropTypes__default.default.bool,
|
|
1679
|
+
keepMounted: PropTypes__default.default.bool,
|
|
910
1680
|
zIndex: PropTypes__default.default.number,
|
|
911
1681
|
onClose: PropTypes__default.default.func,
|
|
912
1682
|
backdropProps: PropTypes__default.default.any,
|