@itguy614/clean-ui 1.2.1 → 1.2.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CuiPopover.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiPopover.vue"],"names":[],"mappings":"AAsRA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG9E,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGnF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE,MAAM,WAAW,eAAgB,SAAQ,aAAa,EAAE,gBAAgB;IACtE,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,mCAAmC;IACnC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAsRD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACrF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAgD/C,QAAA,MAAM,eAAe;;;;;;aA5UT,UAAU;;eAlBR,gBAAgB;aAElB,cAAc;eAEZ,MAAM;eAEN,MAAM;aAER,OAAO;cAQN,OAAO;6EAsVlB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CuiPopover.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiPopover.vue"],"names":[],"mappings":"AAsRA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG9E,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGnF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE,MAAM,WAAW,eAAgB,SAAQ,aAAa,EAAE,gBAAgB;IACtE,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,mCAAmC;IACnC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAsRD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACrF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAiD/C,QAAA,MAAM,eAAe;;;;;;aA7UT,UAAU;;eAlBR,gBAAgB;aAElB,cAAc;eAEZ,MAAM;eAEN,MAAM;aAER,OAAO;cAQN,OAAO;6EAuVlB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,9 +1,9 @@
1
- import { defineComponent as K, useSlots as U, ref as S, watch as M, computed as l, onUnmounted as q, withDirectives as G, openBlock as a, createElementBlock as s, createElementVNode as y, renderSlot as f, createBlock as J, Teleport as Q, normalizeStyle as p, unref as g, toDisplayString as X, withModifiers as Y, createVNode as Z, createCommentVNode as u, vShow as ee } from "vue";
2
- import { usePopover as te } from "../composables/usePopover.js";
3
- import { useClickOutside as oe } from "../composables/useClickOutside.js";
1
+ import { defineComponent as U, useSlots as q, ref as S, watch as M, computed as l, onUnmounted as G, withDirectives as J, openBlock as a, createElementBlock as s, createElementVNode as p, renderSlot as f, createBlock as Q, Teleport as X, normalizeStyle as g, unref as v, toDisplayString as Y, withModifiers as Z, createVNode as ee, createCommentVNode as u, vShow as te } from "vue";
2
+ import { usePopover as oe } from "../composables/usePopover.js";
3
+ import { useClickOutside as ie } from "../composables/useClickOutside.js";
4
4
  import re from "./CuiIcon.vue.js";
5
- import { useMessages as ie } from "../composables/useMessages.js";
6
- const le = ["aria-labelledby"], ae = {
5
+ import { useMessages as le } from "../composables/useMessages.js";
6
+ const ae = ["aria-labelledby"], ne = {
7
7
  key: 0,
8
8
  style: {
9
9
  display: "flex",
@@ -12,12 +12,12 @@ const le = ["aria-labelledby"], ae = {
12
12
  gap: "calc(0.5rem * var(--cui-density-scale, 1))",
13
13
  padding: "calc(0.75rem * var(--cui-density-scale, 1)) calc(0.875rem * var(--cui-density-scale, 1)) calc(0.25rem * var(--cui-density-scale, 1))"
14
14
  }
15
- }, ne = ["id"], se = ["aria-label"], ce = {
15
+ }, se = ["id"], ce = ["aria-label"], ue = {
16
16
  key: 1,
17
17
  style: {
18
18
  padding: "0 calc(0.875rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))"
19
19
  }
20
- }, pe = /* @__PURE__ */ K({
20
+ }, ge = /* @__PURE__ */ U({
21
21
  __name: "CuiPopover",
22
22
  props: {
23
23
  title: {},
@@ -42,68 +42,68 @@ const le = ["aria-labelledby"], ae = {
42
42
  md: "var(--cui-button-radius, 0.375rem)",
43
43
  lg: "0.5rem",
44
44
  full: "9999px"
45
- }, d = R, h = U(), o = S(!1);
46
- let n = null, r = null;
45
+ }, d = R, h = q(), o = S(!1);
46
+ let n = null, i = null;
47
47
  M(
48
48
  () => e.visible,
49
49
  (t) => {
50
50
  t !== void 0 && (o.value = t);
51
51
  }
52
52
  );
53
- const { referenceRef: C, floatingRef: b, arrowRef: E, floatingStyles: D, arrowStyle: B, currentSide: _ } = te({
53
+ const { referenceRef: C, floatingRef: b, arrowRef: E, floatingStyles: D, arrowStyle: B, currentSide: _, isPositioned: P } = oe({
54
54
  placement: l(() => e.placement),
55
55
  offsetDistance: l(() => e.offset ?? 10),
56
56
  arrow: !e.noArrow
57
57
  }), w = S(null);
58
- oe(
58
+ ie(
59
59
  () => [w.value, b.value],
60
60
  () => {
61
- o.value && e.trigger === "click" && i();
61
+ o.value && e.trigger === "click" && r();
62
62
  }
63
63
  ), M(o, (t) => {
64
- typeof document > "u" || (t ? document.addEventListener("keydown", m) : document.removeEventListener("keydown", m));
64
+ typeof document > "u" || (t ? document.addEventListener("keydown", y) : document.removeEventListener("keydown", y));
65
65
  });
66
- function v() {
67
- e.disabled || (r && (clearTimeout(r), r = null), e.showDelay > 0 ? n = setTimeout(() => {
66
+ function m() {
67
+ e.disabled || (i && (clearTimeout(i), i = null), e.showDelay > 0 ? n = setTimeout(() => {
68
68
  o.value = !0, d("update:visible", !0);
69
69
  }, e.showDelay) : (o.value = !0, d("update:visible", !0)));
70
70
  }
71
- function i() {
72
- n && (clearTimeout(n), n = null), e.hideDelay > 0 ? r = setTimeout(() => {
71
+ function r() {
72
+ n && (clearTimeout(n), n = null), e.hideDelay > 0 ? i = setTimeout(() => {
73
73
  o.value = !1, d("update:visible", !1);
74
74
  }, e.hideDelay) : (o.value = !1, d("update:visible", !1));
75
75
  }
76
76
  function I() {
77
- o.value ? i() : v();
78
- }
79
- function P() {
80
- (e.trigger === "hover" || e.trigger === "hover-focus") && v();
77
+ o.value ? r() : m();
81
78
  }
82
79
  function z() {
83
- (e.trigger === "hover" || e.trigger === "hover-focus") && i();
80
+ (e.trigger === "hover" || e.trigger === "hover-focus") && m();
84
81
  }
85
82
  function F() {
86
- (e.trigger === "focus" || e.trigger === "hover-focus") && v();
83
+ (e.trigger === "hover" || e.trigger === "hover-focus") && r();
87
84
  }
88
85
  function L() {
89
- (e.trigger === "focus" || e.trigger === "hover-focus") && i();
86
+ (e.trigger === "focus" || e.trigger === "hover-focus") && m();
90
87
  }
91
88
  function V() {
92
- e.trigger === "click" && I();
93
- }
94
- function m(t) {
95
- t.key === "Escape" && o.value && i();
89
+ (e.trigger === "focus" || e.trigger === "hover-focus") && r();
96
90
  }
97
91
  function $() {
98
- (e.trigger === "hover" || e.trigger === "hover-focus") && r && (clearTimeout(r), r = null);
92
+ e.trigger === "click" && I();
93
+ }
94
+ function y(t) {
95
+ t.key === "Escape" && o.value && r();
99
96
  }
100
97
  function A() {
101
- (e.trigger === "hover" || e.trigger === "hover-focus") && i();
98
+ (e.trigger === "hover" || e.trigger === "hover-focus") && i && (clearTimeout(i), i = null);
99
+ }
100
+ function H() {
101
+ (e.trigger === "hover" || e.trigger === "hover-focus") && r();
102
102
  }
103
- q(() => {
104
- n && clearTimeout(n), r && clearTimeout(r), typeof document < "u" && document.removeEventListener("keydown", m);
103
+ G(() => {
104
+ n && clearTimeout(n), i && clearTimeout(i), typeof document < "u" && document.removeEventListener("keydown", y);
105
105
  });
106
- const k = l(() => e.title || h.header), H = l(() => !!h.footer), x = l(() => e.title ? "cui-popover-title" : void 0), N = l(() => {
106
+ const k = l(() => e.title || h.header), N = l(() => !!h.footer), x = l(() => e.title ? "cui-popover-title" : void 0), W = l(() => {
107
107
  const t = {
108
108
  zIndex: "9998",
109
109
  background: "var(--cui-surface-base)",
@@ -117,7 +117,7 @@ const le = ["aria-labelledby"], ae = {
117
117
  overflow: "hidden"
118
118
  };
119
119
  return e.width && (t.width = e.width), t;
120
- }), W = l(() => ({
120
+ }), j = l(() => ({
121
121
  width: "8px",
122
122
  height: "8px",
123
123
  background: "var(--cui-surface-base)",
@@ -125,46 +125,46 @@ const le = ["aria-labelledby"], ae = {
125
125
  transform: "rotate(45deg)",
126
126
  position: "absolute",
127
127
  ...B.value
128
- })), j = {
128
+ })), O = {
129
129
  top: "polygon(0% 0%, 100% 0%, 100% 100%)",
130
130
  bottom: "polygon(0% 0%, 0% 100%, 100% 100%)",
131
131
  left: "polygon(0% 0%, 100% 0%, 100% 100%)",
132
132
  right: "polygon(0% 0%, 0% 100%, 100% 100%)"
133
- }, O = ie();
134
- return (t, ue) => G((a(), s("div", {
133
+ }, K = le();
134
+ return (t, de) => J((a(), s("div", {
135
135
  ref_key: "wrapperRef",
136
136
  ref: w,
137
137
  style: { display: "inline-flex" },
138
- onMouseenter: P,
139
- onMouseleave: z,
140
- onFocusin: F,
141
- onFocusout: L,
142
- onClick: V
138
+ onMouseenter: z,
139
+ onMouseleave: F,
140
+ onFocusin: L,
141
+ onFocusout: V,
142
+ onClick: $
143
143
  }, [
144
- y("div", {
144
+ p("div", {
145
145
  ref_key: "referenceRef",
146
146
  ref: C,
147
147
  style: { display: "inline-flex" }
148
148
  }, [
149
149
  f(t.$slots, "default")
150
150
  ], 512),
151
- (a(), J(Q, { to: "body" }, [
151
+ (a(), Q(X, { to: "body" }, [
152
152
  o.value ? (a(), s("div", {
153
153
  key: 0,
154
154
  ref_key: "floatingRef",
155
155
  ref: b,
156
- style: p({ ...g(D), ...N.value }),
156
+ style: g({ ...v(D), ...W.value, visibility: v(P) ? "visible" : "hidden" }),
157
157
  role: "dialog",
158
158
  "aria-labelledby": x.value,
159
- onMouseenter: $,
160
- onMouseleave: A
159
+ onMouseenter: A,
160
+ onMouseleave: H
161
161
  }, [
162
- k.value ? (a(), s("div", ae, [
162
+ k.value ? (a(), s("div", ne, [
163
163
  f(t.$slots, "header", {}, () => [
164
- y("span", {
164
+ p("span", {
165
165
  id: x.value,
166
166
  style: { fontSize: "0.875rem", fontWeight: "600", color: "var(--cui-text-body)" }
167
- }, X(c.title), 9, ne)
167
+ }, Y(c.title), 9, se)
168
168
  ]),
169
169
  c.closable ? (a(), s("button", {
170
170
  key: 0,
@@ -184,17 +184,17 @@ const le = ["aria-labelledby"], ae = {
184
184
  marginTop: "calc(-0.0625rem * var(--cui-density-scale, 1))",
185
185
  marginRight: "calc(-0.125rem * var(--cui-density-scale, 1))"
186
186
  },
187
- "aria-label": g(O).close,
188
- onClick: Y(i, ["stop"])
187
+ "aria-label": v(K).close,
188
+ onClick: Z(r, ["stop"])
189
189
  }, [
190
- Z(re, {
190
+ ee(re, {
191
191
  name: "x",
192
192
  size: "0.8125rem"
193
193
  })
194
- ], 8, se)) : u("", !0)
194
+ ], 8, ce)) : u("", !0)
195
195
  ])) : u("", !0),
196
- y("div", {
197
- style: p({
196
+ p("div", {
197
+ style: g({
198
198
  padding: k.value ? "calc(0.25rem * var(--cui-density-scale, 1)) calc(0.875rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))" : "calc(0.75rem * var(--cui-density-scale, 1)) calc(0.875rem * var(--cui-density-scale, 1))",
199
199
  fontSize: "0.875rem",
200
200
  lineHeight: "1.55",
@@ -203,25 +203,25 @@ const le = ["aria-labelledby"], ae = {
203
203
  }, [
204
204
  f(t.$slots, "content")
205
205
  ], 4),
206
- H.value ? (a(), s("div", ce, [
206
+ N.value ? (a(), s("div", ue, [
207
207
  f(t.$slots, "footer")
208
208
  ])) : u("", !0),
209
209
  c.noArrow ? u("", !0) : (a(), s("div", {
210
210
  key: 2,
211
211
  ref_key: "arrowRef",
212
212
  ref: E,
213
- style: p({
214
- ...W.value,
215
- clipPath: j[g(_)] || void 0
213
+ style: g({
214
+ ...j.value,
215
+ clipPath: O[v(_)] || void 0
216
216
  })
217
217
  }, null, 4))
218
- ], 44, le)) : u("", !0)
218
+ ], 44, ae)) : u("", !0)
219
219
  ]))
220
220
  ], 544)), [
221
- [ee, !c.hidden]
221
+ [te, !c.hidden]
222
222
  ]);
223
223
  }
224
224
  });
225
225
  export {
226
- pe as default
226
+ ge as default
227
227
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CuiTimePicker.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTimePicker.vue"],"names":[],"mappings":"AAiRA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,kBAAmB,SAAQ,aAAa,EAAE,gBAAgB;IACzE,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB;IACnB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0HD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAEjC;AAED,iBAAS,IAAI,SAEZ;;;;;;;;;;;UAnIQ,IAAI,GAAG,IAAI,GAAG,IAAI;;gBAZZ,MAAM;YAEV,gBAAgB;gBAEZ,MAAM;;AA4ZrB,wBASG"}
1
+ {"version":3,"file":"CuiTimePicker.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTimePicker.vue"],"names":[],"mappings":"AAyRA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,kBAAmB,SAAQ,aAAa,EAAE,gBAAgB;IACzE,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB;IACnB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW;IACX,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8HD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAEjC;AAED,iBAAS,IAAI,SAEZ;;;;;;;;;;;UAvIQ,IAAI,GAAG,IAAI,GAAG,IAAI;;gBAZZ,MAAM;YAEV,gBAAgB;gBAEZ,MAAM;;AAoarB,wBASG"}
@@ -1,9 +1,10 @@
1
- import { defineComponent as H, ref as v, watch as V, onMounted as L, computed as d, useTemplateRef as O, withDirectives as j, openBlock as g, createElementBlock as h, toDisplayString as $, createCommentVNode as k, createVNode as s, withCtx as f, createElementVNode as p, normalizeStyle as x, createTextVNode as A, vShow as q } from "vue";
1
+ import { defineComponent as L, computed as u, ref as v, watch as V, onMounted as O, useTemplateRef as Z, withDirectives as j, openBlock as h, createElementBlock as S, toDisplayString as k, createCommentVNode as z, createVNode as s, withCtx as f, createElementVNode as p, normalizeStyle as x, createTextVNode as A, vShow as q } from "vue";
2
2
  import F from "./CuiPopover.vue.js";
3
3
  import C from "./CuiInputStepper.vue.js";
4
- import z from "./CuiButton.vue.js";
4
+ import P from "./CuiButton.vue.js";
5
5
  import G from "./CuiIcon.vue.js";
6
- const J = {
6
+ import { INPUT_SIZE_SCALE as J } from "../utils/sizing.js";
7
+ const K = {
7
8
  key: 0,
8
9
  style: {
9
10
  display: "block",
@@ -12,10 +13,10 @@ const J = {
12
13
  fontWeight: "500",
13
14
  color: "var(--cui-text-secondary)"
14
15
  }
15
- }, K = { style: { display: "flex", alignItems: "center", gap: "calc(0.5rem * var(--cui-density-scale, 1))", padding: "calc(0.5rem * var(--cui-density-scale, 1))" } }, Q = {
16
+ }, Q = { style: { display: "flex", alignItems: "center", gap: "calc(0.5rem * var(--cui-density-scale, 1))", padding: "calc(0.5rem * var(--cui-density-scale, 1))" } }, X = {
16
17
  key: 0,
17
18
  style: { display: "flex", flexDirection: "column", gap: "calc(0.125rem * var(--cui-density-scale, 1))", marginLeft: "calc(0.25rem * var(--cui-density-scale, 1))" }
18
- }, te = /* @__PURE__ */ H({
19
+ }, ie = /* @__PURE__ */ L({
19
20
  __name: "CuiTimePicker",
20
21
  props: {
21
22
  modelValue: { default: "" },
@@ -30,69 +31,69 @@ const J = {
30
31
  disabled: { type: Boolean, default: !1 }
31
32
  },
32
33
  emits: ["update:modelValue"],
33
- setup(l, { expose: w, emit: P }) {
34
- const a = l, I = P, i = v(12), o = v(0), r = v("AM"), y = v(!1);
34
+ setup(i, { expose: w, emit: I }) {
35
+ const a = i, y = u(() => J[a.size]), T = I, l = v(12), o = v(0), r = v("AM"), g = v(!1);
35
36
  function b(t) {
36
37
  if (!t) return;
37
38
  const e = t.match(/^(\d{1,2}):(\d{2})$/);
38
39
  if (e) {
39
- const u = parseInt(e[1]), D = parseInt(e[2]);
40
- a.format === "12" ? (r.value = u >= 12 ? "PM" : "AM", i.value = u === 0 ? 12 : u > 12 ? u - 12 : u) : i.value = u, o.value = D;
40
+ const d = parseInt(e[1]), H = parseInt(e[2]);
41
+ a.format === "12" ? (r.value = d >= 12 ? "PM" : "AM", l.value = d === 0 ? 12 : d > 12 ? d - 12 : d) : l.value = d, o.value = H;
41
42
  return;
42
43
  }
43
44
  const n = t.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i);
44
- n && (i.value = parseInt(n[1]), o.value = parseInt(n[2]), r.value = n[3].toUpperCase());
45
+ n && (l.value = parseInt(n[1]), o.value = parseInt(n[2]), r.value = n[3].toUpperCase());
45
46
  }
46
- V(() => a.modelValue, b), L(() => b(a.modelValue));
47
- function S() {
48
- return a.format === "24" ? `${String(i.value).padStart(2, "0")}:${String(o.value).padStart(2, "0")}` : `${String(i.value).padStart(2, "0")}:${String(o.value).padStart(2, "0")} ${r.value}`;
47
+ V(() => a.modelValue, b), O(() => b(a.modelValue));
48
+ function M() {
49
+ return a.format === "24" ? `${String(l.value).padStart(2, "0")}:${String(o.value).padStart(2, "0")}` : `${String(l.value).padStart(2, "0")}:${String(o.value).padStart(2, "0")} ${r.value}`;
49
50
  }
50
51
  function m() {
51
- I("update:modelValue", S());
52
+ T("update:modelValue", M());
52
53
  }
53
- const M = d(() => a.modelValue ? S() : "");
54
- d(() => a.format === "24" ? "##:##" : "##:## AA");
55
- const T = d(
54
+ const $ = u(() => a.modelValue ? M() : "");
55
+ u(() => a.format === "24" ? "##:##" : "##:## AA");
56
+ const E = u(
56
57
  () => a.placeholder ?? (a.format === "24" ? "hh:mm" : "hh:mm AM")
57
58
  );
58
- d(() => a.modelValue ? a.format === "24" ? `${String(i.value).padStart(2, "0")}${String(o.value).padStart(2, "0")}` : `${String(i.value).padStart(2, "0")}${String(o.value).padStart(2, "0")}${r.value}` : "");
59
- const W = d(() => a.format === "12" ? 1 : 0), B = d(() => a.format === "12" ? 12 : 23);
60
- function E(t) {
61
- i.value = t, m();
62
- }
59
+ u(() => a.modelValue ? a.format === "24" ? `${String(l.value).padStart(2, "0")}${String(o.value).padStart(2, "0")}` : `${String(l.value).padStart(2, "0")}${String(o.value).padStart(2, "0")}${r.value}` : "");
60
+ const W = u(() => a.format === "12" ? 1 : 0), B = u(() => a.format === "12" ? 12 : 23);
63
61
  function N(t) {
62
+ l.value = t, m();
63
+ }
64
+ function U(t) {
64
65
  o.value = t, m();
65
66
  }
66
- V(y, (t) => {
67
+ V(g, (t) => {
67
68
  t && b(a.modelValue);
68
69
  });
69
- const c = O("rootEl");
70
- function R(t) {
70
+ const c = Z("rootEl");
71
+ function D(t) {
71
72
  var e;
72
73
  (e = c.value) == null || e.focus(t);
73
74
  }
74
- function U() {
75
+ function R() {
75
76
  var t;
76
77
  (t = c.value) == null || t.blur();
77
78
  }
78
- return w({ el: c, focus: R, blur: U }), (t, e) => j((g(), h("div", {
79
+ return w({ el: c, focus: D, blur: R }), (t, e) => j((h(), S("div", {
79
80
  ref_key: "rootEl",
80
81
  ref: c
81
82
  }, [
82
- l.label ? (g(), h("label", J, $(l.label), 1)) : k("", !0),
83
+ i.label ? (h(), S("label", K, k(i.label), 1)) : z("", !0),
83
84
  s(F, {
84
- visible: y.value,
85
- "onUpdate:visible": e[2] || (e[2] = (n) => y.value = n),
85
+ visible: g.value,
86
+ "onUpdate:visible": e[2] || (e[2] = (n) => g.value = n),
86
87
  placement: "bottom",
87
88
  closable: !1,
88
89
  "no-arrow": "",
89
90
  width: "auto",
90
- disabled: l.disabled
91
+ disabled: i.disabled
91
92
  }, {
92
93
  content: f(() => [
93
- p("div", K, [
94
+ p("div", Q, [
94
95
  s(C, {
95
- "model-value": i.value,
96
+ "model-value": l.value,
96
97
  min: W.value,
97
98
  max: B.value,
98
99
  step: 1,
@@ -100,22 +101,22 @@ const J = {
100
101
  size: "sm",
101
102
  pad: 2,
102
103
  wrap: "",
103
- "onUpdate:modelValue": E
104
+ "onUpdate:modelValue": N
104
105
  }, null, 8, ["model-value", "min", "max"]),
105
106
  e[5] || (e[5] = p("span", { style: { fontSize: "1.25rem", fontWeight: "700", color: "var(--cui-text-body)", lineHeight: "1" } }, ":", -1)),
106
107
  s(C, {
107
108
  "model-value": o.value,
108
109
  min: 0,
109
110
  max: 59,
110
- step: l.minuteStep,
111
+ step: i.minuteStep,
111
112
  orientation: "vertical",
112
113
  size: "sm",
113
114
  pad: 2,
114
115
  wrap: "",
115
- "onUpdate:modelValue": N
116
+ "onUpdate:modelValue": U
116
117
  }, null, 8, ["model-value", "step"]),
117
- l.format === "12" ? (g(), h("div", Q, [
118
- s(z, {
118
+ i.format === "12" ? (h(), S("div", X, [
119
+ s(P, {
119
120
  variant: "ghost",
120
121
  size: "xs",
121
122
  style: x({
@@ -134,7 +135,7 @@ const J = {
134
135
  ])]),
135
136
  _: 1
136
137
  }, 8, ["style"]),
137
- s(z, {
138
+ s(P, {
138
139
  variant: "ghost",
139
140
  size: "xs",
140
141
  style: x({
@@ -153,24 +154,26 @@ const J = {
153
154
  ])]),
154
155
  _: 1
155
156
  }, 8, ["style"])
156
- ])) : k("", !0)
157
+ ])) : z("", !0)
157
158
  ])
158
159
  ]),
159
160
  default: f(() => [
160
161
  p("div", {
162
+ class: "cui-time-picker__trigger",
161
163
  style: x({
162
164
  display: "inline-flex",
163
165
  alignItems: "center",
164
166
  gap: "calc(0.5rem * var(--cui-density-scale, 1))",
165
- padding: "calc(0.4375rem * var(--cui-density-scale, 1)) calc(0.625rem * var(--cui-density-scale, 1))",
167
+ height: y.value.height,
168
+ padding: `0 ${y.value.px}`,
166
169
  border: "1px solid var(--cui-border-strong, var(--cui-border))",
167
170
  borderRadius: "var(--cui-button-radius, 0.375rem)",
168
171
  background: "var(--cui-surface-base, white)",
169
- cursor: l.disabled ? "default" : "pointer",
170
- opacity: l.disabled ? "0.5" : "1",
171
- fontSize: "0.875rem",
172
- color: M.value ? "var(--cui-text-body)" : "var(--cui-text-tertiary)",
173
- minWidth: l.format === "24" ? "6rem" : "8rem"
172
+ cursor: i.disabled ? "default" : "pointer",
173
+ opacity: i.disabled ? "0.5" : "1",
174
+ fontSize: y.value.fontSize,
175
+ color: $.value ? "var(--cui-text-body)" : "var(--cui-text-tertiary)",
176
+ minWidth: i.format === "24" ? "6rem" : "8rem"
174
177
  })
175
178
  }, [
176
179
  s(G, {
@@ -178,16 +181,16 @@ const J = {
178
181
  size: "0.875rem",
179
182
  style: { color: "var(--cui-text-tertiary)", flexShrink: "0" }
180
183
  }),
181
- p("span", null, $(M.value || T.value), 1)
184
+ p("span", null, k($.value || E.value), 1)
182
185
  ], 4)
183
186
  ]),
184
187
  _: 1
185
188
  }, 8, ["visible", "disabled"])
186
189
  ], 512)), [
187
- [q, !l.hidden]
190
+ [q, !i.hidden]
188
191
  ]);
189
192
  }
190
193
  });
191
194
  export {
192
- te as default
195
+ ie as default
193
196
  };
@@ -1 +1 @@
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
+ {"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;AAuDF;;;GAGG;AACH,wBAAgB,QAAQ;IAYpB,kCAAkC;;IAElC,sCAAsC;;IAEtC,iCAAiC;wBAbR,MAAM;IAe/B,+BAA+B;oBAXZ,MAAM;EAc5B"}
@@ -1,33 +1,37 @@
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 = [
4
- { id: "mono", label: "Mono", description: "Monochrome — default theme" },
5
- { id: "default", label: "Navy", description: "Navy blue" },
1
+ import { ref as u, watch as d } from "vue";
2
+ import { safeGetItem as n, safeSetItem as m } from "../utils/storage.js";
3
+ const a = [
4
+ { id: "mono", label: "Mono", description: "Monochrome" },
5
+ { id: "default", label: "Navy", description: "Navy blue (base scale)" },
6
6
  { id: "forest", label: "Forest", description: "Natural green" },
7
7
  { id: "amber", label: "Amber", description: "Warm orange with warm grays" },
8
8
  { id: "azure", label: "Azure", description: "Vibrant blue" },
9
9
  { id: "teal", label: "Teal", description: "Cool teal" },
10
10
  { id: "violet", label: "Violet", description: "Rich purple" },
11
11
  { id: "ruby", label: "Ruby", description: "Bold red" }
12
- ], a = "cui-theme", r = "cui-theme-";
13
- function m() {
14
- return c(a) ?? "mono";
12
+ ], i = "cui-theme", s = "cui-theme-", f = new Set(a.map((e) => `${s}${e.id}`));
13
+ function p() {
14
+ return n(i) ?? "default";
15
15
  }
16
- const o = n(m());
17
- function l(e) {
16
+ const o = u(p());
17
+ function c(e) {
18
18
  if (typeof document > "u") return;
19
19
  const t = document.documentElement;
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}`);
20
+ for (const r of Array.from(t.classList))
21
+ f.has(r) && t.classList.remove(r);
22
+ e !== "default" && t.classList.add(`${s}${e}`);
23
23
  }
24
- l(o.value);
25
- s(o, (e) => {
26
- l(e), u(a, e);
24
+ d(o, (e) => {
25
+ c(e), m(i, e);
27
26
  });
27
+ let l = !1;
28
28
  function b() {
29
- function e(i) {
30
- o.value = i;
29
+ l || (l = !0, n(i) != null && c(o.value));
30
+ }
31
+ function E() {
32
+ b();
33
+ function e(r) {
34
+ o.value = r;
31
35
  }
32
36
  function t() {
33
37
  return o.value;
@@ -36,7 +40,7 @@ function b() {
36
40
  /** Current theme ID (reactive) */
37
41
  theme: o,
38
42
  /** List of available theme presets */
39
- presets: d,
43
+ presets: a,
40
44
  /** Set the active theme by ID */
41
45
  setTheme: e,
42
46
  /** Get the current theme ID */
@@ -44,6 +48,6 @@ function b() {
44
48
  };
45
49
  }
46
50
  export {
47
- d as THEME_PRESETS,
48
- b as useTheme
51
+ a as THEME_PRESETS,
52
+ E as useTheme
49
53
  };
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "1.2.1";
1
+ const o = "1.2.2";
2
2
  export {
3
3
  o as version
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itguy614/clean-ui",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
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",
@@ -51,7 +51,6 @@
51
51
  "./dist/icons/lazy.js",
52
52
  "./dist/duplicate-guard.js",
53
53
  "./src/duplicate-guard.ts",
54
- "./dist/composables/useTheme.js",
55
54
  "./dist/composables/useDensity.js"
56
55
  ],
57
56
  "scripts": {