@baishuyun/ui-base 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/Card/Card-BE6v4I-A.js +69 -0
  2. package/dist/Card/index.js +3 -4
  3. package/dist/CheckBox/CheckBox--rXaUgMO.js +67 -0
  4. package/dist/CheckBox/CheckBox-Db8X-pw9.js +33 -0
  5. package/dist/CheckBox/index.js +4 -39
  6. package/dist/ColorPicker/ColorPicker-BBP-4-so.js +168 -0
  7. package/dist/ColorPicker/index.js +6 -5
  8. package/dist/DropDown/DropDown-CKXi9mXN.js +162 -0
  9. package/dist/DropDown/index.js +7 -4
  10. package/dist/Editor/Buttons--dMLPuk2.js +595 -0
  11. package/dist/Editor/ToolbarPlugin/Buttons/index.js +14 -8
  12. package/dist/Editor/constants/index.js +53 -20
  13. package/dist/Editor/index.js +518 -576
  14. package/dist/Icon/Icon-DppVOyPK.js +19 -0
  15. package/dist/Icon/index.js +2 -4
  16. package/dist/InputTag/InputTag-B6N5MZA2.js +139 -0
  17. package/dist/InputTag/index.js +3 -4
  18. package/dist/Loading/Loading-Bi5NO-Ky.js +15 -0
  19. package/dist/Loading/index.js +2 -4
  20. package/dist/Modal/Modal-FVJpbEgw.js +81 -0
  21. package/dist/Modal/index.js +3 -4
  22. package/dist/NotFoundContent/NotFoundContent-CTPpcZOt.js +9 -0
  23. package/dist/NotFoundContent/index.js +2 -4
  24. package/dist/Radio/Radio-dyoBNiKF.js +85 -0
  25. package/dist/Radio/index.js +2 -105
  26. package/dist/Segmented/Segmented-Dd8glDXI.js +62 -0
  27. package/dist/Segmented/index.js +2 -4
  28. package/dist/Select/Select-Bd2ECrB0.js +729 -0
  29. package/dist/Select/SelectInputSearch-CIXBNLFi.js +46 -0
  30. package/dist/Select/index.js +11 -6
  31. package/dist/Tabs/Tabs-C79GTyGd.js +410 -0
  32. package/dist/Tabs/index.js +6 -7
  33. package/dist/Tree/index.js +5 -4
  34. package/dist/Tree/utils/index.js +24 -39
  35. package/dist/components/Editor/context/EditorContainerContext.d.ts +8 -0
  36. package/dist/index.js +103 -81
  37. package/dist/style.css +2 -1
  38. package/dist/vendors/Tree-CQR9fvpA.js +231 -0
  39. package/dist/vendors/animations-C5JKFkz4.js +38 -0
  40. package/dist/vendors/clsx-DNOE4Gl8.js +16 -0
  41. package/dist/vendors/color-BPWy9DvT.js +12 -0
  42. package/dist/vendors/fuse.js-BKtvbTjL.js +877 -0
  43. package/dist/vendors/lexical-hZliMgDv.js +6439 -0
  44. package/dist/vendors/lodash-es-Bu9xU1fK.js +334 -0
  45. package/dist/vendors/simplebar-react-CFlS-Nm9.js +370 -0
  46. package/dist/vendors/tinycolor2-DToeAEPD.js +726 -0
  47. package/dist/vendors/useFloatingPortal-BA6P5GxV.js +45 -0
  48. package/dist/vendors/useLocale-BfT0V1j4.js +75 -0
  49. package/package.json +3 -3
  50. package/dist/Card/Card-Y1ISqAp9.js +0 -86
  51. package/dist/CheckBox/CheckBox-C9sXWSA5.js +0 -84
  52. package/dist/ColorPicker/ColorPicker-D0D5azon.js +0 -216
  53. package/dist/DropDown/DropDown-DGkSeXQT.js +0 -166
  54. package/dist/Editor/index-C0Rjz8DK.js +0 -846
  55. package/dist/Icon/Icon-CBlIwtp2.js +0 -24
  56. package/dist/InputTag/InputTag-C-rQUJnF.js +0 -155
  57. package/dist/Loading/Loading-CEB4PLUE.js +0 -9
  58. package/dist/Modal/Modal-z3TvEXwN.js +0 -80
  59. package/dist/NotFoundContent/NotFoundContent-h0-oIXlk.js +0 -6
  60. package/dist/Segmented/Segmented-UgzW78Ey.js +0 -75
  61. package/dist/Select/Select-hwXXDuLU.js +0 -820
  62. package/dist/Select/SelectInputSearch-ChUpUgxa.js +0 -34
  63. package/dist/Tabs/TabSelect-DL8Bhehc.js +0 -445
  64. package/dist/vendors/Tree-CLEy-xqz.js +0 -235
  65. package/dist/vendors/clsx-OuTLNxxd.js +0 -16
  66. package/dist/vendors/color-VzwvCPhF.js +0 -21
  67. package/dist/vendors/fuse.js-D1DCbUBb.js +0 -1022
  68. package/dist/vendors/index-MTmG1Ezy.js +0 -15
  69. package/dist/vendors/lexical-DO7eMeC2.js +0 -5891
  70. package/dist/vendors/lodash-es-DFpaJB4Y.js +0 -305
  71. package/dist/vendors/simplebar-react-D68KzE44.js +0 -408
  72. package/dist/vendors/tinycolor2-Begv3Jc8.js +0 -711
  73. package/dist/vendors/useFloatingPortal-9VUFOAOG.js +0 -45
  74. package/dist/vendors/useLocale-DgqW9M3h.js +0 -47
@@ -1,711 +0,0 @@
1
- function m(t) {
2
- "@babel/helpers - typeof";
3
- return m = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
4
- return typeof r;
5
- } : function(r) {
6
- return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
7
- }, m(t);
8
- }
9
- var T = /^\s+/, C = /\s+$/;
10
- function s(t, r) {
11
- if (t = t || "", r = r || {}, t instanceof s)
12
- return t;
13
- if (!(this instanceof s))
14
- return new s(t, r);
15
- var e = I(t);
16
- this._originalInput = t, this._r = e.r, this._g = e.g, this._b = e.b, this._a = e.a, this._roundA = Math.round(100 * this._a) / 100, this._format = r.format || e.format, this._gradientType = r.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = e.ok;
17
- }
18
- s.prototype = {
19
- isDark: function() {
20
- return this.getBrightness() < 128;
21
- },
22
- isLight: function() {
23
- return !this.isDark();
24
- },
25
- isValid: function() {
26
- return this._ok;
27
- },
28
- getOriginalInput: function() {
29
- return this._originalInput;
30
- },
31
- getFormat: function() {
32
- return this._format;
33
- },
34
- getAlpha: function() {
35
- return this._a;
36
- },
37
- getBrightness: function() {
38
- var r = this.toRgb();
39
- return (r.r * 299 + r.g * 587 + r.b * 114) / 1e3;
40
- },
41
- getLuminance: function() {
42
- var r = this.toRgb(), e, a, i, n, h, f;
43
- return e = r.r / 255, a = r.g / 255, i = r.b / 255, e <= 0.03928 ? n = e / 12.92 : n = Math.pow((e + 0.055) / 1.055, 2.4), a <= 0.03928 ? h = a / 12.92 : h = Math.pow((a + 0.055) / 1.055, 2.4), i <= 0.03928 ? f = i / 12.92 : f = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * h + 0.0722 * f;
44
- },
45
- setAlpha: function(r) {
46
- return this._a = w(r), this._roundA = Math.round(100 * this._a) / 100, this;
47
- },
48
- toHsv: function() {
49
- var r = A(this._r, this._g, this._b);
50
- return {
51
- h: r.h * 360,
52
- s: r.s,
53
- v: r.v,
54
- a: this._a
55
- };
56
- },
57
- toHsvString: function() {
58
- var r = A(this._r, this._g, this._b), e = Math.round(r.h * 360), a = Math.round(r.s * 100), i = Math.round(r.v * 100);
59
- return this._a == 1 ? "hsv(" + e + ", " + a + "%, " + i + "%)" : "hsva(" + e + ", " + a + "%, " + i + "%, " + this._roundA + ")";
60
- },
61
- toHsl: function() {
62
- var r = x(this._r, this._g, this._b);
63
- return {
64
- h: r.h * 360,
65
- s: r.s,
66
- l: r.l,
67
- a: this._a
68
- };
69
- },
70
- toHslString: function() {
71
- var r = x(this._r, this._g, this._b), e = Math.round(r.h * 360), a = Math.round(r.s * 100), i = Math.round(r.l * 100);
72
- return this._a == 1 ? "hsl(" + e + ", " + a + "%, " + i + "%)" : "hsla(" + e + ", " + a + "%, " + i + "%, " + this._roundA + ")";
73
- },
74
- toHex: function(r) {
75
- return S(this._r, this._g, this._b, r);
76
- },
77
- toHexString: function(r) {
78
- return "#" + this.toHex(r);
79
- },
80
- toHex8: function(r) {
81
- return B(this._r, this._g, this._b, this._a, r);
82
- },
83
- toHex8String: function(r) {
84
- return "#" + this.toHex8(r);
85
- },
86
- toRgb: function() {
87
- return {
88
- r: Math.round(this._r),
89
- g: Math.round(this._g),
90
- b: Math.round(this._b),
91
- a: this._a
92
- };
93
- },
94
- toRgbString: function() {
95
- return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
96
- },
97
- toPercentageRgb: function() {
98
- return {
99
- r: Math.round(u(this._r, 255) * 100) + "%",
100
- g: Math.round(u(this._g, 255) * 100) + "%",
101
- b: Math.round(u(this._b, 255) * 100) + "%",
102
- a: this._a
103
- };
104
- },
105
- toPercentageRgbString: function() {
106
- return this._a == 1 ? "rgb(" + Math.round(u(this._r, 255) * 100) + "%, " + Math.round(u(this._g, 255) * 100) + "%, " + Math.round(u(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(u(this._r, 255) * 100) + "%, " + Math.round(u(this._g, 255) * 100) + "%, " + Math.round(u(this._b, 255) * 100) + "%, " + this._roundA + ")";
107
- },
108
- toName: function() {
109
- return this._a === 0 ? "transparent" : this._a < 1 ? !1 : X[S(this._r, this._g, this._b, !0)] || !1;
110
- },
111
- toFilter: function(r) {
112
- var e = "#" + k(this._r, this._g, this._b, this._a), a = e, i = this._gradientType ? "GradientType = 1, " : "";
113
- if (r) {
114
- var n = s(r);
115
- a = "#" + k(n._r, n._g, n._b, n._a);
116
- }
117
- return "progid:DXImageTransform.Microsoft.gradient(" + i + "startColorstr=" + e + ",endColorstr=" + a + ")";
118
- },
119
- toString: function(r) {
120
- var e = !!r;
121
- r = r || this._format;
122
- var a = !1, i = this._a < 1 && this._a >= 0, n = !e && i && (r === "hex" || r === "hex6" || r === "hex3" || r === "hex4" || r === "hex8" || r === "name");
123
- return n ? r === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (r === "rgb" && (a = this.toRgbString()), r === "prgb" && (a = this.toPercentageRgbString()), (r === "hex" || r === "hex6") && (a = this.toHexString()), r === "hex3" && (a = this.toHexString(!0)), r === "hex4" && (a = this.toHex8String(!0)), r === "hex8" && (a = this.toHex8String()), r === "name" && (a = this.toName()), r === "hsl" && (a = this.toHslString()), r === "hsv" && (a = this.toHsvString()), a || this.toHexString());
124
- },
125
- clone: function() {
126
- return s(this.toString());
127
- },
128
- _applyModification: function(r, e) {
129
- var a = r.apply(null, [this].concat([].slice.call(e)));
130
- return this._r = a._r, this._g = a._g, this._b = a._b, this.setAlpha(a._a), this;
131
- },
132
- lighten: function() {
133
- return this._applyModification(O, arguments);
134
- },
135
- brighten: function() {
136
- return this._applyModification(q, arguments);
137
- },
138
- darken: function() {
139
- return this._applyModification(D, arguments);
140
- },
141
- desaturate: function() {
142
- return this._applyModification(z, arguments);
143
- },
144
- saturate: function() {
145
- return this._applyModification(G, arguments);
146
- },
147
- greyscale: function() {
148
- return this._applyModification(L, arguments);
149
- },
150
- spin: function() {
151
- return this._applyModification(U, arguments);
152
- },
153
- _applyCombination: function(r, e) {
154
- return r.apply(null, [this].concat([].slice.call(e)));
155
- },
156
- analogous: function() {
157
- return this._applyCombination(j, arguments);
158
- },
159
- complement: function() {
160
- return this._applyCombination(V, arguments);
161
- },
162
- monochromatic: function() {
163
- return this._applyCombination(W, arguments);
164
- },
165
- splitcomplement: function() {
166
- return this._applyCombination($, arguments);
167
- },
168
- // Disabled until https://github.com/bgrins/TinyColor/issues/254
169
- // polyad: function (number) {
170
- // return this._applyCombination(polyad, [number]);
171
- // },
172
- triad: function() {
173
- return this._applyCombination(H, [3]);
174
- },
175
- tetrad: function() {
176
- return this._applyCombination(H, [4]);
177
- }
178
- };
179
- s.fromRatio = function(t, r) {
180
- if (m(t) == "object") {
181
- var e = {};
182
- for (var a in t)
183
- t.hasOwnProperty(a) && (a === "a" ? e[a] = t[a] : e[a] = _(t[a]));
184
- t = e;
185
- }
186
- return s(t, r);
187
- };
188
- function I(t) {
189
- var r = {
190
- r: 0,
191
- g: 0,
192
- b: 0
193
- }, e = 1, a = null, i = null, n = null, h = !1, f = !1;
194
- return typeof t == "string" && (t = Q(t)), m(t) == "object" && (p(t.r) && p(t.g) && p(t.b) ? (r = P(t.r, t.g, t.b), h = !0, f = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : p(t.h) && p(t.s) && p(t.v) ? (a = _(t.s), i = _(t.v), r = N(t.h, a, i), h = !0, f = "hsv") : p(t.h) && p(t.s) && p(t.l) && (a = _(t.s), n = _(t.l), r = E(t.h, a, n), h = !0, f = "hsl"), t.hasOwnProperty("a") && (e = t.a)), e = w(e), {
195
- ok: h,
196
- format: t.format || f,
197
- r: Math.min(255, Math.max(r.r, 0)),
198
- g: Math.min(255, Math.max(r.g, 0)),
199
- b: Math.min(255, Math.max(r.b, 0)),
200
- a: e
201
- };
202
- }
203
- function P(t, r, e) {
204
- return {
205
- r: u(t, 255) * 255,
206
- g: u(r, 255) * 255,
207
- b: u(e, 255) * 255
208
- };
209
- }
210
- function x(t, r, e) {
211
- t = u(t, 255), r = u(r, 255), e = u(e, 255);
212
- var a = Math.max(t, r, e), i = Math.min(t, r, e), n, h, f = (a + i) / 2;
213
- if (a == i)
214
- n = h = 0;
215
- else {
216
- var o = a - i;
217
- switch (h = f > 0.5 ? o / (2 - a - i) : o / (a + i), a) {
218
- case t:
219
- n = (r - e) / o + (r < e ? 6 : 0);
220
- break;
221
- case r:
222
- n = (e - t) / o + 2;
223
- break;
224
- case e:
225
- n = (t - r) / o + 4;
226
- break;
227
- }
228
- n /= 6;
229
- }
230
- return {
231
- h: n,
232
- s: h,
233
- l: f
234
- };
235
- }
236
- function E(t, r, e) {
237
- var a, i, n;
238
- t = u(t, 360), r = u(r, 100), e = u(e, 100);
239
- function h(g, v, d) {
240
- return d < 0 && (d += 1), d > 1 && (d -= 1), d < 1 / 6 ? g + (v - g) * 6 * d : d < 1 / 2 ? v : d < 2 / 3 ? g + (v - g) * (2 / 3 - d) * 6 : g;
241
- }
242
- if (r === 0)
243
- a = i = n = e;
244
- else {
245
- var f = e < 0.5 ? e * (1 + r) : e + r - e * r, o = 2 * e - f;
246
- a = h(o, f, t + 1 / 3), i = h(o, f, t), n = h(o, f, t - 1 / 3);
247
- }
248
- return {
249
- r: a * 255,
250
- g: i * 255,
251
- b: n * 255
252
- };
253
- }
254
- function A(t, r, e) {
255
- t = u(t, 255), r = u(r, 255), e = u(e, 255);
256
- var a = Math.max(t, r, e), i = Math.min(t, r, e), n, h, f = a, o = a - i;
257
- if (h = a === 0 ? 0 : o / a, a == i)
258
- n = 0;
259
- else {
260
- switch (a) {
261
- case t:
262
- n = (r - e) / o + (r < e ? 6 : 0);
263
- break;
264
- case r:
265
- n = (e - t) / o + 2;
266
- break;
267
- case e:
268
- n = (t - r) / o + 4;
269
- break;
270
- }
271
- n /= 6;
272
- }
273
- return {
274
- h: n,
275
- s: h,
276
- v: f
277
- };
278
- }
279
- function N(t, r, e) {
280
- t = u(t, 360) * 6, r = u(r, 100), e = u(e, 100);
281
- var a = Math.floor(t), i = t - a, n = e * (1 - r), h = e * (1 - i * r), f = e * (1 - (1 - i) * r), o = a % 6, g = [e, h, n, n, f, e][o], v = [f, e, e, h, n, n][o], d = [n, n, f, e, e, h][o];
282
- return {
283
- r: g * 255,
284
- g: v * 255,
285
- b: d * 255
286
- };
287
- }
288
- function S(t, r, e, a) {
289
- var i = [b(Math.round(t).toString(16)), b(Math.round(r).toString(16)), b(Math.round(e).toString(16))];
290
- return a && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
291
- }
292
- function B(t, r, e, a, i) {
293
- var n = [b(Math.round(t).toString(16)), b(Math.round(r).toString(16)), b(Math.round(e).toString(16)), b(F(a))];
294
- return i && n[0].charAt(0) == n[0].charAt(1) && n[1].charAt(0) == n[1].charAt(1) && n[2].charAt(0) == n[2].charAt(1) && n[3].charAt(0) == n[3].charAt(1) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) + n[3].charAt(0) : n.join("");
295
- }
296
- function k(t, r, e, a) {
297
- var i = [b(F(a)), b(Math.round(t).toString(16)), b(Math.round(r).toString(16)), b(Math.round(e).toString(16))];
298
- return i.join("");
299
- }
300
- s.equals = function(t, r) {
301
- return !t || !r ? !1 : s(t).toRgbString() == s(r).toRgbString();
302
- };
303
- s.random = function() {
304
- return s.fromRatio({
305
- r: Math.random(),
306
- g: Math.random(),
307
- b: Math.random()
308
- });
309
- };
310
- function z(t, r) {
311
- r = r === 0 ? 0 : r || 10;
312
- var e = s(t).toHsl();
313
- return e.s -= r / 100, e.s = y(e.s), s(e);
314
- }
315
- function G(t, r) {
316
- r = r === 0 ? 0 : r || 10;
317
- var e = s(t).toHsl();
318
- return e.s += r / 100, e.s = y(e.s), s(e);
319
- }
320
- function L(t) {
321
- return s(t).desaturate(100);
322
- }
323
- function O(t, r) {
324
- r = r === 0 ? 0 : r || 10;
325
- var e = s(t).toHsl();
326
- return e.l += r / 100, e.l = y(e.l), s(e);
327
- }
328
- function q(t, r) {
329
- r = r === 0 ? 0 : r || 10;
330
- var e = s(t).toRgb();
331
- return e.r = Math.max(0, Math.min(255, e.r - Math.round(255 * -(r / 100)))), e.g = Math.max(0, Math.min(255, e.g - Math.round(255 * -(r / 100)))), e.b = Math.max(0, Math.min(255, e.b - Math.round(255 * -(r / 100)))), s(e);
332
- }
333
- function D(t, r) {
334
- r = r === 0 ? 0 : r || 10;
335
- var e = s(t).toHsl();
336
- return e.l -= r / 100, e.l = y(e.l), s(e);
337
- }
338
- function U(t, r) {
339
- var e = s(t).toHsl(), a = (e.h + r) % 360;
340
- return e.h = a < 0 ? 360 + a : a, s(e);
341
- }
342
- function V(t) {
343
- var r = s(t).toHsl();
344
- return r.h = (r.h + 180) % 360, s(r);
345
- }
346
- function H(t, r) {
347
- if (isNaN(r) || r <= 0)
348
- throw new Error("Argument to polyad must be a positive number");
349
- for (var e = s(t).toHsl(), a = [s(t)], i = 360 / r, n = 1; n < r; n++)
350
- a.push(s({
351
- h: (e.h + n * i) % 360,
352
- s: e.s,
353
- l: e.l
354
- }));
355
- return a;
356
- }
357
- function $(t) {
358
- var r = s(t).toHsl(), e = r.h;
359
- return [s(t), s({
360
- h: (e + 72) % 360,
361
- s: r.s,
362
- l: r.l
363
- }), s({
364
- h: (e + 216) % 360,
365
- s: r.s,
366
- l: r.l
367
- })];
368
- }
369
- function j(t, r, e) {
370
- r = r || 6, e = e || 30;
371
- var a = s(t).toHsl(), i = 360 / e, n = [s(t)];
372
- for (a.h = (a.h - (i * r >> 1) + 720) % 360; --r; )
373
- a.h = (a.h + i) % 360, n.push(s(a));
374
- return n;
375
- }
376
- function W(t, r) {
377
- r = r || 6;
378
- for (var e = s(t).toHsv(), a = e.h, i = e.s, n = e.v, h = [], f = 1 / r; r--; )
379
- h.push(s({
380
- h: a,
381
- s: i,
382
- v: n
383
- })), n = (n + f) % 1;
384
- return h;
385
- }
386
- s.mix = function(t, r, e) {
387
- e = e === 0 ? 0 : e || 50;
388
- var a = s(t).toRgb(), i = s(r).toRgb(), n = e / 100, h = {
389
- r: (i.r - a.r) * n + a.r,
390
- g: (i.g - a.g) * n + a.g,
391
- b: (i.b - a.b) * n + a.b,
392
- a: (i.a - a.a) * n + a.a
393
- };
394
- return s(h);
395
- };
396
- s.readability = function(t, r) {
397
- var e = s(t), a = s(r);
398
- return (Math.max(e.getLuminance(), a.getLuminance()) + 0.05) / (Math.min(e.getLuminance(), a.getLuminance()) + 0.05);
399
- };
400
- s.isReadable = function(t, r, e) {
401
- var a = s.readability(t, r), i, n;
402
- switch (n = !1, i = Y(e), i.level + i.size) {
403
- case "AAsmall":
404
- case "AAAlarge":
405
- n = a >= 4.5;
406
- break;
407
- case "AAlarge":
408
- n = a >= 3;
409
- break;
410
- case "AAAsmall":
411
- n = a >= 7;
412
- break;
413
- }
414
- return n;
415
- };
416
- s.mostReadable = function(t, r, e) {
417
- var a = null, i = 0, n, h, f, o;
418
- e = e || {}, h = e.includeFallbackColors, f = e.level, o = e.size;
419
- for (var g = 0; g < r.length; g++)
420
- n = s.readability(t, r[g]), n > i && (i = n, a = s(r[g]));
421
- return s.isReadable(t, a, {
422
- level: f,
423
- size: o
424
- }) || !h ? a : (e.includeFallbackColors = !1, s.mostReadable(t, ["#fff", "#000"], e));
425
- };
426
- var M = s.names = {
427
- aliceblue: "f0f8ff",
428
- antiquewhite: "faebd7",
429
- aqua: "0ff",
430
- aquamarine: "7fffd4",
431
- azure: "f0ffff",
432
- beige: "f5f5dc",
433
- bisque: "ffe4c4",
434
- black: "000",
435
- blanchedalmond: "ffebcd",
436
- blue: "00f",
437
- blueviolet: "8a2be2",
438
- brown: "a52a2a",
439
- burlywood: "deb887",
440
- burntsienna: "ea7e5d",
441
- cadetblue: "5f9ea0",
442
- chartreuse: "7fff00",
443
- chocolate: "d2691e",
444
- coral: "ff7f50",
445
- cornflowerblue: "6495ed",
446
- cornsilk: "fff8dc",
447
- crimson: "dc143c",
448
- cyan: "0ff",
449
- darkblue: "00008b",
450
- darkcyan: "008b8b",
451
- darkgoldenrod: "b8860b",
452
- darkgray: "a9a9a9",
453
- darkgreen: "006400",
454
- darkgrey: "a9a9a9",
455
- darkkhaki: "bdb76b",
456
- darkmagenta: "8b008b",
457
- darkolivegreen: "556b2f",
458
- darkorange: "ff8c00",
459
- darkorchid: "9932cc",
460
- darkred: "8b0000",
461
- darksalmon: "e9967a",
462
- darkseagreen: "8fbc8f",
463
- darkslateblue: "483d8b",
464
- darkslategray: "2f4f4f",
465
- darkslategrey: "2f4f4f",
466
- darkturquoise: "00ced1",
467
- darkviolet: "9400d3",
468
- deeppink: "ff1493",
469
- deepskyblue: "00bfff",
470
- dimgray: "696969",
471
- dimgrey: "696969",
472
- dodgerblue: "1e90ff",
473
- firebrick: "b22222",
474
- floralwhite: "fffaf0",
475
- forestgreen: "228b22",
476
- fuchsia: "f0f",
477
- gainsboro: "dcdcdc",
478
- ghostwhite: "f8f8ff",
479
- gold: "ffd700",
480
- goldenrod: "daa520",
481
- gray: "808080",
482
- green: "008000",
483
- greenyellow: "adff2f",
484
- grey: "808080",
485
- honeydew: "f0fff0",
486
- hotpink: "ff69b4",
487
- indianred: "cd5c5c",
488
- indigo: "4b0082",
489
- ivory: "fffff0",
490
- khaki: "f0e68c",
491
- lavender: "e6e6fa",
492
- lavenderblush: "fff0f5",
493
- lawngreen: "7cfc00",
494
- lemonchiffon: "fffacd",
495
- lightblue: "add8e6",
496
- lightcoral: "f08080",
497
- lightcyan: "e0ffff",
498
- lightgoldenrodyellow: "fafad2",
499
- lightgray: "d3d3d3",
500
- lightgreen: "90ee90",
501
- lightgrey: "d3d3d3",
502
- lightpink: "ffb6c1",
503
- lightsalmon: "ffa07a",
504
- lightseagreen: "20b2aa",
505
- lightskyblue: "87cefa",
506
- lightslategray: "789",
507
- lightslategrey: "789",
508
- lightsteelblue: "b0c4de",
509
- lightyellow: "ffffe0",
510
- lime: "0f0",
511
- limegreen: "32cd32",
512
- linen: "faf0e6",
513
- magenta: "f0f",
514
- maroon: "800000",
515
- mediumaquamarine: "66cdaa",
516
- mediumblue: "0000cd",
517
- mediumorchid: "ba55d3",
518
- mediumpurple: "9370db",
519
- mediumseagreen: "3cb371",
520
- mediumslateblue: "7b68ee",
521
- mediumspringgreen: "00fa9a",
522
- mediumturquoise: "48d1cc",
523
- mediumvioletred: "c71585",
524
- midnightblue: "191970",
525
- mintcream: "f5fffa",
526
- mistyrose: "ffe4e1",
527
- moccasin: "ffe4b5",
528
- navajowhite: "ffdead",
529
- navy: "000080",
530
- oldlace: "fdf5e6",
531
- olive: "808000",
532
- olivedrab: "6b8e23",
533
- orange: "ffa500",
534
- orangered: "ff4500",
535
- orchid: "da70d6",
536
- palegoldenrod: "eee8aa",
537
- palegreen: "98fb98",
538
- paleturquoise: "afeeee",
539
- palevioletred: "db7093",
540
- papayawhip: "ffefd5",
541
- peachpuff: "ffdab9",
542
- peru: "cd853f",
543
- pink: "ffc0cb",
544
- plum: "dda0dd",
545
- powderblue: "b0e0e6",
546
- purple: "800080",
547
- rebeccapurple: "663399",
548
- red: "f00",
549
- rosybrown: "bc8f8f",
550
- royalblue: "4169e1",
551
- saddlebrown: "8b4513",
552
- salmon: "fa8072",
553
- sandybrown: "f4a460",
554
- seagreen: "2e8b57",
555
- seashell: "fff5ee",
556
- sienna: "a0522d",
557
- silver: "c0c0c0",
558
- skyblue: "87ceeb",
559
- slateblue: "6a5acd",
560
- slategray: "708090",
561
- slategrey: "708090",
562
- snow: "fffafa",
563
- springgreen: "00ff7f",
564
- steelblue: "4682b4",
565
- tan: "d2b48c",
566
- teal: "008080",
567
- thistle: "d8bfd8",
568
- tomato: "ff6347",
569
- turquoise: "40e0d0",
570
- violet: "ee82ee",
571
- wheat: "f5deb3",
572
- white: "fff",
573
- whitesmoke: "f5f5f5",
574
- yellow: "ff0",
575
- yellowgreen: "9acd32"
576
- }, X = s.hexNames = Z(M);
577
- function Z(t) {
578
- var r = {};
579
- for (var e in t)
580
- t.hasOwnProperty(e) && (r[t[e]] = e);
581
- return r;
582
- }
583
- function w(t) {
584
- return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
585
- }
586
- function u(t, r) {
587
- J(t) && (t = "100%");
588
- var e = K(t);
589
- return t = Math.min(r, Math.max(0, parseFloat(t))), e && (t = parseInt(t * r, 10) / 100), Math.abs(t - r) < 1e-6 ? 1 : t % r / parseFloat(r);
590
- }
591
- function y(t) {
592
- return Math.min(1, Math.max(0, t));
593
- }
594
- function l(t) {
595
- return parseInt(t, 16);
596
- }
597
- function J(t) {
598
- return typeof t == "string" && t.indexOf(".") != -1 && parseFloat(t) === 1;
599
- }
600
- function K(t) {
601
- return typeof t == "string" && t.indexOf("%") != -1;
602
- }
603
- function b(t) {
604
- return t.length == 1 ? "0" + t : "" + t;
605
- }
606
- function _(t) {
607
- return t <= 1 && (t = t * 100 + "%"), t;
608
- }
609
- function F(t) {
610
- return Math.round(parseFloat(t) * 255).toString(16);
611
- }
612
- function R(t) {
613
- return l(t) / 255;
614
- }
615
- var c = (function() {
616
- var t = "[-\\+]?\\d+%?", r = "[-\\+]?\\d*\\.\\d+%?", e = "(?:" + r + ")|(?:" + t + ")", a = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", i = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
617
- return {
618
- CSS_UNIT: new RegExp(e),
619
- rgb: new RegExp("rgb" + a),
620
- rgba: new RegExp("rgba" + i),
621
- hsl: new RegExp("hsl" + a),
622
- hsla: new RegExp("hsla" + i),
623
- hsv: new RegExp("hsv" + a),
624
- hsva: new RegExp("hsva" + i),
625
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
626
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
627
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
628
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
629
- };
630
- })();
631
- function p(t) {
632
- return !!c.CSS_UNIT.exec(t);
633
- }
634
- function Q(t) {
635
- t = t.replace(T, "").replace(C, "").toLowerCase();
636
- var r = !1;
637
- if (M[t])
638
- t = M[t], r = !0;
639
- else if (t == "transparent")
640
- return {
641
- r: 0,
642
- g: 0,
643
- b: 0,
644
- a: 0,
645
- format: "name"
646
- };
647
- var e;
648
- return (e = c.rgb.exec(t)) ? {
649
- r: e[1],
650
- g: e[2],
651
- b: e[3]
652
- } : (e = c.rgba.exec(t)) ? {
653
- r: e[1],
654
- g: e[2],
655
- b: e[3],
656
- a: e[4]
657
- } : (e = c.hsl.exec(t)) ? {
658
- h: e[1],
659
- s: e[2],
660
- l: e[3]
661
- } : (e = c.hsla.exec(t)) ? {
662
- h: e[1],
663
- s: e[2],
664
- l: e[3],
665
- a: e[4]
666
- } : (e = c.hsv.exec(t)) ? {
667
- h: e[1],
668
- s: e[2],
669
- v: e[3]
670
- } : (e = c.hsva.exec(t)) ? {
671
- h: e[1],
672
- s: e[2],
673
- v: e[3],
674
- a: e[4]
675
- } : (e = c.hex8.exec(t)) ? {
676
- r: l(e[1]),
677
- g: l(e[2]),
678
- b: l(e[3]),
679
- a: R(e[4]),
680
- format: r ? "name" : "hex8"
681
- } : (e = c.hex6.exec(t)) ? {
682
- r: l(e[1]),
683
- g: l(e[2]),
684
- b: l(e[3]),
685
- format: r ? "name" : "hex"
686
- } : (e = c.hex4.exec(t)) ? {
687
- r: l(e[1] + "" + e[1]),
688
- g: l(e[2] + "" + e[2]),
689
- b: l(e[3] + "" + e[3]),
690
- a: R(e[4] + "" + e[4]),
691
- format: r ? "name" : "hex8"
692
- } : (e = c.hex3.exec(t)) ? {
693
- r: l(e[1] + "" + e[1]),
694
- g: l(e[2] + "" + e[2]),
695
- b: l(e[3] + "" + e[3]),
696
- format: r ? "name" : "hex"
697
- } : !1;
698
- }
699
- function Y(t) {
700
- var r, e;
701
- return t = t || {
702
- level: "AA",
703
- size: "small"
704
- }, r = (t.level || "AA").toUpperCase(), e = (t.size || "small").toLowerCase(), r !== "AA" && r !== "AAA" && (r = "AA"), e !== "small" && e !== "large" && (e = "small"), {
705
- level: r,
706
- size: e
707
- };
708
- }
709
- export {
710
- s as t
711
- };