@storybook/addon-onboarding 0.0.0-pr-32412-sha-4e0feb24 → 0.0.0-pr-32458-sha-a8934fc9
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.
|
@@ -1437,6 +1437,855 @@ __name(HighlightElement, "HighlightElement");
|
|
|
1437
1437
|
// src/features/GuidedTour/GuidedTour.tsx
|
|
1438
1438
|
import React12, { useEffect as useEffect3, useState } from "react";
|
|
1439
1439
|
|
|
1440
|
+
// ../../node_modules/@babel/runtime/helpers/esm/extends.js
|
|
1441
|
+
function _extends() {
|
|
1442
|
+
return _extends = Object.assign ? Object.assign.bind() : function(n2) {
|
|
1443
|
+
for (var e2 = 1; e2 < arguments.length; e2++) {
|
|
1444
|
+
var t2 = arguments[e2];
|
|
1445
|
+
for (var r2 in t2) ({}).hasOwnProperty.call(t2, r2) && (n2[r2] = t2[r2]);
|
|
1446
|
+
}
|
|
1447
|
+
return n2;
|
|
1448
|
+
}, _extends.apply(null, arguments);
|
|
1449
|
+
}
|
|
1450
|
+
__name(_extends, "_extends");
|
|
1451
|
+
|
|
1452
|
+
// ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
|
1453
|
+
function _assertThisInitialized(e2) {
|
|
1454
|
+
if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1455
|
+
return e2;
|
|
1456
|
+
}
|
|
1457
|
+
__name(_assertThisInitialized, "_assertThisInitialized");
|
|
1458
|
+
|
|
1459
|
+
// ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
|
1460
|
+
function _setPrototypeOf(t2, e2) {
|
|
1461
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
|
|
1462
|
+
return t3.__proto__ = e3, t3;
|
|
1463
|
+
}, _setPrototypeOf(t2, e2);
|
|
1464
|
+
}
|
|
1465
|
+
__name(_setPrototypeOf, "_setPrototypeOf");
|
|
1466
|
+
|
|
1467
|
+
// ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
|
1468
|
+
function _inheritsLoose(t2, o2) {
|
|
1469
|
+
t2.prototype = Object.create(o2.prototype), t2.prototype.constructor = t2, _setPrototypeOf(t2, o2);
|
|
1470
|
+
}
|
|
1471
|
+
__name(_inheritsLoose, "_inheritsLoose");
|
|
1472
|
+
|
|
1473
|
+
// ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
|
1474
|
+
function _getPrototypeOf(t2) {
|
|
1475
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
|
|
1476
|
+
return t3.__proto__ || Object.getPrototypeOf(t3);
|
|
1477
|
+
}, _getPrototypeOf(t2);
|
|
1478
|
+
}
|
|
1479
|
+
__name(_getPrototypeOf, "_getPrototypeOf");
|
|
1480
|
+
|
|
1481
|
+
// ../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
|
|
1482
|
+
function _isNativeFunction(t2) {
|
|
1483
|
+
try {
|
|
1484
|
+
return -1 !== Function.toString.call(t2).indexOf("[native code]");
|
|
1485
|
+
} catch (n2) {
|
|
1486
|
+
return "function" == typeof t2;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
__name(_isNativeFunction, "_isNativeFunction");
|
|
1490
|
+
|
|
1491
|
+
// ../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
|
|
1492
|
+
function _isNativeReflectConstruct() {
|
|
1493
|
+
try {
|
|
1494
|
+
var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
1495
|
+
}));
|
|
1496
|
+
} catch (t3) {
|
|
1497
|
+
}
|
|
1498
|
+
return (_isNativeReflectConstruct = /* @__PURE__ */ __name(function _isNativeReflectConstruct3() {
|
|
1499
|
+
return !!t2;
|
|
1500
|
+
}, "_isNativeReflectConstruct"))();
|
|
1501
|
+
}
|
|
1502
|
+
__name(_isNativeReflectConstruct, "_isNativeReflectConstruct");
|
|
1503
|
+
|
|
1504
|
+
// ../../node_modules/@babel/runtime/helpers/esm/construct.js
|
|
1505
|
+
function _construct(t2, e2, r2) {
|
|
1506
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
1507
|
+
var o2 = [null];
|
|
1508
|
+
o2.push.apply(o2, e2);
|
|
1509
|
+
var p2 = new (t2.bind.apply(t2, o2))();
|
|
1510
|
+
return r2 && _setPrototypeOf(p2, r2.prototype), p2;
|
|
1511
|
+
}
|
|
1512
|
+
__name(_construct, "_construct");
|
|
1513
|
+
|
|
1514
|
+
// ../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
|
|
1515
|
+
function _wrapNativeSuper(t2) {
|
|
1516
|
+
var r2 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
|
|
1517
|
+
return _wrapNativeSuper = /* @__PURE__ */ __name(function _wrapNativeSuper2(t3) {
|
|
1518
|
+
if (null === t3 || !_isNativeFunction(t3)) return t3;
|
|
1519
|
+
if ("function" != typeof t3) throw new TypeError("Super expression must either be null or a function");
|
|
1520
|
+
if (void 0 !== r2) {
|
|
1521
|
+
if (r2.has(t3)) return r2.get(t3);
|
|
1522
|
+
r2.set(t3, Wrapper4);
|
|
1523
|
+
}
|
|
1524
|
+
function Wrapper4() {
|
|
1525
|
+
return _construct(t3, arguments, _getPrototypeOf(this).constructor);
|
|
1526
|
+
}
|
|
1527
|
+
__name(Wrapper4, "Wrapper");
|
|
1528
|
+
return Wrapper4.prototype = Object.create(t3.prototype, {
|
|
1529
|
+
constructor: {
|
|
1530
|
+
value: Wrapper4,
|
|
1531
|
+
enumerable: false,
|
|
1532
|
+
writable: true,
|
|
1533
|
+
configurable: true
|
|
1534
|
+
}
|
|
1535
|
+
}), _setPrototypeOf(Wrapper4, t3);
|
|
1536
|
+
}, "_wrapNativeSuper"), _wrapNativeSuper(t2);
|
|
1537
|
+
}
|
|
1538
|
+
__name(_wrapNativeSuper, "_wrapNativeSuper");
|
|
1539
|
+
|
|
1540
|
+
// ../../node_modules/polished/dist/polished.esm.js
|
|
1541
|
+
var ERRORS = {
|
|
1542
|
+
"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",
|
|
1543
|
+
"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",
|
|
1544
|
+
"3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
|
|
1545
|
+
"4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
|
|
1546
|
+
"5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
|
|
1547
|
+
"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",
|
|
1548
|
+
"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",
|
|
1549
|
+
"8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
|
|
1550
|
+
"9": "Please provide a number of steps to the modularScale helper.\n\n",
|
|
1551
|
+
"10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
|
|
1552
|
+
"11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',
|
|
1553
|
+
"12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',
|
|
1554
|
+
"13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',
|
|
1555
|
+
"14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
|
|
1556
|
+
"15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
|
|
1557
|
+
"16": "You must provide a template to this method.\n\n",
|
|
1558
|
+
"17": "You passed an unsupported selector state to this method.\n\n",
|
|
1559
|
+
"18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
|
|
1560
|
+
"19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
|
|
1561
|
+
"20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
|
|
1562
|
+
"21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
|
1563
|
+
"22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
|
1564
|
+
"23": "fontFace expects a name of a font-family.\n\n",
|
|
1565
|
+
"24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
|
|
1566
|
+
"25": "fontFace expects localFonts to be an array.\n\n",
|
|
1567
|
+
"26": "fontFace expects fileFormats to be an array.\n\n",
|
|
1568
|
+
"27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
|
|
1569
|
+
"28": "Please supply a filename to retinaImage() as the first argument.\n\n",
|
|
1570
|
+
"29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
|
|
1571
|
+
"30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
|
1572
|
+
"31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
|
|
1573
|
+
"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",
|
|
1574
|
+
"33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
|
|
1575
|
+
"34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
|
|
1576
|
+
"35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
|
|
1577
|
+
"36": "Property must be a string value.\n\n",
|
|
1578
|
+
"37": "Syntax Error at %s.\n\n",
|
|
1579
|
+
"38": "Formula contains a function that needs parentheses at %s.\n\n",
|
|
1580
|
+
"39": "Formula is missing closing parenthesis at %s.\n\n",
|
|
1581
|
+
"40": "Formula has too many closing parentheses at %s.\n\n",
|
|
1582
|
+
"41": "All values in a formula must have the same unit or be unitless.\n\n",
|
|
1583
|
+
"42": "Please provide a number of steps to the modularScale helper.\n\n",
|
|
1584
|
+
"43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
|
|
1585
|
+
"44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
|
|
1586
|
+
"45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
|
|
1587
|
+
"46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
|
|
1588
|
+
"47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
|
|
1589
|
+
"48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
|
|
1590
|
+
"49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
|
|
1591
|
+
"50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
|
|
1592
|
+
"51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
|
|
1593
|
+
"52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
|
|
1594
|
+
"53": "fontFace expects localFonts to be an array.\n\n",
|
|
1595
|
+
"54": "fontFace expects fileFormats to be an array.\n\n",
|
|
1596
|
+
"55": "fontFace expects a name of a font-family.\n\n",
|
|
1597
|
+
"56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
|
|
1598
|
+
"57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
|
|
1599
|
+
"58": "Please supply a filename to retinaImage() as the first argument.\n\n",
|
|
1600
|
+
"59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
|
|
1601
|
+
"60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
|
1602
|
+
"61": "Property must be a string value.\n\n",
|
|
1603
|
+
"62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
|
|
1604
|
+
"63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
|
|
1605
|
+
"64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
|
|
1606
|
+
"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",
|
|
1607
|
+
"66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
|
|
1608
|
+
"67": "You must provide a template to this method.\n\n",
|
|
1609
|
+
"68": "You passed an unsupported selector state to this method.\n\n",
|
|
1610
|
+
"69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',
|
|
1611
|
+
"70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',
|
|
1612
|
+
"71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',
|
|
1613
|
+
"72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',
|
|
1614
|
+
"73": "Please provide a valid CSS variable.\n\n",
|
|
1615
|
+
"74": "CSS variable not found and no default was provided.\n\n",
|
|
1616
|
+
"75": "important requires a valid style object, got a %s instead.\n\n",
|
|
1617
|
+
"76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
|
|
1618
|
+
"77": 'remToPx expects a value in "rem" but you provided it in "%s".\n\n',
|
|
1619
|
+
"78": 'base must be set in "px" or "%" but you set it in "%s".\n'
|
|
1620
|
+
};
|
|
1621
|
+
function format() {
|
|
1622
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1623
|
+
args[_key] = arguments[_key];
|
|
1624
|
+
}
|
|
1625
|
+
var a2 = args[0];
|
|
1626
|
+
var b2 = [];
|
|
1627
|
+
var c2;
|
|
1628
|
+
for (c2 = 1; c2 < args.length; c2 += 1) {
|
|
1629
|
+
b2.push(args[c2]);
|
|
1630
|
+
}
|
|
1631
|
+
b2.forEach(function(d2) {
|
|
1632
|
+
a2 = a2.replace(/%[a-z]/, d2);
|
|
1633
|
+
});
|
|
1634
|
+
return a2;
|
|
1635
|
+
}
|
|
1636
|
+
__name(format, "format");
|
|
1637
|
+
var PolishedError = function(_Error) {
|
|
1638
|
+
_inheritsLoose(PolishedError2, _Error);
|
|
1639
|
+
function PolishedError2(code) {
|
|
1640
|
+
var _this;
|
|
1641
|
+
if (process.env.NODE_ENV === "production") {
|
|
1642
|
+
_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;
|
|
1643
|
+
} else {
|
|
1644
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1645
|
+
args[_key2 - 1] = arguments[_key2];
|
|
1646
|
+
}
|
|
1647
|
+
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
1648
|
+
}
|
|
1649
|
+
return _assertThisInitialized(_this);
|
|
1650
|
+
}
|
|
1651
|
+
__name(PolishedError2, "PolishedError");
|
|
1652
|
+
return PolishedError2;
|
|
1653
|
+
}(_wrapNativeSuper(Error));
|
|
1654
|
+
function endsWith(string, suffix) {
|
|
1655
|
+
return string.substr(-suffix.length) === suffix;
|
|
1656
|
+
}
|
|
1657
|
+
__name(endsWith, "endsWith");
|
|
1658
|
+
var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
|
|
1659
|
+
function stripUnit(value) {
|
|
1660
|
+
if (typeof value !== "string") return value;
|
|
1661
|
+
var matchedValue = value.match(cssRegex$1);
|
|
1662
|
+
return matchedValue ? parseFloat(value) : value;
|
|
1663
|
+
}
|
|
1664
|
+
__name(stripUnit, "stripUnit");
|
|
1665
|
+
var pxtoFactory = /* @__PURE__ */ __name(function pxtoFactory2(to) {
|
|
1666
|
+
return function(pxval, base) {
|
|
1667
|
+
if (base === void 0) {
|
|
1668
|
+
base = "16px";
|
|
1669
|
+
}
|
|
1670
|
+
var newPxval = pxval;
|
|
1671
|
+
var newBase = base;
|
|
1672
|
+
if (typeof pxval === "string") {
|
|
1673
|
+
if (!endsWith(pxval, "px")) {
|
|
1674
|
+
throw new PolishedError(69, to, pxval);
|
|
1675
|
+
}
|
|
1676
|
+
newPxval = stripUnit(pxval);
|
|
1677
|
+
}
|
|
1678
|
+
if (typeof base === "string") {
|
|
1679
|
+
if (!endsWith(base, "px")) {
|
|
1680
|
+
throw new PolishedError(70, to, base);
|
|
1681
|
+
}
|
|
1682
|
+
newBase = stripUnit(base);
|
|
1683
|
+
}
|
|
1684
|
+
if (typeof newPxval === "string") {
|
|
1685
|
+
throw new PolishedError(71, pxval, to);
|
|
1686
|
+
}
|
|
1687
|
+
if (typeof newBase === "string") {
|
|
1688
|
+
throw new PolishedError(72, base, to);
|
|
1689
|
+
}
|
|
1690
|
+
return "" + newPxval / newBase + to;
|
|
1691
|
+
};
|
|
1692
|
+
}, "pxtoFactory");
|
|
1693
|
+
var pixelsto = pxtoFactory;
|
|
1694
|
+
var em = pixelsto("em");
|
|
1695
|
+
var rem = pixelsto("rem");
|
|
1696
|
+
function colorToInt(color2) {
|
|
1697
|
+
return Math.round(color2 * 255);
|
|
1698
|
+
}
|
|
1699
|
+
__name(colorToInt, "colorToInt");
|
|
1700
|
+
function convertToInt(red, green, blue) {
|
|
1701
|
+
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
1702
|
+
}
|
|
1703
|
+
__name(convertToInt, "convertToInt");
|
|
1704
|
+
function hslToRgb(hue, saturation, lightness, convert2) {
|
|
1705
|
+
if (convert2 === void 0) {
|
|
1706
|
+
convert2 = convertToInt;
|
|
1707
|
+
}
|
|
1708
|
+
if (saturation === 0) {
|
|
1709
|
+
return convert2(lightness, lightness, lightness);
|
|
1710
|
+
}
|
|
1711
|
+
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
1712
|
+
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
1713
|
+
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
1714
|
+
var red = 0;
|
|
1715
|
+
var green = 0;
|
|
1716
|
+
var blue = 0;
|
|
1717
|
+
if (huePrime >= 0 && huePrime < 1) {
|
|
1718
|
+
red = chroma;
|
|
1719
|
+
green = secondComponent;
|
|
1720
|
+
} else if (huePrime >= 1 && huePrime < 2) {
|
|
1721
|
+
red = secondComponent;
|
|
1722
|
+
green = chroma;
|
|
1723
|
+
} else if (huePrime >= 2 && huePrime < 3) {
|
|
1724
|
+
green = chroma;
|
|
1725
|
+
blue = secondComponent;
|
|
1726
|
+
} else if (huePrime >= 3 && huePrime < 4) {
|
|
1727
|
+
green = secondComponent;
|
|
1728
|
+
blue = chroma;
|
|
1729
|
+
} else if (huePrime >= 4 && huePrime < 5) {
|
|
1730
|
+
red = secondComponent;
|
|
1731
|
+
blue = chroma;
|
|
1732
|
+
} else if (huePrime >= 5 && huePrime < 6) {
|
|
1733
|
+
red = chroma;
|
|
1734
|
+
blue = secondComponent;
|
|
1735
|
+
}
|
|
1736
|
+
var lightnessModification = lightness - chroma / 2;
|
|
1737
|
+
var finalRed = red + lightnessModification;
|
|
1738
|
+
var finalGreen = green + lightnessModification;
|
|
1739
|
+
var finalBlue = blue + lightnessModification;
|
|
1740
|
+
return convert2(finalRed, finalGreen, finalBlue);
|
|
1741
|
+
}
|
|
1742
|
+
__name(hslToRgb, "hslToRgb");
|
|
1743
|
+
var namedColorMap = {
|
|
1744
|
+
aliceblue: "f0f8ff",
|
|
1745
|
+
antiquewhite: "faebd7",
|
|
1746
|
+
aqua: "00ffff",
|
|
1747
|
+
aquamarine: "7fffd4",
|
|
1748
|
+
azure: "f0ffff",
|
|
1749
|
+
beige: "f5f5dc",
|
|
1750
|
+
bisque: "ffe4c4",
|
|
1751
|
+
black: "000",
|
|
1752
|
+
blanchedalmond: "ffebcd",
|
|
1753
|
+
blue: "0000ff",
|
|
1754
|
+
blueviolet: "8a2be2",
|
|
1755
|
+
brown: "a52a2a",
|
|
1756
|
+
burlywood: "deb887",
|
|
1757
|
+
cadetblue: "5f9ea0",
|
|
1758
|
+
chartreuse: "7fff00",
|
|
1759
|
+
chocolate: "d2691e",
|
|
1760
|
+
coral: "ff7f50",
|
|
1761
|
+
cornflowerblue: "6495ed",
|
|
1762
|
+
cornsilk: "fff8dc",
|
|
1763
|
+
crimson: "dc143c",
|
|
1764
|
+
cyan: "00ffff",
|
|
1765
|
+
darkblue: "00008b",
|
|
1766
|
+
darkcyan: "008b8b",
|
|
1767
|
+
darkgoldenrod: "b8860b",
|
|
1768
|
+
darkgray: "a9a9a9",
|
|
1769
|
+
darkgreen: "006400",
|
|
1770
|
+
darkgrey: "a9a9a9",
|
|
1771
|
+
darkkhaki: "bdb76b",
|
|
1772
|
+
darkmagenta: "8b008b",
|
|
1773
|
+
darkolivegreen: "556b2f",
|
|
1774
|
+
darkorange: "ff8c00",
|
|
1775
|
+
darkorchid: "9932cc",
|
|
1776
|
+
darkred: "8b0000",
|
|
1777
|
+
darksalmon: "e9967a",
|
|
1778
|
+
darkseagreen: "8fbc8f",
|
|
1779
|
+
darkslateblue: "483d8b",
|
|
1780
|
+
darkslategray: "2f4f4f",
|
|
1781
|
+
darkslategrey: "2f4f4f",
|
|
1782
|
+
darkturquoise: "00ced1",
|
|
1783
|
+
darkviolet: "9400d3",
|
|
1784
|
+
deeppink: "ff1493",
|
|
1785
|
+
deepskyblue: "00bfff",
|
|
1786
|
+
dimgray: "696969",
|
|
1787
|
+
dimgrey: "696969",
|
|
1788
|
+
dodgerblue: "1e90ff",
|
|
1789
|
+
firebrick: "b22222",
|
|
1790
|
+
floralwhite: "fffaf0",
|
|
1791
|
+
forestgreen: "228b22",
|
|
1792
|
+
fuchsia: "ff00ff",
|
|
1793
|
+
gainsboro: "dcdcdc",
|
|
1794
|
+
ghostwhite: "f8f8ff",
|
|
1795
|
+
gold: "ffd700",
|
|
1796
|
+
goldenrod: "daa520",
|
|
1797
|
+
gray: "808080",
|
|
1798
|
+
green: "008000",
|
|
1799
|
+
greenyellow: "adff2f",
|
|
1800
|
+
grey: "808080",
|
|
1801
|
+
honeydew: "f0fff0",
|
|
1802
|
+
hotpink: "ff69b4",
|
|
1803
|
+
indianred: "cd5c5c",
|
|
1804
|
+
indigo: "4b0082",
|
|
1805
|
+
ivory: "fffff0",
|
|
1806
|
+
khaki: "f0e68c",
|
|
1807
|
+
lavender: "e6e6fa",
|
|
1808
|
+
lavenderblush: "fff0f5",
|
|
1809
|
+
lawngreen: "7cfc00",
|
|
1810
|
+
lemonchiffon: "fffacd",
|
|
1811
|
+
lightblue: "add8e6",
|
|
1812
|
+
lightcoral: "f08080",
|
|
1813
|
+
lightcyan: "e0ffff",
|
|
1814
|
+
lightgoldenrodyellow: "fafad2",
|
|
1815
|
+
lightgray: "d3d3d3",
|
|
1816
|
+
lightgreen: "90ee90",
|
|
1817
|
+
lightgrey: "d3d3d3",
|
|
1818
|
+
lightpink: "ffb6c1",
|
|
1819
|
+
lightsalmon: "ffa07a",
|
|
1820
|
+
lightseagreen: "20b2aa",
|
|
1821
|
+
lightskyblue: "87cefa",
|
|
1822
|
+
lightslategray: "789",
|
|
1823
|
+
lightslategrey: "789",
|
|
1824
|
+
lightsteelblue: "b0c4de",
|
|
1825
|
+
lightyellow: "ffffe0",
|
|
1826
|
+
lime: "0f0",
|
|
1827
|
+
limegreen: "32cd32",
|
|
1828
|
+
linen: "faf0e6",
|
|
1829
|
+
magenta: "f0f",
|
|
1830
|
+
maroon: "800000",
|
|
1831
|
+
mediumaquamarine: "66cdaa",
|
|
1832
|
+
mediumblue: "0000cd",
|
|
1833
|
+
mediumorchid: "ba55d3",
|
|
1834
|
+
mediumpurple: "9370db",
|
|
1835
|
+
mediumseagreen: "3cb371",
|
|
1836
|
+
mediumslateblue: "7b68ee",
|
|
1837
|
+
mediumspringgreen: "00fa9a",
|
|
1838
|
+
mediumturquoise: "48d1cc",
|
|
1839
|
+
mediumvioletred: "c71585",
|
|
1840
|
+
midnightblue: "191970",
|
|
1841
|
+
mintcream: "f5fffa",
|
|
1842
|
+
mistyrose: "ffe4e1",
|
|
1843
|
+
moccasin: "ffe4b5",
|
|
1844
|
+
navajowhite: "ffdead",
|
|
1845
|
+
navy: "000080",
|
|
1846
|
+
oldlace: "fdf5e6",
|
|
1847
|
+
olive: "808000",
|
|
1848
|
+
olivedrab: "6b8e23",
|
|
1849
|
+
orange: "ffa500",
|
|
1850
|
+
orangered: "ff4500",
|
|
1851
|
+
orchid: "da70d6",
|
|
1852
|
+
palegoldenrod: "eee8aa",
|
|
1853
|
+
palegreen: "98fb98",
|
|
1854
|
+
paleturquoise: "afeeee",
|
|
1855
|
+
palevioletred: "db7093",
|
|
1856
|
+
papayawhip: "ffefd5",
|
|
1857
|
+
peachpuff: "ffdab9",
|
|
1858
|
+
peru: "cd853f",
|
|
1859
|
+
pink: "ffc0cb",
|
|
1860
|
+
plum: "dda0dd",
|
|
1861
|
+
powderblue: "b0e0e6",
|
|
1862
|
+
purple: "800080",
|
|
1863
|
+
rebeccapurple: "639",
|
|
1864
|
+
red: "f00",
|
|
1865
|
+
rosybrown: "bc8f8f",
|
|
1866
|
+
royalblue: "4169e1",
|
|
1867
|
+
saddlebrown: "8b4513",
|
|
1868
|
+
salmon: "fa8072",
|
|
1869
|
+
sandybrown: "f4a460",
|
|
1870
|
+
seagreen: "2e8b57",
|
|
1871
|
+
seashell: "fff5ee",
|
|
1872
|
+
sienna: "a0522d",
|
|
1873
|
+
silver: "c0c0c0",
|
|
1874
|
+
skyblue: "87ceeb",
|
|
1875
|
+
slateblue: "6a5acd",
|
|
1876
|
+
slategray: "708090",
|
|
1877
|
+
slategrey: "708090",
|
|
1878
|
+
snow: "fffafa",
|
|
1879
|
+
springgreen: "00ff7f",
|
|
1880
|
+
steelblue: "4682b4",
|
|
1881
|
+
tan: "d2b48c",
|
|
1882
|
+
teal: "008080",
|
|
1883
|
+
thistle: "d8bfd8",
|
|
1884
|
+
tomato: "ff6347",
|
|
1885
|
+
turquoise: "40e0d0",
|
|
1886
|
+
violet: "ee82ee",
|
|
1887
|
+
wheat: "f5deb3",
|
|
1888
|
+
white: "fff",
|
|
1889
|
+
whitesmoke: "f5f5f5",
|
|
1890
|
+
yellow: "ff0",
|
|
1891
|
+
yellowgreen: "9acd32"
|
|
1892
|
+
};
|
|
1893
|
+
function nameToHex(color2) {
|
|
1894
|
+
if (typeof color2 !== "string") return color2;
|
|
1895
|
+
var normalizedColorName = color2.toLowerCase();
|
|
1896
|
+
return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color2;
|
|
1897
|
+
}
|
|
1898
|
+
__name(nameToHex, "nameToHex");
|
|
1899
|
+
var hexRegex = /^#[a-fA-F0-9]{6}$/;
|
|
1900
|
+
var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
|
|
1901
|
+
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
|
|
1902
|
+
var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
|
|
1903
|
+
var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
|
|
1904
|
+
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
1905
|
+
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;
|
|
1906
|
+
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;
|
|
1907
|
+
function parseToRgb(color2) {
|
|
1908
|
+
if (typeof color2 !== "string") {
|
|
1909
|
+
throw new PolishedError(3);
|
|
1910
|
+
}
|
|
1911
|
+
var normalizedColor = nameToHex(color2);
|
|
1912
|
+
if (normalizedColor.match(hexRegex)) {
|
|
1913
|
+
return {
|
|
1914
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
1915
|
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
|
1916
|
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
1917
|
+
};
|
|
1918
|
+
}
|
|
1919
|
+
if (normalizedColor.match(hexRgbaRegex)) {
|
|
1920
|
+
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
1921
|
+
return {
|
|
1922
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
1923
|
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
|
1924
|
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
|
|
1925
|
+
alpha
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
if (normalizedColor.match(reducedHexRegex)) {
|
|
1929
|
+
return {
|
|
1930
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
1931
|
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
1932
|
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
1936
|
+
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
1937
|
+
return {
|
|
1938
|
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
1939
|
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
1940
|
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
|
|
1941
|
+
alpha: _alpha
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
1945
|
+
if (rgbMatched) {
|
|
1946
|
+
return {
|
|
1947
|
+
red: parseInt("" + rgbMatched[1], 10),
|
|
1948
|
+
green: parseInt("" + rgbMatched[2], 10),
|
|
1949
|
+
blue: parseInt("" + rgbMatched[3], 10)
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
1953
|
+
if (rgbaMatched) {
|
|
1954
|
+
return {
|
|
1955
|
+
red: parseInt("" + rgbaMatched[1], 10),
|
|
1956
|
+
green: parseInt("" + rgbaMatched[2], 10),
|
|
1957
|
+
blue: parseInt("" + rgbaMatched[3], 10),
|
|
1958
|
+
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
1959
|
+
};
|
|
1960
|
+
}
|
|
1961
|
+
var hslMatched = hslRegex.exec(normalizedColor);
|
|
1962
|
+
if (hslMatched) {
|
|
1963
|
+
var hue = parseInt("" + hslMatched[1], 10);
|
|
1964
|
+
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
1965
|
+
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
1966
|
+
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
1967
|
+
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
1968
|
+
if (!hslRgbMatched) {
|
|
1969
|
+
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
1970
|
+
}
|
|
1971
|
+
return {
|
|
1972
|
+
red: parseInt("" + hslRgbMatched[1], 10),
|
|
1973
|
+
green: parseInt("" + hslRgbMatched[2], 10),
|
|
1974
|
+
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
1978
|
+
if (hslaMatched) {
|
|
1979
|
+
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
1980
|
+
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
1981
|
+
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
1982
|
+
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
1983
|
+
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
1984
|
+
if (!_hslRgbMatched) {
|
|
1985
|
+
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
1986
|
+
}
|
|
1987
|
+
return {
|
|
1988
|
+
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
1989
|
+
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
1990
|
+
blue: parseInt("" + _hslRgbMatched[3], 10),
|
|
1991
|
+
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
throw new PolishedError(5);
|
|
1995
|
+
}
|
|
1996
|
+
__name(parseToRgb, "parseToRgb");
|
|
1997
|
+
function rgbToHsl(color2) {
|
|
1998
|
+
var red = color2.red / 255;
|
|
1999
|
+
var green = color2.green / 255;
|
|
2000
|
+
var blue = color2.blue / 255;
|
|
2001
|
+
var max = Math.max(red, green, blue);
|
|
2002
|
+
var min = Math.min(red, green, blue);
|
|
2003
|
+
var lightness = (max + min) / 2;
|
|
2004
|
+
if (max === min) {
|
|
2005
|
+
if (color2.alpha !== void 0) {
|
|
2006
|
+
return {
|
|
2007
|
+
hue: 0,
|
|
2008
|
+
saturation: 0,
|
|
2009
|
+
lightness,
|
|
2010
|
+
alpha: color2.alpha
|
|
2011
|
+
};
|
|
2012
|
+
} else {
|
|
2013
|
+
return {
|
|
2014
|
+
hue: 0,
|
|
2015
|
+
saturation: 0,
|
|
2016
|
+
lightness
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
var hue;
|
|
2021
|
+
var delta = max - min;
|
|
2022
|
+
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
2023
|
+
switch (max) {
|
|
2024
|
+
case red:
|
|
2025
|
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
2026
|
+
break;
|
|
2027
|
+
case green:
|
|
2028
|
+
hue = (blue - red) / delta + 2;
|
|
2029
|
+
break;
|
|
2030
|
+
default:
|
|
2031
|
+
hue = (red - green) / delta + 4;
|
|
2032
|
+
break;
|
|
2033
|
+
}
|
|
2034
|
+
hue *= 60;
|
|
2035
|
+
if (color2.alpha !== void 0) {
|
|
2036
|
+
return {
|
|
2037
|
+
hue,
|
|
2038
|
+
saturation,
|
|
2039
|
+
lightness,
|
|
2040
|
+
alpha: color2.alpha
|
|
2041
|
+
};
|
|
2042
|
+
}
|
|
2043
|
+
return {
|
|
2044
|
+
hue,
|
|
2045
|
+
saturation,
|
|
2046
|
+
lightness
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
__name(rgbToHsl, "rgbToHsl");
|
|
2050
|
+
function parseToHsl(color2) {
|
|
2051
|
+
return rgbToHsl(parseToRgb(color2));
|
|
2052
|
+
}
|
|
2053
|
+
__name(parseToHsl, "parseToHsl");
|
|
2054
|
+
var reduceHexValue = /* @__PURE__ */ __name(function reduceHexValue2(value) {
|
|
2055
|
+
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
2056
|
+
return "#" + value[1] + value[3] + value[5];
|
|
2057
|
+
}
|
|
2058
|
+
return value;
|
|
2059
|
+
}, "reduceHexValue");
|
|
2060
|
+
var reduceHexValue$1 = reduceHexValue;
|
|
2061
|
+
function numberToHex(value) {
|
|
2062
|
+
var hex = value.toString(16);
|
|
2063
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
2064
|
+
}
|
|
2065
|
+
__name(numberToHex, "numberToHex");
|
|
2066
|
+
function colorToHex(color2) {
|
|
2067
|
+
return numberToHex(Math.round(color2 * 255));
|
|
2068
|
+
}
|
|
2069
|
+
__name(colorToHex, "colorToHex");
|
|
2070
|
+
function convertToHex(red, green, blue) {
|
|
2071
|
+
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
2072
|
+
}
|
|
2073
|
+
__name(convertToHex, "convertToHex");
|
|
2074
|
+
function hslToHex(hue, saturation, lightness) {
|
|
2075
|
+
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
2076
|
+
}
|
|
2077
|
+
__name(hslToHex, "hslToHex");
|
|
2078
|
+
function hsl(value, saturation, lightness) {
|
|
2079
|
+
if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number") {
|
|
2080
|
+
return hslToHex(value, saturation, lightness);
|
|
2081
|
+
} else if (typeof value === "object" && saturation === void 0 && lightness === void 0) {
|
|
2082
|
+
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
2083
|
+
}
|
|
2084
|
+
throw new PolishedError(1);
|
|
2085
|
+
}
|
|
2086
|
+
__name(hsl, "hsl");
|
|
2087
|
+
function hsla(value, saturation, lightness, alpha) {
|
|
2088
|
+
if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number" && typeof alpha === "number") {
|
|
2089
|
+
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
2090
|
+
} else if (typeof value === "object" && saturation === void 0 && lightness === void 0 && alpha === void 0) {
|
|
2091
|
+
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
2092
|
+
}
|
|
2093
|
+
throw new PolishedError(2);
|
|
2094
|
+
}
|
|
2095
|
+
__name(hsla, "hsla");
|
|
2096
|
+
function rgb(value, green, blue) {
|
|
2097
|
+
if (typeof value === "number" && typeof green === "number" && typeof blue === "number") {
|
|
2098
|
+
return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
|
|
2099
|
+
} else if (typeof value === "object" && green === void 0 && blue === void 0) {
|
|
2100
|
+
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
2101
|
+
}
|
|
2102
|
+
throw new PolishedError(6);
|
|
2103
|
+
}
|
|
2104
|
+
__name(rgb, "rgb");
|
|
2105
|
+
function rgba(firstValue, secondValue, thirdValue, fourthValue) {
|
|
2106
|
+
if (typeof firstValue === "string" && typeof secondValue === "number") {
|
|
2107
|
+
var rgbValue = parseToRgb(firstValue);
|
|
2108
|
+
return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
|
|
2109
|
+
} else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") {
|
|
2110
|
+
return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
|
|
2111
|
+
} else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) {
|
|
2112
|
+
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
2113
|
+
}
|
|
2114
|
+
throw new PolishedError(7);
|
|
2115
|
+
}
|
|
2116
|
+
__name(rgba, "rgba");
|
|
2117
|
+
var isRgb = /* @__PURE__ */ __name(function isRgb2(color2) {
|
|
2118
|
+
return typeof color2.red === "number" && typeof color2.green === "number" && typeof color2.blue === "number" && (typeof color2.alpha !== "number" || typeof color2.alpha === "undefined");
|
|
2119
|
+
}, "isRgb");
|
|
2120
|
+
var isRgba = /* @__PURE__ */ __name(function isRgba2(color2) {
|
|
2121
|
+
return typeof color2.red === "number" && typeof color2.green === "number" && typeof color2.blue === "number" && typeof color2.alpha === "number";
|
|
2122
|
+
}, "isRgba");
|
|
2123
|
+
var isHsl = /* @__PURE__ */ __name(function isHsl2(color2) {
|
|
2124
|
+
return typeof color2.hue === "number" && typeof color2.saturation === "number" && typeof color2.lightness === "number" && (typeof color2.alpha !== "number" || typeof color2.alpha === "undefined");
|
|
2125
|
+
}, "isHsl");
|
|
2126
|
+
var isHsla = /* @__PURE__ */ __name(function isHsla2(color2) {
|
|
2127
|
+
return typeof color2.hue === "number" && typeof color2.saturation === "number" && typeof color2.lightness === "number" && typeof color2.alpha === "number";
|
|
2128
|
+
}, "isHsla");
|
|
2129
|
+
function toColorString(color2) {
|
|
2130
|
+
if (typeof color2 !== "object") throw new PolishedError(8);
|
|
2131
|
+
if (isRgba(color2)) return rgba(color2);
|
|
2132
|
+
if (isRgb(color2)) return rgb(color2);
|
|
2133
|
+
if (isHsla(color2)) return hsla(color2);
|
|
2134
|
+
if (isHsl(color2)) return hsl(color2);
|
|
2135
|
+
throw new PolishedError(8);
|
|
2136
|
+
}
|
|
2137
|
+
__name(toColorString, "toColorString");
|
|
2138
|
+
function curried(f2, length, acc) {
|
|
2139
|
+
return /* @__PURE__ */ __name(function fn() {
|
|
2140
|
+
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
2141
|
+
return combined.length >= length ? f2.apply(this, combined) : curried(f2, length, combined);
|
|
2142
|
+
}, "fn");
|
|
2143
|
+
}
|
|
2144
|
+
__name(curried, "curried");
|
|
2145
|
+
function curry(f2) {
|
|
2146
|
+
return curried(f2, f2.length, []);
|
|
2147
|
+
}
|
|
2148
|
+
__name(curry, "curry");
|
|
2149
|
+
function adjustHue(degree, color2) {
|
|
2150
|
+
if (color2 === "transparent") return color2;
|
|
2151
|
+
var hslColor = parseToHsl(color2);
|
|
2152
|
+
return toColorString(_extends({}, hslColor, {
|
|
2153
|
+
hue: hslColor.hue + parseFloat(degree)
|
|
2154
|
+
}));
|
|
2155
|
+
}
|
|
2156
|
+
__name(adjustHue, "adjustHue");
|
|
2157
|
+
var curriedAdjustHue = curry(adjustHue);
|
|
2158
|
+
function guard(lowerBoundary, upperBoundary, value) {
|
|
2159
|
+
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
2160
|
+
}
|
|
2161
|
+
__name(guard, "guard");
|
|
2162
|
+
function darken(amount, color2) {
|
|
2163
|
+
if (color2 === "transparent") return color2;
|
|
2164
|
+
var hslColor = parseToHsl(color2);
|
|
2165
|
+
return toColorString(_extends({}, hslColor, {
|
|
2166
|
+
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
2167
|
+
}));
|
|
2168
|
+
}
|
|
2169
|
+
__name(darken, "darken");
|
|
2170
|
+
var curriedDarken = curry(darken);
|
|
2171
|
+
var curriedDarken$1 = curriedDarken;
|
|
2172
|
+
function desaturate(amount, color2) {
|
|
2173
|
+
if (color2 === "transparent") return color2;
|
|
2174
|
+
var hslColor = parseToHsl(color2);
|
|
2175
|
+
return toColorString(_extends({}, hslColor, {
|
|
2176
|
+
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
2177
|
+
}));
|
|
2178
|
+
}
|
|
2179
|
+
__name(desaturate, "desaturate");
|
|
2180
|
+
var curriedDesaturate = curry(desaturate);
|
|
2181
|
+
function lighten(amount, color2) {
|
|
2182
|
+
if (color2 === "transparent") return color2;
|
|
2183
|
+
var hslColor = parseToHsl(color2);
|
|
2184
|
+
return toColorString(_extends({}, hslColor, {
|
|
2185
|
+
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
2186
|
+
}));
|
|
2187
|
+
}
|
|
2188
|
+
__name(lighten, "lighten");
|
|
2189
|
+
var curriedLighten = curry(lighten);
|
|
2190
|
+
var curriedLighten$1 = curriedLighten;
|
|
2191
|
+
function mix(weight, color2, otherColor) {
|
|
2192
|
+
if (color2 === "transparent") return otherColor;
|
|
2193
|
+
if (otherColor === "transparent") return color2;
|
|
2194
|
+
if (weight === 0) return otherColor;
|
|
2195
|
+
var parsedColor1 = parseToRgb(color2);
|
|
2196
|
+
var color1 = _extends({}, parsedColor1, {
|
|
2197
|
+
alpha: typeof parsedColor1.alpha === "number" ? parsedColor1.alpha : 1
|
|
2198
|
+
});
|
|
2199
|
+
var parsedColor2 = parseToRgb(otherColor);
|
|
2200
|
+
var color22 = _extends({}, parsedColor2, {
|
|
2201
|
+
alpha: typeof parsedColor2.alpha === "number" ? parsedColor2.alpha : 1
|
|
2202
|
+
});
|
|
2203
|
+
var alphaDelta = color1.alpha - color22.alpha;
|
|
2204
|
+
var x2 = parseFloat(weight) * 2 - 1;
|
|
2205
|
+
var y2 = x2 * alphaDelta === -1 ? x2 : x2 + alphaDelta;
|
|
2206
|
+
var z2 = 1 + x2 * alphaDelta;
|
|
2207
|
+
var weight1 = (y2 / z2 + 1) / 2;
|
|
2208
|
+
var weight2 = 1 - weight1;
|
|
2209
|
+
var mixedColor = {
|
|
2210
|
+
red: Math.floor(color1.red * weight1 + color22.red * weight2),
|
|
2211
|
+
green: Math.floor(color1.green * weight1 + color22.green * weight2),
|
|
2212
|
+
blue: Math.floor(color1.blue * weight1 + color22.blue * weight2),
|
|
2213
|
+
alpha: color1.alpha * parseFloat(weight) + color22.alpha * (1 - parseFloat(weight))
|
|
2214
|
+
};
|
|
2215
|
+
return rgba(mixedColor);
|
|
2216
|
+
}
|
|
2217
|
+
__name(mix, "mix");
|
|
2218
|
+
var curriedMix = curry(mix);
|
|
2219
|
+
var mix$1 = curriedMix;
|
|
2220
|
+
function opacify(amount, color2) {
|
|
2221
|
+
if (color2 === "transparent") return color2;
|
|
2222
|
+
var parsedColor = parseToRgb(color2);
|
|
2223
|
+
var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
|
|
2224
|
+
var colorWithAlpha = _extends({}, parsedColor, {
|
|
2225
|
+
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
2226
|
+
});
|
|
2227
|
+
return rgba(colorWithAlpha);
|
|
2228
|
+
}
|
|
2229
|
+
__name(opacify, "opacify");
|
|
2230
|
+
var curriedOpacify = curry(opacify);
|
|
2231
|
+
function saturate(amount, color2) {
|
|
2232
|
+
if (color2 === "transparent") return color2;
|
|
2233
|
+
var hslColor = parseToHsl(color2);
|
|
2234
|
+
return toColorString(_extends({}, hslColor, {
|
|
2235
|
+
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
2236
|
+
}));
|
|
2237
|
+
}
|
|
2238
|
+
__name(saturate, "saturate");
|
|
2239
|
+
var curriedSaturate = curry(saturate);
|
|
2240
|
+
function setHue(hue, color2) {
|
|
2241
|
+
if (color2 === "transparent") return color2;
|
|
2242
|
+
return toColorString(_extends({}, parseToHsl(color2), {
|
|
2243
|
+
hue: parseFloat(hue)
|
|
2244
|
+
}));
|
|
2245
|
+
}
|
|
2246
|
+
__name(setHue, "setHue");
|
|
2247
|
+
var curriedSetHue = curry(setHue);
|
|
2248
|
+
function setLightness(lightness, color2) {
|
|
2249
|
+
if (color2 === "transparent") return color2;
|
|
2250
|
+
return toColorString(_extends({}, parseToHsl(color2), {
|
|
2251
|
+
lightness: parseFloat(lightness)
|
|
2252
|
+
}));
|
|
2253
|
+
}
|
|
2254
|
+
__name(setLightness, "setLightness");
|
|
2255
|
+
var curriedSetLightness = curry(setLightness);
|
|
2256
|
+
function setSaturation(saturation, color2) {
|
|
2257
|
+
if (color2 === "transparent") return color2;
|
|
2258
|
+
return toColorString(_extends({}, parseToHsl(color2), {
|
|
2259
|
+
saturation: parseFloat(saturation)
|
|
2260
|
+
}));
|
|
2261
|
+
}
|
|
2262
|
+
__name(setSaturation, "setSaturation");
|
|
2263
|
+
var curriedSetSaturation = curry(setSaturation);
|
|
2264
|
+
function shade(percentage, color2) {
|
|
2265
|
+
if (color2 === "transparent") return color2;
|
|
2266
|
+
return mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color2);
|
|
2267
|
+
}
|
|
2268
|
+
__name(shade, "shade");
|
|
2269
|
+
var curriedShade = curry(shade);
|
|
2270
|
+
function tint(percentage, color2) {
|
|
2271
|
+
if (color2 === "transparent") return color2;
|
|
2272
|
+
return mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color2);
|
|
2273
|
+
}
|
|
2274
|
+
__name(tint, "tint");
|
|
2275
|
+
var curriedTint = curry(tint);
|
|
2276
|
+
function transparentize(amount, color2) {
|
|
2277
|
+
if (color2 === "transparent") return color2;
|
|
2278
|
+
var parsedColor = parseToRgb(color2);
|
|
2279
|
+
var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
|
|
2280
|
+
var colorWithAlpha = _extends({}, parsedColor, {
|
|
2281
|
+
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
2282
|
+
});
|
|
2283
|
+
return rgba(colorWithAlpha);
|
|
2284
|
+
}
|
|
2285
|
+
__name(transparentize, "transparentize");
|
|
2286
|
+
var curriedTransparentize = curry(transparentize);
|
|
2287
|
+
var curriedTransparentize$1 = curriedTransparentize;
|
|
2288
|
+
|
|
1440
2289
|
// ../../node_modules/react-joyride/dist/index.mjs
|
|
1441
2290
|
import * as React9 from "react";
|
|
1442
2291
|
|
|
@@ -2224,7 +3073,7 @@ var defineProperty = /* @__PURE__ */ __name(function(obj, key, value) {
|
|
|
2224
3073
|
}
|
|
2225
3074
|
return obj;
|
|
2226
3075
|
}, "defineProperty");
|
|
2227
|
-
var
|
|
3076
|
+
var _extends2 = Object.assign || function(target) {
|
|
2228
3077
|
for (var i2 = 1; i2 < arguments.length; i2++) {
|
|
2229
3078
|
var source = arguments[i2];
|
|
2230
3079
|
for (var key in source) {
|
|
@@ -2236,7 +3085,7 @@ var _extends = Object.assign || function(target) {
|
|
|
2236
3085
|
return target;
|
|
2237
3086
|
};
|
|
2238
3087
|
function getClientRect(offsets) {
|
|
2239
|
-
return
|
|
3088
|
+
return _extends2({}, offsets, {
|
|
2240
3089
|
right: offsets.left + offsets.width,
|
|
2241
3090
|
bottom: offsets.top + offsets.height
|
|
2242
3091
|
});
|
|
@@ -2428,7 +3277,7 @@ function computeAutoPlacement(placement, refRect, popper, reference, boundariesE
|
|
|
2428
3277
|
}
|
|
2429
3278
|
};
|
|
2430
3279
|
var sortedAreas = Object.keys(rects).map(function(key) {
|
|
2431
|
-
return
|
|
3280
|
+
return _extends2({
|
|
2432
3281
|
key
|
|
2433
3282
|
}, rects[key], {
|
|
2434
3283
|
area: getArea(rects[key])
|
|
@@ -2760,9 +3609,9 @@ function computeStyle(data, options) {
|
|
|
2760
3609
|
var attributes = {
|
|
2761
3610
|
"x-placement": data.placement
|
|
2762
3611
|
};
|
|
2763
|
-
data.attributes =
|
|
2764
|
-
data.styles =
|
|
2765
|
-
data.arrowStyles =
|
|
3612
|
+
data.attributes = _extends2({}, attributes, data.attributes);
|
|
3613
|
+
data.styles = _extends2({}, styles, data.styles);
|
|
3614
|
+
data.arrowStyles = _extends2({}, data.offsets.arrow, data.arrowStyles);
|
|
2766
3615
|
return data;
|
|
2767
3616
|
}
|
|
2768
3617
|
__name(computeStyle, "computeStyle");
|
|
@@ -2902,7 +3751,7 @@ function flip(data, options) {
|
|
|
2902
3751
|
variation = getOppositeVariation(variation);
|
|
2903
3752
|
}
|
|
2904
3753
|
data.placement = placement + (variation ? "-" + variation : "");
|
|
2905
|
-
data.offsets.popper =
|
|
3754
|
+
data.offsets.popper = _extends2({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
|
2906
3755
|
data = runModifiers(data.instance.modifiers, data, "flip");
|
|
2907
3756
|
}
|
|
2908
3757
|
});
|
|
@@ -3066,7 +3915,7 @@ function preventOverflow(data, options) {
|
|
|
3066
3915
|
};
|
|
3067
3916
|
order.forEach(function(placement) {
|
|
3068
3917
|
var side = ["left", "top"].indexOf(placement) !== -1 ? "primary" : "secondary";
|
|
3069
|
-
popper =
|
|
3918
|
+
popper = _extends2({}, popper, check[side](placement));
|
|
3070
3919
|
});
|
|
3071
3920
|
data.offsets.popper = popper;
|
|
3072
3921
|
return data;
|
|
@@ -3085,7 +3934,7 @@ function shift(data) {
|
|
|
3085
3934
|
start: defineProperty({}, side, reference[side]),
|
|
3086
3935
|
end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
|
3087
3936
|
};
|
|
3088
|
-
data.offsets.popper =
|
|
3937
|
+
data.offsets.popper = _extends2({}, popper, shiftOffsets[shiftvariation]);
|
|
3089
3938
|
}
|
|
3090
3939
|
return data;
|
|
3091
3940
|
}
|
|
@@ -3491,7 +4340,7 @@ var Popper = function() {
|
|
|
3491
4340
|
return requestAnimationFrame(_this.update);
|
|
3492
4341
|
};
|
|
3493
4342
|
this.update = debounce(this.update.bind(this));
|
|
3494
|
-
this.options =
|
|
4343
|
+
this.options = _extends2({}, Popper2.Defaults, options);
|
|
3495
4344
|
this.state = {
|
|
3496
4345
|
isDestroyed: false,
|
|
3497
4346
|
isCreated: false,
|
|
@@ -3500,11 +4349,11 @@ var Popper = function() {
|
|
|
3500
4349
|
this.reference = reference && reference.jquery ? reference[0] : reference;
|
|
3501
4350
|
this.popper = popper && popper.jquery ? popper[0] : popper;
|
|
3502
4351
|
this.options.modifiers = {};
|
|
3503
|
-
Object.keys(
|
|
3504
|
-
_this.options.modifiers[name] =
|
|
4352
|
+
Object.keys(_extends2({}, Popper2.Defaults.modifiers, options.modifiers)).forEach(function(name) {
|
|
4353
|
+
_this.options.modifiers[name] = _extends2({}, Popper2.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
|
3505
4354
|
});
|
|
3506
4355
|
this.modifiers = Object.keys(this.options.modifiers).map(function(name) {
|
|
3507
|
-
return
|
|
4356
|
+
return _extends2({
|
|
3508
4357
|
name
|
|
3509
4358
|
}, _this.options.modifiers[name]);
|
|
3510
4359
|
}).sort(function(a2, b2) {
|
|
@@ -4492,25 +5341,25 @@ function _inherits(subClass, superClass) {
|
|
|
4492
5341
|
Object.defineProperty(subClass, "prototype", {
|
|
4493
5342
|
writable: false
|
|
4494
5343
|
});
|
|
4495
|
-
if (superClass)
|
|
5344
|
+
if (superClass) _setPrototypeOf2(subClass, superClass);
|
|
4496
5345
|
}
|
|
4497
5346
|
__name(_inherits, "_inherits");
|
|
4498
|
-
function
|
|
4499
|
-
|
|
5347
|
+
function _getPrototypeOf2(o2) {
|
|
5348
|
+
_getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf3(o3) {
|
|
4500
5349
|
return o3.__proto__ || Object.getPrototypeOf(o3);
|
|
4501
5350
|
}, "_getPrototypeOf");
|
|
4502
|
-
return
|
|
5351
|
+
return _getPrototypeOf2(o2);
|
|
4503
5352
|
}
|
|
4504
|
-
__name(
|
|
4505
|
-
function
|
|
4506
|
-
|
|
5353
|
+
__name(_getPrototypeOf2, "_getPrototypeOf");
|
|
5354
|
+
function _setPrototypeOf2(o2, p2) {
|
|
5355
|
+
_setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf3(o3, p3) {
|
|
4507
5356
|
o3.__proto__ = p3;
|
|
4508
5357
|
return o3;
|
|
4509
5358
|
}, "_setPrototypeOf");
|
|
4510
|
-
return
|
|
5359
|
+
return _setPrototypeOf2(o2, p2);
|
|
4511
5360
|
}
|
|
4512
|
-
__name(
|
|
4513
|
-
function
|
|
5361
|
+
__name(_setPrototypeOf2, "_setPrototypeOf");
|
|
5362
|
+
function _isNativeReflectConstruct2() {
|
|
4514
5363
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
4515
5364
|
if (Reflect.construct.sham) return false;
|
|
4516
5365
|
if (typeof Proxy === "function") return true;
|
|
@@ -4522,7 +5371,7 @@ function _isNativeReflectConstruct() {
|
|
|
4522
5371
|
return false;
|
|
4523
5372
|
}
|
|
4524
5373
|
}
|
|
4525
|
-
__name(
|
|
5374
|
+
__name(_isNativeReflectConstruct2, "_isNativeReflectConstruct");
|
|
4526
5375
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4527
5376
|
if (source == null) return {};
|
|
4528
5377
|
var target = {};
|
|
@@ -4552,28 +5401,28 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
4552
5401
|
return target;
|
|
4553
5402
|
}
|
|
4554
5403
|
__name(_objectWithoutProperties, "_objectWithoutProperties");
|
|
4555
|
-
function
|
|
5404
|
+
function _assertThisInitialized2(self) {
|
|
4556
5405
|
if (self === void 0) {
|
|
4557
5406
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4558
5407
|
}
|
|
4559
5408
|
return self;
|
|
4560
5409
|
}
|
|
4561
|
-
__name(
|
|
5410
|
+
__name(_assertThisInitialized2, "_assertThisInitialized");
|
|
4562
5411
|
function _possibleConstructorReturn(self, call) {
|
|
4563
5412
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
4564
5413
|
return call;
|
|
4565
5414
|
} else if (call !== void 0) {
|
|
4566
5415
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
4567
5416
|
}
|
|
4568
|
-
return
|
|
5417
|
+
return _assertThisInitialized2(self);
|
|
4569
5418
|
}
|
|
4570
5419
|
__name(_possibleConstructorReturn, "_possibleConstructorReturn");
|
|
4571
5420
|
function _createSuper(Derived) {
|
|
4572
|
-
var hasNativeReflectConstruct =
|
|
5421
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct2();
|
|
4573
5422
|
return /* @__PURE__ */ __name(function _createSuperInternal() {
|
|
4574
|
-
var Super =
|
|
5423
|
+
var Super = _getPrototypeOf2(Derived), result;
|
|
4575
5424
|
if (hasNativeReflectConstruct) {
|
|
4576
|
-
var NewTarget =
|
|
5425
|
+
var NewTarget = _getPrototypeOf2(this).constructor;
|
|
4577
5426
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
4578
5427
|
} else {
|
|
4579
5428
|
result = Super.apply(this, arguments);
|
|
@@ -4976,19 +5825,19 @@ var ReactFloater = function(_React$Component) {
|
|
|
4976
5825
|
var _this;
|
|
4977
5826
|
_classCallCheck(this, ReactFloater2);
|
|
4978
5827
|
_this = _super.call(this, props);
|
|
4979
|
-
_defineProperty(
|
|
5828
|
+
_defineProperty(_assertThisInitialized2(_this), "setArrowRef", function(ref) {
|
|
4980
5829
|
_this.arrowRef = ref;
|
|
4981
5830
|
});
|
|
4982
|
-
_defineProperty(
|
|
5831
|
+
_defineProperty(_assertThisInitialized2(_this), "setChildRef", function(ref) {
|
|
4983
5832
|
_this.childRef = ref;
|
|
4984
5833
|
});
|
|
4985
|
-
_defineProperty(
|
|
5834
|
+
_defineProperty(_assertThisInitialized2(_this), "setFloaterRef", function(ref) {
|
|
4986
5835
|
_this.floaterRef = ref;
|
|
4987
5836
|
});
|
|
4988
|
-
_defineProperty(
|
|
5837
|
+
_defineProperty(_assertThisInitialized2(_this), "setWrapperRef", function(ref) {
|
|
4989
5838
|
_this.wrapperRef = ref;
|
|
4990
5839
|
});
|
|
4991
|
-
_defineProperty(
|
|
5840
|
+
_defineProperty(_assertThisInitialized2(_this), "handleTransitionEnd", function() {
|
|
4992
5841
|
var status = _this.state.status;
|
|
4993
5842
|
var callback = _this.props.callback;
|
|
4994
5843
|
if (_this.wrapperPopper) {
|
|
@@ -4999,7 +5848,7 @@ var ReactFloater = function(_React$Component) {
|
|
|
4999
5848
|
callback(newStatus === STATUS.OPEN ? "open" : "close", _this.props);
|
|
5000
5849
|
});
|
|
5001
5850
|
});
|
|
5002
|
-
_defineProperty(
|
|
5851
|
+
_defineProperty(_assertThisInitialized2(_this), "handleClick", function() {
|
|
5003
5852
|
var _this$props = _this.props, event = _this$props.event, open = _this$props.open;
|
|
5004
5853
|
if (esm_default["boolean"](open)) return;
|
|
5005
5854
|
var _this$state = _this.state, positionWrapper = _this$state.positionWrapper, status = _this$state.status;
|
|
@@ -5008,7 +5857,7 @@ var ReactFloater = function(_React$Component) {
|
|
|
5008
5857
|
_this.toggle();
|
|
5009
5858
|
}
|
|
5010
5859
|
});
|
|
5011
|
-
_defineProperty(
|
|
5860
|
+
_defineProperty(_assertThisInitialized2(_this), "handleMouseEnter", function() {
|
|
5012
5861
|
var _this$props2 = _this.props, event = _this$props2.event, open = _this$props2.open;
|
|
5013
5862
|
if (esm_default["boolean"](open) || isMobile()) return;
|
|
5014
5863
|
var status = _this.state.status;
|
|
@@ -5018,7 +5867,7 @@ var ReactFloater = function(_React$Component) {
|
|
|
5018
5867
|
_this.toggle();
|
|
5019
5868
|
}
|
|
5020
5869
|
});
|
|
5021
|
-
_defineProperty(
|
|
5870
|
+
_defineProperty(_assertThisInitialized2(_this), "handleMouseLeave", function() {
|
|
5022
5871
|
var _this$props3 = _this.props, event = _this$props3.event, eventDelay = _this$props3.eventDelay, open = _this$props3.open;
|
|
5023
5872
|
if (esm_default["boolean"](open) || isMobile()) return;
|
|
5024
5873
|
var _this$state2 = _this.state, status = _this$state2.status, positionWrapper = _this$state2.positionWrapper;
|
|
@@ -7391,122 +8240,93 @@ import { useTheme } from "storybook/theming";
|
|
|
7391
8240
|
|
|
7392
8241
|
// src/features/GuidedTour/Tooltip.tsx
|
|
7393
8242
|
import React11, { useEffect as useEffect2 } from "react";
|
|
7394
|
-
import {
|
|
8243
|
+
import { Button as Button3 } from "storybook/internal/components";
|
|
7395
8244
|
import { CloseAltIcon } from "@storybook/icons";
|
|
7396
8245
|
import { color, styled as styled3 } from "storybook/theming";
|
|
7397
8246
|
|
|
7398
8247
|
// src/components/Button/Button.tsx
|
|
7399
8248
|
import React10, { forwardRef } from "react";
|
|
7400
8249
|
import { styled as styled2 } from "storybook/theming";
|
|
7401
|
-
var StyledButton = styled2.button
|
|
7402
|
-
all: unset
|
|
7403
|
-
|
|
7404
|
-
border: 0
|
|
7405
|
-
|
|
7406
|
-
cursor: pointer
|
|
7407
|
-
display: inline-flex
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
padding: 0 0.75rem
|
|
7411
|
-
background:
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
if (variant === "secondary") {
|
|
7431
|
-
return theme2.darkest;
|
|
7432
|
-
}
|
|
7433
|
-
if (variant === "outline") {
|
|
7434
|
-
return theme2.darkest;
|
|
7435
|
-
}
|
|
7436
|
-
if (variant === "white") {
|
|
7437
|
-
return theme2.color.secondary;
|
|
7438
|
-
}
|
|
7439
|
-
return theme2.color.lightest;
|
|
7440
|
-
}};
|
|
7441
|
-
box-shadow: ${({ variant }) => {
|
|
7442
|
-
if (variant === "secondary") {
|
|
7443
|
-
return "#D9E8F2 0 0 0 1px inset";
|
|
7444
|
-
}
|
|
7445
|
-
if (variant === "outline") {
|
|
7446
|
-
return "#D9E8F2 0 0 0 1px inset";
|
|
7447
|
-
}
|
|
7448
|
-
return "none";
|
|
7449
|
-
}};
|
|
7450
|
-
height: 32px;
|
|
7451
|
-
font-size: 0.8125rem;
|
|
7452
|
-
font-weight: 700;
|
|
7453
|
-
font-family: ${({ theme: theme2 }) => theme2.typography.fonts.base};
|
|
7454
|
-
transition: background-color, box-shadow, color, opacity;
|
|
7455
|
-
transition-duration: 0.16s;
|
|
7456
|
-
transition-timing-function: ease-in-out;
|
|
7457
|
-
text-decoration: none;
|
|
7458
|
-
|
|
7459
|
-
&:hover {
|
|
7460
|
-
background-color: ${({ theme: theme2, variant }) => {
|
|
7461
|
-
if (variant === "primary") {
|
|
7462
|
-
return "#0b94eb";
|
|
7463
|
-
}
|
|
7464
|
-
if (variant === "secondary") {
|
|
7465
|
-
return "#eef4f9";
|
|
7466
|
-
}
|
|
7467
|
-
if (variant === "outline") {
|
|
7468
|
-
return "transparent";
|
|
7469
|
-
}
|
|
7470
|
-
if (variant === "white") {
|
|
7471
|
-
return theme2.color.lightest;
|
|
7472
|
-
}
|
|
7473
|
-
return "#0b94eb";
|
|
7474
|
-
}};
|
|
7475
|
-
color: ${({ theme: theme2, variant }) => {
|
|
7476
|
-
if (variant === "primary") {
|
|
8250
|
+
var StyledButton = styled2.button(({ theme: theme2, variant }) => ({
|
|
8251
|
+
all: "unset",
|
|
8252
|
+
boxSizing: "border-box",
|
|
8253
|
+
border: 0,
|
|
8254
|
+
borderRadius: "4px",
|
|
8255
|
+
cursor: "pointer",
|
|
8256
|
+
display: "inline-flex",
|
|
8257
|
+
alignItems: "center",
|
|
8258
|
+
justifyContent: "center",
|
|
8259
|
+
padding: "0 0.75rem",
|
|
8260
|
+
background: (() => {
|
|
8261
|
+
if (variant === "secondary") {
|
|
8262
|
+
return theme2.button.background;
|
|
8263
|
+
}
|
|
8264
|
+
if (variant === "outline") {
|
|
8265
|
+
return "transparent";
|
|
8266
|
+
}
|
|
8267
|
+
if (variant === "white") {
|
|
8268
|
+
return theme2.color.lightest;
|
|
8269
|
+
}
|
|
8270
|
+
return theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary);
|
|
8271
|
+
})(),
|
|
8272
|
+
color: (() => {
|
|
8273
|
+
if (variant === "secondary" || variant === "outline") {
|
|
8274
|
+
return theme2.color.defaultText;
|
|
8275
|
+
}
|
|
8276
|
+
if (variant === "white") {
|
|
8277
|
+
return theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary);
|
|
8278
|
+
}
|
|
7477
8279
|
return theme2.color.lightest;
|
|
7478
|
-
}
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
return theme2.color.darkest;
|
|
7487
|
-
}
|
|
7488
|
-
return theme2.color.lightest;
|
|
7489
|
-
}};
|
|
7490
|
-
}
|
|
7491
|
-
|
|
7492
|
-
&:focus {
|
|
7493
|
-
box-shadow: ${({ variant }) => {
|
|
7494
|
-
if (variant === "primary") {
|
|
7495
|
-
return "inset 0 0 0 1px rgba(0, 0, 0, 0.2)";
|
|
7496
|
-
}
|
|
7497
|
-
if (variant === "secondary") {
|
|
7498
|
-
return "inset 0 0 0 1px #0b94eb";
|
|
7499
|
-
}
|
|
7500
|
-
if (variant === "outline") {
|
|
7501
|
-
return "inset 0 0 0 1px #0b94eb";
|
|
7502
|
-
}
|
|
7503
|
-
if (variant === "white") {
|
|
8280
|
+
})(),
|
|
8281
|
+
boxShadow: (() => {
|
|
8282
|
+
if (variant === "secondary") {
|
|
8283
|
+
return `${theme2.button.border} 0 0 0 1px inset`;
|
|
8284
|
+
}
|
|
8285
|
+
if (variant === "outline") {
|
|
8286
|
+
return `${theme2.button.border} 0 0 0 1px inset`;
|
|
8287
|
+
}
|
|
7504
8288
|
return "none";
|
|
8289
|
+
})(),
|
|
8290
|
+
height: "32px",
|
|
8291
|
+
fontSize: "0.8125rem",
|
|
8292
|
+
fontWeight: "700",
|
|
8293
|
+
fontFamily: theme2.typography.fonts.base,
|
|
8294
|
+
transition: "background-color, box-shadow, color, opacity",
|
|
8295
|
+
transitionDuration: "0.16s",
|
|
8296
|
+
transitionTimingFunction: "ease-in-out",
|
|
8297
|
+
textDecoration: "none",
|
|
8298
|
+
"&:hover, &:focus": {
|
|
8299
|
+
background: (() => {
|
|
8300
|
+
if (variant === "secondary" || variant === "outline") {
|
|
8301
|
+
return curriedTransparentize$1(0.93, theme2.color.secondary);
|
|
8302
|
+
}
|
|
8303
|
+
if (variant === "white") {
|
|
8304
|
+
return curriedTransparentize$1(0.1, theme2.color.lightest);
|
|
8305
|
+
}
|
|
8306
|
+
return theme2.base === "light" ? curriedLighten$1(0.1, theme2.color.secondary) : curriedDarken$1(0.3, theme2.color.secondary);
|
|
8307
|
+
})(),
|
|
8308
|
+
color: (() => {
|
|
8309
|
+
if (variant === "secondary" || variant === "outline") {
|
|
8310
|
+
return theme2.barSelectedColor;
|
|
8311
|
+
}
|
|
8312
|
+
if (variant === "white") {
|
|
8313
|
+
return theme2.base === "light" ? curriedLighten$1(0.1, theme2.color.secondary) : curriedDarken$1(0.3, theme2.color.secondary);
|
|
8314
|
+
}
|
|
8315
|
+
return theme2.color.lightest;
|
|
8316
|
+
})(),
|
|
8317
|
+
boxShadow: (() => {
|
|
8318
|
+
if (variant === "secondary" || variant === "outline" || variant === "white") {
|
|
8319
|
+
return `inset 0 0 0 1px ${theme2.barSelectedColor}`;
|
|
8320
|
+
}
|
|
8321
|
+
return "none";
|
|
8322
|
+
})()
|
|
8323
|
+
},
|
|
8324
|
+
"&:focus-visible": {
|
|
8325
|
+
outline: `solid ${theme2.color.secondary}`,
|
|
8326
|
+
outlineOffset: "2px",
|
|
8327
|
+
outlineWidth: "2px"
|
|
7505
8328
|
}
|
|
7506
|
-
|
|
7507
|
-
}};
|
|
7508
|
-
}
|
|
7509
|
-
`;
|
|
8329
|
+
}));
|
|
7510
8330
|
var Button = forwardRef(/* @__PURE__ */ __name(function Button2({ children, onClick, variant = "primary", ...rest }, ref) {
|
|
7511
8331
|
return React10.createElement(StyledButton, { ref, onClick, variant, ...rest }, children);
|
|
7512
8332
|
}, "Button"));
|
|
@@ -7587,7 +8407,17 @@ var Tooltip = /* @__PURE__ */ __name(({
|
|
|
7587
8407
|
}
|
|
7588
8408
|
};
|
|
7589
8409
|
}, []);
|
|
7590
|
-
return React11.createElement(TooltipBody, { ...tooltipProps, style: step.styles?.tooltip }, React11.createElement(Wrapper2, null, React11.createElement(TooltipHeader, null, step.title && React11.createElement(TooltipTitle, null, step.title), React11.createElement(
|
|
8410
|
+
return React11.createElement(TooltipBody, { ...tooltipProps, style: step.styles?.tooltip }, React11.createElement(Wrapper2, null, React11.createElement(TooltipHeader, null, step.title && React11.createElement(TooltipTitle, null, step.title), React11.createElement(
|
|
8411
|
+
Button3,
|
|
8412
|
+
{
|
|
8413
|
+
...closeProps,
|
|
8414
|
+
onClick: closeProps.onClick,
|
|
8415
|
+
variant: "solid",
|
|
8416
|
+
padding: "small",
|
|
8417
|
+
ariaLabel: "Close"
|
|
8418
|
+
},
|
|
8419
|
+
React11.createElement(CloseAltIcon, null)
|
|
8420
|
+
)), React11.createElement(TooltipContent, null, step.content)), React11.createElement(TooltipFooter, { id: "buttonNext" }, React11.createElement(Count, null, index + 1, " of ", size), !step.hideNextButton && React11.createElement(
|
|
7591
8421
|
Button,
|
|
7592
8422
|
{
|
|
7593
8423
|
...primaryProps,
|
|
@@ -7663,18 +8493,18 @@ function GuidedTour({
|
|
|
7663
8493
|
},
|
|
7664
8494
|
spotlight: {
|
|
7665
8495
|
backgroundColor: "none",
|
|
7666
|
-
border: `solid 2px ${theme2.color.secondary}`,
|
|
8496
|
+
border: `solid 2px ${theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary)}`,
|
|
7667
8497
|
boxShadow: "0px 0px 0px 9999px rgba(27, 28, 29, 0.2)"
|
|
7668
8498
|
},
|
|
7669
8499
|
tooltip: {
|
|
7670
8500
|
width: 280,
|
|
7671
8501
|
color: theme2.color.lightest,
|
|
7672
|
-
background: theme2.color.secondary
|
|
8502
|
+
background: theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary)
|
|
7673
8503
|
},
|
|
7674
8504
|
options: {
|
|
7675
8505
|
zIndex: 9998,
|
|
7676
|
-
primaryColor: theme2.color.secondary,
|
|
7677
|
-
arrowColor: theme2.color.secondary
|
|
8506
|
+
primaryColor: theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary),
|
|
8507
|
+
arrowColor: theme2.base === "light" ? theme2.color.secondary : curriedDarken$1(0.18, theme2.color.secondary)
|
|
7678
8508
|
}
|
|
7679
8509
|
}
|
|
7680
8510
|
}
|
|
@@ -7684,7 +8514,7 @@ __name(GuidedTour, "GuidedTour");
|
|
|
7684
8514
|
|
|
7685
8515
|
// src/features/IntentSurvey/IntentSurvey.tsx
|
|
7686
8516
|
import React13, { useState as useState2 } from "react";
|
|
7687
|
-
import { Button as
|
|
8517
|
+
import { Button as Button4, Form, Modal } from "storybook/internal/components";
|
|
7688
8518
|
import { styled as styled4 } from "storybook/theming";
|
|
7689
8519
|
|
|
7690
8520
|
// ../../.storybook/isChromatic.ts
|
|
@@ -7820,34 +8650,57 @@ var IntentSurvey = /* @__PURE__ */ __name(({
|
|
|
7820
8650
|
Object.fromEntries(Object.entries(formFields).map(([key, field]) => [key, field.values]))
|
|
7821
8651
|
);
|
|
7822
8652
|
}, "onSubmitForm");
|
|
7823
|
-
return React13.createElement(
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
8653
|
+
return React13.createElement(
|
|
8654
|
+
Modal,
|
|
8655
|
+
{
|
|
8656
|
+
ariaLabel: "Storybook user survey",
|
|
8657
|
+
defaultOpen: true,
|
|
8658
|
+
width: 420,
|
|
8659
|
+
onOpenChange: (isOpen) => {
|
|
8660
|
+
if (!isOpen) {
|
|
8661
|
+
onDismiss();
|
|
8662
|
+
}
|
|
8663
|
+
}
|
|
8664
|
+
},
|
|
8665
|
+
React13.createElement(Form, { onSubmit: onSubmitForm, id: "intent-survey-form" }, React13.createElement(Content, null, React13.createElement(Modal.Header, null, React13.createElement(Modal.Title, null, "Help improve Storybook")), Object.keys(formFields).map((key) => {
|
|
8666
|
+
const field = formFields[key];
|
|
8667
|
+
return React13.createElement(React13.Fragment, { key }, React13.createElement(Question, null, field.label), field.type === "checkbox" && React13.createElement(Row, null, Object.entries(field.options).map(([opt, option]) => {
|
|
8668
|
+
const id = `${key}:${opt}`;
|
|
8669
|
+
return React13.createElement("div", { key: id }, React13.createElement(Label, { htmlFor: id }, React13.createElement(
|
|
8670
|
+
Checkbox,
|
|
8671
|
+
{
|
|
8672
|
+
name: id,
|
|
8673
|
+
id,
|
|
8674
|
+
checked: field.values[opt],
|
|
8675
|
+
disabled: isSubmitting,
|
|
8676
|
+
onChange: (e2) => updateFormData(key, opt, e2.target.checked)
|
|
8677
|
+
}
|
|
8678
|
+
), option.label));
|
|
8679
|
+
})), field.type === "select" && React13.createElement(
|
|
8680
|
+
Form.Select,
|
|
7829
8681
|
{
|
|
7830
|
-
name:
|
|
7831
|
-
id,
|
|
7832
|
-
|
|
8682
|
+
name: key,
|
|
8683
|
+
id: key,
|
|
8684
|
+
value: Object.entries(field.values).find(([, isSelected]) => isSelected)?.[0] || "",
|
|
8685
|
+
required: field.required,
|
|
7833
8686
|
disabled: isSubmitting,
|
|
7834
|
-
onChange: (e2) => updateFormData(key,
|
|
7835
|
-
}
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
8687
|
+
onChange: (e2) => updateFormData(key, e2.target.value)
|
|
8688
|
+
},
|
|
8689
|
+
React13.createElement("option", { disabled: true, hidden: true, value: "" }, "Select an option..."),
|
|
8690
|
+
Object.entries(field.options).map(([opt, option]) => React13.createElement("option", { key: opt, value: opt }, option.label))
|
|
8691
|
+
));
|
|
8692
|
+
}), React13.createElement(Actions, null, React13.createElement(
|
|
8693
|
+
Button4,
|
|
7839
8694
|
{
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
onChange: (e2) => updateFormData(key, e2.target.value)
|
|
8695
|
+
ariaLabel: false,
|
|
8696
|
+
disabled: isSubmitting || !isValid,
|
|
8697
|
+
size: "medium",
|
|
8698
|
+
type: "submit",
|
|
8699
|
+
variant: "solid"
|
|
7846
8700
|
},
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
}), React13.createElement(Actions, null, React13.createElement(Button3, { disabled: isSubmitting || !isValid, size: "medium", type: "submit", variant: "solid" }, "Submit")))));
|
|
8701
|
+
"Submit"
|
|
8702
|
+
))))
|
|
8703
|
+
);
|
|
7851
8704
|
}, "IntentSurvey");
|
|
7852
8705
|
function shuffle(array) {
|
|
7853
8706
|
for (let i2 = array.length - 1; i2 > 0; i2--) {
|