@alegendstale/holly-components 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/x11.js +4 -0
- package/dist/components/canvas/canvas-gradient.d.ts.map +1 -1
- package/dist/components/canvas/canvas-gradient.js +6 -6
- package/dist/components/color-palette/color-palette-utils.d.ts.map +1 -1
- package/dist/components/color-palette/color-palette-utils.js +9 -8
- package/dist/components/color-palette/color-palette.js +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/node_modules/colorsea/colors/x11.js +14 -0
- package/dist/utils/basicUtils.d.ts +2 -0
- package/dist/utils/basicUtils.d.ts.map +1 -1
- package/dist/utils/basicUtils.js +24 -15
- package/package.json +2 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
+
function l(e) {
|
|
3
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
o as commonjsGlobal,
|
|
7
|
+
l as getDefaultExportFromCjs
|
|
8
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-gradient.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/canvas-gradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"canvas-gradient.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/canvas-gradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAGrC,qBACa,cAAe,SAAQ,UAAU;IAE7C,MAAM,EAAE,MAAM,EAAE,CAAM;IAGtB,MAAM,EAAE,MAAM,CAAK;IAGnB,KAAK,EAAE,MAAM,CAAK;IAGlB,SAAS,EAAE,SAAS,CAAoB;IAExC,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAM3D;;OAEG;IACI,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;CAyB3F;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,iBAAiB,EAAE,cAAc,CAAC;KAClC;CACD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Direction as l } from "../color-palette/color-palette-utils.js";
|
|
2
|
-
import d from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { property as c, customElement as d } from "lit/decorators.js";
|
|
3
|
+
import { CanvasBase as f } from "./canvas-base.js";
|
|
4
|
+
import { isColorValid as u } from "../../utils/basicUtils.js";
|
|
5
5
|
var m = Object.defineProperty, v = Object.getOwnPropertyDescriptor, p = (r, e, o, i) => {
|
|
6
6
|
for (var t = i > 1 ? void 0 : i ? v(e, o) : e, s = r.length - 1, a; s >= 0; s--)
|
|
7
7
|
(a = r[s]) && (t = (i ? a(e, o, t) : a(t)) || t);
|
|
8
8
|
return i && t && m(e, o, t), t;
|
|
9
9
|
};
|
|
10
|
-
let n = class extends
|
|
10
|
+
let n = class extends f {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments), this.colors = [], this.height = 0, this.width = 0, this.direction = l.Column;
|
|
13
13
|
}
|
|
@@ -22,7 +22,7 @@ let n = class extends u {
|
|
|
22
22
|
this.canvas.height = e, this.canvas.width = o;
|
|
23
23
|
let t = i === l.Column ? this.context.createLinearGradient(0, 0, o, 0) : this.context.createLinearGradient(0, 0, 0, e), s = [];
|
|
24
24
|
for (const [a, h] of r.entries())
|
|
25
|
-
|
|
25
|
+
u(h) && (t.addColorStop(a / (r.length - 1), h), s.push(h));
|
|
26
26
|
if (s.length <= 1) throw new Error("There are not enough valid color stops to create the gradient.");
|
|
27
27
|
this.context.fillStyle = t || "#000", this.context.fillRect(0, 0, o, e), this.canvas.classList.add("gradient"), this.canvas.style.setProperty("--palette-column-flex-basis", (e / r.length / 2).toString() + "px");
|
|
28
28
|
}
|
|
@@ -40,7 +40,7 @@ p([
|
|
|
40
40
|
c({ type: String })
|
|
41
41
|
], n.prototype, "direction", 2);
|
|
42
42
|
n = p([
|
|
43
|
-
|
|
43
|
+
d("canvas-gradient")
|
|
44
44
|
], n);
|
|
45
45
|
export {
|
|
46
46
|
n as CanvasGradient
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-palette-utils.d.ts","sourceRoot":"","sources":["../../../src/components/color-palette/color-palette-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color-palette-utils.d.ts","sourceRoot":"","sources":["../../../src/components/color-palette/color-palette-utils.ts"],"names":[],"mappings":"AAEA,oBAAY,SAAS;IACpB,GAAG,QAAQ;IACX,MAAM,WAAW;CACjB;AAED,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,KAAK,iBAAiB;CACvB;AAED,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,eAAe,EAAE,oBAc7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,oBAAY,MAAM;IACjB,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,gBAAgB,qBAAqB;IACrC,2BAA2B,8BAA8B;IACzD,gBAAgB,qBAAqB;CACrC;AAED,eAAO,MAAM,QAAQ,QAAyJ,CAAA;AAE9K,qBAAa,YAAa,SAAQ,KAAK;IACtC,MAAM,EAAE,MAAM,CAAC;gBAEH,MAAM,EAAE,MAAM,EAAE,OAAO,SAAK;CAIxC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,MAAM,CAQrE;AAED;;;;EAIE;AACF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,MAAM,CA8BjF;AAED;;EAEE;AACF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB;;;EAaxF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { parseUrl as i } from "../../utils/basicUtils.js";
|
|
2
|
-
import n from "validate-color";
|
|
1
|
+
import { parseUrl as i, isColorValid as n } from "../../utils/basicUtils.js";
|
|
3
2
|
var s = /* @__PURE__ */ ((r) => (r.Row = "row", r.Column = "column", r))(s || {}), u = /* @__PURE__ */ ((r) => (r.Both = "Both", r.Alias = "Prefer Alias", r))(u || {}), f = /* @__PURE__ */ ((r) => (r.Raw = "Raw", r.Value = "Value", r))(f || {});
|
|
4
|
-
const
|
|
3
|
+
const c = {
|
|
5
4
|
noticeDuration: 1e4,
|
|
6
5
|
errorPulse: !0,
|
|
7
6
|
aliasMode: "Both",
|
|
@@ -23,12 +22,14 @@ class h extends Error {
|
|
|
23
22
|
super(t), this.status = l;
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function v(r, l) {
|
|
27
26
|
let t = r.flatMap((e) => e.includes("(") ? e.split(";").flatMap((a) => a.trim()).filter((a) => a !== "") : e.split(",").flatMap((a) => a.trim())).flatMap((e) => e.trim().replace(";", ""));
|
|
28
27
|
const o = t.join("");
|
|
29
28
|
if (o.match(d)) return i(o);
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
if (!l) {
|
|
30
|
+
for (let e of t)
|
|
31
|
+
if (!n(e)) return "Invalid Colors";
|
|
32
|
+
}
|
|
32
33
|
return t;
|
|
33
34
|
}
|
|
34
35
|
export {
|
|
@@ -37,7 +38,7 @@ export {
|
|
|
37
38
|
s as Direction,
|
|
38
39
|
h as PaletteError,
|
|
39
40
|
p as Status,
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
c as defaultSettings,
|
|
42
|
+
v as parseColors,
|
|
42
43
|
d as urlRegex
|
|
43
44
|
};
|
|
@@ -65,7 +65,7 @@ let s = class extends b {
|
|
|
65
65
|
* Sets the current status and parses colors
|
|
66
66
|
*/
|
|
67
67
|
setStatusAndColors() {
|
|
68
|
-
const t = () => !isNaN(this.height) && !isNaN(this.width) && Object.values(P).includes(this.direction) && this.gradient != null && this.preventHover != null && this.override != null && (this.aliases instanceof Array || typeof this.aliases > "u"), e = D(this.colors);
|
|
68
|
+
const t = () => !isNaN(this.height) && !isNaN(this.width) && Object.values(P).includes(this.direction) && this.gradient != null && this.preventHover != null && this.override != null && (this.aliases instanceof Array || typeof this.aliases > "u"), e = D(this.colors, this.override);
|
|
69
69
|
t() || (this.status = n.INVALID_SETTINGS), (typeof e == "string" || typeof e == "object" && e.length === 0) && (this.status = this.status === n.INVALID_SETTINGS ? n.INVALID_COLORS_AND_SETTINGS : n.INVALID_COLORS), typeof e == "object" && (this.colors = e), this.colors.length <= 1 && this.gradient && (this.status = n.INVALID_GRADIENT);
|
|
70
70
|
}
|
|
71
71
|
render() {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { ToolTip, BottomSheet, CarouselScroller, ColorPalette, Canvas, AbsoluteContainer };
|
|
1
|
+
export * as ToolTip from './components/tool-tip';
|
|
2
|
+
export * as BottomSheet from './components/bottom-sheet';
|
|
3
|
+
export * as CarouselScroller from './components/carousel-scroller';
|
|
4
|
+
export * as ColorPalette from './components/color-palette';
|
|
5
|
+
export * as Canvas from './components/canvas';
|
|
6
|
+
export * as AbsoluteContainer from './components/absolute-container';
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,gBAAgB,MAAM,gCAAgC,CAAA;AAClE,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,iBAAiB,MAAM,iCAAiC,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,gBAAgB,MAAM,gCAAgC,CAAA;AAClE,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAA;AAC1D,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,iBAAiB,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { commonjsGlobal as d, getDefaultExportFromCjs as r } from "../../../_virtual/_commonjsHelpers.js";
|
|
2
|
+
import { __module as e } from "../../../_virtual/x11.js";
|
|
3
|
+
(function(f, o) {
|
|
4
|
+
(function(i, a) {
|
|
5
|
+
f.exports = a();
|
|
6
|
+
})(d, function() {
|
|
7
|
+
return { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflower: "#6495ed", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", gold: "#ffd700", goldenrod: "#daa520", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", laserlemon: "#ffff54", lavender: "#e6e6fa", lavenderblush: "#fff0f5", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrod: "#fafad2", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", maroon2: "#7f0000", maroon3: "#b03060", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", purple2: "#7f007f", purple3: "#a020f0", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" };
|
|
8
|
+
});
|
|
9
|
+
})(e);
|
|
10
|
+
var l = e.exports;
|
|
11
|
+
const t = /* @__PURE__ */ r(l);
|
|
12
|
+
export {
|
|
13
|
+
t as default
|
|
14
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CommonColorTuple, CommonColoraTuple } from "colorsea";
|
|
1
2
|
import { PaletteSettings, ColorPaletteSettings, CopyFormat } from "../components/color-palette/color-palette-utils";
|
|
2
3
|
/**
|
|
3
4
|
* Get settings without their default values
|
|
@@ -44,4 +45,5 @@ export declare function copyToClipboard(text: string, copyFormat?: CopyFormat):
|
|
|
44
45
|
* Calculate font size based on number of colors
|
|
45
46
|
*/
|
|
46
47
|
export declare function getAdjustedFontSize(colorsCount: number): number;
|
|
48
|
+
export declare function isColorValid(color: string | CommonColorTuple | CommonColoraTuple): boolean;
|
|
47
49
|
//# sourceMappingURL=basicUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicUtils.d.ts","sourceRoot":"","sources":["../../src/utils/basicUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"basicUtils.d.ts","sourceRoot":"","sources":["../../src/utils/basicUtils.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAmB,MAAM,iDAAiD,CAAC;AAErI;;GAEG;AACH,wBAAgB,mBAAmB,CAAE,QAAQ,EAAE,eAAe,wCAsB7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAE,QAAQ,EAAE,eAAe,GAAG,oBAAoB,WAUnF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAE,QAAQ,EAAE,eAAe,sBAGrE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,OAW9D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,YAQnC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,oBAAoB,GAAG,eAAe,CAU7F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAA,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;CAAE,GAAG,MAAM,GAAG,MAAM,CAGnH;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGxD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAMxC;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,iBAU1E;AAED;;EAEE;AACF,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,UAItD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,OAAO,CAS1F"}
|
package/dist/utils/basicUtils.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import r from "colorsea";
|
|
2
|
+
import i from "../node_modules/colorsea/colors/x11.js";
|
|
3
|
+
import { CopyFormat as n } from "../components/color-palette/color-palette-utils.js";
|
|
4
|
+
function f(t) {
|
|
5
|
+
var o;
|
|
6
|
+
return t.includes("-") ? t.substring(t.lastIndexOf("/") + 1).split("-").map((e) => "#" + e) : ((o = t.substring(t.lastIndexOf("/") + 1).match(/.{1,6}/g)) == null ? void 0 : o.map((e) => "#" + e)) || [];
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
function l(t) {
|
|
9
|
+
const o = r(t);
|
|
10
|
+
return o.rgb()[0] * 0.299 + o.rgb()[1] * 0.587 + o.rgb()[2] * 0.114 > 186 ? "#000000" : "#ffffff";
|
|
10
11
|
}
|
|
11
|
-
async function
|
|
12
|
+
async function u(t, o) {
|
|
12
13
|
let e = t;
|
|
13
|
-
|
|
14
|
+
o === n.Value && !t.includes("`") && (e.includes("#") ? e = e.split("#")[1] : e.includes("(") && (e = e.split("(")[1].split(")")[0])), await navigator.clipboard.writeText(e);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function p(t) {
|
|
16
17
|
return Math.max(10, 16 - t);
|
|
17
18
|
}
|
|
19
|
+
function d(t) {
|
|
20
|
+
try {
|
|
21
|
+
return r.useNames(i), r(t, void 0, { thowParseError: !0 }), !0;
|
|
22
|
+
} catch {
|
|
23
|
+
return !1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
18
26
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
u as copyToClipboard,
|
|
28
|
+
p as getAdjustedFontSize,
|
|
29
|
+
l as getForegroundColor,
|
|
30
|
+
d as isColorValid,
|
|
31
|
+
f as parseUrl
|
|
23
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"name": "@alegendstale/holly-components",
|
|
5
5
|
"description": "Reusable UI components created using lit",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"colorsea": "^1.2.2",
|
|
41
41
|
"lucide": "^0.471.0",
|
|
42
|
-
"quantize": "^1.0.2"
|
|
43
|
-
"validate-color": "^2.2.4"
|
|
42
|
+
"quantize": "^1.0.2"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@chromatic-com/storybook": "^1.7.0",
|