@itguy614/clean-ui 1.0.0 → 1.1.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 (81) hide show
  1. package/dist/clean-ui.css +1 -1
  2. package/dist/components/CuiAlert.vue.d.ts.map +1 -1
  3. package/dist/components/CuiAlert.vue.js +1 -1
  4. package/dist/components/CuiAlert.vue2.js +41 -38
  5. package/dist/components/CuiBadge.vue.d.ts.map +1 -1
  6. package/dist/components/CuiBadge.vue.js +1 -1
  7. package/dist/components/CuiBadge.vue2.js +15 -12
  8. package/dist/components/CuiBanner.vue.d.ts.map +1 -1
  9. package/dist/components/CuiBanner.vue.js +9 -8
  10. package/dist/components/CuiButton.vue.d.ts.map +1 -1
  11. package/dist/components/CuiButton.vue.js +2 -2
  12. package/dist/components/CuiButton.vue2.js +23 -20
  13. package/dist/components/CuiDataGrid.vue.d.ts +53 -79
  14. package/dist/components/CuiDataGrid.vue.d.ts.map +1 -1
  15. package/dist/components/CuiDataGrid.vue.js +2 -0
  16. package/dist/components/CuiDataGridBulkBar.vue.d.ts.map +1 -1
  17. package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
  18. package/dist/components/CuiIcon.vue.d.ts +14 -2
  19. package/dist/components/CuiIcon.vue.d.ts.map +1 -1
  20. package/dist/components/CuiIcon.vue.js +1 -1
  21. package/dist/components/CuiIcon.vue2.js +51 -30
  22. package/dist/components/CuiInput.vue.d.ts +6 -6
  23. package/dist/components/CuiInput.vue.d.ts.map +1 -1
  24. package/dist/components/CuiInput.vue.js +2 -2
  25. package/dist/components/CuiInput.vue2.js +15 -13
  26. package/dist/components/CuiMaskedInput.vue.d.ts +8 -8
  27. package/dist/components/CuiRating.vue.d.ts +1 -1
  28. package/dist/components/CuiRating.vue.d.ts.map +1 -1
  29. package/dist/components/CuiTab.vue.d.ts.map +1 -1
  30. package/dist/components/CuiTab.vue.js +1 -1
  31. package/dist/components/CuiTab.vue2.js +41 -36
  32. package/dist/components/CuiTable.vue.d.ts +3 -3
  33. package/dist/components/CuiTable.vue.d.ts.map +1 -1
  34. package/dist/components/CuiTable.vue.js +58 -53
  35. package/dist/components/CuiTableCell.vue.d.ts +1 -0
  36. package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
  37. package/dist/components/CuiTableCell.vue.js +4 -4
  38. package/dist/components/CuiTabs.vue.d.ts +2 -2
  39. package/dist/components/CuiTabs.vue.d.ts.map +1 -1
  40. package/dist/components/CuiTabs.vue.js +2 -2
  41. package/dist/components/CuiTabs.vue2.js +127 -89
  42. package/dist/components/CuiTreeNode.vue.d.ts +1 -0
  43. package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
  44. package/dist/components/CuiTreeNode.vue.js +28 -27
  45. package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
  46. package/dist/components/CuiTreeView.vue.js +22 -22
  47. package/dist/components/tabs-context.d.ts +7 -1
  48. package/dist/components/tabs-context.d.ts.map +1 -1
  49. package/dist/composables/useDataGridViews.d.ts.map +1 -1
  50. package/dist/composables/useDataGridViews.js +37 -35
  51. package/dist/composables/useDensity.d.ts.map +1 -1
  52. package/dist/composables/useDensity.js +19 -19
  53. package/dist/composables/useOverlay.d.ts.map +1 -1
  54. package/dist/composables/useOverlay.js +46 -36
  55. package/dist/composables/useTheme.d.ts.map +1 -1
  56. package/dist/composables/useTheme.js +17 -25
  57. package/dist/icons/builtin.d.ts +67 -0
  58. package/dist/icons/builtin.d.ts.map +1 -0
  59. package/dist/icons/builtin.js +67 -0
  60. package/dist/icons/lazy.d.ts +8 -0
  61. package/dist/icons/lazy.d.ts.map +1 -0
  62. package/dist/icons/lazy.js +21 -0
  63. package/dist/icons/registry.d.ts +29 -0
  64. package/dist/icons/registry.d.ts.map +1 -0
  65. package/dist/icons/registry.js +30 -0
  66. package/dist/index.d.ts +2 -0
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +124 -117
  69. package/dist/messages.d.ts +4 -0
  70. package/dist/messages.d.ts.map +1 -1
  71. package/dist/messages.js +10 -9
  72. package/dist/utils/devWarn.d.ts +16 -0
  73. package/dist/utils/devWarn.d.ts.map +1 -0
  74. package/dist/utils/devWarn.js +21 -0
  75. package/dist/utils/scrollLock.d.ts +22 -0
  76. package/dist/utils/scrollLock.d.ts.map +1 -0
  77. package/dist/utils/scrollLock.js +42 -0
  78. package/dist/utils/storage.d.ts +18 -0
  79. package/dist/utils/storage.d.ts.map +1 -0
  80. package/dist/utils/storage.js +27 -0
  81. package/package.json +7 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devWarn.d.ts","sourceRoot":"","sources":["../../src/utils/devWarn.ts"],"names":[],"mappings":"AAWA,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI9C;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAClE,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,IAAI,CAmBN"}
@@ -0,0 +1,21 @@
1
+ import { isColorRole as i } from "./color.js";
2
+ const s = "primary, secondary, success, error, warning, info, surface, surface-light, surface-dark", l = /* @__PURE__ */ new Set();
3
+ function c(o) {
4
+ l.has(o) || (l.add(o), console.warn(o));
5
+ }
6
+ function d(o, e, r) {
7
+ const n = e.value;
8
+ if (n != null && !e.allowed.includes(n)) {
9
+ const a = i(n) ? ` "${n}" is a color role — did you mean color="${n}"?` : "";
10
+ c(
11
+ `[clean-ui] ${o}: variant="${n}" is not valid. Expected one of: ${e.allowed.join(", ")}.${a}`
12
+ );
13
+ }
14
+ r != null && !i(r) && c(
15
+ `[clean-ui] ${o}: color="${r}" is not a valid role. Expected one of: ${s}.${r === "danger" ? ' Use color="error".' : ""}`
16
+ );
17
+ }
18
+ export {
19
+ c as warnOnce,
20
+ d as warnVariantColor
21
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Body scroll lock for overlays.
3
+ *
4
+ * `overflow: hidden` on <body> is enough on desktop and Android, but iOS Safari
5
+ * ignores it for touch scrolling — the page keeps panning behind an open modal.
6
+ * The reliable fix there is pinning the body with `position: fixed` at its
7
+ * current offset and restoring the scroll position on unlock, which we apply
8
+ * only on iOS: it's more invasive (the document is briefly out of flow, and the
9
+ * scroll position round-trips through JS), so platforms that honor
10
+ * `overflow: hidden` shouldn't pay for it.
11
+ *
12
+ * Locks are reference-counted. Stacked overlays each lock and unlock, and the
13
+ * document is only restored — and the scroll offset only captured — at the
14
+ * outermost boundary.
15
+ */
16
+ /** Lock body scrolling. Safe to call repeatedly — the lock is counted. */
17
+ export declare function lockBodyScroll(): void;
18
+ /** Release one lock. The document is restored when the last one is released. */
19
+ export declare function unlockBodyScroll(): void;
20
+ /** Whether a lock is currently held (exposed for tests). */
21
+ export declare function isBodyScrollLocked(): boolean;
22
+ //# sourceMappingURL=scrollLock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollLock.d.ts","sourceRoot":"","sources":["../../src/utils/scrollLock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkCH,0EAA0E;AAC1E,wBAAgB,cAAc,IAAI,IAAI,CAuCrC;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,IAAI,IAAI,CA8BvC;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C"}
@@ -0,0 +1,42 @@
1
+ let n = 0, o = null;
2
+ function r() {
3
+ if (typeof navigator > "u") return !1;
4
+ const t = navigator.userAgent;
5
+ return /iP(hone|ad|od)/.test(t) ? !0 : /Macintosh/.test(t) && (navigator.maxTouchPoints ?? 0) > 1;
6
+ }
7
+ function d() {
8
+ return window.innerWidth - document.documentElement.clientWidth;
9
+ }
10
+ function c() {
11
+ if (typeof document > "u" || (n += 1, n > 1)) return;
12
+ const t = document.body, i = r(), l = window.scrollY;
13
+ o = {
14
+ overflow: t.style.overflow,
15
+ position: t.style.position,
16
+ top: t.style.top,
17
+ left: t.style.left,
18
+ right: t.style.right,
19
+ width: t.style.width,
20
+ paddingRight: t.style.paddingRight,
21
+ scrollY: l,
22
+ pinned: i
23
+ };
24
+ const e = d();
25
+ if (e > 0) {
26
+ const s = parseFloat(getComputedStyle(t).paddingRight) || 0;
27
+ t.style.paddingRight = `${s + e}px`;
28
+ }
29
+ t.style.overflow = "hidden", i && (t.style.position = "fixed", t.style.top = `-${l}px`, t.style.left = "0", t.style.right = "0", t.style.width = "100%");
30
+ }
31
+ function u() {
32
+ if (typeof document > "u" || n === 0 || (n -= 1, n > 0 || !o)) return;
33
+ const t = document.body, { scrollY: i, pinned: l } = o;
34
+ if (t.style.overflow = o.overflow, t.style.position = o.position, t.style.top = o.top, t.style.left = o.left, t.style.right = o.right, t.style.width = o.width, t.style.paddingRight = o.paddingRight, o = null, l) {
35
+ const e = document.documentElement, s = e.style.scrollBehavior;
36
+ e.style.scrollBehavior = "auto", window.scrollTo(0, i), e.style.scrollBehavior = s;
37
+ }
38
+ }
39
+ export {
40
+ c as lockBodyScroll,
41
+ u as unlockBodyScroll
42
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Guarded Web Storage access.
3
+ *
4
+ * `localStorage` being *defined* doesn't mean it's usable: a sandboxed iframe
5
+ * without `allow-same-origin` throws on property access, Safari private mode and
6
+ * cookie-blocking settings can throw on read/write, and Node >= 22 exposes an
7
+ * inert global (no `getItem`) that jsdom-based test runners inherit. A
8
+ * `typeof window !== "undefined"` guard catches none of those.
9
+ *
10
+ * Route every read/write through here so a hostile storage environment
11
+ * degrades to "no persistence" instead of throwing — which matters most at
12
+ * module scope, where one throw takes the whole library barrel down.
13
+ */
14
+ /** Read a key, or `null` if storage is unavailable or the read throws. */
15
+ export declare function safeGetItem(key: string): string | null;
16
+ /** Write a key. Returns whether it stuck — callers may ignore it. */
17
+ export declare function safeSetItem(key: string, value: string): boolean;
18
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMtD;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAU/D"}
@@ -0,0 +1,27 @@
1
+ function n() {
2
+ try {
3
+ return typeof localStorage > "u" || localStorage === null || typeof localStorage.getItem != "function" ? null : localStorage;
4
+ } catch {
5
+ return null;
6
+ }
7
+ }
8
+ function l(e) {
9
+ var t;
10
+ try {
11
+ return ((t = n()) == null ? void 0 : t.getItem(e)) ?? null;
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+ function u(e, t) {
17
+ try {
18
+ const r = n();
19
+ return r ? (r.setItem(e, t), !0) : !1;
20
+ } catch {
21
+ return !1;
22
+ }
23
+ }
24
+ export {
25
+ l as safeGetItem,
26
+ u as safeSetItem
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itguy614/clean-ui",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "description": "A clean, dark-mode-ready Vue 3 component library — 100+ token-driven, themeable, accessible components.",
6
6
  "license": "MIT",
@@ -35,6 +35,10 @@
35
35
  "import": "./dist/index.js"
36
36
  },
37
37
  "./styles": "./dist/clean-ui.css",
38
+ "./icons/lazy": {
39
+ "types": "./dist/icons/lazy.d.ts",
40
+ "import": "./dist/icons/lazy.js"
41
+ },
38
42
  "./*": "./dist/*"
39
43
  },
40
44
  "files": [
@@ -43,7 +47,8 @@
43
47
  "LICENSE"
44
48
  ],
45
49
  "sideEffects": [
46
- "**/*.css"
50
+ "**/*.css",
51
+ "./dist/icons/lazy.js"
47
52
  ],
48
53
  "scripts": {
49
54
  "build": "vite build && vue-tsc --emitDeclarationOnly && node scripts/postbuild.mjs",