@itguy614/clean-ui 1.0.1 → 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 (63) hide show
  1. package/dist/clean-ui.css +1 -1
  2. package/dist/components/CuiBanner.vue.d.ts.map +1 -1
  3. package/dist/components/CuiBanner.vue.js +9 -8
  4. package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
  5. package/dist/components/CuiIcon.vue.d.ts +14 -2
  6. package/dist/components/CuiIcon.vue.d.ts.map +1 -1
  7. package/dist/components/CuiIcon.vue.js +1 -1
  8. package/dist/components/CuiIcon.vue2.js +51 -30
  9. package/dist/components/CuiRating.vue.d.ts +1 -1
  10. package/dist/components/CuiRating.vue.d.ts.map +1 -1
  11. package/dist/components/CuiTab.vue.d.ts.map +1 -1
  12. package/dist/components/CuiTab.vue.js +1 -1
  13. package/dist/components/CuiTab.vue2.js +41 -36
  14. package/dist/components/CuiTable.vue.d.ts +3 -3
  15. package/dist/components/CuiTable.vue.d.ts.map +1 -1
  16. package/dist/components/CuiTable.vue.js +58 -53
  17. package/dist/components/CuiTableCell.vue.d.ts +1 -0
  18. package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
  19. package/dist/components/CuiTableCell.vue.js +4 -4
  20. package/dist/components/CuiTabs.vue.d.ts +2 -2
  21. package/dist/components/CuiTabs.vue.d.ts.map +1 -1
  22. package/dist/components/CuiTabs.vue.js +2 -2
  23. package/dist/components/CuiTabs.vue2.js +127 -89
  24. package/dist/components/CuiTreeNode.vue.d.ts +1 -0
  25. package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
  26. package/dist/components/CuiTreeNode.vue.js +28 -27
  27. package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
  28. package/dist/components/CuiTreeView.vue.js +22 -22
  29. package/dist/components/tabs-context.d.ts +7 -1
  30. package/dist/components/tabs-context.d.ts.map +1 -1
  31. package/dist/composables/useDataGridViews.d.ts.map +1 -1
  32. package/dist/composables/useDataGridViews.js +37 -35
  33. package/dist/composables/useDensity.d.ts.map +1 -1
  34. package/dist/composables/useDensity.js +19 -19
  35. package/dist/composables/useOverlay.d.ts.map +1 -1
  36. package/dist/composables/useOverlay.js +44 -36
  37. package/dist/composables/useTheme.d.ts.map +1 -1
  38. package/dist/composables/useTheme.js +17 -25
  39. package/dist/icons/builtin.d.ts +67 -0
  40. package/dist/icons/builtin.d.ts.map +1 -0
  41. package/dist/icons/builtin.js +67 -0
  42. package/dist/icons/lazy.d.ts +8 -0
  43. package/dist/icons/lazy.d.ts.map +1 -0
  44. package/dist/icons/lazy.js +21 -0
  45. package/dist/icons/registry.d.ts +29 -0
  46. package/dist/icons/registry.d.ts.map +1 -0
  47. package/dist/icons/registry.js +30 -0
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +124 -117
  51. package/dist/messages.d.ts +4 -0
  52. package/dist/messages.d.ts.map +1 -1
  53. package/dist/messages.js +10 -9
  54. package/dist/utils/devWarn.d.ts +1 -0
  55. package/dist/utils/devWarn.d.ts.map +1 -1
  56. package/dist/utils/devWarn.js +1 -0
  57. package/dist/utils/scrollLock.d.ts +22 -0
  58. package/dist/utils/scrollLock.d.ts.map +1 -0
  59. package/dist/utils/scrollLock.js +42 -0
  60. package/dist/utils/storage.d.ts +18 -0
  61. package/dist/utils/storage.d.ts.map +1 -0
  62. package/dist/utils/storage.js +27 -0
  63. package/package.json +7 -2
@@ -1,67 +1,69 @@
1
- import { ref as u } from "vue";
2
- function g(s = "cui-datagrid") {
3
- function r(a) {
4
- return `${s}-views-${a}`;
1
+ import { ref as f } from "vue";
2
+ import { safeSetItem as l, safeGetItem as g } from "../utils/storage.js";
3
+ function V(s = "cui-datagrid") {
4
+ function r(e) {
5
+ return `${s}-views-${e}`;
5
6
  }
6
7
  return {
7
- async load(a) {
8
+ async load(e) {
9
+ const a = g(r(e));
10
+ if (!a) return [];
8
11
  try {
9
- const e = localStorage.getItem(r(a));
10
- return e ? JSON.parse(e) : [];
12
+ return JSON.parse(a);
11
13
  } catch {
12
14
  return [];
13
15
  }
14
16
  },
15
- async save(a, e) {
16
- const t = await this.load(a), i = t.findIndex((l) => l.id === e.id);
17
- i >= 0 ? t[i] = e : t.push(e), localStorage.setItem(r(a), JSON.stringify(t));
17
+ async save(e, a) {
18
+ const t = await this.load(e), i = t.findIndex((u) => u.id === a.id);
19
+ i >= 0 ? t[i] = a : t.push(a), l(r(e), JSON.stringify(t));
18
20
  },
19
- async remove(a, e) {
20
- const i = (await this.load(a)).filter((l) => l.id !== e);
21
- localStorage.setItem(r(a), JSON.stringify(i));
21
+ async remove(e, a) {
22
+ const i = (await this.load(e)).filter((u) => u.id !== a);
23
+ l(r(e), JSON.stringify(i));
22
24
  }
23
25
  };
24
26
  }
25
- function I(s) {
26
- const r = s.adapter ?? g(), a = u([]), e = u(null), t = u(!1);
27
+ function h(s) {
28
+ const r = s.adapter ?? V(), e = f([]), a = f(null), t = f(!1);
27
29
  async function i() {
28
30
  t.value = !0;
29
31
  try {
30
- a.value = await r.load(s.gridId);
32
+ e.value = await r.load(s.gridId);
31
33
  } finally {
32
34
  t.value = !1;
33
35
  }
34
36
  }
35
- async function l(n, d) {
36
- const c = a.value.find((y) => y.name === n), o = {
37
+ async function u(n, o) {
38
+ const c = e.value.find((m) => m.name === n), d = {
37
39
  id: (c == null ? void 0 : c.id) ?? crypto.randomUUID(),
38
40
  name: n,
39
- config: d
41
+ config: o
40
42
  };
41
- await r.save(s.gridId, o), await i(), e.value = o.id;
43
+ await r.save(s.gridId, d), await i(), a.value = d.id;
42
44
  }
43
- async function f(n, d) {
44
- const c = a.value.find((o) => o.id === n);
45
- c && (await r.save(s.gridId, { ...c, config: d }), await i());
45
+ async function w(n, o) {
46
+ const c = e.value.find((d) => d.id === n);
47
+ c && (await r.save(s.gridId, { ...c, config: o }), await i());
46
48
  }
47
- async function w(n) {
48
- await r.remove(s.gridId, n), e.value === n && (e.value = null), await i();
49
+ async function v(n) {
50
+ await r.remove(s.gridId, n), a.value === n && (a.value = null), await i();
49
51
  }
50
- function v(n) {
51
- e.value = n;
52
+ function y(n) {
53
+ a.value = n;
52
54
  }
53
55
  return {
54
- views: a,
55
- activeViewId: e,
56
+ views: e,
57
+ activeViewId: a,
56
58
  loading: t,
57
59
  fetchViews: i,
58
- saveView: l,
59
- updateView: f,
60
- removeView: w,
61
- selectView: v
60
+ saveView: u,
61
+ updateView: w,
62
+ removeView: v,
63
+ selectView: y
62
64
  };
63
65
  }
64
66
  export {
65
- g as localStorageViewAdapter,
66
- I as useDataGridViews
67
+ V as localStorageViewAdapter,
68
+ h as useDataGridViews
67
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useDensity.d.ts","sourceRoot":"","sources":["../../src/composables/useDensity.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,EAI1C,CAAC;AAmCF;;;;GAIG;AACH,wBAAgB,UAAU;IAUtB,oCAAoC;;IAEpC,gCAAgC;;IAEhC,6BAA6B;qBAbP,SAAS;IAe/B,iCAAiC;sBAXZ,SAAS;EAcjC"}
1
+ {"version":3,"file":"useDensity.d.ts","sourceRoot":"","sources":["../../src/composables/useDensity.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,EAI1C,CAAC;AAkCF;;;;GAIG;AACH,wBAAgB,UAAU;IAUtB,oCAAoC;;IAEpC,gCAAgC;;IAEhC,6BAA6B;qBAbP,SAAS;IAe/B,iCAAiC;sBAXZ,SAAS;EAcjC"}
@@ -1,26 +1,26 @@
1
- import { ref as l, watch as u } from "vue";
2
- const c = [
1
+ import { ref as r, watch as f } from "vue";
2
+ import { safeGetItem as l, safeSetItem as u } from "../utils/storage.js";
3
+ const i = [
3
4
  { id: "compact", label: "Compact", description: "Tighter spacing — more on screen" },
4
5
  { id: "default", label: "Default", description: "Balanced default spacing" },
5
6
  { id: "comfortable", label: "Comfortable", description: "Roomier spacing" }
6
- ], a = "cui-density", s = "cui-density-", i = "default", d = new Set(c.map((t) => t.id)), n = l(f());
7
- function f() {
8
- if (typeof window > "u") return i;
9
- const t = localStorage.getItem(a);
10
- return t && d.has(t) ? t : i;
7
+ ], c = "cui-density", o = "cui-density-", d = "default", m = new Set(i.map((t) => t.id)), n = r(p());
8
+ function p() {
9
+ const t = l(c);
10
+ return t && m.has(t) ? t : d;
11
11
  }
12
- function r(t) {
12
+ function a(t) {
13
13
  if (typeof document > "u") return;
14
14
  const e = document.documentElement;
15
- for (const o of Array.from(e.classList))
16
- o.startsWith(s) && e.classList.remove(o);
17
- t !== "default" && e.classList.add(`${s}${t}`), localStorage.setItem(a, t);
15
+ for (const s of Array.from(e.classList))
16
+ s.startsWith(o) && e.classList.remove(s);
17
+ t !== "default" && e.classList.add(`${o}${t}`), u(c, t);
18
18
  }
19
- r(n.value);
20
- u(n, r);
21
- function p() {
22
- function t(o) {
23
- n.value = o;
19
+ a(n.value);
20
+ f(n, a);
21
+ function S() {
22
+ function t(s) {
23
+ n.value = s;
24
24
  }
25
25
  function e() {
26
26
  return n.value;
@@ -29,7 +29,7 @@ function p() {
29
29
  /** Current density id (reactive) */
30
30
  density: n,
31
31
  /** Available density presets */
32
- presets: c,
32
+ presets: i,
33
33
  /** Set the active density */
34
34
  setDensity: t,
35
35
  /** Get the current density id */
@@ -37,6 +37,6 @@ function p() {
37
37
  };
38
38
  }
39
39
  export {
40
- c as DENSITY_PRESETS,
41
- p as useDensity
40
+ i as DENSITY_PRESETS,
41
+ S as useDensity
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/composables/useOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAK9F,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,qDAAqD;IACrD,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;IACpH,qDAAqD;IACrD,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB;;;;;;;mBAuE7B,aAAa;EAyDpC"}
1
+ {"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/composables/useOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAM9F,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,qDAAqD;IACrD,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;IACpH,qDAAqD;IACrD,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB;;;;;;;mBAqF7B,aAAa;EAuDpC"}
@@ -1,59 +1,67 @@
1
- import { ref as d, watch as x, onMounted as A, onUnmounted as E, nextTick as q } from "vue";
1
+ import { ref as d, watch as q, onMounted as E, onUnmounted as B, nextTick as C } from "vue";
2
+ import { lockBodyScroll as D, unlockBodyScroll as L } from "../utils/scrollLock.js";
2
3
  const t = /* @__PURE__ */ new Set();
3
- function C(y) {
4
+ function K(k) {
4
5
  const {
5
- open: v,
6
- dialogRef: l,
7
- persistent: p,
8
- allowNested: b,
9
- animationDuration: g = 200,
10
- onUpdateOpen: w,
11
- onClose: O
12
- } = y, i = Symbol("overlay"), s = d(!1), a = d(!1), m = d(null);
13
- function u() {
14
- !b() && t.size > 0 && t.clear(), t.add(i), m.value = document.activeElement, s.value = !0, document.body.style.overflow = "hidden", q(() => {
6
+ open: m,
7
+ dialogRef: a,
8
+ persistent: b,
9
+ allowNested: g,
10
+ animationDuration: S = 200,
11
+ onUpdateOpen: O,
12
+ onClose: h
13
+ } = k, c = Symbol("overlay"), i = d(!1), u = d(!1), p = d(null);
14
+ let o = !1;
15
+ function w() {
16
+ o || (o = !0, D());
17
+ }
18
+ function y() {
19
+ o && (o = !1, L());
20
+ }
21
+ function s() {
22
+ !g() && t.size > 0 && t.clear(), t.add(c), p.value = document.activeElement, i.value = !0, w(), C(() => {
15
23
  requestAnimationFrame(() => {
16
24
  var e;
17
- a.value = !0, (e = l.value) == null || e.focus();
25
+ u.value = !0, (e = a.value) == null || e.focus();
18
26
  });
19
27
  });
20
28
  }
21
- function c() {
22
- a.value = !1, t.delete(i), setTimeout(() => {
29
+ function r() {
30
+ u.value = !1, t.delete(c), setTimeout(() => {
23
31
  var e;
24
- s.value = !1, w(!1), O(), t.size === 0 && (document.body.style.overflow = ""), (e = m.value) == null || e.focus();
25
- }, g);
32
+ i.value = !1, O(!1), h(), y(), (e = p.value) == null || e.focus();
33
+ }, S);
26
34
  }
27
35
  function f() {
28
- p() || c();
36
+ b() || r();
29
37
  }
30
- function h() {
38
+ function x() {
31
39
  f();
32
40
  }
33
- function k(e) {
34
- if (e.key === "Escape" && (e.stopPropagation(), f()), e.key === "Tab" && l.value) {
35
- const r = l.value.querySelectorAll(
41
+ function A(e) {
42
+ if (e.key === "Escape" && (e.stopPropagation(), f()), e.key === "Tab" && a.value) {
43
+ const v = a.value.querySelectorAll(
36
44
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
37
- ), o = r[0], n = r[r.length - 1];
38
- e.shiftKey ? document.activeElement === o && (e.preventDefault(), n == null || n.focus()) : document.activeElement === n && (e.preventDefault(), o == null || o.focus());
45
+ ), n = v[0], l = v[v.length - 1];
46
+ e.shiftKey ? document.activeElement === n && (e.preventDefault(), l == null || l.focus()) : document.activeElement === l && (e.preventDefault(), n == null || n.focus());
39
47
  }
40
48
  }
41
- return x(v, (e) => {
42
- e ? u() : c();
43
- }), A(() => {
44
- v() && u();
49
+ return q(m, (e) => {
50
+ e ? s() : r();
45
51
  }), E(() => {
46
- t.delete(i), t.size === 0 && (document.body.style.overflow = "");
52
+ m() && s();
53
+ }), B(() => {
54
+ t.delete(c), y();
47
55
  }), {
48
- isVisible: s,
49
- isAnimating: a,
50
- openOverlay: u,
51
- closeOverlay: c,
56
+ isVisible: i,
57
+ isAnimating: u,
58
+ openOverlay: s,
59
+ closeOverlay: r,
52
60
  requestClose: f,
53
- onBackdropClick: h,
54
- onKeydown: k
61
+ onBackdropClick: x,
62
+ onKeydown: A
55
63
  };
56
64
  }
57
65
  export {
58
- C as useOverlay
66
+ K as useOverlay
59
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/composables/useTheme.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,EAAE,WAAW,EAStC,CAAC;AAgDF;;;GAGG;AACH,wBAAgB,QAAQ;IAUpB,kCAAkC;;IAElC,sCAAsC;;IAEtC,iCAAiC;wBAbR,MAAM;IAe/B,+BAA+B;oBAXZ,MAAM;EAc5B"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/composables/useTheme.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,EAAE,WAAW,EAStC,CAAC;AAmCF;;;GAGG;AACH,wBAAgB,QAAQ;IAUpB,kCAAkC;;IAElC,sCAAsC;;IAEtC,iCAAiC;wBAbR,MAAM;IAe/B,+BAA+B;oBAXZ,MAAM;EAc5B"}
@@ -1,5 +1,6 @@
1
- import { ref as c, watch as s } from "vue";
2
- const u = [
1
+ import { ref as n, watch as s } from "vue";
2
+ import { safeGetItem as c, safeSetItem as u } from "../utils/storage.js";
3
+ const d = [
3
4
  { id: "mono", label: "Mono", description: "Monochrome — default theme" },
4
5
  { id: "default", label: "Navy", description: "Navy blue" },
5
6
  { id: "forest", label: "Forest", description: "Natural green" },
@@ -8,34 +9,25 @@ const u = [
8
9
  { id: "teal", label: "Teal", description: "Cool teal" },
9
10
  { id: "violet", label: "Violet", description: "Rich purple" },
10
11
  { id: "ruby", label: "Ruby", description: "Bold red" }
11
- ], n = "cui-theme", i = "cui-theme-", a = typeof window < "u";
12
- function d() {
13
- if (!a) return "mono";
14
- try {
15
- return localStorage.getItem(n) ?? "mono";
16
- } catch {
17
- return "mono";
18
- }
12
+ ], a = "cui-theme", r = "cui-theme-";
13
+ function m() {
14
+ return c(a) ?? "mono";
19
15
  }
20
- const o = c(d());
16
+ const o = n(m());
21
17
  function l(e) {
22
18
  if (typeof document > "u") return;
23
19
  const t = document.documentElement;
24
- for (const r of Array.from(t.classList))
25
- r.startsWith(i) && t.classList.remove(r);
26
- e !== "default" && t.classList.add(`${i}${e}`);
20
+ for (const i of Array.from(t.classList))
21
+ i.startsWith(r) && t.classList.remove(i);
22
+ e !== "default" && t.classList.add(`${r}${e}`);
27
23
  }
28
24
  l(o.value);
29
25
  s(o, (e) => {
30
- if (l(e), a)
31
- try {
32
- localStorage.setItem(n, e);
33
- } catch {
34
- }
26
+ l(e), u(a, e);
35
27
  });
36
- function f() {
37
- function e(r) {
38
- o.value = r;
28
+ function b() {
29
+ function e(i) {
30
+ o.value = i;
39
31
  }
40
32
  function t() {
41
33
  return o.value;
@@ -44,7 +36,7 @@ function f() {
44
36
  /** Current theme ID (reactive) */
45
37
  theme: o,
46
38
  /** List of available theme presets */
47
- presets: u,
39
+ presets: d,
48
40
  /** Set the active theme by ID */
49
41
  setTheme: e,
50
42
  /** Get the current theme ID */
@@ -52,6 +44,6 @@ function f() {
52
44
  };
53
45
  }
54
46
  export {
55
- u as THEME_PRESETS,
56
- f as useTheme
47
+ d as THEME_PRESETS,
48
+ b as useTheme
57
49
  };
@@ -0,0 +1,67 @@
1
+ import type { Component } from "vue";
2
+ /** kebab-case icon name → Phosphor component. */
3
+ export declare const BUILTIN_ICONS: Record<string, Component>;
4
+ /** Rendered when a name can't be resolved at all. */
5
+ export declare const FALLBACK_ICON: {
6
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
7
+ weight: {
8
+ type: import("vue").PropType<"bold" | "fill" | "thin" | "light" | "regular" | "duotone">;
9
+ };
10
+ size: {
11
+ type: (StringConstructor | NumberConstructor)[];
12
+ };
13
+ color: {
14
+ type: StringConstructor;
15
+ };
16
+ mirrored: {
17
+ type: BooleanConstructor;
18
+ };
19
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
20
+ mirrored: boolean;
21
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
22
+ P: {};
23
+ B: {};
24
+ D: {};
25
+ C: {};
26
+ M: {};
27
+ Defaults: {};
28
+ }, Readonly<import("vue").ExtractPropTypes<{
29
+ weight: {
30
+ type: import("vue").PropType<"bold" | "fill" | "thin" | "light" | "regular" | "duotone">;
31
+ };
32
+ size: {
33
+ type: (StringConstructor | NumberConstructor)[];
34
+ };
35
+ color: {
36
+ type: StringConstructor;
37
+ };
38
+ mirrored: {
39
+ type: BooleanConstructor;
40
+ };
41
+ }>>, {}, {}, {}, {}, {
42
+ mirrored: boolean;
43
+ }>;
44
+ __isFragment?: never;
45
+ __isTeleport?: never;
46
+ __isSuspense?: never;
47
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
48
+ weight: {
49
+ type: import("vue").PropType<"bold" | "fill" | "thin" | "light" | "regular" | "duotone">;
50
+ };
51
+ size: {
52
+ type: (StringConstructor | NumberConstructor)[];
53
+ };
54
+ color: {
55
+ type: StringConstructor;
56
+ };
57
+ mirrored: {
58
+ type: BooleanConstructor;
59
+ };
60
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
61
+ mirrored: boolean;
62
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
63
+ $slots: {
64
+ default?(_: {}): any;
65
+ };
66
+ });
67
+ //# sourceMappingURL=builtin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../../src/icons/builtin.ts"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAErC,iDAAiD;AACjD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAkEnD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAa,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { PhQuestion as e, PhVideoCamera as h, PhMusicNote as r, PhImage as i, PhFileZip as l, PhFileXls as a, PhFileText as o, PhFilePdf as P, PhFileDoc as t, PhFile as c, PhCloudArrowUp as n, PhStarHalf as s, PhStar as u, PhUser as p, PhTable as C, PhSquaresFour as f, PhSpinnerGap as d, PhColumns as m, PhClock as g, PhCircleNotch as k, PhCircle as w, PhCalendarBlank as y, PhXCircle as F, PhWarningCircle as D, PhWarning as S, PhInfo as b, PhCheckCircle as x, PhBookmarkSimple as I, PhArrowCounterClockwise as N, PhX as U, PhUploadSimple as L, PhTrash as T, PhPushPin as A, PhPlus as B, PhMinus as q, PhMagnifyingGlass as M, PhFunnel as X, PhFloppyDisk as v, PhEyeSlash as E, PhEye as G, PhDotsThree as O, PhDotsSixVertical as R, PhDotsNine as V, PhCopy as W, PhCheck as _, PhCaretDoubleRight as z, PhCaretDoubleLeft as H, PhCaretUpDown as K, PhCaretUp as Q, PhCaretRight as Z, PhCaretLeft as j, PhCaretDown as J } from "@phosphor-icons/vue";
2
+ const $ = {
3
+ // --- Carets / navigation ---
4
+ "caret-down": J,
5
+ "caret-left": j,
6
+ "caret-right": Z,
7
+ "caret-up": Q,
8
+ "caret-up-down": K,
9
+ // CuiDataGrid unsorted column
10
+ "caret-double-left": H,
11
+ "caret-double-right": z,
12
+ // --- Controls / actions ---
13
+ check: _,
14
+ copy: W,
15
+ "dots-nine": V,
16
+ "dots-six-vertical": R,
17
+ "dots-three": O,
18
+ eye: G,
19
+ "eye-slash": E,
20
+ "floppy-disk": v,
21
+ funnel: X,
22
+ "magnifying-glass": M,
23
+ minus: q,
24
+ plus: B,
25
+ "push-pin": A,
26
+ trash: T,
27
+ "upload-simple": L,
28
+ x: U,
29
+ "arrow-counter-clockwise": N,
30
+ "bookmark-simple": I,
31
+ // --- Status (COLOR_ICON_MAP + CuiConfirmDialog) ---
32
+ "check-circle": x,
33
+ info: b,
34
+ warning: S,
35
+ "warning-circle": D,
36
+ "x-circle": F,
37
+ // --- Structure / display ---
38
+ "calendar-blank": y,
39
+ circle: w,
40
+ "circle-notch": k,
41
+ clock: g,
42
+ columns: m,
43
+ "spinner-gap": d,
44
+ "squares-four": f,
45
+ table: C,
46
+ user: p,
47
+ // --- CuiRating defaults ---
48
+ star: u,
49
+ "star-half": s,
50
+ // --- CuiFileUpload's fileIcon() ---
51
+ "cloud-arrow-up": n,
52
+ file: c,
53
+ "file-doc": t,
54
+ "file-pdf": P,
55
+ "file-text": o,
56
+ "file-xls": a,
57
+ "file-zip": l,
58
+ image: i,
59
+ "music-note": r,
60
+ "video-camera": h,
61
+ // --- Fallback for an unknown name ---
62
+ question: e
63
+ }, ee = e;
64
+ export {
65
+ $ as BUILTIN_ICONS,
66
+ ee as FALLBACK_ICON
67
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Enable lazy resolution. Called automatically when this module is imported;
3
+ * exported as well so the intent can be explicit at a call site.
4
+ */
5
+ export declare function enableLazyIcons(): void;
6
+ /** Undo {@link enableLazyIcons} — unregistered names go back to the fallback glyph. */
7
+ export declare function disableLazyIcons(): void;
8
+ //# sourceMappingURL=lazy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/icons/lazy.ts"],"names":[],"mappings":"AAgCA;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAUtC;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
@@ -0,0 +1,21 @@
1
+ import { setIconFallbackResolver as t } from "./registry.js";
2
+ function c(e) {
3
+ return "Ph" + e.split("-").map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join("");
4
+ }
5
+ const n = /* @__PURE__ */ new Map();
6
+ function s() {
7
+ t(async (e) => {
8
+ const a = c(e);
9
+ if (n.has(a)) return n.get(a);
10
+ const o = (await import("@phosphor-icons/vue"))[a];
11
+ return n.set(a, o), o;
12
+ });
13
+ }
14
+ function i() {
15
+ t(null);
16
+ }
17
+ s();
18
+ export {
19
+ i as disableLazyIcons,
20
+ s as enableLazyIcons
21
+ };
@@ -0,0 +1,29 @@
1
+ import { type Component } from "vue";
2
+ /**
3
+ * Register icons by name. Later calls override earlier ones for the same name,
4
+ * and a registered name also overrides the built-in of that name.
5
+ */
6
+ export declare function registerIcons(icons: Record<string, Component>): void;
7
+ /** Look a name up: registered first, then the library's built-in set. */
8
+ export declare function resolveRegisteredIcon(name: string): Component | undefined;
9
+ /** Whether a name resolves without the lazy fallback (i.e. is tree-shakeable). */
10
+ export declare function hasIcon(name: string): boolean;
11
+ /** Names currently resolvable statically — built-in plus registered. */
12
+ export declare function registeredIconNames(): string[];
13
+ /** Test seam: drop consumer registrations, leaving the built-ins. */
14
+ export declare function __clearRegisteredIcons(): void;
15
+ /**
16
+ * Resolver consulted for a name that is neither built-in nor registered.
17
+ *
18
+ * Deliberately a hook rather than a dynamic `import()` inside CuiIcon: a bundler
19
+ * that sees `import("@phosphor-icons/vue")` anywhere must keep all ~1500 icons,
20
+ * which is the very cost #42 is about — measured at 1315 kB gzip versus 124 kB
21
+ * once the import is gone. Keeping it in a separate module that nothing imports
22
+ * by default means the package only enters a bundle if the consumer asks for it,
23
+ * via `@itguy614/clean-ui/icons/lazy`.
24
+ */
25
+ export type IconFallbackResolver = (name: string) => Promise<Component | undefined>;
26
+ /** Install a resolver for unregistered names. See `icons/lazy`. */
27
+ export declare function setIconFallbackResolver(resolver: IconFallbackResolver | null): void;
28
+ export declare function getIconFallbackResolver(): IconFallbackResolver | null;
29
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/icons/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AA0BtD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAEpE;AAED,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEzE;AAED,kFAAkF;AAClF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED,qEAAqE;AACrE,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAIpF,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAEnF;AAED,wBAAgB,uBAAuB,IAAI,oBAAoB,GAAG,IAAI,CAErE"}
@@ -0,0 +1,30 @@
1
+ import { shallowReactive as r } from "vue";
2
+ import { BUILTIN_ICONS as n } from "./builtin.js";
3
+ const t = r({});
4
+ function l(e) {
5
+ Object.assign(t, e);
6
+ }
7
+ function c(e) {
8
+ return t[e] ?? n[e];
9
+ }
10
+ function u(e) {
11
+ return c(e) !== void 0;
12
+ }
13
+ function a() {
14
+ return [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(t)])].sort();
15
+ }
16
+ let o = null;
17
+ function f(e) {
18
+ o = e;
19
+ }
20
+ function I() {
21
+ return o;
22
+ }
23
+ export {
24
+ I as getIconFallbackResolver,
25
+ u as hasIcon,
26
+ l as registerIcons,
27
+ a as registeredIconNames,
28
+ c as resolveRegisteredIcon,
29
+ f as setIconFallbackResolver
30
+ };
package/dist/index.d.ts CHANGED
@@ -224,6 +224,8 @@ export { RadioGroupKey } from "./components/radio-context";
224
224
  export type { RadioGroupContext } from "./components/radio-context";
225
225
  export type { CleanUIOptions, CleanUIPlugin } from "./types";
226
226
  export type { TailwindSpacing, TailwindBreakpoint, ResponsiveValue, GridColumns, GridRows, GridSpan, FlexDirection, FlexWrap, FlexAlign, FlexJustify, } from "./types/grid";
227
+ export { registerIcons, hasIcon, registeredIconNames, setIconFallbackResolver, type IconFallbackResolver, } from "./icons/registry";
228
+ export { BUILTIN_ICONS } from "./icons/builtin";
227
229
  export { useTheme, THEME_PRESETS, type ThemePreset } from "./composables/useTheme";
228
230
  export { useDensity, DENSITY_PRESETS, type DensityId, type DensityPreset } from "./composables/useDensity";
229
231
  export { ssrThemeInitScript } from "./ssr-theme-init";