vlite3 1.4.8 → 1.4.10

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 (32) hide show
  1. package/components/Cart/CartVariant2.vue.js +1 -1
  2. package/components/Cart/CartVariant4.vue.js +28 -28
  3. package/components/CategoryManager/CategoryManager.vue2.js +3 -3
  4. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  5. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  6. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  7. package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
  8. package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
  9. package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +44 -0
  10. package/components/ScaleGenerator/ScaleGenerator.vue.js +110 -0
  11. package/components/ScaleGenerator/ScaleGenerator.vue2.js +4 -0
  12. package/components/ScaleGenerator/index.d.ts +2 -0
  13. package/components/ScaleGenerator/types.d.ts +63 -0
  14. package/components/Screen/ScreenFilter.vue.js +3 -3
  15. package/components/ThemeProvider/ThemeProvider.vue.d.ts +27 -0
  16. package/components/ThemeProvider/ThemeProvider.vue.js +37 -0
  17. package/components/ThemeProvider/ThemeProvider.vue2.js +4 -0
  18. package/components/ThemeProvider/index.d.ts +3 -0
  19. package/components/ThemeProvider/themeVars.d.ts +23 -0
  20. package/components/ThemeProvider/themeVars.js +376 -0
  21. package/components/ThemeProvider/types.d.ts +46 -0
  22. package/composables/useThemeStyles.d.ts +8 -0
  23. package/composables/useThemeStyles.js +9 -0
  24. package/index.d.ts +3 -0
  25. package/index.js +387 -373
  26. package/package.json +1 -1
  27. package/utils/colorUtils.d.ts +41 -0
  28. package/utils/colorUtils.js +36 -0
  29. package/utils/index.d.ts +1 -0
  30. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
  31. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
  32. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +0 -0
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "1.4.8",
6
+ "version": "1.4.10",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Generic color utilities used by the theme system.
3
+ *
4
+ * These are intentionally pure functions with no Vue / DOM dependencies so they
5
+ * can be reused in both client and server contexts (SSR / Nuxt / Node tooling)
6
+ * and unit-tested without a renderer.
7
+ *
8
+ * Conventions:
9
+ * - All inputs are 3- or 6-digit hex strings, with or without the leading `#`.
10
+ * - Outputs are 7-character hex strings (`#rrggbb`) with the leading `#`.
11
+ */
12
+ /**
13
+ * Convert a hex color to HSL.
14
+ *
15
+ * @example
16
+ * hexToHSL('#ff3b30') // → { h: 3, s: 100, l: 59 }
17
+ * hexToHSL('f00') // → { h: 0, s: 100, l: 50 }
18
+ */
19
+ export declare function hexToHSL(hex: string): {
20
+ h: number;
21
+ s: number;
22
+ l: number;
23
+ };
24
+ /**
25
+ * Mix two hex colors by linearly interpolating their RGB channels.
26
+ *
27
+ * @param color1 Base color (weight = 0 keeps this color).
28
+ * @param color2 Mix target (weight = 1 returns this color).
29
+ * @param weight Mix ratio in `[0, 1]`. Values outside the range are clamped.
30
+ *
31
+ * @example
32
+ * mixColorHex('#000000', '#ffffff', 0.5) // → '#7f7f7f'
33
+ */
34
+ export declare function mixColorHex(color1: string, color2: string, weight: number): string;
35
+ /**
36
+ * Decide whether a hex color is "dark" (luminance < 50%).
37
+ *
38
+ * Useful for picking a contrasting foreground color or for selecting between
39
+ * light and dark theme palettes without inspecting CSS at runtime.
40
+ */
41
+ export declare function isDarkColor(hex: string): boolean;
@@ -0,0 +1,36 @@
1
+ function b(i) {
2
+ let t = i.replace(/^#/, "");
3
+ t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
4
+ const r = parseInt(t.slice(0, 2), 16) / 255, n = parseInt(t.slice(2, 4), 16) / 255, s = parseInt(t.slice(4, 6), 16) / 255, c = Math.max(r, n, s), o = Math.min(r, n, s), p = (c + o) / 2;
5
+ let a = 0, h = 0;
6
+ if (c !== o) {
7
+ const e = c - o;
8
+ switch (h = p > 0.5 ? e / (2 - c - o) : e / (c + o), c) {
9
+ case r:
10
+ a = (n - s) / e + (n < s ? 6 : 0);
11
+ break;
12
+ case n:
13
+ a = (s - r) / e + 2;
14
+ break;
15
+ case s:
16
+ a = (r - n) / e + 4;
17
+ break;
18
+ }
19
+ a /= 6;
20
+ }
21
+ return { h: a * 360, s: h * 100, l: p * 100 };
22
+ }
23
+ function f(i, t, r) {
24
+ const n = i.replace(/^#/, ""), s = t.replace(/^#/, ""), c = parseInt(n.slice(0, 2), 16), o = parseInt(n.slice(2, 4), 16), p = parseInt(n.slice(4, 6), 16), a = parseInt(s.slice(0, 2), 16), h = parseInt(s.slice(2, 4), 16), e = parseInt(s.slice(4, 6), 16), l = Math.min(1, Math.max(0, r)), u = Math.round(c * (1 - l) + a * l), m = Math.round(o * (1 - l) + h * l), I = Math.round(p * (1 - l) + e * l);
25
+ return "#" + (1 << 24 | u << 16 | m << 8 | I).toString(16).slice(1);
26
+ }
27
+ function M(i) {
28
+ if (!i) return !1;
29
+ const { l: t } = b(i);
30
+ return t < 50;
31
+ }
32
+ export {
33
+ b as hexToHSL,
34
+ M as isDarkColor,
35
+ f as mixColorHex
36
+ };
package/utils/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './search.util';
4
4
  export * from './env';
5
5
  export * from './i18n';
6
6
  export * from './configUtils';
7
+ export * from './colorUtils';