@quidgest/ui 0.20.1 → 0.21.0

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 (129) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +10 -0
  3. package/dist/json/api.json +36 -1
  4. package/dist/ui.css +52 -248
  5. package/dist/ui.esm.js +782 -677
  6. package/dist/ui.js +718 -613
  7. package/dist/ui.min.css +1 -1
  8. package/dist/ui.min.js +718 -613
  9. package/dist/ui.scss +74 -34
  10. package/esm/components/QAccordion/QAccordionItem.vue.js +1 -1
  11. package/esm/components/QBadge/QBadge.d.ts.map +1 -1
  12. package/esm/components/QBadge/QBadge.vue.js +20 -24
  13. package/esm/components/QButton/QButton.d.ts.map +1 -1
  14. package/esm/components/QButton/QButton.vue.js +32 -29
  15. package/esm/components/QCheckbox/QCheckbox.vue.js +1 -1
  16. package/esm/components/QDialog/QDialog.d.ts +4 -2
  17. package/esm/components/QDialog/QDialog.d.ts.map +1 -1
  18. package/esm/components/QDialog/QDialog.vue.js +84 -74
  19. package/esm/components/QDialog/QDialogProvider.d.ts.map +1 -1
  20. package/esm/components/QDialog/QDialogProvider.vue.js +21 -12
  21. package/esm/components/QDialog/index.d.ts +72 -3
  22. package/esm/components/QDialog/index.d.ts.map +1 -1
  23. package/esm/components/QDialog/types.d.ts +10 -1
  24. package/esm/components/QDialog/types.d.ts.map +1 -1
  25. package/esm/components/QDismissibleLayer/QDismissibleLayer.d.ts.map +1 -1
  26. package/esm/components/QDismissibleLayer/QDismissibleLayer.vue.js +9 -8
  27. package/esm/components/QDivider/QDivider.d.ts.map +1 -1
  28. package/esm/components/QDivider/QDivider.vue.js +3 -3
  29. package/esm/components/QFileUpload/QFileUpload.vue.js +1 -1
  30. package/esm/components/QGauge/QGauge.vue.js +1 -1
  31. package/esm/components/QList/QListItem.d.ts.map +1 -1
  32. package/esm/components/QList/QListItem.vue.js +5 -2
  33. package/esm/components/QList/QListItemGroup.vue.js +1 -1
  34. package/esm/components/QObfuscation/QObfuscation.vue.js +1 -1
  35. package/esm/components/QPhoneField/QPhoneField.d.ts.map +1 -1
  36. package/esm/components/QPhoneField/QPhoneField.vue.js +1 -1
  37. package/esm/components/QPropertyList/QPropertyListGroup.vue.js +1 -1
  38. package/esm/components/QPropertyList/QPropertyListRow.vue.js +1 -1
  39. package/esm/components/QPropertyList/index.d.ts.map +1 -1
  40. package/esm/components/QRadioGroup/QRadioButton.vue.js +1 -1
  41. package/esm/components/QRadioGroup/QRadioGroup.vue.js +2 -2
  42. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  43. package/esm/components/QSelect/QSelect.vue.js +1 -1
  44. package/esm/components/QSidebar/QSidebar.d.ts.map +1 -1
  45. package/esm/components/QSidebar/QSidebar.vue.js +19 -10
  46. package/esm/components/QSidebar/QSidebarItem.d.ts.map +1 -1
  47. package/esm/components/QSidebar/QSidebarItem.vue.js +51 -49
  48. package/esm/components/QSidebar/context.d.ts +7 -0
  49. package/esm/components/QSidebar/context.d.ts.map +1 -1
  50. package/esm/components/QSwitch/QSwitch.vue.js +1 -1
  51. package/esm/components/QTabs/QTab.d.ts.map +1 -1
  52. package/esm/components/QTabs/QTab.vue.js +52 -50
  53. package/esm/components/QTabs/QTabs.d.ts.map +1 -1
  54. package/esm/components/QTabs/QTabs.vue.js +37 -12
  55. package/esm/components/QTabs/context.d.ts +7 -0
  56. package/esm/components/QTabs/context.d.ts.map +1 -1
  57. package/esm/components/QTextArea/QTextArea.vue.js +1 -1
  58. package/esm/components/QTextField/QTextField.d.ts.map +1 -1
  59. package/esm/components/QTextField/QTextField.vue.js +1 -1
  60. package/esm/components/QThemeProvider/QThemeProvider.vue.js +1 -1
  61. package/esm/components/QToast/QToast.d.ts +4 -2
  62. package/esm/components/QToast/QToast.d.ts.map +1 -1
  63. package/esm/components/QToast/QToast.vue.js +80 -67
  64. package/esm/components/QToast/QToaster.d.ts.map +1 -1
  65. package/esm/components/QToast/QToaster.vue.js +21 -16
  66. package/esm/components/QToast/index.d.ts +39 -3
  67. package/esm/components/QToast/index.d.ts.map +1 -1
  68. package/esm/components/QToast/types.d.ts +6 -2
  69. package/esm/components/QToast/types.d.ts.map +1 -1
  70. package/esm/components/QToggleGroup/QToggleGroupItem.vue.js +1 -1
  71. package/esm/components/QTooltip/QTooltip.vue.js +1 -1
  72. package/esm/composables/index.d.ts +2 -2
  73. package/esm/composables/index.d.ts.map +1 -1
  74. package/esm/composables/useColor/index.d.ts +46 -17
  75. package/esm/composables/useColor/index.d.ts.map +1 -1
  76. package/esm/composables/useColor/index.js +57 -29
  77. package/esm/composables/useColor/types.d.ts +4 -1
  78. package/esm/composables/useColor/types.d.ts.map +1 -1
  79. package/esm/composables/useDialog/_internal.d.ts +2 -0
  80. package/esm/composables/useDialog/_internal.d.ts.map +1 -0
  81. package/esm/composables/useDialog/_internal.js +65 -0
  82. package/esm/composables/useDialog/index.d.ts +11 -3
  83. package/esm/composables/useDialog/index.d.ts.map +1 -1
  84. package/esm/composables/useDialog/index.js +38 -22
  85. package/esm/composables/useDialog/types.d.ts +25 -11
  86. package/esm/composables/useDialog/types.d.ts.map +1 -1
  87. package/esm/composables/useDismissibleLayerStack/index.d.ts +17 -2
  88. package/esm/composables/useDismissibleLayerStack/index.d.ts.map +1 -1
  89. package/esm/composables/useDismissibleLayerStack/index.js +28 -11
  90. package/esm/composables/useGroup/index.d.ts.map +1 -1
  91. package/esm/composables/useGroup/index.js +12 -1
  92. package/esm/composables/useId/index.d.ts +18 -0
  93. package/esm/composables/useId/index.d.ts.map +1 -0
  94. package/esm/composables/useId/index.js +10 -0
  95. package/esm/composables/useToast/_internal.d.ts +2 -0
  96. package/esm/composables/useToast/_internal.d.ts.map +1 -0
  97. package/esm/composables/useToast/_internal.js +142 -0
  98. package/esm/composables/useToast/index.d.ts +8 -25
  99. package/esm/composables/useToast/index.d.ts.map +1 -1
  100. package/esm/composables/useToast/index.js +29 -26
  101. package/esm/composables/useToast/types.d.ts +31 -17
  102. package/esm/composables/useToast/types.d.ts.map +1 -1
  103. package/esm/framework.d.ts.map +1 -1
  104. package/esm/framework.js +16 -12
  105. package/esm/templates/theme.js +39 -39
  106. package/esm/utils/color/contrast.d.ts +11 -4
  107. package/esm/utils/color/contrast.d.ts.map +1 -1
  108. package/esm/utils/color/contrast.js +16 -3
  109. package/esm/utils/color/index.d.ts +1 -0
  110. package/esm/utils/color/index.d.ts.map +1 -1
  111. package/esm/utils/color/merge.d.ts +9 -0
  112. package/esm/utils/color/merge.d.ts.map +1 -1
  113. package/esm/utils/color/merge.js +21 -22
  114. package/esm/utils/color/parse.d.ts +21 -5
  115. package/esm/utils/color/parse.d.ts.map +1 -1
  116. package/esm/utils/color/parse.js +88 -20
  117. package/esm/utils/color/theme-colors.d.ts +35 -0
  118. package/esm/utils/color/theme-colors.d.ts.map +1 -0
  119. package/esm/utils/color/theme-colors.js +25 -0
  120. package/esm/utils/index.js +50 -42
  121. package/package.json +3 -5
  122. package/esm/composables/uid.d.ts +0 -9
  123. package/esm/composables/uid.d.ts.map +0 -1
  124. package/esm/composables/uid.js +0 -8
  125. package/esm/composables/useToast/types.js +0 -4
  126. package/esm/vendors/uuid/dist/native.js +0 -3
  127. package/esm/vendors/uuid/dist/rng.js +0 -11
  128. package/esm/vendors/uuid/dist/stringify.js +0 -8
  129. package/esm/vendors/uuid/dist/v4.js +0 -20
@@ -1,17 +1,16 @@
1
- import { rgbToHex as e, rgbToHsl as t } from "./conversion.js";
2
- import { parseColor as n } from "./parse.js";
3
- import { getComplementaryColor as r, getContrastingColor as i } from "./contrast.js";
4
- import { darken as a, lighten as o } from "./manipulate.js";
5
- //#region src/utils/color/merge.ts
6
- function s(s, c) {
7
- let l = { ...s }, u = (t, r) => {
8
- let i = n(t), s = e(o(i, 85)), c = e(a(i, 25)), l = r.toString().replace(/(Light|Dark)$/, "");
1
+ import { rgbToHex as e } from "./conversion.js";
2
+ import { parseColor as t } from "./parse.js";
3
+ import { getComplementaryColor as n, getContrastingColor as r } from "./contrast.js";
4
+ import { darken as i, lighten as a } from "./manipulate.js";
5
+ function o(o, s) {
6
+ let c = { ...o }, l = (n, r) => {
7
+ let o = t(n), s = e(a(o, 75)), c = e(i(o, 25)), l = r.toString().replace(/(Light|Dark)$/, "");
9
8
  return {
10
- [l]: t,
9
+ [l]: n,
11
10
  [`${l}Light`]: s,
12
11
  [`${l}Dark`]: c
13
12
  };
14
- }, d = (e) => i(t(n(e)).l);
13
+ }, u = (e) => r(t(e));
15
14
  for (let e of [
16
15
  "primary",
17
16
  "secondary",
@@ -23,22 +22,22 @@ function s(s, c) {
23
22
  "neutral"
24
23
  ]) {
25
24
  let t = e, n = `${e}Light`, r = `${e}Dark`, i = `on${e.charAt(0).toUpperCase() + e.slice(1)}`, a = `on${e.charAt(0).toUpperCase() + e.slice(1)}Light`, o = `on${e.charAt(0).toUpperCase() + e.slice(1)}Dark`;
26
- if (c[t]) {
27
- let e = u(c[t], t);
28
- Object.assign(l, e), l[i] = d(c[t]), l[a] = d(e[n]), l[o] = d(e[r]);
25
+ if (s[t]) {
26
+ let e = l(s[t], t);
27
+ Object.assign(c, e), c[i] = u(s[t]), c[a] = u(e[n]), c[o] = u(e[r]);
29
28
  }
30
- c[t] || (c[n] && (l[n] = c[n], c[a] || (l[a] = d(c[n]))), c[r] && (l[r] = c[r], c[o] || (l[o] = d(c[r])))), c[i] && (l[i] = c[i]), c[a] && (l[a] = c[a]), c[o] && (l[o] = c[o]);
29
+ s[t] || (s[n] && (c[n] = s[n], s[a] || (c[a] = u(s[n]))), s[r] && (c[r] = s[r], s[o] || (c[o] = u(s[r])))), s[i] && (c[i] = s[i]), s[a] && (c[a] = s[a]), s[o] && (c[o] = s[o]);
31
30
  }
32
- if (c.primary && !c.highlight) {
33
- let e = r(c.primary), t = u(e, "highlight");
34
- Object.assign(l, t), l.onHighlight = d(e), l.onHighlightLight = d(t.highlightLight), l.onHighlightDark = d(t.highlightDark);
31
+ if (s.primary && !s.highlight) {
32
+ let e = n(s.primary), t = l(e, "highlight");
33
+ Object.assign(c, t), c.onHighlight = u(e), c.onHighlightLight = u(t.highlightLight), c.onHighlightDark = u(t.highlightDark);
35
34
  }
36
- for (let e of ["background", "container"]) if (c[e]) {
37
- l[e] = c[e];
35
+ for (let e of ["background", "container"]) if (s[e]) {
36
+ c[e] = s[e];
38
37
  let t = `on${e.charAt(0).toUpperCase() + e.slice(1)}`;
39
- c[t] || (l[t] = d(c[e]));
38
+ s[t] || (c[t] = u(s[e]));
40
39
  }
41
- return c.onBackground && (l.onBackground = c.onBackground), c.onContainer && (l.onContainer = c.onContainer), l;
40
+ return s.onBackground && (c.onBackground = s.onBackground), s.onContainer && (c.onContainer = s.onContainer), c;
42
41
  }
43
42
  //#endregion
44
- export { s as mergeColorSchemes };
43
+ export { o as mergeColorSchemes };
@@ -2,23 +2,39 @@ import { RGB } from './types';
2
2
  /**
3
3
  * Checks if the given string represents a valid hexadecimal color code.
4
4
  *
5
+ * When `enforceSixChars` is false, accepts `#rgb`, `#rrggbb`, and `#rrggbbaa`
6
+ * (aligned with {@link tryParseColor} / hex parsing). When true, only `#rrggbb`.
7
+ *
5
8
  * @param hexColorCode - The color code to validate.
6
9
  * @param enforceSixChars - Whether to enforce only the 6-character format (default is false).
7
10
  * @returns True if the color code is valid, false otherwise.
8
11
  */
9
12
  export declare function isValidHex(hexColorCode: string, enforceSixChars?: boolean): boolean;
10
13
  /**
11
- * Tries to parse a string in the format 'rgb(r, g, b)' to an RGB object.
14
+ * Tries to parse an `rgb()` or `rgba()` color string to an RGB object.
15
+ *
16
+ * Supports comma-separated and modern space-separated syntax. Alpha is ignored.
12
17
  *
13
- * @param tr The input string to parse, expected in the format 'rgb(r, g, b)'.
14
- * @returns An object containing parsed RGB values if the input string is valid, otherwise undefined.
18
+ * @param str - The input string to parse.
19
+ * @returns Parsed RGB values when valid, otherwise undefined.
15
20
  */
16
21
  export declare function tryParseRgb(str: string): RGB | undefined;
17
22
  /**
18
- * Parses a color from a hex string.
23
+ * Attempts to parse a color string into an RGB object without throwing.
24
+ *
25
+ * Supports hex (`#rgb`, `#rrggbb`, `#rrggbbaa`), `rgb`/`rgba`, and `hsl`/`hsla`.
26
+ * Alpha channels are ignored.
27
+ *
28
+ * @param color - A CSS color string.
29
+ * @returns The parsed RGB object, or undefined when parsing fails.
30
+ */
31
+ export declare function tryParseColor(color: string): RGB | undefined;
32
+ /**
33
+ * Parses a supported CSS color string.
19
34
  *
20
- * @param color A hex string representing the color, e.g., "#aabbcc".
35
+ * @param color - A CSS color string, e.g. `#aabbcc` or `rgb(170, 187, 204)`.
21
36
  * @returns A `RGB` object representing the parsed color.
37
+ * @throws {Error} When the color format is not supported.
22
38
  */
23
39
  export declare function parseColor(color: string): RGB;
24
40
  //# sourceMappingURL=parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/utils/color/parse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAElC;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,GAAE,OAAe,GAAG,OAAO,CAQ1F;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CASxD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAkB7C"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/utils/color/parse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AASlC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,GAAE,OAAe,GAAG,OAAO,CAQ1F;AAuMD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAExD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAS5D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAQ7C"}
@@ -1,26 +1,94 @@
1
+ import { hslToRgb as e } from "./conversion.js";
1
2
  //#region src/utils/color/parse.ts
2
- function e(e, t = !1) {
3
- return t ? /^#[a-fA-F0-9]{6}$/.test(e) : /^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e);
4
- }
5
- function t(e) {
6
- let t = e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
7
- if (t) return {
8
- r: parseInt(t[1], 10),
9
- g: parseInt(t[2], 10),
10
- b: parseInt(t[3], 10)
11
- };
3
+ var t = /^#([a-fA-F0-9]{3})$/, n = /^#([a-fA-F0-9]{6})$/, r = /^#([a-fA-F0-9]{8})$/;
4
+ function i(e, i = !1) {
5
+ return i ? n.test(e) : t.test(e) || n.test(e) || r.test(e);
6
+ }
7
+ function a(e) {
8
+ return Math.max(0, Math.min(255, Math.round(e)));
12
9
  }
13
- function n(n) {
14
- if (e(n)) return n.length === 4 && (n = "#" + n[1] + n[1] + n[2] + n[2] + n[3] + n[3]), {
15
- r: parseInt(n.slice(1, 3), 16),
16
- g: parseInt(n.slice(3, 5), 16),
17
- b: parseInt(n.slice(5, 7), 16)
10
+ function o(e) {
11
+ return {
12
+ r: parseInt(e.slice(0, 2), 16),
13
+ g: parseInt(e.slice(2, 4), 16),
14
+ b: parseInt(e.slice(4, 6), 16)
18
15
  };
19
- {
20
- let e = t(n);
21
- if (e) return e;
16
+ }
17
+ function s(e) {
18
+ if (t.test(e)) return o(("#" + e[1] + e[1] + e[2] + e[2] + e[3] + e[3]).slice(1));
19
+ if (n.test(e)) return o(e.slice(1));
20
+ if (r.test(e)) return o(e.slice(1, 7));
21
+ }
22
+ function c(e) {
23
+ let t = e.trim(), n = t.match(/^(-?\d*\.?\d+)%$/);
24
+ if (n) {
25
+ let e = Number.parseFloat(n[1]);
26
+ return Number.isNaN(e) ? void 0 : a(e / 100 * 255);
22
27
  }
23
- throw Error("Invalid color format");
28
+ let r = t.match(/^(-?\d*\.?\d+)$/);
29
+ if (!r) return;
30
+ let i = Number.parseFloat(r[1]);
31
+ if (!Number.isNaN(i)) return a(i);
32
+ }
33
+ function l(e) {
34
+ let t = e.trim().toLowerCase().match(/^(-?\d*\.?\d+)(deg)?$/);
35
+ if (!t) return;
36
+ let n = Number.parseFloat(t[1]);
37
+ if (!Number.isNaN(n)) return (n % 360 + 360) % 360;
38
+ }
39
+ function u(e) {
40
+ let t = e.trim();
41
+ if (!t.endsWith("%")) return;
42
+ let n = Number.parseFloat(t.slice(0, -1));
43
+ if (!Number.isNaN(n)) return Math.max(0, Math.min(100, n));
44
+ }
45
+ function d(e) {
46
+ let t = e.match(/^rgba?\(([^)]+)\)$/i);
47
+ if (!t) return;
48
+ let n = t[1].split("/")[0].split(",").map((e) => e.trim()).filter(Boolean);
49
+ if (n.length < 3) return;
50
+ let r = c(n[0]), i = c(n[1]), a = c(n[2]);
51
+ if (!(r === void 0 || i === void 0 || a === void 0)) return {
52
+ r,
53
+ g: i,
54
+ b: a
55
+ };
56
+ }
57
+ function f(e) {
58
+ let t = e.match(/^rgba?\(([^)]+)\)$/i);
59
+ if (!t) return;
60
+ let [n] = t[1].split("/"), r = n.trim().split(/\s+/).filter(Boolean);
61
+ if (r.length !== 3) return;
62
+ let i = c(r[0]), a = c(r[1]), o = c(r[2]);
63
+ if (!(i === void 0 || a === void 0 || o === void 0)) return {
64
+ r: i,
65
+ g: a,
66
+ b: o
67
+ };
68
+ }
69
+ function p(t) {
70
+ let n = t.match(/^hsla?\(([^)]+)\)$/i);
71
+ if (!n) return;
72
+ let [r] = n[1].split("/"), i = r.includes(",") ? "," : /\s+/, a = r.split(i).map((e) => e.trim()).filter(Boolean);
73
+ if (a.length < 3) return;
74
+ let o = l(a[0]), s = u(a[1]), c = u(a[2]);
75
+ if (!(o === void 0 || s === void 0 || c === void 0)) return e({
76
+ h: o,
77
+ s,
78
+ l: c
79
+ });
80
+ }
81
+ function m(e) {
82
+ return d(e) ?? f(e);
83
+ }
84
+ function h(e) {
85
+ let t = e.trim();
86
+ return s(t) ?? d(t) ?? f(t) ?? p(t);
87
+ }
88
+ function g(e) {
89
+ let t = h(e);
90
+ if (!t) throw Error("Invalid color format");
91
+ return t;
24
92
  }
25
93
  //#endregion
26
- export { e as isValidHex, n as parseColor, t as tryParseRgb };
94
+ export { i as isValidHex, g as parseColor, h as tryParseColor, m as tryParseRgb };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Theme utility color keys used for BEM classification via `isThemeColor` /
3
+ * `isUtilityColor`.
4
+ *
5
+ * Brand/semantic keys match the historical `$theme-colors` SCSS map. Color CSS
6
+ * vars for QButton / QBadge / QToast come from bound `useColor` styles rather
7
+ * than `$theme-colors` BEM loops. `background` remains a utility key so QButton
8
+ * can apply its hand-written `--background` modifier (and skip inline vars for
9
+ * that color). `container` is omitted (scheme resolve only).
10
+ */
11
+ export declare const THEME_COLOR_KEYS: readonly ["primary", "secondary", "highlight", "info", "success", "warning", "danger", "neutral", "background"];
12
+ /**
13
+ * A theme utility color key that resolves against the active color scheme.
14
+ */
15
+ export type ThemeColorKey = (typeof THEME_COLOR_KEYS)[number];
16
+ /**
17
+ * Checks whether a color string is a theme utility color key.
18
+ *
19
+ * Does not trim: BEM consumers build classes from the raw prop
20
+ * (`q-button--${color}`), so padded keys must not be classified as utilities
21
+ * or the modifier class would miss while the prop still looks theme-like.
22
+ *
23
+ * @param color - The color value to check.
24
+ * @returns True when the value matches a key in {@link THEME_COLOR_KEYS}.
25
+ */
26
+ export declare function isThemeColor(color: string): color is ThemeColorKey;
27
+ /**
28
+ * Checks whether a color string is an unsupported CSS keyword or function
29
+ * that cannot be resolved by `useColor`.
30
+ *
31
+ * @param color - The color value to check.
32
+ * @returns True for `transparent`, `currentColor`, `inherit`, and `var(...)`.
33
+ */
34
+ export declare function isUnsupportedColor(color: string): boolean;
35
+ //# sourceMappingURL=theme-colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-colors.d.ts","sourceRoot":"","sources":["../../../src/utils/color/theme-colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,iHAUnB,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAI7D;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIzD"}
@@ -0,0 +1,25 @@
1
+ //#region src/utils/color/theme-colors.ts
2
+ var e = [
3
+ "primary",
4
+ "secondary",
5
+ "highlight",
6
+ "info",
7
+ "success",
8
+ "warning",
9
+ "danger",
10
+ "neutral",
11
+ "background"
12
+ ], t = /* @__PURE__ */ new Set([
13
+ "transparent",
14
+ "currentcolor",
15
+ "inherit"
16
+ ]);
17
+ function n(t) {
18
+ return e.includes(t);
19
+ }
20
+ function r(e) {
21
+ let n = e.trim().toLowerCase();
22
+ return t.has(n) || n.startsWith("var(");
23
+ }
24
+ //#endregion
25
+ export { e as THEME_COLOR_KEYS, n as isThemeColor, r as isUnsupportedColor };
@@ -1,54 +1,62 @@
1
1
  import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
2
2
  import { hslToRgb as t, hueToRgb as n, rgbToHex as r, rgbToHsl as i, rgbToVariableString as a } from "./color/conversion.js";
3
- import { isValidHex as o, parseColor as s, tryParseRgb as c } from "./color/parse.js";
4
- import { getComplementaryColor as l, getContrastingColor as u } from "./color/contrast.js";
5
- import { darken as d, lighten as f } from "./color/manipulate.js";
6
- import { mergeColorSchemes as p } from "./color/merge.js";
7
- import { addDays as m, addMonths as h, advancePastFormatLiteral as g, clampDayByMonthYear as _, clampNumericSegments as v, completePartialDateInput as y, convertDatePatternToMask as b, formatDate as x, formatUsesSeconds as S, formatUsesTime as C, getDaysInMonth as w, getEndOfDay as T, getFirstDayOfMonth as E, getFirstDayOfWeek as D, getLastDayOfMonth as O, getStartOfDay as k, inputIncludesTimePortion as A, isBetween as j, isLeapYear as M, isSameDay as N, isTimeOnlyFormat as P, normalizeNumericToken as F, padNumber as I, parseDate as L, parseDateWithCompletion as R, parseIsoDate as z, uses12HourFormat as B } from "./date.js";
8
- import { applyMask as V } from "./mask.js";
3
+ import { isValidHex as o, parseColor as s, tryParseColor as c, tryParseRgb as l } from "./color/parse.js";
4
+ import { getComplementaryColor as u, getContrastingColor as d, getRelativeLuminance as f } from "./color/contrast.js";
5
+ import { darken as p, lighten as m } from "./color/manipulate.js";
6
+ import { mergeColorSchemes as h } from "./color/merge.js";
7
+ import { THEME_COLOR_KEYS as g, isThemeColor as _, isUnsupportedColor as v } from "./color/theme-colors.js";
8
+ import { addDays as y, addMonths as b, advancePastFormatLiteral as x, clampDayByMonthYear as S, clampNumericSegments as C, completePartialDateInput as w, convertDatePatternToMask as T, formatDate as E, formatUsesSeconds as D, formatUsesTime as O, getDaysInMonth as k, getEndOfDay as A, getFirstDayOfMonth as j, getFirstDayOfWeek as M, getLastDayOfMonth as N, getStartOfDay as P, inputIncludesTimePortion as F, isBetween as I, isLeapYear as L, isSameDay as R, isTimeOnlyFormat as z, normalizeNumericToken as B, padNumber as V, parseDate as H, parseDateWithCompletion as U, parseIsoDate as W, uses12HourFormat as G } from "./date.js";
9
+ import { applyMask as K } from "./mask.js";
9
10
  //#region src/utils/index.ts
10
- var H = /* @__PURE__ */ e({
11
- addDays: () => m,
12
- addMonths: () => h,
13
- advancePastFormatLiteral: () => g,
14
- applyMask: () => V,
15
- clampDayByMonthYear: () => _,
16
- clampNumericSegments: () => v,
17
- completePartialDateInput: () => y,
18
- convertDatePatternToMask: () => b,
19
- darken: () => d,
20
- formatDate: () => x,
21
- formatUsesSeconds: () => S,
22
- formatUsesTime: () => C,
23
- getComplementaryColor: () => l,
24
- getContrastingColor: () => u,
25
- getDaysInMonth: () => w,
26
- getEndOfDay: () => T,
27
- getFirstDayOfMonth: () => E,
28
- getFirstDayOfWeek: () => D,
29
- getLastDayOfMonth: () => O,
30
- getStartOfDay: () => k,
11
+ var q = /* @__PURE__ */ e({
12
+ COLOR_SCHEME_DARKEN_AMOUNT: () => 25,
13
+ COLOR_SCHEME_LIGHTEN_AMOUNT: () => 75,
14
+ THEME_COLOR_KEYS: () => g,
15
+ addDays: () => y,
16
+ addMonths: () => b,
17
+ advancePastFormatLiteral: () => x,
18
+ applyMask: () => K,
19
+ clampDayByMonthYear: () => S,
20
+ clampNumericSegments: () => C,
21
+ completePartialDateInput: () => w,
22
+ convertDatePatternToMask: () => T,
23
+ darken: () => p,
24
+ formatDate: () => E,
25
+ formatUsesSeconds: () => D,
26
+ formatUsesTime: () => O,
27
+ getComplementaryColor: () => u,
28
+ getContrastingColor: () => d,
29
+ getDaysInMonth: () => k,
30
+ getEndOfDay: () => A,
31
+ getFirstDayOfMonth: () => j,
32
+ getFirstDayOfWeek: () => M,
33
+ getLastDayOfMonth: () => N,
34
+ getRelativeLuminance: () => f,
35
+ getStartOfDay: () => P,
31
36
  hslToRgb: () => t,
32
37
  hueToRgb: () => n,
33
- inputIncludesTimePortion: () => A,
34
- isBetween: () => j,
35
- isLeapYear: () => M,
36
- isSameDay: () => N,
37
- isTimeOnlyFormat: () => P,
38
+ inputIncludesTimePortion: () => F,
39
+ isBetween: () => I,
40
+ isLeapYear: () => L,
41
+ isSameDay: () => R,
42
+ isThemeColor: () => _,
43
+ isTimeOnlyFormat: () => z,
44
+ isUnsupportedColor: () => v,
38
45
  isValidHex: () => o,
39
- lighten: () => f,
40
- mergeColorSchemes: () => p,
41
- normalizeNumericToken: () => F,
42
- padNumber: () => I,
46
+ lighten: () => m,
47
+ mergeColorSchemes: () => h,
48
+ normalizeNumericToken: () => B,
49
+ padNumber: () => V,
43
50
  parseColor: () => s,
44
- parseDate: () => L,
45
- parseDateWithCompletion: () => R,
46
- parseIsoDate: () => z,
51
+ parseDate: () => H,
52
+ parseDateWithCompletion: () => U,
53
+ parseIsoDate: () => W,
47
54
  rgbToHex: () => r,
48
55
  rgbToHsl: () => i,
49
56
  rgbToVariableString: () => a,
50
- tryParseRgb: () => c,
51
- uses12HourFormat: () => B
57
+ tryParseColor: () => c,
58
+ tryParseRgb: () => l,
59
+ uses12HourFormat: () => G
52
60
  });
53
61
  //#endregion
54
- export { m as addDays, h as addMonths, g as advancePastFormatLiteral, V as applyMask, _ as clampDayByMonthYear, v as clampNumericSegments, y as completePartialDateInput, b as convertDatePatternToMask, d as darken, x as formatDate, S as formatUsesSeconds, C as formatUsesTime, l as getComplementaryColor, u as getContrastingColor, w as getDaysInMonth, T as getEndOfDay, E as getFirstDayOfMonth, D as getFirstDayOfWeek, O as getLastDayOfMonth, k as getStartOfDay, t as hslToRgb, n as hueToRgb, A as inputIncludesTimePortion, j as isBetween, M as isLeapYear, N as isSameDay, P as isTimeOnlyFormat, o as isValidHex, f as lighten, p as mergeColorSchemes, F as normalizeNumericToken, I as padNumber, s as parseColor, L as parseDate, R as parseDateWithCompletion, z as parseIsoDate, r as rgbToHex, i as rgbToHsl, a as rgbToVariableString, c as tryParseRgb, B as uses12HourFormat, H as utils_exports };
62
+ export { g as THEME_COLOR_KEYS, y as addDays, b as addMonths, x as advancePastFormatLiteral, K as applyMask, S as clampDayByMonthYear, C as clampNumericSegments, w as completePartialDateInput, T as convertDatePatternToMask, p as darken, E as formatDate, D as formatUsesSeconds, O as formatUsesTime, u as getComplementaryColor, d as getContrastingColor, k as getDaysInMonth, A as getEndOfDay, j as getFirstDayOfMonth, M as getFirstDayOfWeek, N as getLastDayOfMonth, f as getRelativeLuminance, P as getStartOfDay, t as hslToRgb, n as hueToRgb, F as inputIncludesTimePortion, I as isBetween, L as isLeapYear, R as isSameDay, _ as isThemeColor, z as isTimeOnlyFormat, v as isUnsupportedColor, o as isValidHex, m as lighten, h as mergeColorSchemes, B as normalizeNumericToken, V as padNumber, s as parseColor, H as parseDate, U as parseDateWithCompletion, W as parseIsoDate, r as rgbToHex, i as rgbToHsl, a as rgbToVariableString, c as tryParseColor, l as tryParseRgb, G as uses12HourFormat, q as utils_exports };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.20.1",
4
+ "version": "0.21.0",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",
@@ -41,8 +41,7 @@
41
41
  "./components": "./esm/components/index.js",
42
42
  "./components/*": "./esm/components/*/index.js",
43
43
  "./utils": "./esm/utils/index.js",
44
- "./utils/*": "./esm/utils/*/index.js",
45
- "./*": "./*"
44
+ "./utils/*": "./esm/utils/*/index.js"
46
45
  },
47
46
  "devDependencies": {
48
47
  "@fortawesome/fontawesome-free": "^6.7.2",
@@ -68,8 +67,7 @@
68
67
  },
69
68
  "dependencies": {
70
69
  "country-flag-icons": "1.6.19",
71
- "libphonenumber-js": "1.13.7",
72
- "uuid": "^13.0.0"
70
+ "libphonenumber-js": "1.13.7"
73
71
  },
74
72
  "scripts": {
75
73
  "clean:build": "rimraf dist esm coverage",
@@ -1,9 +0,0 @@
1
- import { MaybeRefOrGetter, Ref } from 'vue';
2
- /**
3
- * Custom hook to generate unique IDs.
4
- *
5
- * @param [componentId] - Optional component-specific ID.
6
- * @returns A unique ID as a string or a ref containing a string
7
- */
8
- export declare function useId(componentId?: MaybeRefOrGetter<string | undefined>): Ref<string>;
9
- //# sourceMappingURL=uid.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/composables/uid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAMhD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAGrF"}
@@ -1,8 +0,0 @@
1
- import e from "../vendors/uuid/dist/v4.js";
2
- import { ref as t, toValue as n } from "vue";
3
- //#region src/composables/uid.ts
4
- function r(r) {
5
- return t(n(r) ?? `uid-${e()}`);
6
- }
7
- //#endregion
8
- export { r as useId };
@@ -1,4 +0,0 @@
1
- //#region src/composables/useToast/types.ts
2
- var e = Symbol.for("q-toast");
3
- //#endregion
4
- export { e as ToastSymbol };
@@ -1,3 +0,0 @@
1
- var e = { randomUUID: typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
2
- //#endregion
3
- export { e as default };
@@ -1,11 +0,0 @@
1
- //#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/rng.js
2
- var e, t = /* @__PURE__ */ new Uint8Array(16);
3
- function n() {
4
- if (!e) {
5
- if (typeof crypto > "u" || !crypto.getRandomValues) throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
6
- e = crypto.getRandomValues.bind(crypto);
7
- }
8
- return e(t);
9
- }
10
- //#endregion
11
- export { n as default };
@@ -1,8 +0,0 @@
1
- //#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/stringify.js
2
- var e = [];
3
- for (let t = 0; t < 256; ++t) e.push((t + 256).toString(16).slice(1));
4
- function t(t, n = 0) {
5
- return (e[t[n + 0]] + e[t[n + 1]] + e[t[n + 2]] + e[t[n + 3]] + "-" + e[t[n + 4]] + e[t[n + 5]] + "-" + e[t[n + 6]] + e[t[n + 7]] + "-" + e[t[n + 8]] + e[t[n + 9]] + "-" + e[t[n + 10]] + e[t[n + 11]] + e[t[n + 12]] + e[t[n + 13]] + e[t[n + 14]] + e[t[n + 15]]).toLowerCase();
6
- }
7
- //#endregion
8
- export { t as unsafeStringify };
@@ -1,20 +0,0 @@
1
- import e from "./native.js";
2
- import t from "./rng.js";
3
- import { unsafeStringify as n } from "./stringify.js";
4
- //#region ../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js
5
- function r(e, r, i) {
6
- e ||= {};
7
- let a = e.random ?? e.rng?.() ?? t();
8
- if (a.length < 16) throw Error("Random bytes length must be >= 16");
9
- if (a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, r) {
10
- if (i ||= 0, i < 0 || i + 16 > r.length) throw RangeError(`UUID byte range ${i}:${i + 15} is out of buffer bounds`);
11
- for (let e = 0; e < 16; ++e) r[i + e] = a[e];
12
- return r;
13
- }
14
- return n(a);
15
- }
16
- function i(t, n, i) {
17
- return e.randomUUID && !n && !t ? e.randomUUID() : r(t, n, i);
18
- }
19
- //#endregion
20
- export { i as default };