@ac-design/design-system 2.2.0 → 2.2.1

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,4 +1,5 @@
1
- import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeStyle as ee, onBeforeUnmount as te, onMounted as ne, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, useAttrs as re, useId as ie, useModel as y, watch as ae, withCtx as oe } from "vue";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, nextTick as p, normalizeClass as m, normalizeStyle as ee, onBeforeUnmount as te, onMounted as ne, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y, useAttrs as re, useId as ie, useModel as b, watch as ae, withCtx as oe } from "vue";
2
3
  import { Clock as se, X as ce } from "@lucide/vue";
3
4
  //#region src/lib/components/AcTimePicker.vue?vue&type=script&setup=true&lang.ts
4
5
  var le = ["for"], ue = {
@@ -30,10 +31,10 @@ var le = ["for"], ue = {
30
31
  "aria-selected",
31
32
  "aria-disabled",
32
33
  "onClick"
33
- ], we = { class: "mt-4 flex shrink-0 justify-center gap-2 border-t border-border pt-4" }, Te = ["disabled"], b = 86399, x = /*@__PURE__*/ l({
34
+ ], we = { class: "mt-4 flex shrink-0 justify-center gap-2 border-t border-border pt-4" }, Te = ["disabled"], x = 86399, S = /*@__PURE__*/ u({
34
35
  inheritAttrs: !1,
35
36
  __name: "AcTimePicker",
36
- props: /*@__PURE__*/ u({
37
+ props: /*@__PURE__*/ d({
37
38
  label: { default: "" },
38
39
  placeholder: { default: "Choose time" },
39
40
  hourCycle: { default: 24 },
@@ -70,19 +71,19 @@ var le = ["for"], ue = {
70
71
  openModifiers: {}
71
72
  }),
72
73
  emits: ["update:modelValue", "update:open"],
73
- setup(l, { expose: u }) {
74
- let x = l, S = y(l, "modelValue"), C = y(l, "open"), Ee = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/, w = ie(), T = re(), De = r(() => ({
75
- class: T.class,
76
- style: T.style
77
- })), Oe = r(() => {
78
- let { class: e, style: t, ...n } = T;
74
+ setup(u, { expose: d }) {
75
+ let S = u, C = b(u, "modelValue"), w = b(u, "open"), Ee = /^(\d{1,2}):(\d{2})(?::(\d{2}))?$/, T = ie(), E = re(), De = i(() => ({
76
+ class: E.class,
77
+ style: E.style
78
+ })), Oe = i(() => {
79
+ let { class: e, style: t, ...n } = E;
79
80
  return n;
80
- }), E = `${w}-label`, D = `${w}-value`, O = `${w}-msg`, k = `${w}-hint`, A = h(null), j = h(null), M = h(null), N = h({
81
+ }), D = `${T}-label`, O = `${T}-value`, k = `${T}-msg`, A = `${T}-hint`, j = g(null), M = g(null), N = g(null), P = g({
81
82
  left: 0,
82
83
  maxHeight: 400,
83
84
  minWidth: 0
84
- }), P = h(!1), F = r(() => C.value || P.value), I = r(() => G(S.value)), L = r(() => G(x.min) ?? 0), R = r(() => G(x.max) ?? b), z = r(() => I.value === null ? null : K(I.value)), B = r(() => x.hourCycle === 12), V = r(() => I.value === null ? "" : Ne(I.value)), ke = r(() => [x.hint && k, x.errorMsg && O].filter(Boolean).join(" ") || void 0), Ae = r(() => x.label ? `${x.label}: choose time` : "Choose time"), je = r(() => q(Fe())), H = r(() => {
85
- let e = z.value, t = e?.h ?? null, n = e?.m ?? null, r = t === null ? 0 : t >= 12 ? 12 : 0, i = [], a = B.value ? [
85
+ }), F = g(!1), I = i(() => w.value || F.value), L = i(() => G(C.value)), R = i(() => G(S.min) ?? 0), z = i(() => G(S.max) ?? x), B = i(() => L.value === null ? null : K(L.value)), V = i(() => S.hourCycle === 12), H = i(() => L.value === null ? "" : Pe(L.value)), ke = i(() => [S.hint && A, S.errorMsg && k].filter(Boolean).join(" ") || void 0), Ae = i(() => S.label ? `${S.label}: choose time` : "Choose time"), je = i(() => q(Ie())), Me = i(() => {
86
+ let e = B.value, t = e?.h ?? null, n = e?.m ?? null, r = t === null ? 0 : t >= 12 ? 12 : 0, i = [], a = V.value ? [
86
87
  0,
87
88
  1,
88
89
  2,
@@ -103,25 +104,25 @@ var le = ["for"], ue = {
103
104
  selected: t,
104
105
  cells: a.map((e) => ({
105
106
  value: e,
106
- text: U(B.value ? e % 12 || 12 : e),
107
+ text: U(V.value ? e % 12 || 12 : e),
107
108
  disabled: !J(e * 3600, e * 3600 + 3599)
108
109
  }))
109
110
  });
110
- let o = t ?? Pe();
111
+ let o = t ?? Fe();
111
112
  if (i.push({
112
113
  unit: "m",
113
114
  heading: "Min",
114
115
  name: "Minutes",
115
116
  selected: n,
116
- cells: W(0, 59, Math.max(1, x.minuteStep)).map((e) => {
117
+ cells: W(0, 59, Math.max(1, S.minuteStep)).map((e) => {
117
118
  let t = o * 3600 + e * 60;
118
119
  return {
119
120
  value: e,
120
121
  text: U(e),
121
- disabled: !J(t, x.showSeconds ? t + 59 : t)
122
+ disabled: !J(t, S.showSeconds ? t + 59 : t)
122
123
  };
123
124
  })
124
- }), x.showSeconds) {
125
+ }), S.showSeconds) {
125
126
  let t = n ?? 0;
126
127
  i.push({
127
128
  unit: "s",
@@ -135,7 +136,7 @@ var le = ["for"], ue = {
135
136
  }))
136
137
  });
137
138
  }
138
- return B.value && i.push({
139
+ return V.value && i.push({
139
140
  unit: "p",
140
141
  heading: "AM/PM",
141
142
  name: "AM or PM",
@@ -147,7 +148,7 @@ var le = ["for"], ue = {
147
148
  }, {
148
149
  value: 12,
149
150
  text: "PM",
150
- disabled: !J(43200, b)
151
+ disabled: !J(43200, x)
151
152
  }]
152
153
  }), i;
153
154
  });
@@ -176,79 +177,79 @@ var le = ["for"], ue = {
176
177
  s: e % 60
177
178
  };
178
179
  }
179
- function Me(e) {
180
+ function Ne(e) {
180
181
  let { h: t, m: n, s: r } = K(e);
181
- return x.showSeconds ? `${U(t)}:${U(n)}:${U(r)}` : `${U(t)}:${U(n)}`;
182
+ return S.showSeconds ? `${U(t)}:${U(n)}:${U(r)}` : `${U(t)}:${U(n)}`;
182
183
  }
183
- function Ne(e) {
184
- let { h: t, m: n, s: r } = K(e), i = x.showSeconds ? `${U(n)}:${U(r)}` : U(n);
185
- return B.value ? `${U(t % 12 || 12)}:${i} ${t >= 12 ? "PM" : "AM"}` : `${U(t)}:${i}`;
184
+ function Pe(e) {
185
+ let { h: t, m: n, s: r } = K(e), i = S.showSeconds ? `${U(n)}:${U(r)}` : U(n);
186
+ return V.value ? `${U(t % 12 || 12)}:${i} ${t >= 12 ? "PM" : "AM"}` : `${U(t)}:${i}`;
186
187
  }
187
188
  function q(e) {
188
- return e >= L.value && e <= R.value;
189
+ return e >= R.value && e <= z.value;
189
190
  }
190
191
  function J(e, t) {
191
- return t >= L.value && e <= R.value;
192
- }
193
- function Pe() {
194
- return Math.floor(L.value / 3600);
192
+ return t >= R.value && e <= z.value;
195
193
  }
196
194
  function Fe() {
197
- let e = /* @__PURE__ */ new Date(), t = Math.max(1, x.minuteStep), n = Math.floor(e.getMinutes() / t) * t;
198
- return e.getHours() * 3600 + n * 60 + (x.showSeconds ? e.getSeconds() : 0);
195
+ return Math.floor(R.value / 3600);
199
196
  }
200
- function Ie(e) {
201
- if (q(e) && Le(e)) return e;
202
- let { h: t } = K(e), n = Math.max(1, x.minuteStep) * 60, r = [];
203
- for (let e = t * 3600; e < (t + 1) * 3600; e += n) if (x.showSeconds) for (let t = 0; t < 60; t++) r.push(e + t);
197
+ function Ie() {
198
+ let e = /* @__PURE__ */ new Date(), t = Math.max(1, S.minuteStep), n = Math.floor(e.getMinutes() / t) * t;
199
+ return e.getHours() * 3600 + n * 60 + (S.showSeconds ? e.getSeconds() : 0);
200
+ }
201
+ function Le(e) {
202
+ if (q(e) && Re(e)) return e;
203
+ let { h: t } = K(e), n = Math.max(1, S.minuteStep) * 60, r = [];
204
+ for (let e = t * 3600; e < (t + 1) * 3600; e += n) if (S.showSeconds) for (let t = 0; t < 60; t++) r.push(e + t);
204
205
  else r.push(e);
205
206
  let i = r.filter(q);
206
207
  return i.length ? i.reduce((t, n) => Math.abs(n - e) < Math.abs(t - e) ? n : t) : null;
207
208
  }
208
- function Le(e) {
209
+ function Re(e) {
209
210
  let { m: t, s: n } = K(e);
210
- return t % Math.max(1, x.minuteStep) === 0 && (x.showSeconds || n === 0);
211
+ return t % Math.max(1, S.minuteStep) === 0 && (S.showSeconds || n === 0);
211
212
  }
212
- function Re(e, t) {
213
- let { h: n, m: r, s: i } = z.value ?? K(Ie(L.value) ?? L.value);
213
+ function ze(e, t) {
214
+ let { h: n, m: r, s: i } = B.value ?? K(Le(R.value) ?? R.value);
214
215
  e === "h" ? n = t : e === "m" ? r = t : e === "s" ? i = t : n = n % 12 + t;
215
- let a = Ie(n * 3600 + r * 60 + (x.showSeconds ? i : 0));
216
- a !== null && (S.value = Me(a));
217
- }
218
- function ze() {
219
- S.value = Me(Fe()), f(() => Z("smooth"));
216
+ let a = Le(n * 3600 + r * 60 + (S.showSeconds ? i : 0));
217
+ a !== null && (C.value = Ne(a));
220
218
  }
221
219
  function Be() {
222
- S.value = null, j.value?.focus();
220
+ C.value = Ne(Ie()), p(() => Z("smooth"));
221
+ }
222
+ function Ve() {
223
+ C.value = null, M.value?.focus();
223
224
  }
224
225
  function Y() {
225
- let e = j.value;
226
- if (!e) return;
227
- let t = e.getBoundingClientRect(), n = M.value?.offsetWidth ?? 240, r = M.value?.offsetHeight ?? 320, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = Math.max(8, Math.min(t.left, window.innerWidth - n - 8)), c = Math.min(t.width, 448);
228
- N.value = o ? {
229
- bottom: window.innerHeight - t.top + 6,
230
- left: s,
231
- maxHeight: Math.max(200, a),
232
- minWidth: c
226
+ let t = M.value;
227
+ if (!t) return;
228
+ let n = t.getBoundingClientRect(), r = e(), i = N.value?.offsetWidth ?? 240, a = N.value?.offsetHeight ?? 320, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = Math.max(8, Math.min(n.left - r.left, r.width - i - 8)), u = Math.min(n.width, 448);
229
+ P.value = c ? {
230
+ bottom: r.bottom - n.top + 6,
231
+ left: l,
232
+ maxHeight: Math.max(200, s),
233
+ minWidth: u
233
234
  } : {
234
- top: t.bottom + 6,
235
- left: s,
236
- maxHeight: Math.max(200, i),
237
- minWidth: c
235
+ top: n.bottom + 6 - r.top,
236
+ left: l,
237
+ maxHeight: Math.max(200, o),
238
+ minWidth: u
238
239
  };
239
240
  }
240
- function Ve() {
241
- x.disabled || C.value || (C.value = !0);
241
+ function He() {
242
+ S.disabled || w.value || (w.value = !0);
242
243
  }
243
244
  function X(e = !0) {
244
- C.value && (C.value = !1, e && j.value?.focus());
245
+ w.value && (w.value = !1, e && M.value?.focus());
245
246
  }
246
- async function He() {
247
- Y(), Ze(), await f(), Y(), Z("instant"), We(0);
247
+ async function Ue() {
248
+ Y(), Qe(), await p(), Y(), Z("instant"), Ge(0);
248
249
  }
249
250
  function Z(e) {
250
251
  let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
251
- M.value?.querySelectorAll("[role=listbox]").forEach((e) => {
252
+ N.value?.querySelectorAll("[role=listbox]").forEach((e) => {
252
253
  let n = e.querySelector("[aria-selected=true]") ?? e.querySelector("[aria-disabled=false]");
253
254
  n && e.scrollTo({
254
255
  top: n.offsetTop - (e.clientHeight - n.offsetHeight) / 2,
@@ -256,22 +257,22 @@ var le = ["for"], ue = {
256
257
  });
257
258
  });
258
259
  }
259
- function Ue(e) {
260
- return [...M.value?.querySelectorAll(`[data-col="${e}"] [role=option]`) ?? []];
261
- }
262
260
  function We(e) {
263
- let t = Ue(e);
261
+ return [...N.value?.querySelectorAll(`[data-col="${e}"] [role=option]`) ?? []];
262
+ }
263
+ function Ge(e) {
264
+ let t = We(e);
264
265
  (t.find((e) => e.tabIndex === 0) ?? t[0])?.focus({ preventScroll: !0 });
265
266
  }
266
- function Ge(e, t) {
267
+ function Ke(e, t) {
267
268
  return (e.cells.find((t) => t.value === e.selected) ?? e.cells.find((e) => !e.disabled)) === t ? 0 : -1;
268
269
  }
269
- function Ke(e, t, n) {
270
- n.disabled || (Re(t.unit, n.value), f(() => {
271
- Z("smooth"), Ue(e).find((e) => e.tabIndex === 0)?.focus({ preventScroll: !0 });
270
+ function qe(e, t, n) {
271
+ n.disabled || (ze(t.unit, n.value), p(() => {
272
+ Z("smooth"), We(e).find((e) => e.tabIndex === 0)?.focus({ preventScroll: !0 });
272
273
  }));
273
274
  }
274
- function qe(e, t, n) {
275
+ function Je(e, t, n) {
275
276
  let r = n.cells.filter((e) => !e.disabled);
276
277
  if (!r.length) return;
277
278
  let i = r.findIndex((e) => e.value === n.selected), a = {
@@ -285,171 +286,171 @@ var le = ["for"], ue = {
285
286
  if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
286
287
  e.preventDefault();
287
288
  let n = t + (e.key === "ArrowRight" ? 1 : -1);
288
- n >= 0 && n < H.value.length && We(n);
289
+ n >= 0 && n < Me.value.length && Ge(n);
289
290
  return;
290
291
  }
291
292
  if (e.key === "Enter") {
292
293
  e.preventDefault();
293
294
  let t = n.cells.find((t) => String(t.value) === e.target.dataset.value);
294
- t && !t.disabled && Re(n.unit, t.value), X();
295
+ t && !t.disabled && ze(n.unit, t.value), X();
295
296
  return;
296
297
  }
297
298
  if (!(e.key in a)) return;
298
299
  e.preventDefault();
299
300
  let o = r[Math.max(0, Math.min(r.length - 1, a[e.key]))];
300
- Ke(t, n, o);
301
+ qe(t, n, o);
301
302
  }
302
- function Je(e) {
303
+ function Ye(e) {
303
304
  if (e.key === "Escape") {
304
305
  e.preventDefault(), e.stopPropagation(), X();
305
306
  return;
306
307
  }
307
- if (e.key !== "Tab" || !M.value) return;
308
- let t = [...M.value.querySelectorAll("button:not([disabled])")].filter((e) => e.tabIndex >= 0);
308
+ if (e.key !== "Tab" || !N.value) return;
309
+ let t = [...N.value.querySelectorAll("button:not([disabled])")].filter((e) => e.tabIndex >= 0);
309
310
  if (!t.length) return;
310
311
  let n = t[0], r = t[t.length - 1];
311
312
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
312
313
  }
313
- function Ye(e) {
314
- (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), Ve());
315
- }
316
314
  function Xe(e) {
315
+ (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), He());
316
+ }
317
+ function Ze(e) {
317
318
  let t = e.target;
318
- A.value?.contains(t) || M.value?.contains(t) || X(!1);
319
+ j.value?.contains(t) || N.value?.contains(t) || X(!1);
319
320
  }
320
321
  function Q(e) {
321
- e?.target instanceof Node && M.value?.contains(e.target) || Y();
322
+ e?.target instanceof Node && N.value?.contains(e.target) || Y();
322
323
  }
323
- function Ze() {
324
- document.addEventListener("pointerdown", Xe, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q);
324
+ function Qe() {
325
+ document.addEventListener("pointerdown", Ze, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q);
325
326
  }
326
327
  function $() {
327
- document.removeEventListener("pointerdown", Xe, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
328
+ document.removeEventListener("pointerdown", Ze, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
328
329
  }
329
- return ae(C, (e) => e ? He() : $()), ne(() => {
330
- C.value && He();
331
- }), te($), u({ focus: () => j.value?.focus() }), (r, u) => (m(), o("div", d({
330
+ return ae(w, (e) => e ? Ue() : $()), ne(() => {
331
+ w.value && Ue();
332
+ }), te($), d({ focus: () => M.value?.focus() }), (e, i) => (h(), s("div", f({
332
333
  ref_key: "root",
333
- ref: A
334
+ ref: j
334
335
  }, De.value, {
335
- class: ["w-full", l.disabled && "opacity-50"],
336
+ class: ["w-full", u.disabled && "opacity-50"],
336
337
  "data-ac-ds": "",
337
338
  "data-testid": "ac-time-picker"
338
339
  }), [
339
- l.label ? (m(), o("label", {
340
+ u.label ? (h(), s("label", {
340
341
  key: 0,
341
- id: E,
342
- for: `${v(w)}-trigger`,
342
+ id: D,
343
+ for: `${y(T)}-trigger`,
343
344
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
344
- }, [s("span", null, _(l.label), 1), l.required ? (m(), o("span", ue, "*")) : a("", !0)], 8, le)) : a("", !0),
345
- l.hint ? (m(), o("p", {
345
+ }, [c("span", null, v(u.label), 1), u.required ? (h(), s("span", ue, "*")) : o("", !0)], 8, le)) : o("", !0),
346
+ u.hint ? (h(), s("p", {
346
347
  key: 1,
347
- id: k,
348
+ id: A,
348
349
  class: "mb-2 text-base text-muted"
349
- }, _(l.hint), 1)) : a("", !0),
350
- s("div", de, [s("button", d({
351
- id: `${v(w)}-trigger`,
350
+ }, v(u.hint), 1)) : o("", !0),
351
+ c("div", de, [c("button", f({
352
+ id: `${y(T)}-trigger`,
352
353
  ref_key: "trigger",
353
- ref: j
354
+ ref: M
354
355
  }, Oe.value, {
355
356
  type: "button",
356
- disabled: l.disabled,
357
+ disabled: u.disabled,
357
358
  "aria-haspopup": "dialog",
358
- "aria-expanded": C.value,
359
- "aria-labelledby": l.label ? `${E} ${D}` : D,
359
+ "aria-expanded": w.value,
360
+ "aria-labelledby": u.label ? `${D} ${O}` : O,
360
361
  "aria-describedby": ke.value,
361
- "aria-invalid": !!l.errorMsg || void 0,
362
- "aria-required": l.required || void 0,
362
+ "aria-invalid": !!u.errorMsg || void 0,
363
+ "aria-required": u.required || void 0,
363
364
  class: ["flex w-full items-center rounded-10 border bg-background text-left text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
364
- l.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
365
- l.clearable && S.value ? "pr-20" : "pr-10",
366
- l.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
367
- l.errorMsg ? ["border-danger/60", F.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : F.value ? "focus-ring" : ["border-border", !l.disabled && "hover:border-accent-active"]
365
+ u.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
366
+ u.clearable && C.value ? "pr-20" : "pr-10",
367
+ u.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
368
+ u.errorMsg ? ["border-danger/60", I.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : I.value ? "focus-ring" : ["border-border", !u.disabled && "hover:border-accent-active"]
368
369
  ]],
369
- onClick: u[0] ||= (e) => C.value ? X() : Ve(),
370
- onKeydown: Ye,
371
- onFocus: u[1] ||= (e) => P.value = !0,
372
- onBlur: u[2] ||= (e) => P.value = !1
373
- }), [s("span", {
374
- id: D,
375
- class: p(["truncate tabular-nums", !V.value && "text-muted/80"])
376
- }, _(V.value || S.value || l.placeholder), 3)], 16, fe), s("span", { class: p(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", l.size === "small" ? "right-3" : "right-4"]) }, [l.clearable && S.value && !l.disabled ? (m(), o("button", {
370
+ onClick: i[0] ||= (e) => w.value ? X() : He(),
371
+ onKeydown: Xe,
372
+ onFocus: i[1] ||= (e) => F.value = !0,
373
+ onBlur: i[2] ||= (e) => F.value = !1
374
+ }), [c("span", {
375
+ id: O,
376
+ class: m(["truncate tabular-nums", !H.value && "text-muted/80"])
377
+ }, v(H.value || C.value || u.placeholder), 3)], 16, fe), c("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", u.size === "small" ? "right-3" : "right-4"]) }, [u.clearable && C.value && !u.disabled ? (h(), s("button", {
377
378
  key: 0,
378
379
  type: "button",
379
380
  class: "pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full p-1 transition-colors duration-200 hover:bg-accent-hover hover:text-primary active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
380
- "aria-label": l.label ? `Clear ${l.label}` : "Clear",
381
- onClick: Be
382
- }, [c(v(ce), {
381
+ "aria-label": u.label ? `Clear ${u.label}` : "Clear",
382
+ onClick: Ve
383
+ }, [l(y(ce), {
383
384
  class: "size-4",
384
385
  "aria-hidden": "true"
385
- })], 8, pe)) : a("", !0), c(v(se), {
386
- class: p(["size-4", C.value && "text-heading"]),
386
+ })], 8, pe)) : o("", !0), l(y(se), {
387
+ class: m(["size-4", w.value && "text-heading"]),
387
388
  "aria-hidden": "true"
388
389
  }, null, 8, ["class"])], 2)]),
389
- l.errorMsg ? (m(), o("p", {
390
+ u.errorMsg ? (h(), s("p", {
390
391
  key: 2,
391
- id: O,
392
+ id: k,
392
393
  class: "mt-1 text-base text-danger-strong",
393
394
  role: "alert"
394
- }, _(l.errorMsg), 1)) : a("", !0),
395
- l.name ? (m(), o("input", {
395
+ }, v(u.errorMsg), 1)) : o("", !0),
396
+ u.name ? (h(), s("input", {
396
397
  key: 3,
397
398
  type: "hidden",
398
- name: l.name,
399
- value: S.value ?? ""
400
- }, null, 8, me)) : a("", !0),
401
- (m(), i(t, { to: "body" }, [c(n, {
399
+ name: u.name,
400
+ value: C.value ?? ""
401
+ }, null, 8, me)) : o("", !0),
402
+ (h(), a(n, { to: "body" }, [l(r, {
402
403
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
403
404
  "enter-from-class": "opacity-0 scale-95",
404
405
  "leave-active-class": "transition duration-100 ease-in",
405
406
  "leave-to-class": "opacity-0"
406
407
  }, {
407
- default: oe(() => [C.value ? (m(), o("div", {
408
+ default: oe(() => [w.value ? (h(), s("div", {
408
409
  key: 0,
409
410
  ref_key: "panel",
410
- ref: M,
411
+ ref: N,
411
412
  role: "dialog",
412
413
  "aria-modal": "true",
413
414
  "aria-label": Ae.value,
414
415
  class: "fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-10 border border-border bg-surface p-3 shadow-sm",
415
416
  style: ee({
416
- top: N.value.top === void 0 ? void 0 : `${N.value.top}px`,
417
- bottom: N.value.bottom === void 0 ? void 0 : `${N.value.bottom}px`,
418
- left: `${N.value.left}px`,
419
- maxHeight: `${N.value.maxHeight}px`,
420
- minWidth: `${N.value.minWidth}px`
417
+ top: P.value.top === void 0 ? void 0 : `${P.value.top}px`,
418
+ bottom: P.value.bottom === void 0 ? void 0 : `${P.value.bottom}px`,
419
+ left: `${P.value.left}px`,
420
+ maxHeight: `${P.value.maxHeight}px`,
421
+ minWidth: `${P.value.minWidth}px`
421
422
  }),
422
423
  "data-ac-ds": "",
423
424
  "data-testid": "ac-time-picker-panel",
424
- onKeydown: Je
425
- }, [s("div", ge, [(m(!0), o(e, null, g(H.value, (t, n) => (m(), o(e, { key: t.unit }, [t.unit === "p" ? (m(), o("span", _e)) : n > 0 ? (m(), o("span", ve, ":")) : a("", !0), s("div", {
425
+ onKeydown: Ye
426
+ }, [c("div", ge, [(h(!0), s(t, null, _(Me.value, (e, n) => (h(), s(t, { key: e.unit }, [e.unit === "p" ? (h(), s("span", _e)) : n > 0 ? (h(), s("span", ve, ":")) : o("", !0), c("div", {
426
427
  class: "flex h-full min-w-14 flex-1 flex-col items-center",
427
428
  "data-col": n
428
- }, [s("span", be, _(t.heading), 1), s("div", {
429
+ }, [c("span", be, v(e.heading), 1), c("div", {
429
430
  role: "listbox",
430
- "aria-label": t.name,
431
+ "aria-label": e.name,
431
432
  class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
432
- onKeydown: (e) => qe(e, n, t)
433
- }, [s("div", Se, [(m(!0), o(e, null, g(t.cells, (e) => (m(), o("button", {
434
- key: e.value,
433
+ onKeydown: (t) => Je(t, n, e)
434
+ }, [c("div", Se, [(h(!0), s(t, null, _(e.cells, (t) => (h(), s("button", {
435
+ key: t.value,
435
436
  type: "button",
436
- "data-value": e.value,
437
+ "data-value": t.value,
437
438
  role: "option",
438
- tabindex: Ge(t, e),
439
- "aria-selected": e.value === t.selected,
440
- "aria-disabled": e.disabled,
441
- class: p(["inline-flex h-10 shrink-0 items-center justify-center rounded-8 tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", [t.unit === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.value === t.selected ? ["cursor-pointer bg-primary text-white", t.unit !== "p" && "scale-110 font-bold"] : "cursor-pointer text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
442
- onClick: (r) => Ke(n, t, e)
443
- }, _(e.text), 11, Ce))), 128))])], 40, xe)], 8, ye)], 64))), 128))]), s("div", we, [s("button", {
439
+ tabindex: Ke(e, t),
440
+ "aria-selected": t.value === e.selected,
441
+ "aria-disabled": t.disabled,
442
+ class: m(["inline-flex h-10 shrink-0 items-center justify-center rounded-8 tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", [e.unit === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", t.disabled ? "cursor-not-allowed text-muted/50 line-through" : t.value === e.selected ? ["cursor-pointer bg-primary text-white", e.unit !== "p" && "scale-110 font-bold"] : "cursor-pointer text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
443
+ onClick: (r) => qe(n, e, t)
444
+ }, v(t.text), 11, Ce))), 128))])], 40, xe)], 8, ye)], 64))), 128))]), c("div", we, [c("button", {
444
445
  type: "button",
445
446
  class: "cursor-pointer rounded-8 bg-accent px-3 py-1.5 text-xs font-medium text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
446
447
  disabled: !je.value,
447
- onClick: ze
448
- }, " Current time ", 8, Te)])], 44, he)) : a("", !0)]),
448
+ onClick: Be
449
+ }, " Current time ", 8, Te)])], 44, he)) : o("", !0)]),
449
450
  _: 1
450
451
  })]))
451
452
  ], 16));
452
453
  }
453
454
  });
454
455
  //#endregion
455
- export { x as default };
456
+ export { S as default };