@gobolt/genesis 0.0.7 → 0.0.8
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/README.md +8 -2
- package/dist/AntdIcon-c395a1c4.js +204 -0
- package/dist/CheckOutlined-52d9ac25.js +29 -0
- package/dist/{CloseCircleFilled-ZIY-u-27.js → CloseCircleFilled-ddc51e7e.js} +11 -8
- package/dist/CloseOutlined-14b8bba1.js +16 -0
- package/dist/Compact-c39ed20d.js +179 -0
- package/dist/ContextIsolator-b09b2c52.js +20 -0
- package/dist/DownOutlined-64a4732a.js +206 -0
- package/dist/EllipsisOutlined-60122660.js +1115 -0
- package/dist/{ExclamationCircleFilled-BICVVQIg.js → ExclamationCircleFilled-23ef9812.js} +22 -16
- package/dist/InfoCircleFilled-c5f90c20.js +16 -0
- package/dist/Overflow-a570fa69.js +361 -0
- package/dist/RightOutlined-83515eb4.js +16 -0
- package/dist/SearchOutlined-a9014e08.js +16 -0
- package/dist/{TextArea-3MOYYuAQ.js → TextArea-20825221.js} +597 -582
- package/dist/{button-BNV2qdrP.js → button-fa1c119c.js} +287 -280
- package/dist/collapse-345bc884.js +20 -0
- package/dist/compact-item-b8f85aa6.js +75 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.js +102 -0
- package/dist/components/Badge/__stories__/Badge.stories.d.ts +13 -0
- package/dist/components/Badge/__tests__/Badge.test.js +72 -0
- package/dist/components/Badge/icons/ASN.d.ts +2 -0
- package/dist/components/Badge/icons/ASN.js +23 -0
- package/dist/components/Badge/icons/Appointment.d.ts +2 -0
- package/dist/components/Badge/icons/Appointment.js +23 -0
- package/dist/components/Badge/icons/Inventory.d.ts +2 -0
- package/dist/components/Badge/icons/Inventory.js +23 -0
- package/dist/components/Badge/icons/Parcel.d.ts +2 -0
- package/dist/components/Badge/icons/Parcel.js +23 -0
- package/dist/components/Badge/icons/Product.d.ts +2 -0
- package/dist/components/Badge/icons/Product.js +23 -0
- package/dist/components/Badge/icons/Route.d.ts +2 -0
- package/dist/components/Badge/icons/Route.js +23 -0
- package/dist/components/Badge/icons/Shipment.d.ts +2 -0
- package/dist/components/Badge/icons/Shipment.js +23 -0
- package/dist/components/Badge/icons/ShoppingCart.d.ts +2 -0
- package/dist/components/Badge/icons/ShoppingCart.js +23 -0
- package/dist/components/Badge/icons/System.d.ts +2 -0
- package/dist/components/Badge/icons/System.js +23 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +23 -0
- package/dist/components/Badge/styles.d.ts +3 -0
- package/dist/components/Badge/styles.js +35 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +27 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/components/Breadcrumb/__stories__/Breadcrumb.stories.d.ts +10 -0
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +70 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.js +27 -0
- package/dist/components/Breadcrumb/styles.d.ts +23 -0
- package/dist/components/Breadcrumb/styles.js +2457 -0
- package/dist/components/Button/Button.js +42 -0
- package/dist/components/Button/__tests__/Button.test.js +61 -0
- package/dist/components/Button/index.js +22 -0
- package/dist/components/{atoms/button → Button}/styles.js +30 -19
- package/dist/components/{atoms/checkbox → Checkbox}/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +70 -0
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +64 -0
- package/dist/components/Checkbox/index.js +49 -0
- package/dist/components/{atoms/checkbox → Checkbox}/styles.d.ts +1 -3
- package/dist/components/{atoms/checkbox → Checkbox}/styles.js +165 -157
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +72 -0
- package/dist/components/ErrorBoundaryFallback/index.js +51 -0
- package/dist/components/ErrorBoundaryFallback/styles.d.ts +3 -0
- package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/styles.js +38 -34
- package/dist/components/{molecules/form → Form}/Form.d.ts +2 -4
- package/dist/components/Form/Form.js +49 -0
- package/dist/components/Form/__stories__/FormStory.js +130 -0
- package/dist/components/Form/index.js +48 -0
- package/dist/components/{atoms/input → Input}/Input.d.ts +1 -3
- package/dist/components/Input/Input.js +42 -0
- package/dist/components/{atoms/input → Input}/__stories__/Input.stories.d.ts +5 -1
- package/dist/components/Input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/Input/__tests__/Input.test.js +69 -0
- package/dist/components/Input/index.js +31 -0
- package/dist/components/{atoms/input → Input}/styles.d.ts +2 -3
- package/dist/components/Input/styles.js +542 -0
- package/dist/components/Message/Message.d.ts +13 -0
- package/dist/components/Message/Message.js +105 -0
- package/dist/components/Message/__stories__/Message.stories.d.ts +15 -0
- package/dist/components/Message/__tests__/Message.test.d.ts +1 -0
- package/dist/components/Message/__tests__/Message.test.js +88 -0
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/Message/index.js +50 -0
- package/dist/components/Message/styles.d.ts +5 -0
- package/dist/components/Message/styles.js +35 -0
- package/dist/components/Notification/Notification.d.ts +16 -0
- package/dist/components/Notification/Notification.js +1436 -0
- package/dist/components/Notification/__stories__/Notification.stories.d.ts +10 -0
- package/dist/components/Notification/__tests__/Notification.test.d.ts +1 -0
- package/dist/components/Notification/__tests__/Notification.test.js +76 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/Notification/index.js +61 -0
- package/dist/components/Notification/styles.d.ts +6 -0
- package/dist/components/Notification/styles.js +49 -0
- package/dist/components/Radio/Radio.d.ts +14 -0
- package/dist/components/Radio/Radio.js +114 -0
- package/dist/components/Radio/RadioGroup.d.ts +12 -0
- package/dist/components/Radio/RadioGroup.js +86 -0
- package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +9 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.d.ts +1 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.js +85 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +58 -0
- package/dist/components/Radio/states/RadioChecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioChecked.js +18 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.js +18 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.js +30 -0
- package/dist/components/Radio/states/RadioCheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedHover.js +18 -0
- package/dist/components/Radio/states/RadioUnchecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioUnchecked.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.js +29 -0
- package/dist/components/Radio/states/RadioUncheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedHover.js +18 -0
- package/dist/components/{atoms/select → Select}/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{atoms/select → Select}/__stories__/Select.stories.d.ts +3 -1
- package/dist/components/Select/__tests__/Select.test.d.ts +1 -0
- package/dist/components/Select/__tests__/Select.test.js +101 -0
- package/dist/components/Select/index.js +30 -0
- package/dist/components/{atoms/select → Select}/styles.d.ts +4 -1
- package/dist/components/Select/styles.js +3723 -0
- package/dist/components/Toast/Toast.d.ts +14 -0
- package/dist/components/Toast/Toast.js +48 -0
- package/dist/components/Toast/__stories__/Toast.stories.d.ts +15 -0
- package/dist/components/Toast/__tests__/Toast.test.d.ts +1 -0
- package/dist/components/Toast/__tests__/Toast.test.js +63 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +48 -0
- package/dist/components/Toast/styles.d.ts +5 -0
- package/dist/components/Toast/styles.js +39 -0
- package/dist/components/{atoms/typography → Typography}/Typography.d.ts +2 -1
- package/dist/components/Typography/Typography.js +48 -0
- package/dist/components/Typography/__tests__/Typography.test.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +60 -0
- package/dist/components/Typography/index.js +48 -0
- package/dist/components/Typography/styles.d.ts +7 -0
- package/dist/components/Typography/styles.js +55 -0
- package/dist/components/index.d.ts +18 -14
- package/dist/components/index.js +70 -14
- package/dist/constants/index.d.ts +104 -0
- package/dist/constants/index.js +41 -7
- package/dist/{context-CZsFJmh6.js → context-3b8a39af.js} +547 -536
- package/dist/genesis/GenesisThemeBreakdown.js +69 -22
- package/dist/genesis/GenesisThemeDemo.d.ts +0 -2
- package/dist/genesis/GenesisThemeDemo.js +53 -4
- package/dist/genesis/styles.d.ts +2 -6
- package/dist/genesis/styles.js +1144 -2210
- package/dist/index-0a886e53.js +100 -0
- package/dist/{index-SAAXFt-P.js → index-0b9ee239.js} +347 -338
- package/dist/index-1a33c134.js +1389 -0
- package/dist/index-4003d75b.js +3748 -0
- package/dist/{index-D1v_7IIx.js → index-501fc13d.js} +369 -343
- package/dist/index-89035ea5.js +3242 -0
- package/dist/{index-BQO27mgE.js → index-8c8d2d0c.js} +123 -122
- package/dist/{index-C7kFNqp2.js → index-e2b72ca8.js} +107 -102
- package/dist/index.d.ts +1 -0
- package/dist/index.js +77 -18
- package/dist/{isVisible-CNQjrJPN.js → isVisible-729780f5.js} +110 -82
- package/dist/{magic-string.es-BkUFmFT4.js → magic-string.es-b7491176.js} +103 -56
- package/dist/{SearchOutlined-DuzJkIiQ.js → pickAttrs-00ba4687.js} +16 -26
- package/dist/presets-83ccb923.js +787 -0
- package/dist/providers/GenesisProvider.d.ts +5 -0
- package/dist/providers/GenesisProvider.js +59 -5
- package/dist/providers/ThemeProvider.d.ts +2 -1
- package/dist/providers/ThemeProvider.js +16 -11
- package/dist/providers/ToastProvider.d.ts +6 -0
- package/dist/providers/ToastProvider.js +49 -0
- package/dist/providers/ToastWrapper.d.ts +7 -0
- package/dist/providers/ToastWrapper.js +56 -0
- package/dist/providers/__stories__/GenesisProvider.stories.d.ts +6 -0
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.js +51 -4
- package/dist/setup-aaca7b6f.js +21158 -0
- package/dist/{styled-components.browser.esm-CZ1XM4o4.js → styled-components.browser.esm-02f500bc.js} +134 -72
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +54 -18
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +51 -15
- package/dist/styles/design-tokens/variables.d.ts +7 -7
- package/dist/styles/design-tokens/variables.js +48 -48
- package/dist/styles/global-styles.js +4 -3
- package/dist/styles/theme/genesis-theme.d.ts +3 -0
- package/dist/styles/theme/genesis-theme.js +402 -263
- package/dist/styles/theme/global-styles.js +4 -3
- package/dist/styles/theme/index.js +5 -4
- package/dist/test/setup.js +46 -2
- package/dist/useVariants-a0d64298.js +30 -0
- package/dist/utils/isAllEnglishString.js +2 -1
- package/package.json +34 -28
- package/dist/AntdIcon-Bsnbyy6g.js +0 -200
- package/dist/CheckOutlined-DAynWe12.js +0 -527
- package/dist/Compact-CJBo3f0u.js +0 -185
- package/dist/ContextIsolator-CGkdKtc3.js +0 -20
- package/dist/Form-Cylpi4M4.js +0 -1815
- package/dist/Overflow-CP1M4Z0s.js +0 -369
- package/dist/compact-item-DH13cl8A.js +0 -61
- package/dist/components/atoms/button/Button.js +0 -27
- package/dist/components/atoms/button/index.js +0 -4
- package/dist/components/atoms/checkbox/Checkbox.js +0 -13
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.js +0 -18
- package/dist/components/atoms/checkbox/index.js +0 -4
- package/dist/components/atoms/index.d.ts +0 -1
- package/dist/components/atoms/index.js +0 -3
- package/dist/components/atoms/input/Input.js +0 -12
- package/dist/components/atoms/input/__tests__/Input.test.js +0 -28
- package/dist/components/atoms/input/index.js +0 -4
- package/dist/components/atoms/input/styles.js +0 -415
- package/dist/components/atoms/select/Select.js +0 -24
- package/dist/components/atoms/select/__tests__/Select.test.js +0 -10735
- package/dist/components/atoms/select/index.js +0 -4
- package/dist/components/atoms/select/styles.js +0 -3868
- package/dist/components/atoms/typography/Typography.js +0 -44
- package/dist/components/atoms/typography/__tests__/Typography.test.js +0 -16
- package/dist/components/atoms/typography/index.js +0 -4
- package/dist/components/atoms/typography/styles.d.ts +0 -11
- package/dist/components/atoms/typography/styles.js +0 -28
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +0 -35
- package/dist/components/molecules/error-boundary-fallback/index.js +0 -4
- package/dist/components/molecules/error-boundary-fallback/styles.d.ts +0 -1
- package/dist/components/molecules/form/Form.js +0 -7
- package/dist/components/molecules/form/__stories__/FormStory.js +0 -90
- package/dist/components/molecules/form/index.js +0 -4
- package/dist/index-3MWkSVA1.js +0 -96
- package/dist/index-BPtFqhcp.js +0 -19110
- package/dist/index-BWys7dkb.js +0 -4462
- package/dist/index-VDH3iLaC.js +0 -884
- package/dist/setup-CMYVZCPF.js +0 -33883
- package/dist/useVariants-CEpw6Ww6.js +0 -29
- /package/dist/components/{atoms/checkbox/__tests__/Checkbox.test.d.ts → Badge/__tests__/Badge.test.d.ts} +0 -0
- /package/dist/components/{atoms/input/__tests__/Input.test.d.ts → Breadcrumb/__tests__/Breadcrumb.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/Button.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/__stories__/Button.stories.d.ts +0 -0
- /package/dist/components/{atoms/select/__tests__/Select.test.d.ts → Button/__tests__/Button.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/index.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/styles.d.ts +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/__stories__/Checkbox.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography/__tests__/Typography.test.d.ts → Checkbox/__tests__/Checkbox.test.d.ts} +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/index.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/ErrorBoundaryFallback.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/__stories__/ErrorBoundaryFallback.stories.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/index.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/Form.stories.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/FormStory.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/index.d.ts +0 -0
- /package/dist/components/{atoms/input → Input}/index.d.ts +0 -0
- /package/dist/components/{atoms/select → Select}/index.d.ts +0 -0
- /package/dist/components/{atoms/typography → Typography}/__stories__/Typography.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography → Typography}/index.d.ts +0 -0
- /package/dist/{presetColors-Cl8UP3Nw.js → presetColors-ccf8cb4c.js} +0 -0
- /package/dist/{reactNode-sKPeiqPL.js → reactNode-f4391605.js} +0 -0
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
import { createContext as it } from "react";
|
|
2
|
+
var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
|
+
function st(n) {
|
|
4
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
5
|
+
}
|
|
6
|
+
var J = { exports: {} };
|
|
7
|
+
/*!
|
|
8
|
+
Copyright (c) 2018 Jed Watson.
|
|
9
|
+
Licensed under the MIT License (MIT), see
|
|
10
|
+
http://jedwatson.github.io/classnames
|
|
11
|
+
*/
|
|
12
|
+
(function(n) {
|
|
13
|
+
(function() {
|
|
14
|
+
var t = {}.hasOwnProperty;
|
|
15
|
+
function e() {
|
|
16
|
+
for (var s = "", a = 0; a < arguments.length; a++) {
|
|
17
|
+
var f = arguments[a];
|
|
18
|
+
f && (s = i(s, r(f)));
|
|
19
|
+
}
|
|
20
|
+
return s;
|
|
21
|
+
}
|
|
22
|
+
function r(s) {
|
|
23
|
+
if (typeof s == "string" || typeof s == "number")
|
|
24
|
+
return s;
|
|
25
|
+
if (typeof s != "object")
|
|
26
|
+
return "";
|
|
27
|
+
if (Array.isArray(s))
|
|
28
|
+
return e.apply(null, s);
|
|
29
|
+
if (s.toString !== Object.prototype.toString && !s.toString.toString().includes("[native code]"))
|
|
30
|
+
return s.toString();
|
|
31
|
+
var a = "";
|
|
32
|
+
for (var f in s)
|
|
33
|
+
t.call(s, f) && s[f] && (a = i(a, f));
|
|
34
|
+
return a;
|
|
35
|
+
}
|
|
36
|
+
function i(s, a) {
|
|
37
|
+
return a ? s ? s + " " + a : s + a : s;
|
|
38
|
+
}
|
|
39
|
+
n.exports ? (e.default = e, n.exports = e) : window.classNames = e;
|
|
40
|
+
})();
|
|
41
|
+
})(J);
|
|
42
|
+
var at = J.exports;
|
|
43
|
+
const Et = /* @__PURE__ */ st(at);
|
|
44
|
+
function $() {
|
|
45
|
+
return $ = Object.assign ? Object.assign.bind() : function(n) {
|
|
46
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
47
|
+
var e = arguments[t];
|
|
48
|
+
for (var r in e)
|
|
49
|
+
({}).hasOwnProperty.call(e, r) && (n[r] = e[r]);
|
|
50
|
+
}
|
|
51
|
+
return n;
|
|
52
|
+
}, $.apply(null, arguments);
|
|
53
|
+
}
|
|
54
|
+
function p(n) {
|
|
55
|
+
"@babel/helpers - typeof";
|
|
56
|
+
return p = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
57
|
+
return typeof t;
|
|
58
|
+
} : function(t) {
|
|
59
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
60
|
+
}, p(n);
|
|
61
|
+
}
|
|
62
|
+
var S = {}, R = [], ot = function(t) {
|
|
63
|
+
R.push(t);
|
|
64
|
+
};
|
|
65
|
+
function ft(n, t) {
|
|
66
|
+
if (process.env.NODE_ENV !== "production" && !n && console !== void 0) {
|
|
67
|
+
var e = R.reduce(function(r, i) {
|
|
68
|
+
return i(r ?? "", "warning");
|
|
69
|
+
}, t);
|
|
70
|
+
e && console.error("Warning: ".concat(e));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function ut(n, t) {
|
|
74
|
+
if (process.env.NODE_ENV !== "production" && !n && console !== void 0) {
|
|
75
|
+
var e = R.reduce(function(r, i) {
|
|
76
|
+
return i(r ?? "", "note");
|
|
77
|
+
}, t);
|
|
78
|
+
e && console.warn("Note: ".concat(e));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function ct() {
|
|
82
|
+
S = {};
|
|
83
|
+
}
|
|
84
|
+
function z(n, t, e) {
|
|
85
|
+
!t && !S[e] && (n(!1, e), S[e] = !0);
|
|
86
|
+
}
|
|
87
|
+
function F(n, t) {
|
|
88
|
+
z(ft, n, t);
|
|
89
|
+
}
|
|
90
|
+
function ht(n, t) {
|
|
91
|
+
z(ut, n, t);
|
|
92
|
+
}
|
|
93
|
+
F.preMessage = ot;
|
|
94
|
+
F.resetWarned = ct;
|
|
95
|
+
F.noteOnce = ht;
|
|
96
|
+
function lt(n, t) {
|
|
97
|
+
if (p(n) != "object" || !n)
|
|
98
|
+
return n;
|
|
99
|
+
var e = n[Symbol.toPrimitive];
|
|
100
|
+
if (e !== void 0) {
|
|
101
|
+
var r = e.call(n, t || "default");
|
|
102
|
+
if (p(r) != "object")
|
|
103
|
+
return r;
|
|
104
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
105
|
+
}
|
|
106
|
+
return (t === "string" ? String : Number)(n);
|
|
107
|
+
}
|
|
108
|
+
function dt(n) {
|
|
109
|
+
var t = lt(n, "string");
|
|
110
|
+
return p(t) == "symbol" ? t : t + "";
|
|
111
|
+
}
|
|
112
|
+
function d(n, t, e) {
|
|
113
|
+
return (t = dt(t)) in n ? Object.defineProperty(n, t, {
|
|
114
|
+
value: e,
|
|
115
|
+
enumerable: !0,
|
|
116
|
+
configurable: !0,
|
|
117
|
+
writable: !0
|
|
118
|
+
}) : n[t] = e, n;
|
|
119
|
+
}
|
|
120
|
+
function B(n, t) {
|
|
121
|
+
var e = Object.keys(n);
|
|
122
|
+
if (Object.getOwnPropertySymbols) {
|
|
123
|
+
var r = Object.getOwnPropertySymbols(n);
|
|
124
|
+
t && (r = r.filter(function(i) {
|
|
125
|
+
return Object.getOwnPropertyDescriptor(n, i).enumerable;
|
|
126
|
+
})), e.push.apply(e, r);
|
|
127
|
+
}
|
|
128
|
+
return e;
|
|
129
|
+
}
|
|
130
|
+
function I(n) {
|
|
131
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
132
|
+
var e = arguments[t] != null ? arguments[t] : {};
|
|
133
|
+
t % 2 ? B(Object(e), !0).forEach(function(r) {
|
|
134
|
+
d(n, r, e[r]);
|
|
135
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : B(Object(e)).forEach(function(r) {
|
|
136
|
+
Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return n;
|
|
140
|
+
}
|
|
141
|
+
function W(n, t) {
|
|
142
|
+
(t == null || t > n.length) && (t = n.length);
|
|
143
|
+
for (var e = 0, r = Array(t); e < t; e++)
|
|
144
|
+
r[e] = n[e];
|
|
145
|
+
return r;
|
|
146
|
+
}
|
|
147
|
+
function gt(n, t) {
|
|
148
|
+
if (n) {
|
|
149
|
+
if (typeof n == "string")
|
|
150
|
+
return W(n, t);
|
|
151
|
+
var e = {}.toString.call(n).slice(8, -1);
|
|
152
|
+
return e === "Object" && n.constructor && (e = n.constructor.name), e === "Map" || e === "Set" ? Array.from(n) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? W(n, t) : void 0;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function bt(n) {
|
|
156
|
+
if (Array.isArray(n))
|
|
157
|
+
return n;
|
|
158
|
+
}
|
|
159
|
+
function mt(n, t) {
|
|
160
|
+
var e = n == null ? null : typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
|
|
161
|
+
if (e != null) {
|
|
162
|
+
var r, i, s, a, f = [], o = !0, u = !1;
|
|
163
|
+
try {
|
|
164
|
+
if (s = (e = e.call(n)).next, t === 0) {
|
|
165
|
+
if (Object(e) !== e)
|
|
166
|
+
return;
|
|
167
|
+
o = !1;
|
|
168
|
+
} else
|
|
169
|
+
for (; !(o = (r = s.call(e)).done) && (f.push(r.value), f.length !== t); o = !0)
|
|
170
|
+
;
|
|
171
|
+
} catch (c) {
|
|
172
|
+
u = !0, i = c;
|
|
173
|
+
} finally {
|
|
174
|
+
try {
|
|
175
|
+
if (!o && e.return != null && (a = e.return(), Object(a) !== a))
|
|
176
|
+
return;
|
|
177
|
+
} finally {
|
|
178
|
+
if (u)
|
|
179
|
+
throw i;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return f;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
function pt() {
|
|
186
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
187
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
188
|
+
}
|
|
189
|
+
function Nt(n, t) {
|
|
190
|
+
return bt(n) || mt(n, t) || gt(n, t) || pt();
|
|
191
|
+
}
|
|
192
|
+
function vt() {
|
|
193
|
+
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
194
|
+
}
|
|
195
|
+
function yt(n, t) {
|
|
196
|
+
if (!n)
|
|
197
|
+
return !1;
|
|
198
|
+
if (n.contains)
|
|
199
|
+
return n.contains(t);
|
|
200
|
+
for (var e = t; e; ) {
|
|
201
|
+
if (e === n)
|
|
202
|
+
return !0;
|
|
203
|
+
e = e.parentNode;
|
|
204
|
+
}
|
|
205
|
+
return !1;
|
|
206
|
+
}
|
|
207
|
+
var V = "data-rc-order", q = "data-rc-priority", _t = "rc-util-key", x = /* @__PURE__ */ new Map();
|
|
208
|
+
function X() {
|
|
209
|
+
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = n.mark;
|
|
210
|
+
return t ? t.startsWith("data-") ? t : "data-".concat(t) : _t;
|
|
211
|
+
}
|
|
212
|
+
function y(n) {
|
|
213
|
+
if (n.attachTo)
|
|
214
|
+
return n.attachTo;
|
|
215
|
+
var t = document.querySelector("head");
|
|
216
|
+
return t || document.body;
|
|
217
|
+
}
|
|
218
|
+
function St(n) {
|
|
219
|
+
return n === "queue" ? "prependQueue" : n ? "prepend" : "append";
|
|
220
|
+
}
|
|
221
|
+
function T(n) {
|
|
222
|
+
return Array.from((x.get(n) || n).children).filter(function(t) {
|
|
223
|
+
return t.tagName === "STYLE";
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function Z(n) {
|
|
227
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
228
|
+
if (!vt())
|
|
229
|
+
return null;
|
|
230
|
+
var e = t.csp, r = t.prepend, i = t.priority, s = i === void 0 ? 0 : i, a = St(r), f = a === "prependQueue", o = document.createElement("style");
|
|
231
|
+
o.setAttribute(V, a), f && s && o.setAttribute(q, "".concat(s)), e != null && e.nonce && (o.nonce = e == null ? void 0 : e.nonce), o.innerHTML = n;
|
|
232
|
+
var u = y(t), c = u.firstChild;
|
|
233
|
+
if (r) {
|
|
234
|
+
if (f) {
|
|
235
|
+
var l = (t.styles || T(u)).filter(function(g) {
|
|
236
|
+
if (!["prepend", "prependQueue"].includes(g.getAttribute(V)))
|
|
237
|
+
return !1;
|
|
238
|
+
var nt = Number(g.getAttribute(q) || 0);
|
|
239
|
+
return s >= nt;
|
|
240
|
+
});
|
|
241
|
+
if (l.length)
|
|
242
|
+
return u.insertBefore(o, l[l.length - 1].nextSibling), o;
|
|
243
|
+
}
|
|
244
|
+
u.insertBefore(o, c);
|
|
245
|
+
} else
|
|
246
|
+
u.appendChild(o);
|
|
247
|
+
return o;
|
|
248
|
+
}
|
|
249
|
+
function tt(n) {
|
|
250
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = y(t);
|
|
251
|
+
return (t.styles || T(e)).find(function(r) {
|
|
252
|
+
return r.getAttribute(X(t)) === n;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function kt(n) {
|
|
256
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = tt(n, t);
|
|
257
|
+
if (e) {
|
|
258
|
+
var r = y(t);
|
|
259
|
+
r.removeChild(e);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function xt(n, t) {
|
|
263
|
+
var e = x.get(n);
|
|
264
|
+
if (!e || !yt(document, e)) {
|
|
265
|
+
var r = Z("", t), i = r.parentNode;
|
|
266
|
+
x.set(n, i), n.removeChild(r);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function Dt(n, t) {
|
|
270
|
+
var e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = y(e), i = T(r), s = I(I({}, e), {}, {
|
|
271
|
+
styles: i
|
|
272
|
+
});
|
|
273
|
+
xt(r, s);
|
|
274
|
+
var a = tt(t, s);
|
|
275
|
+
if (a) {
|
|
276
|
+
var f, o;
|
|
277
|
+
if ((f = s.csp) !== null && f !== void 0 && f.nonce && a.nonce !== ((o = s.csp) === null || o === void 0 ? void 0 : o.nonce)) {
|
|
278
|
+
var u;
|
|
279
|
+
a.nonce = (u = s.csp) === null || u === void 0 ? void 0 : u.nonce;
|
|
280
|
+
}
|
|
281
|
+
return a.innerHTML !== n && (a.innerHTML = n), a;
|
|
282
|
+
}
|
|
283
|
+
var c = Z(n, s);
|
|
284
|
+
return c.setAttribute(X(s), t), c;
|
|
285
|
+
}
|
|
286
|
+
function wt(n, t) {
|
|
287
|
+
if (n == null)
|
|
288
|
+
return {};
|
|
289
|
+
var e = {};
|
|
290
|
+
for (var r in n)
|
|
291
|
+
if ({}.hasOwnProperty.call(n, r)) {
|
|
292
|
+
if (t.indexOf(r) !== -1)
|
|
293
|
+
continue;
|
|
294
|
+
e[r] = n[r];
|
|
295
|
+
}
|
|
296
|
+
return e;
|
|
297
|
+
}
|
|
298
|
+
function Lt(n, t) {
|
|
299
|
+
if (n == null)
|
|
300
|
+
return {};
|
|
301
|
+
var e, r, i = wt(n, t);
|
|
302
|
+
if (Object.getOwnPropertySymbols) {
|
|
303
|
+
var s = Object.getOwnPropertySymbols(n);
|
|
304
|
+
for (r = 0; r < s.length; r++)
|
|
305
|
+
e = s[r], t.indexOf(e) === -1 && {}.propertyIsEnumerable.call(n, e) && (i[e] = n[e]);
|
|
306
|
+
}
|
|
307
|
+
return i;
|
|
308
|
+
}
|
|
309
|
+
var Ot = /* @__PURE__ */ it({});
|
|
310
|
+
const Rt = Ot, h = Math.round;
|
|
311
|
+
function _(n, t) {
|
|
312
|
+
const e = n.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], r = e.map((i) => parseFloat(i));
|
|
313
|
+
for (let i = 0; i < 3; i += 1)
|
|
314
|
+
r[i] = t(r[i] || 0, e[i] || "", i);
|
|
315
|
+
return e[3] ? r[3] = e[3].includes("%") ? r[3] / 100 : r[3] : r[3] = 1, r;
|
|
316
|
+
}
|
|
317
|
+
const G = (n, t, e) => e === 0 ? n : n / 100;
|
|
318
|
+
function m(n, t) {
|
|
319
|
+
const e = t || 255;
|
|
320
|
+
return n > e ? e : n < 0 ? 0 : n;
|
|
321
|
+
}
|
|
322
|
+
class b {
|
|
323
|
+
constructor(t) {
|
|
324
|
+
d(this, "isValid", !0), d(this, "r", 0), d(this, "g", 0), d(this, "b", 0), d(this, "a", 1), d(this, "_h", void 0), d(this, "_s", void 0), d(this, "_l", void 0), d(this, "_v", void 0), d(this, "_max", void 0), d(this, "_min", void 0), d(this, "_brightness", void 0);
|
|
325
|
+
function e(r) {
|
|
326
|
+
return r[0] in t && r[1] in t && r[2] in t;
|
|
327
|
+
}
|
|
328
|
+
if (t)
|
|
329
|
+
if (typeof t == "string") {
|
|
330
|
+
let i = function(s) {
|
|
331
|
+
return r.startsWith(s);
|
|
332
|
+
};
|
|
333
|
+
const r = t.trim();
|
|
334
|
+
/^#?[A-F\d]{3,8}$/i.test(r) ? this.fromHexString(r) : i("rgb") ? this.fromRgbString(r) : i("hsl") ? this.fromHslString(r) : (i("hsv") || i("hsb")) && this.fromHsvString(r);
|
|
335
|
+
} else if (t instanceof b)
|
|
336
|
+
this.r = t.r, this.g = t.g, this.b = t.b, this.a = t.a, this._h = t._h, this._s = t._s, this._l = t._l, this._v = t._v;
|
|
337
|
+
else if (e("rgb"))
|
|
338
|
+
this.r = m(t.r), this.g = m(t.g), this.b = m(t.b), this.a = typeof t.a == "number" ? m(t.a, 1) : 1;
|
|
339
|
+
else if (e("hsl"))
|
|
340
|
+
this.fromHsl(t);
|
|
341
|
+
else if (e("hsv"))
|
|
342
|
+
this.fromHsv(t);
|
|
343
|
+
else
|
|
344
|
+
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(t));
|
|
345
|
+
}
|
|
346
|
+
// ======================= Setter =======================
|
|
347
|
+
setR(t) {
|
|
348
|
+
return this._sc("r", t);
|
|
349
|
+
}
|
|
350
|
+
setG(t) {
|
|
351
|
+
return this._sc("g", t);
|
|
352
|
+
}
|
|
353
|
+
setB(t) {
|
|
354
|
+
return this._sc("b", t);
|
|
355
|
+
}
|
|
356
|
+
setA(t) {
|
|
357
|
+
return this._sc("a", t, 1);
|
|
358
|
+
}
|
|
359
|
+
setHue(t) {
|
|
360
|
+
const e = this.toHsv();
|
|
361
|
+
return e.h = t, this._c(e);
|
|
362
|
+
}
|
|
363
|
+
// ======================= Getter =======================
|
|
364
|
+
/**
|
|
365
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
366
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
367
|
+
*/
|
|
368
|
+
getLuminance() {
|
|
369
|
+
function t(s) {
|
|
370
|
+
const a = s / 255;
|
|
371
|
+
return a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4);
|
|
372
|
+
}
|
|
373
|
+
const e = t(this.r), r = t(this.g), i = t(this.b);
|
|
374
|
+
return 0.2126 * e + 0.7152 * r + 0.0722 * i;
|
|
375
|
+
}
|
|
376
|
+
getHue() {
|
|
377
|
+
if (typeof this._h > "u") {
|
|
378
|
+
const t = this.getMax() - this.getMin();
|
|
379
|
+
t === 0 ? this._h = 0 : this._h = h(60 * (this.r === this.getMax() ? (this.g - this.b) / t + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / t + 2 : (this.r - this.g) / t + 4));
|
|
380
|
+
}
|
|
381
|
+
return this._h;
|
|
382
|
+
}
|
|
383
|
+
getSaturation() {
|
|
384
|
+
if (typeof this._s > "u") {
|
|
385
|
+
const t = this.getMax() - this.getMin();
|
|
386
|
+
t === 0 ? this._s = 0 : this._s = t / this.getMax();
|
|
387
|
+
}
|
|
388
|
+
return this._s;
|
|
389
|
+
}
|
|
390
|
+
getLightness() {
|
|
391
|
+
return typeof this._l > "u" && (this._l = (this.getMax() + this.getMin()) / 510), this._l;
|
|
392
|
+
}
|
|
393
|
+
getValue() {
|
|
394
|
+
return typeof this._v > "u" && (this._v = this.getMax() / 255), this._v;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
398
|
+
* Note: this is not the b of HSB
|
|
399
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
400
|
+
*/
|
|
401
|
+
getBrightness() {
|
|
402
|
+
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
403
|
+
}
|
|
404
|
+
// ======================== Func ========================
|
|
405
|
+
darken(t = 10) {
|
|
406
|
+
const e = this.getHue(), r = this.getSaturation();
|
|
407
|
+
let i = this.getLightness() - t / 100;
|
|
408
|
+
return i < 0 && (i = 0), this._c({
|
|
409
|
+
h: e,
|
|
410
|
+
s: r,
|
|
411
|
+
l: i,
|
|
412
|
+
a: this.a
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
lighten(t = 10) {
|
|
416
|
+
const e = this.getHue(), r = this.getSaturation();
|
|
417
|
+
let i = this.getLightness() + t / 100;
|
|
418
|
+
return i > 1 && (i = 1), this._c({
|
|
419
|
+
h: e,
|
|
420
|
+
s: r,
|
|
421
|
+
l: i,
|
|
422
|
+
a: this.a
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
427
|
+
* 0 means no mixing (return current color).
|
|
428
|
+
*/
|
|
429
|
+
mix(t, e = 50) {
|
|
430
|
+
const r = this._c(t), i = e / 100, s = (f) => (r[f] - this[f]) * i + this[f], a = {
|
|
431
|
+
r: h(s("r")),
|
|
432
|
+
g: h(s("g")),
|
|
433
|
+
b: h(s("b")),
|
|
434
|
+
a: h(s("a") * 100) / 100
|
|
435
|
+
};
|
|
436
|
+
return this._c(a);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Mix the color with pure white, from 0 to 100.
|
|
440
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
441
|
+
*/
|
|
442
|
+
tint(t = 10) {
|
|
443
|
+
return this.mix({
|
|
444
|
+
r: 255,
|
|
445
|
+
g: 255,
|
|
446
|
+
b: 255,
|
|
447
|
+
a: 1
|
|
448
|
+
}, t);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Mix the color with pure black, from 0 to 100.
|
|
452
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
453
|
+
*/
|
|
454
|
+
shade(t = 10) {
|
|
455
|
+
return this.mix({
|
|
456
|
+
r: 0,
|
|
457
|
+
g: 0,
|
|
458
|
+
b: 0,
|
|
459
|
+
a: 1
|
|
460
|
+
}, t);
|
|
461
|
+
}
|
|
462
|
+
onBackground(t) {
|
|
463
|
+
const e = this._c(t), r = this.a + e.a * (1 - this.a), i = (s) => h((this[s] * this.a + e[s] * e.a * (1 - this.a)) / r);
|
|
464
|
+
return this._c({
|
|
465
|
+
r: i("r"),
|
|
466
|
+
g: i("g"),
|
|
467
|
+
b: i("b"),
|
|
468
|
+
a: r
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
// ======================= Status =======================
|
|
472
|
+
isDark() {
|
|
473
|
+
return this.getBrightness() < 128;
|
|
474
|
+
}
|
|
475
|
+
isLight() {
|
|
476
|
+
return this.getBrightness() >= 128;
|
|
477
|
+
}
|
|
478
|
+
// ======================== MISC ========================
|
|
479
|
+
equals(t) {
|
|
480
|
+
return this.r === t.r && this.g === t.g && this.b === t.b && this.a === t.a;
|
|
481
|
+
}
|
|
482
|
+
clone() {
|
|
483
|
+
return this._c(this);
|
|
484
|
+
}
|
|
485
|
+
// ======================= Format =======================
|
|
486
|
+
toHexString() {
|
|
487
|
+
let t = "#";
|
|
488
|
+
const e = (this.r || 0).toString(16);
|
|
489
|
+
t += e.length === 2 ? e : "0" + e;
|
|
490
|
+
const r = (this.g || 0).toString(16);
|
|
491
|
+
t += r.length === 2 ? r : "0" + r;
|
|
492
|
+
const i = (this.b || 0).toString(16);
|
|
493
|
+
if (t += i.length === 2 ? i : "0" + i, typeof this.a == "number" && this.a >= 0 && this.a < 1) {
|
|
494
|
+
const s = h(this.a * 255).toString(16);
|
|
495
|
+
t += s.length === 2 ? s : "0" + s;
|
|
496
|
+
}
|
|
497
|
+
return t;
|
|
498
|
+
}
|
|
499
|
+
/** CSS support color pattern */
|
|
500
|
+
toHsl() {
|
|
501
|
+
return {
|
|
502
|
+
h: this.getHue(),
|
|
503
|
+
s: this.getSaturation(),
|
|
504
|
+
l: this.getLightness(),
|
|
505
|
+
a: this.a
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
/** CSS support color pattern */
|
|
509
|
+
toHslString() {
|
|
510
|
+
const t = this.getHue(), e = h(this.getSaturation() * 100), r = h(this.getLightness() * 100);
|
|
511
|
+
return this.a !== 1 ? `hsla(${t},${e}%,${r}%,${this.a})` : `hsl(${t},${e}%,${r}%)`;
|
|
512
|
+
}
|
|
513
|
+
/** Same as toHsb */
|
|
514
|
+
toHsv() {
|
|
515
|
+
return {
|
|
516
|
+
h: this.getHue(),
|
|
517
|
+
s: this.getSaturation(),
|
|
518
|
+
v: this.getValue(),
|
|
519
|
+
a: this.a
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
toRgb() {
|
|
523
|
+
return {
|
|
524
|
+
r: this.r,
|
|
525
|
+
g: this.g,
|
|
526
|
+
b: this.b,
|
|
527
|
+
a: this.a
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
toRgbString() {
|
|
531
|
+
return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
|
|
532
|
+
}
|
|
533
|
+
toString() {
|
|
534
|
+
return this.toRgbString();
|
|
535
|
+
}
|
|
536
|
+
// ====================== Privates ======================
|
|
537
|
+
/** Return a new FastColor object with one channel changed */
|
|
538
|
+
_sc(t, e, r) {
|
|
539
|
+
const i = this.clone();
|
|
540
|
+
return i[t] = m(e, r), i;
|
|
541
|
+
}
|
|
542
|
+
_c(t) {
|
|
543
|
+
return new this.constructor(t);
|
|
544
|
+
}
|
|
545
|
+
getMax() {
|
|
546
|
+
return typeof this._max > "u" && (this._max = Math.max(this.r, this.g, this.b)), this._max;
|
|
547
|
+
}
|
|
548
|
+
getMin() {
|
|
549
|
+
return typeof this._min > "u" && (this._min = Math.min(this.r, this.g, this.b)), this._min;
|
|
550
|
+
}
|
|
551
|
+
fromHexString(t) {
|
|
552
|
+
const e = t.replace("#", "");
|
|
553
|
+
function r(i, s) {
|
|
554
|
+
return parseInt(e[i] + e[s || i], 16);
|
|
555
|
+
}
|
|
556
|
+
e.length < 6 ? (this.r = r(0), this.g = r(1), this.b = r(2), this.a = e[3] ? r(3) / 255 : 1) : (this.r = r(0, 1), this.g = r(2, 3), this.b = r(4, 5), this.a = e[6] ? r(6, 7) / 255 : 1);
|
|
557
|
+
}
|
|
558
|
+
fromHsl({
|
|
559
|
+
h: t,
|
|
560
|
+
s: e,
|
|
561
|
+
l: r,
|
|
562
|
+
a: i
|
|
563
|
+
}) {
|
|
564
|
+
if (this._h = t % 360, this._s = e, this._l = r, this.a = typeof i == "number" ? i : 1, e <= 0) {
|
|
565
|
+
const g = h(r * 255);
|
|
566
|
+
this.r = g, this.g = g, this.b = g;
|
|
567
|
+
}
|
|
568
|
+
let s = 0, a = 0, f = 0;
|
|
569
|
+
const o = t / 60, u = (1 - Math.abs(2 * r - 1)) * e, c = u * (1 - Math.abs(o % 2 - 1));
|
|
570
|
+
o >= 0 && o < 1 ? (s = u, a = c) : o >= 1 && o < 2 ? (s = c, a = u) : o >= 2 && o < 3 ? (a = u, f = c) : o >= 3 && o < 4 ? (a = c, f = u) : o >= 4 && o < 5 ? (s = c, f = u) : o >= 5 && o < 6 && (s = u, f = c);
|
|
571
|
+
const l = r - u / 2;
|
|
572
|
+
this.r = h((s + l) * 255), this.g = h((a + l) * 255), this.b = h((f + l) * 255);
|
|
573
|
+
}
|
|
574
|
+
fromHsv({
|
|
575
|
+
h: t,
|
|
576
|
+
s: e,
|
|
577
|
+
v: r,
|
|
578
|
+
a: i
|
|
579
|
+
}) {
|
|
580
|
+
this._h = t % 360, this._s = e, this._v = r, this.a = typeof i == "number" ? i : 1;
|
|
581
|
+
const s = h(r * 255);
|
|
582
|
+
if (this.r = s, this.g = s, this.b = s, e <= 0)
|
|
583
|
+
return;
|
|
584
|
+
const a = t / 60, f = Math.floor(a), o = a - f, u = h(r * (1 - e) * 255), c = h(r * (1 - e * o) * 255), l = h(r * (1 - e * (1 - o)) * 255);
|
|
585
|
+
switch (f) {
|
|
586
|
+
case 0:
|
|
587
|
+
this.g = l, this.b = u;
|
|
588
|
+
break;
|
|
589
|
+
case 1:
|
|
590
|
+
this.r = c, this.b = u;
|
|
591
|
+
break;
|
|
592
|
+
case 2:
|
|
593
|
+
this.r = u, this.b = l;
|
|
594
|
+
break;
|
|
595
|
+
case 3:
|
|
596
|
+
this.r = u, this.g = c;
|
|
597
|
+
break;
|
|
598
|
+
case 4:
|
|
599
|
+
this.r = l, this.g = u;
|
|
600
|
+
break;
|
|
601
|
+
case 5:
|
|
602
|
+
default:
|
|
603
|
+
this.g = u, this.b = c;
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
fromHsvString(t) {
|
|
608
|
+
const e = _(t, G);
|
|
609
|
+
this.fromHsv({
|
|
610
|
+
h: e[0],
|
|
611
|
+
s: e[1],
|
|
612
|
+
v: e[2],
|
|
613
|
+
a: e[3]
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
fromHslString(t) {
|
|
617
|
+
const e = _(t, G);
|
|
618
|
+
this.fromHsl({
|
|
619
|
+
h: e[0],
|
|
620
|
+
s: e[1],
|
|
621
|
+
l: e[2],
|
|
622
|
+
a: e[3]
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
fromRgbString(t) {
|
|
626
|
+
const e = _(t, (r, i) => (
|
|
627
|
+
// Convert percentage to number. e.g. 50% -> 128
|
|
628
|
+
i.includes("%") ? h(r / 100 * 255) : r
|
|
629
|
+
));
|
|
630
|
+
this.r = e[0], this.g = e[1], this.b = e[2], this.a = e[3];
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
var v = 2, K = 0.16, Mt = 0.05, Ht = 0.05, Pt = 0.15, et = 5, rt = 4, jt = [{
|
|
634
|
+
index: 7,
|
|
635
|
+
amount: 15
|
|
636
|
+
}, {
|
|
637
|
+
index: 6,
|
|
638
|
+
amount: 25
|
|
639
|
+
}, {
|
|
640
|
+
index: 5,
|
|
641
|
+
amount: 30
|
|
642
|
+
}, {
|
|
643
|
+
index: 5,
|
|
644
|
+
amount: 45
|
|
645
|
+
}, {
|
|
646
|
+
index: 5,
|
|
647
|
+
amount: 65
|
|
648
|
+
}, {
|
|
649
|
+
index: 5,
|
|
650
|
+
amount: 85
|
|
651
|
+
}, {
|
|
652
|
+
index: 4,
|
|
653
|
+
amount: 90
|
|
654
|
+
}, {
|
|
655
|
+
index: 3,
|
|
656
|
+
amount: 95
|
|
657
|
+
}, {
|
|
658
|
+
index: 2,
|
|
659
|
+
amount: 97
|
|
660
|
+
}, {
|
|
661
|
+
index: 1,
|
|
662
|
+
amount: 98
|
|
663
|
+
}];
|
|
664
|
+
function Q(n, t, e) {
|
|
665
|
+
var r;
|
|
666
|
+
return Math.round(n.h) >= 60 && Math.round(n.h) <= 240 ? r = e ? Math.round(n.h) - v * t : Math.round(n.h) + v * t : r = e ? Math.round(n.h) + v * t : Math.round(n.h) - v * t, r < 0 ? r += 360 : r >= 360 && (r -= 360), r;
|
|
667
|
+
}
|
|
668
|
+
function Y(n, t, e) {
|
|
669
|
+
if (n.h === 0 && n.s === 0)
|
|
670
|
+
return n.s;
|
|
671
|
+
var r;
|
|
672
|
+
return e ? r = n.s - K * t : t === rt ? r = n.s + K : r = n.s + Mt * t, r > 1 && (r = 1), e && t === et && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Math.round(r * 100) / 100;
|
|
673
|
+
}
|
|
674
|
+
function U(n, t, e) {
|
|
675
|
+
var r;
|
|
676
|
+
return e ? r = n.v + Ht * t : r = n.v - Pt * t, r = Math.max(0, Math.min(1, r)), Math.round(r * 100) / 100;
|
|
677
|
+
}
|
|
678
|
+
function Ft(n) {
|
|
679
|
+
for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, e = [], r = new b(n), i = r.toHsv(), s = et; s > 0; s -= 1) {
|
|
680
|
+
var a = new b({
|
|
681
|
+
h: Q(i, s, !0),
|
|
682
|
+
s: Y(i, s, !0),
|
|
683
|
+
v: U(i, s, !0)
|
|
684
|
+
});
|
|
685
|
+
e.push(a);
|
|
686
|
+
}
|
|
687
|
+
e.push(r);
|
|
688
|
+
for (var f = 1; f <= rt; f += 1) {
|
|
689
|
+
var o = new b({
|
|
690
|
+
h: Q(i, f),
|
|
691
|
+
s: Y(i, f),
|
|
692
|
+
v: U(i, f)
|
|
693
|
+
});
|
|
694
|
+
e.push(o);
|
|
695
|
+
}
|
|
696
|
+
return t.theme === "dark" ? jt.map(function(u) {
|
|
697
|
+
var c = u.index, l = u.amount;
|
|
698
|
+
return new b(t.backgroundColor || "#141414").mix(e[c], l).toHexString();
|
|
699
|
+
}) : e.map(function(u) {
|
|
700
|
+
return u.toHexString();
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
var Tt = {
|
|
704
|
+
red: "#F5222D",
|
|
705
|
+
volcano: "#FA541C",
|
|
706
|
+
orange: "#FA8C16",
|
|
707
|
+
gold: "#FAAD14",
|
|
708
|
+
yellow: "#FADB14",
|
|
709
|
+
lime: "#A0D911",
|
|
710
|
+
green: "#52C41A",
|
|
711
|
+
cyan: "#13C2C2",
|
|
712
|
+
blue: "#1677FF",
|
|
713
|
+
geekblue: "#2F54EB",
|
|
714
|
+
purple: "#722ED1",
|
|
715
|
+
magenta: "#EB2F96",
|
|
716
|
+
grey: "#666666"
|
|
717
|
+
}, w = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
|
|
718
|
+
w.primary = w[5];
|
|
719
|
+
var O = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
|
|
720
|
+
O.primary = O[5];
|
|
721
|
+
var M = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
|
|
722
|
+
M.primary = M[5];
|
|
723
|
+
var H = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
|
|
724
|
+
H.primary = H[5];
|
|
725
|
+
var P = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
|
|
726
|
+
P.primary = P[5];
|
|
727
|
+
var j = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
|
|
728
|
+
j.primary = j[5];
|
|
729
|
+
var C = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
|
|
730
|
+
C.primary = C[5];
|
|
731
|
+
var A = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
|
|
732
|
+
A.primary = A[5];
|
|
733
|
+
var E = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
|
734
|
+
E.primary = E[5];
|
|
735
|
+
var N = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
|
|
736
|
+
N.primary = N[5];
|
|
737
|
+
var k = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
|
|
738
|
+
k.primary = k[5];
|
|
739
|
+
var D = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
|
|
740
|
+
D.primary = D[5];
|
|
741
|
+
var L = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
|
|
742
|
+
L.primary = L[5];
|
|
743
|
+
var $t = {
|
|
744
|
+
red: w,
|
|
745
|
+
volcano: O,
|
|
746
|
+
orange: M,
|
|
747
|
+
gold: H,
|
|
748
|
+
yellow: P,
|
|
749
|
+
lime: j,
|
|
750
|
+
green: C,
|
|
751
|
+
cyan: A,
|
|
752
|
+
blue: E,
|
|
753
|
+
geekblue: N,
|
|
754
|
+
purple: k,
|
|
755
|
+
magenta: D,
|
|
756
|
+
grey: L
|
|
757
|
+
};
|
|
758
|
+
export {
|
|
759
|
+
Rt as C,
|
|
760
|
+
b as F,
|
|
761
|
+
I as _,
|
|
762
|
+
$ as a,
|
|
763
|
+
At as b,
|
|
764
|
+
Et as c,
|
|
765
|
+
p as d,
|
|
766
|
+
Lt as e,
|
|
767
|
+
Nt as f,
|
|
768
|
+
Ft as g,
|
|
769
|
+
d as h,
|
|
770
|
+
E as i,
|
|
771
|
+
ft as j,
|
|
772
|
+
vt as k,
|
|
773
|
+
H as l,
|
|
774
|
+
st as m,
|
|
775
|
+
ht as n,
|
|
776
|
+
W as o,
|
|
777
|
+
gt as p,
|
|
778
|
+
bt as q,
|
|
779
|
+
kt as r,
|
|
780
|
+
pt as s,
|
|
781
|
+
dt as t,
|
|
782
|
+
Dt as u,
|
|
783
|
+
ct as v,
|
|
784
|
+
F as w,
|
|
785
|
+
Tt as x,
|
|
786
|
+
$t as y
|
|
787
|
+
};
|