@ac-design/design-system 2.2.1 → 2.3.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 (42) hide show
  1. package/dist/lib/compat.css +210 -0
  2. package/dist/lib/components/AcButton.vue.d.ts +18 -12
  3. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
  4. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  5. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  6. package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
  7. package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
  8. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +432 -369
  9. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  10. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  11. package/dist/lib/components/AcInput.vue.d.ts +28 -7
  12. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
  13. package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
  14. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  15. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  16. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  17. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  18. package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
  19. package/dist/lib/components/AcRadioCard.js +5 -0
  20. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  21. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  22. package/dist/lib/components/AcSelect.vue.d.ts +12 -1
  23. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +190 -174
  24. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  25. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  26. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  27. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  28. package/dist/lib/components/AcTable.vue.d.ts +13 -1
  29. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
  30. package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
  31. package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
  32. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
  33. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  34. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  35. package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
  36. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +206 -174
  37. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  38. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
  39. package/dist/lib/components/index.d.ts +1 -0
  40. package/dist/lib/components/types.d.ts +2 -0
  41. package/dist/lib/index.js +34 -33
  42. package/package.json +1 -1
@@ -1,13 +1,16 @@
1
1
  import e from "./AcButton.js";
2
2
  import { fixedFrame as t } from "./fixedFrame.js";
3
- import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as ee, mergeProps as te, nextTick as p, normalizeClass as m, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as h, reactive as ae, ref as g, renderList as _, resolveDynamicComponent as oe, toDisplayString as v, unref as y, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
3
+ import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as ee, mergeProps as te, nextTick as p, normalizeClass as m, onBeforeUnmount as ne, onMounted as re, openBlock as h, reactive as ie, ref as g, renderList as _, renderSlot as ae, resolveDynamicComponent as oe, toDisplayString as v, unref as y, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
4
4
  import { Calendar as fe, CalendarRange as pe, ChevronLeft as me, ChevronRight as he, Clock as ge, Timer as _e, X as ve } from "@lucide/vue";
5
5
  //#region src/lib/components/AcDatePicker.vue?vue&type=script&setup=true&lang.ts
6
- var ye = ["for"], be = {
7
- key: 0,
6
+ var ye = ["for"], be = { key: 0 }, xe = {
7
+ key: 1,
8
8
  class: "text-danger",
9
9
  "aria-hidden": "true"
10
- }, xe = { class: "relative" }, Se = [
10
+ }, Se = {
11
+ key: 2,
12
+ class: "relative"
13
+ }, Ce = [
11
14
  "id",
12
15
  "disabled",
13
16
  "aria-expanded",
@@ -15,7 +18,13 @@ var ye = ["for"], be = {
15
18
  "aria-describedby",
16
19
  "aria-invalid",
17
20
  "aria-required"
18
- ], Ce = ["aria-label"], we = ["name", "value"], Te = ["aria-label"], Ee = {
21
+ ], we = ["aria-label"], Te = [
22
+ "role",
23
+ "aria-modal",
24
+ "aria-label",
25
+ "aria-describedby",
26
+ "inert"
27
+ ], Ee = {
19
28
  key: 0,
20
29
  class: "flex shrink-0 flex-wrap gap-1 border-b border-border p-2 sm:w-44 sm:flex-col sm:flex-nowrap sm:border-r sm:border-b-0",
21
30
  role: "group",
@@ -74,9 +83,13 @@ var ye = ["for"], be = {
74
83
  class: "mb-1 text-center text-xs font-medium text-heading"
75
84
  }, Xe = { class: "flex h-48 items-stretch justify-center gap-1" }, Ze = {
76
85
  key: 0,
86
+ class: "mx-2 mt-6 h-32 w-px shrink-0 self-center bg-border",
87
+ "aria-hidden": "true"
88
+ }, Qe = {
89
+ key: 1,
77
90
  class: "mt-6 self-center font-bold text-heading/50",
78
91
  "aria-hidden": "true"
79
- }, Qe = { class: "flex h-full min-w-10 flex-1 flex-col items-center" }, $e = {
92
+ }, $e = {
80
93
  class: "mb-2 text-xm font-bold tracking-wider text-heading/50 uppercase",
81
94
  "aria-hidden": "true"
82
95
  }, et = [
@@ -87,14 +100,17 @@ var ye = ["for"], be = {
87
100
  "tabindex",
88
101
  "aria-selected",
89
102
  "onClick"
90
- ], rt = { class: "mt-3 text-center text-xs text-muted" }, it = {
103
+ ], rt = {
104
+ key: 0,
105
+ class: "mt-3 text-center text-xs text-muted"
106
+ }, it = {
91
107
  key: 2,
92
108
  class: "flex flex-wrap items-center gap-2 border-t border-border px-3 py-3"
93
109
  }, at = ["disabled"], ot = {
94
110
  key: 1,
95
111
  class: "basis-full text-xs text-danger-strong",
96
112
  role: "alert"
97
- }, b = /*@__PURE__*/ f({
113
+ }, st = ["name", "value"], b = /*@__PURE__*/ f({
98
114
  inheritAttrs: !1,
99
115
  __name: "AcDatePicker",
100
116
  props: /*@__PURE__*/ ee({
@@ -134,7 +150,20 @@ var ye = ["for"], be = {
134
150
  errorMsg: { default: "" },
135
151
  hint: { default: "" },
136
152
  size: { default: "normal" },
137
- name: { default: "" }
153
+ name: { default: "" },
154
+ inline: {
155
+ type: Boolean,
156
+ default: !1
157
+ },
158
+ autoApply: {
159
+ type: Boolean,
160
+ default: !1
161
+ },
162
+ hourCycle: { default: 24 },
163
+ showTimeZone: {
164
+ type: Boolean,
165
+ default: !0
166
+ }
138
167
  }, {
139
168
  modelValue: { default: null },
140
169
  modelModifiers: {},
@@ -146,7 +175,7 @@ var ye = ["for"], be = {
146
175
  }),
147
176
  emits: ["update:modelValue", "update:open"],
148
177
  setup(f, { expose: ee }) {
149
- let b = f, st = le(f, "modelValue"), x = le(f, "open"), ct = /^\d{4}-\d{2}-\d{2}$/, lt = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, ut = {
178
+ let b = f, ct = le(f, "modelValue"), x = le(f, "open"), lt = /^\d{4}-\d{2}-\d{2}$/, ut = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, dt = {
150
179
  w: 604800,
151
180
  d: 86400,
152
181
  h: 3600,
@@ -156,11 +185,12 @@ var ye = ["for"], be = {
156
185
  us: 1e-6,
157
186
  µs: 1e-6,
158
187
  ns: 1e-9
159
- }, dt = Date.UTC(2023, 0, 1), ft = {
188
+ }, ft = Date.UTC(2023, 0, 1), pt = {
160
189
  h: "Hrs",
161
190
  m: "Min",
162
- s: "Sec"
163
- }, pt = [{
191
+ s: "Sec",
192
+ p: "AM/PM"
193
+ }, mt = [{
164
194
  key: "date",
165
195
  label: "Date",
166
196
  icon: fe
@@ -168,57 +198,57 @@ var ye = ["for"], be = {
168
198
  key: "time",
169
199
  label: "Time",
170
200
  icon: ge
171
- }], S = ce(), mt = se(), ht = a(() => ({
172
- class: mt.class,
173
- style: mt.style
174
- })), gt = a(() => {
175
- let { class: e, style: t, ...n } = mt;
201
+ }], S = ce(), ht = se(), gt = a(() => ({
202
+ class: ht.class,
203
+ style: ht.style
204
+ })), _t = a(() => {
205
+ let { class: e, style: t, ...n } = ht;
176
206
  return n;
177
- }), _t = `${S}-label`, vt = `${S}-value`, yt = `${S}-month`, bt = `${S}-msg`, xt = `${S}-hint`, St = /* @__PURE__ */ new Map(), Ct = g(null), wt = g(null), C = g(null), w = g({
207
+ }), vt = `${S}-label`, yt = `${S}-value`, bt = `${S}-month`, xt = `${S}-msg`, St = `${S}-hint`, Ct = /* @__PURE__ */ new Map(), wt = g(null), Tt = g(null), C = g(null), w = g({
178
208
  left: 0,
179
209
  maxHeight: 480,
180
210
  minWidth: 0
181
- }), T = g("2026-01-01"), E = g("days"), D = g(2020), O = g(0), k = g("date"), A = g("2026-01-01"), j = g(null), M = g(null), N = g(null), P = ae({
211
+ }), T = g("2026-01-01"), E = g("days"), D = g(2020), O = g(0), k = g("date"), A = g("2026-01-01"), Et = g(null), j = g(null), M = g(null), N = ie({
182
212
  h: 0,
183
213
  m: 0,
184
214
  s: 0
185
- }), F = ae({
215
+ }), Dt = ie({
186
216
  h: 23,
187
217
  m: 59,
188
218
  s: 59
189
- }), I = ae({
219
+ }), P = ie({
190
220
  d: 0,
191
221
  h: 0,
192
222
  m: 0
193
- }), L = a(() => b.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), R = a(() => b.range && b.mode !== "duration"), z = a(() => b.mode === "datetime"), Tt = a(() => b.weekStartsOn ?? un()), Et = a(() => new Intl.DateTimeFormat(b.locale, {
223
+ }), F = a(() => b.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), I = a(() => b.range && b.mode !== "duration"), L = a(() => b.mode === "datetime"), Ot = a(() => b.weekStartsOn ?? mn()), kt = a(() => new Intl.DateTimeFormat(b.locale, {
194
224
  year: "numeric",
195
225
  month: "short",
196
226
  day: "numeric",
197
227
  timeZone: "UTC"
198
- })), Dt = a(() => new Intl.DateTimeFormat(b.locale, {
228
+ })), At = a(() => new Intl.DateTimeFormat(b.locale, {
199
229
  year: "numeric",
200
230
  month: "short",
201
231
  day: "numeric",
202
232
  hour: "2-digit",
203
233
  minute: "2-digit",
204
234
  second: b.showSeconds ? "2-digit" : void 0,
205
- hourCycle: "h23",
206
- timeZone: L.value,
207
- timeZoneName: "short"
208
- })), Ot = a(() => new Intl.DateTimeFormat(b.locale, {
235
+ hourCycle: b.hourCycle === 12 ? "h12" : "h23",
236
+ timeZone: F.value,
237
+ timeZoneName: b.showTimeZone ? "short" : void 0
238
+ })), jt = a(() => new Intl.DateTimeFormat(b.locale, {
209
239
  month: "long",
210
240
  year: "numeric",
211
241
  timeZone: "UTC"
212
- })), kt = a(() => new Intl.DateTimeFormat(b.locale, {
242
+ })), Mt = a(() => new Intl.DateTimeFormat(b.locale, {
213
243
  weekday: "long",
214
244
  year: "numeric",
215
245
  month: "long",
216
246
  day: "numeric",
217
247
  timeZone: "UTC"
218
- })), At = a(() => new Intl.DateTimeFormat(b.locale, {
248
+ })), Nt = a(() => new Intl.DateTimeFormat(b.locale, {
219
249
  day: "numeric",
220
250
  timeZone: "UTC"
221
- })), jt = a(() => {
251
+ })), Pt = a(() => {
222
252
  let e = new Intl.DateTimeFormat(b.locale, {
223
253
  weekday: "short",
224
254
  timeZone: "UTC"
@@ -227,35 +257,35 @@ var ye = ["for"], be = {
227
257
  timeZone: "UTC"
228
258
  });
229
259
  return Array.from({ length: 7 }, (n, r) => {
230
- let i = new Date(dt + (Tt.value + r) % 7 * 864e5);
260
+ let i = new Date(ft + (Ot.value + r) % 7 * 864e5);
231
261
  return {
232
262
  short: e.format(i),
233
263
  long: t.format(i)
234
264
  };
235
265
  });
236
- }), Mt = a(() => new Intl.DateTimeFormat(b.locale, {
237
- timeZone: L.value,
266
+ }), Ft = a(() => new Intl.DateTimeFormat(b.locale, {
267
+ timeZone: F.value,
238
268
  timeZoneName: "short"
239
- }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? L.value), Nt = a(() => Z(Date.now()).day), B = a(() => b.minDate ? pn(b.minDate) : null), V = a(() => b.maxDate ? pn(b.maxDate) : null), Pt = a(() => b.minDate ? Q(b.minDate) : null), Ft = a(() => b.maxDate ? ct.test(b.maxDate) ? fn(Y(b.maxDate, 1), 0, 0, 0) - 1e3 : Q(b.maxDate) : null), H = a(() => {
240
- let e = st.value;
241
- return R.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
242
- }), It = a(() => H.value.some(Boolean)), Lt = a(() => {
243
- let [e, t] = H.value;
269
+ }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? F.value), It = a(() => Y(Date.now()).day), R = a(() => b.minDate ? _n(b.minDate) : null), z = a(() => b.maxDate ? _n(b.maxDate) : null), Lt = a(() => b.minDate ? X(b.minDate) : null), Rt = a(() => b.maxDate ? lt.test(b.maxDate) ? gn(q(b.maxDate, 1), 0, 0, 0) - 1e3 : X(b.maxDate) : null), B = a(() => {
270
+ let e = ct.value;
271
+ return I.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
272
+ }), zt = a(() => B.value.some(Boolean)), Bt = a(() => {
273
+ let [e, t] = B.value;
244
274
  if (!e) return "";
245
275
  if (b.mode === "duration") {
246
- let t = hn(e);
247
- return t === null ? e : _n(t);
276
+ let t = vn(e);
277
+ return t === null ? e : bn(t);
248
278
  }
249
279
  if (b.mode === "date") {
250
- let n = pn(e), r = t ? pn(t) : null;
251
- return n ? R.value ? r ? Et.value.formatRange(J(n), J(r)) : `${Et.value.format(J(n))} –` : Et.value.format(J(n)) : e;
280
+ let n = _n(e), r = t ? _n(t) : null;
281
+ return n ? I.value ? r ? kt.value.formatRange(K(n), K(r)) : `${kt.value.format(K(n))} –` : kt.value.format(K(n)) : e;
252
282
  }
253
- let n = Q(e), r = t ? Q(t) : null;
254
- return n === null ? e : R.value ? r === null ? `${Dt.value.format(n)} –` : Dt.value.formatRange(n, r) : Dt.value.format(n);
255
- }), Rt = a(() => H.value.filter(Boolean).join("/")), zt = a(() => {
256
- let e = (ln(T.value) - Tt.value + 7) % 7, t = Y(T.value, -e), n = Math.ceil((e + cn(T.value)) / 7);
257
- return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => Y(t, n * 7 + r)));
258
- }), U = a(() => q(T.value).y), Bt = a(() => q(T.value).m - 1), Vt = a(() => {
283
+ let n = X(e), r = t ? X(t) : null;
284
+ return n === null ? e : I.value ? r === null ? `${At.value.format(n)} –` : At.value.formatRange(n, r) : At.value.format(n);
285
+ }), Vt = a(() => B.value.filter(Boolean).join("/")), Ht = a(() => {
286
+ let e = (pn(T.value) - Ot.value + 7) % 7, t = q(T.value, -e), n = Math.ceil((e + fn(T.value)) / 7);
287
+ return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => q(t, n * 7 + r)));
288
+ }), V = a(() => G(T.value).y), Ut = a(() => G(T.value).m - 1), Wt = a(() => {
259
289
  let e = new Intl.DateTimeFormat(b.locale, {
260
290
  month: "short",
261
291
  timeZone: "UTC"
@@ -265,67 +295,67 @@ var ye = ["for"], be = {
265
295
  timeZone: "UTC"
266
296
  });
267
297
  return Array.from({ length: 12 }, (n, r) => {
268
- let i = K(U.value, r + 1, 1);
298
+ let i = W(V.value, r + 1, 1);
269
299
  return {
270
300
  value: r,
271
- text: e.format(J(i)),
272
- label: t.format(J(i)),
273
- disabled: yn(i, K(U.value, r + 2, 0)),
274
- selected: r === Bt.value
301
+ text: e.format(K(i)),
302
+ label: t.format(K(i)),
303
+ disabled: Sn(i, W(V.value, r + 2, 0)),
304
+ selected: r === Ut.value
275
305
  };
276
306
  });
277
- }), Ht = a(() => Array.from({ length: 12 }, (e, t) => {
307
+ }), Gt = a(() => Array.from({ length: 12 }, (e, t) => {
278
308
  let n = D.value + t;
279
309
  return {
280
310
  value: n,
281
311
  text: String(n),
282
312
  label: String(n),
283
- disabled: yn(K(n, 1, 1), K(n, 12, 31)),
284
- selected: n === U.value
313
+ disabled: Sn(W(n, 1, 1), W(n, 12, 31)),
314
+ selected: n === V.value
285
315
  };
286
- })), Ut = a(() => E.value === "months" ? Vt.value : Ht.value), Wt = a(() => [
316
+ })), Kt = a(() => E.value === "months" ? Wt.value : Gt.value), qt = a(() => [
287
317
  0,
288
318
  4,
289
319
  8
290
- ].map((e) => Ut.value.slice(e, e + 4))), Gt = a(() => Ut.value.some((e) => e.value === O.value) ? O.value : Ut.value[0].value), W = a(() => E.value === "days" ? Ot.value.format(J(T.value)) : E.value === "months" ? String(U.value) : `${D.value}–${D.value + 9}`), Kt = a(() => E.value === "days" ? ["Previous month", "Next month"] : E.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), qt = a(() => !R.value || !M.value ? null : N.value ?? j.value ?? null), G = a(() => M.value ? fn(M.value, P.h, P.m, P.s) : null), Jt = a(() => N.value ? fn(N.value, F.h, F.m, F.s) : null), Yt = a(() => {
291
- if (!z.value) return "";
292
- let e = R.value ? [G.value, Jt.value] : [G.value];
320
+ ].map((e) => Kt.value.slice(e, e + 4))), Jt = a(() => Kt.value.some((e) => e.value === O.value) ? O.value : Kt.value[0].value), H = a(() => E.value === "days" ? jt.value.format(K(T.value)) : E.value === "months" ? String(V.value) : `${D.value}–${D.value + 9}`), Yt = a(() => E.value === "days" ? ["Previous month", "Next month"] : E.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), Xt = a(() => !I.value || !j.value ? null : M.value ?? Et.value ?? null), U = a(() => j.value ? gn(j.value, N.h, N.m, N.s) : null), Zt = a(() => M.value ? gn(M.value, Dt.h, Dt.m, Dt.s) : null), Qt = a(() => {
321
+ if (!L.value) return "";
322
+ let e = I.value ? [U.value, Zt.value] : [U.value];
293
323
  for (let t of e) if (t !== null) {
294
- if (Pt.value !== null && t < Pt.value) return `Choose a time from ${Dt.value.format(Pt.value)}`;
295
- if (Ft.value !== null && t > Ft.value) return `Choose a time up to ${Dt.value.format(Ft.value)}`;
324
+ if (Lt.value !== null && t < Lt.value) return `Choose a time from ${At.value.format(Lt.value)}`;
325
+ if (Rt.value !== null && t > Rt.value) return `Choose a time up to ${At.value.format(Rt.value)}`;
296
326
  }
297
- return R.value && G.value !== null && Jt.value !== null && Jt.value < G.value ? "The end must be after the start" : "";
298
- }), Xt = a(() => b.mode === "duration" ? !0 : !M.value || R.value && !N.value ? !1 : !Yt.value), Zt = a(() => I.d * 86400 + I.h * 3600 + I.m * 60), Qt = a(() => {
327
+ return I.value && U.value !== null && Zt.value !== null && Zt.value < U.value ? "The end must be after the start" : "";
328
+ }), $t = a(() => b.mode === "duration" ? !0 : b.inline && !L.value ? !1 : !I.value || L.value && (!b.autoApply || !!Qt.value)), en = a(() => b.mode === "duration" ? !0 : !j.value || I.value && !M.value ? !1 : !Qt.value), tn = a(() => P.d * 86400 + P.h * 3600 + P.m * 60), nn = a(() => {
299
329
  let e = [{
300
330
  key: "start",
301
- label: R.value ? "Start" : "Time",
302
- clock: P
331
+ label: I.value ? "Start" : "Time",
332
+ clock: N
303
333
  }];
304
- return R.value && e.push({
334
+ return I.value && e.push({
305
335
  key: "end",
306
336
  label: "End",
307
- clock: F
337
+ clock: Dt
308
338
  }), e.map((e) => ({
309
339
  ...e,
310
- spinners: wn(e.clock, e.label)
340
+ spinners: En(e.clock, e.label)
311
341
  }));
312
- }), $t = a(() => [
313
- Cn("d", "Days", 0, 999, !1, !1, () => I.d, (e) => I.d = e),
314
- Cn("h", "Hours", 0, 23, !1, !1, () => I.h, (e) => I.h = e),
315
- Cn("m", "Minutes", 0, 59, !1, !1, () => I.m, (e) => I.m = e)
316
- ]), en = g(!1), tn = a(() => x.value || en.value), nn = a(() => [b.hint && xt, b.errorMsg && bt].filter(Boolean).join(" ") || void 0), rn = a(() => {
342
+ }), rn = a(() => [
343
+ Q("d", "Days", 0, 999, !1, !1, () => P.d, (e) => P.d = e),
344
+ Q("h", "Hours", 0, 23, !1, !1, () => P.h, (e) => P.h = e),
345
+ Q("m", "Minutes", 0, 59, !1, !1, () => P.m, (e) => P.m = e)
346
+ ]), an = g(!1), on = a(() => x.value || an.value), sn = a(() => [b.hint && St, b.errorMsg && xt].filter(Boolean).join(" ") || void 0), cn = a(() => {
317
347
  if (b.mode === "duration") return b.label || "Choose duration";
318
- let e = R.value ? "date range" : z.value ? "date and time" : "date";
348
+ let e = I.value ? "date range" : L.value ? "date and time" : "date";
319
349
  return b.label ? `${b.label}: choose ${e}` : `Choose ${e}`;
320
- }), an = a(() => b.mode === "duration" ? _e : R.value ? pe : fe);
321
- function on(e) {
350
+ }), ln = a(() => b.mode === "duration" ? _e : I.value ? pe : fe);
351
+ function un(e) {
322
352
  return String(e).padStart(2, "0");
323
353
  }
324
- function K(e, t, n) {
354
+ function W(e, t, n) {
325
355
  let r = new Date(Date.UTC(e, t - 1, n));
326
- return `${r.getUTCFullYear()}-${on(r.getUTCMonth() + 1)}-${on(r.getUTCDate())}`;
356
+ return `${r.getUTCFullYear()}-${un(r.getUTCMonth() + 1)}-${un(r.getUTCDate())}`;
327
357
  }
328
- function q(e) {
358
+ function G(e) {
329
359
  let [t, n, r] = e.split("-").map(Number);
330
360
  return {
331
361
  y: t,
@@ -333,39 +363,39 @@ var ye = ["for"], be = {
333
363
  d: r
334
364
  };
335
365
  }
336
- function J(e) {
337
- let { y: t, m: n, d: r } = q(e);
366
+ function K(e) {
367
+ let { y: t, m: n, d: r } = G(e);
338
368
  return new Date(Date.UTC(t, n - 1, r));
339
369
  }
340
- function Y(e, t) {
341
- let { y: n, m: r, d: i } = q(e);
342
- return K(n, r, i + t);
370
+ function q(e, t) {
371
+ let { y: n, m: r, d: i } = G(e);
372
+ return W(n, r, i + t);
343
373
  }
344
- function sn(e, t) {
345
- let { y: n, m: r, d: i } = q(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
346
- return K(n, r + t, Math.min(i, a));
374
+ function dn(e, t) {
375
+ let { y: n, m: r, d: i } = G(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
376
+ return W(n, r + t, Math.min(i, a));
347
377
  }
348
- function X(e) {
378
+ function J(e) {
349
379
  return `${e.slice(0, 7)}-01`;
350
380
  }
351
- function cn(e) {
352
- let { y: t, m: n } = q(e);
381
+ function fn(e) {
382
+ let { y: t, m: n } = G(e);
353
383
  return new Date(Date.UTC(t, n, 0)).getUTCDate();
354
384
  }
355
- function ln(e) {
356
- return J(e).getUTCDay();
385
+ function pn(e) {
386
+ return K(e).getUTCDay();
357
387
  }
358
- function un() {
388
+ function mn() {
359
389
  try {
360
390
  let e = new Intl.Locale(b.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
361
391
  if (t) return t % 7;
362
392
  } catch {}
363
393
  return 0;
364
394
  }
365
- function Z(e) {
366
- let t = St.get(L.value);
395
+ function Y(e) {
396
+ let t = Ct.get(F.value);
367
397
  t || (t = new Intl.DateTimeFormat("en-US", {
368
- timeZone: L.value,
398
+ timeZone: F.value,
369
399
  hourCycle: "h23",
370
400
  year: "numeric",
371
401
  month: "2-digit",
@@ -373,53 +403,53 @@ var ye = ["for"], be = {
373
403
  hour: "2-digit",
374
404
  minute: "2-digit",
375
405
  second: "2-digit"
376
- }), St.set(L.value, t));
406
+ }), Ct.set(F.value, t));
377
407
  let n = {};
378
408
  for (let { type: r, value: i } of t.formatToParts(e)) r !== "literal" && (n[r] = Number(i));
379
409
  return {
380
- day: K(n.year, n.month, n.day),
410
+ day: W(n.year, n.month, n.day),
381
411
  h: n.hour % 24,
382
412
  m: n.minute,
383
413
  s: n.second
384
414
  };
385
415
  }
386
- function dn(e) {
387
- let t = Z(e), { y: n, m: r, d: i } = q(t.day);
416
+ function hn(e) {
417
+ let t = Y(e), { y: n, m: r, d: i } = G(t.day);
388
418
  return Date.UTC(n, r - 1, i, t.h, t.m, t.s) - Math.floor(e / 1e3) * 1e3;
389
419
  }
390
- function fn(e, t, n, r) {
391
- let { y: i, m: a, d: o } = q(e), s = Date.UTC(i, a - 1, o, t, n, r), c = dn(s), l = s - c, u = dn(l);
420
+ function gn(e, t, n, r) {
421
+ let { y: i, m: a, d: o } = G(e), s = Date.UTC(i, a - 1, o, t, n, r), c = hn(s), l = s - c, u = hn(l);
392
422
  return u === c ? l : s - u;
393
423
  }
394
- function Q(e) {
395
- let t = lt.exec(e);
396
- if (t) return fn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
397
- if (ct.test(e)) return fn(e, 0, 0, 0);
424
+ function X(e) {
425
+ let t = ut.exec(e);
426
+ if (t) return gn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
427
+ if (lt.test(e)) return gn(e, 0, 0, 0);
398
428
  let n = Date.parse(e);
399
429
  return Number.isNaN(n) ? null : n;
400
430
  }
401
- function pn(e) {
402
- if (ct.test(e)) return e;
403
- let t = Q(e);
404
- return t === null ? null : Z(t).day;
431
+ function _n(e) {
432
+ if (lt.test(e)) return e;
433
+ let t = X(e);
434
+ return t === null ? null : Y(t).day;
405
435
  }
406
- function mn(e) {
436
+ function Z(e) {
407
437
  return new Date(e).toISOString().replace(/\.000Z$/, "Z");
408
438
  }
409
- function hn(e) {
439
+ function vn(e) {
410
440
  let t = e.replace(/\s+/g, "");
411
441
  if (!t) return null;
412
442
  if (t === "0") return 0;
413
443
  let n = /(\d+(?:\.\d+)?)(ns|us|µs|ms|w|d|h|m|s)/y, r = 0, i = 0, a;
414
- for (; a = n.exec(t);) r += Number(a[1]) * ut[a[2]], i = n.lastIndex;
444
+ for (; a = n.exec(t);) r += Number(a[1]) * dt[a[2]], i = n.lastIndex;
415
445
  return i === t.length ? r : null;
416
446
  }
417
- function gn(e) {
447
+ function yn(e) {
418
448
  if (e <= 0) return null;
419
449
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.round(e % 60);
420
450
  return `${t ? `${t}h` : ""}${n ? `${n}m` : ""}${r ? `${r}s` : ""}` || null;
421
451
  }
422
- function _n(e) {
452
+ function bn(e) {
423
453
  let t = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), i = Math.round(e % 60);
424
454
  return [
425
455
  t && `${t}d`,
@@ -428,26 +458,26 @@ var ye = ["for"], be = {
428
458
  i && `${i}s`
429
459
  ].filter(Boolean).join(" ") || "0m";
430
460
  }
431
- function vn(e) {
432
- return B.value && e < B.value || V.value && e > V.value ? !0 : b.isDateDisabled?.(e) ?? !1;
461
+ function xn(e) {
462
+ return R.value && e < R.value || z.value && e > z.value ? !0 : b.isDateDisabled?.(e) ?? !1;
433
463
  }
434
- function yn(e, t) {
435
- return !!B.value && t < B.value || !!V.value && e > V.value;
464
+ function Sn(e, t) {
465
+ return !!R.value && t < R.value || !!z.value && e > z.value;
436
466
  }
437
- function bn(e) {
438
- return e === M.value || R.value && e === (N.value ?? qt.value);
467
+ function Cn(e) {
468
+ return e === j.value || I.value && e === (M.value ?? Xt.value);
439
469
  }
440
- function xn(e) {
441
- let t = M.value, n = qt.value;
470
+ function wn(e) {
471
+ let t = j.value, n = Xt.value;
442
472
  if (!t || !n) return !1;
443
473
  let [r, i] = t <= n ? [t, n] : [n, t];
444
474
  return e >= r && e <= i;
445
475
  }
446
- function Sn(e) {
447
- let t = M.value, n = qt.value, [r, i] = t <= n ? [t, n] : [n, t];
476
+ function Tn(e) {
477
+ let t = j.value, n = Xt.value, [r, i] = t <= n ? [t, n] : [n, t];
448
478
  return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
449
479
  }
450
- function Cn(e, t, n, r, i, a, o, s) {
480
+ function Q(e, t, n, r, i, a, o, s) {
451
481
  return {
452
482
  key: e,
453
483
  label: t,
@@ -459,65 +489,80 @@ var ye = ["for"], be = {
459
489
  set: s
460
490
  };
461
491
  }
462
- function wn(e, t) {
463
- let n = [Cn("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Cn("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
464
- return b.showSeconds && n.push(Cn("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n;
465
- }
466
- function Tn(e) {
467
- return e.padded ? on(e.get()) : String(e.get());
468
- }
469
492
  function En(e, t) {
493
+ let n = b.hourCycle === 12, r = [n ? {
494
+ ...Q("h", `${t} hours`, 0, 11, !0, !0, () => e.h % 12, (t) => e.h = t + (e.h >= 12 ? 12 : 0)),
495
+ text: (e) => un(e || 12)
496
+ } : Q("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Q("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
497
+ return b.showSeconds && r.push(Q("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n && r.push({
498
+ ...Q("p", `${t} AM or PM`, 0, 12, !1, !1, () => e.h >= 12 ? 12 : 0, (t) => e.h = e.h % 12 + t),
499
+ values: [0, 12],
500
+ text: (e) => e ? "PM" : "AM"
501
+ }), r;
502
+ }
503
+ function Dn(e) {
504
+ return e.padded ? un(e.get()) : String(e.get());
505
+ }
506
+ function On(e, t) {
470
507
  let n = t.get(), r = t.max - t.min + 1, i = null;
471
- e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = Tn(t));
508
+ e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = Dn(t));
472
509
  }
473
- function Dn(e, t) {
510
+ function kn(e, t) {
474
511
  let n = e.target, r = n.value.replace(/\D/g, "").slice(0, String(t.max).length);
475
512
  if (n.value = r, !r) return;
476
513
  let i = Number(r);
477
514
  i > t.max && (i = Number(r.slice(-1))), t.set(Math.max(t.min, i));
478
515
  }
479
- function On(e, t) {
480
- e.target.value = Tn(t);
516
+ function An(e, t) {
517
+ e.target.value = Dn(t);
481
518
  }
482
- function kn() {
483
- if (j.value = null, E.value = "days", k.value = "date", b.mode === "duration") {
484
- let e = H.value[0] ? hn(H.value[0]) ?? 0 : 0;
485
- I.d = Math.floor(e / 86400), I.h = Math.floor(e % 86400 / 3600), I.m = Math.floor(e % 3600 / 60);
519
+ function jn(e = !0) {
520
+ if (Et.value = null, e && (E.value = "days", k.value = "date"), b.mode === "duration") {
521
+ let e = B.value[0] ? vn(B.value[0]) ?? 0 : 0;
522
+ P.d = Math.floor(e / 86400), P.h = Math.floor(e % 86400 / 3600), P.m = Math.floor(e % 3600 / 60);
486
523
  return;
487
524
  }
488
- let [e, t] = H.value;
489
- if (M.value = null, N.value = null, Object.assign(P, {
525
+ let [t, n] = B.value;
526
+ if (j.value = null, M.value = null, Object.assign(N, {
490
527
  h: 0,
491
528
  m: 0,
492
529
  s: 0
493
- }), Object.assign(F, {
530
+ }), Object.assign(Dt, {
494
531
  h: 23,
495
532
  m: 59,
496
533
  s: b.showSeconds ? 59 : 0
497
- }), z.value) {
498
- let n = e ? Q(e) : null, r = t ? Q(t) : null;
499
- if (n !== null) {
500
- let e = Z(n);
501
- M.value = e.day, Object.assign(P, {
502
- h: e.h,
503
- m: e.m,
504
- s: e.s
534
+ }), b.autoApply) {
535
+ let e = Y(Date.now());
536
+ Object.assign(N, {
537
+ h: e.h,
538
+ m: e.m,
539
+ s: 0
540
+ });
541
+ }
542
+ if (L.value) {
543
+ let e = t ? X(t) : null, r = n ? X(n) : null;
544
+ if (e !== null) {
545
+ let t = Y(e);
546
+ j.value = t.day, Object.assign(N, {
547
+ h: t.h,
548
+ m: t.m,
549
+ s: t.s
505
550
  });
506
551
  }
507
552
  if (r !== null) {
508
- let e = Z(r);
509
- N.value = e.day, Object.assign(F, {
553
+ let e = Y(r);
554
+ M.value = e.day, Object.assign(Dt, {
510
555
  h: e.h,
511
556
  m: e.m,
512
557
  s: e.s
513
558
  });
514
559
  }
515
- } else M.value = e ? pn(e) : null, N.value = t ? pn(t) : null;
516
- let n = M.value ?? Nt.value;
517
- !M.value && B.value && n < B.value && (n = B.value), !M.value && V.value && n > V.value && (n = V.value), A.value = n, T.value = X(n);
560
+ } else j.value = t ? _n(t) : null, M.value = n ? _n(n) : null;
561
+ let r = j.value ?? It.value;
562
+ !j.value && R.value && r < R.value && (r = R.value), !j.value && z.value && r > z.value && (r = z.value), A.value = r, T.value = J(r);
518
563
  }
519
- function An() {
520
- let e = wt.value;
564
+ function Mn() {
565
+ let e = Tt.value;
521
566
  if (!e) return;
522
567
  let n = e.getBoundingClientRect(), r = t(), i = C.value?.offsetWidth ?? 300, a = C.value?.offsetHeight ?? 380, 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);
523
568
  w.value = c ? {
@@ -532,96 +577,102 @@ var ye = ["for"], be = {
532
577
  minWidth: u
533
578
  };
534
579
  }
535
- function jn() {
580
+ function Nn() {
536
581
  b.disabled || x.value || (x.value = !0);
537
582
  }
538
- function Mn(e = !0) {
539
- x.value && (x.value = !1, e && wt.value?.focus());
583
+ function Pn(e = !0) {
584
+ x.value && (x.value = !1, e && Tt.value?.focus());
540
585
  }
541
- async function Nn() {
542
- kn(), An(), or(), await p(), An(), b.mode === "duration" ? C.value?.querySelector("input")?.focus() : Pn();
586
+ async function Fn() {
587
+ jn(), Mn(), ur(), await p(), Mn(), b.mode === "duration" ? C.value?.querySelector("input")?.focus() : In();
543
588
  }
544
- function Pn() {
589
+ function In() {
545
590
  p(() => C.value?.querySelector(`[data-day="${A.value}"]`)?.focus());
546
591
  }
547
- function $(e) {
548
- st.value = e, Mn();
592
+ function $(e, t = !0) {
593
+ ct.value = e, t && Pn();
594
+ }
595
+ function Ln() {
596
+ b.autoApply && L.value && (I.value || (j.value ??= A.value), en.value && $(I.value ? [Z(U.value), Z(Zt.value)] : Z(U.value), !1));
549
597
  }
550
- function Fn(e) {
551
- if (!vn(e)) {
552
- if (A.value = e, X(e) !== T.value && (T.value = X(e), Pn()), !R.value) {
553
- M.value = e, z.value || $(e);
598
+ function Rn() {
599
+ b.inline ? jn(!1) : Pn();
600
+ }
601
+ function zn(e) {
602
+ if (!xn(e)) {
603
+ if (A.value = e, J(e) !== T.value && (T.value = J(e), In()), !I.value) {
604
+ j.value = e, L.value ? Ln() : $(e);
554
605
  return;
555
606
  }
556
- if (!M.value || N.value) {
557
- M.value = e, N.value = null;
607
+ if (!j.value || M.value) {
608
+ j.value = e, M.value = null;
558
609
  return;
559
610
  }
560
- e < M.value ? (N.value = M.value, M.value = e) : N.value = e, j.value = null, z.value || $([M.value, N.value]);
611
+ e < j.value ? (M.value = j.value, j.value = e) : M.value = e, Et.value = null, L.value ? Ln() : $([j.value, M.value]);
561
612
  }
562
613
  }
563
- function In() {
564
- if (Xt.value) {
565
- if (b.mode === "duration") return $(gn(Zt.value));
566
- if (!z.value) return $(R.value ? [M.value, N.value] : M.value);
567
- $(R.value ? [mn(G.value), mn(Jt.value)] : mn(G.value));
614
+ function Bn() {
615
+ if (en.value) {
616
+ if (b.mode === "duration") return $(yn(tn.value));
617
+ if (!L.value) return $(I.value ? [j.value, M.value] : j.value);
618
+ $(I.value ? [Z(U.value), Z(Zt.value)] : Z(U.value));
568
619
  }
569
620
  }
570
- function Ln() {
571
- let e = Z(Date.now());
572
- M.value = e.day, Object.assign(P, {
621
+ function Vn() {
622
+ let e = Y(Date.now());
623
+ j.value = e.day, Object.assign(N, {
573
624
  h: e.h,
574
625
  m: e.m,
575
626
  s: b.showSeconds ? e.s : 0
576
- }), A.value = e.day, T.value = X(e.day), E.value = "days", k.value === "time" && p(() => Zn("smooth"));
627
+ }), A.value = e.day, T.value = J(e.day), E.value = "days", Ln(), k.value === "time" && p(() => tr("smooth"));
577
628
  }
578
- function Rn() {
579
- Fn(Nt.value);
629
+ function Hn() {
630
+ zn(It.value);
580
631
  }
581
- function zn(e) {
632
+ function Un(e) {
582
633
  if (e.value) return $(e.value());
583
634
  if (!e.duration) return;
584
- if (b.mode === "duration") return $(gn(hn(e.duration) ?? 0));
585
- let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (hn(e.duration) ?? 0) * 1e3;
586
- if (b.mode === "date") return $(R.value ? [Z(n).day, Z(t).day] : Z(n).day);
587
- $(R.value ? [mn(n), mn(t)] : mn(n));
635
+ if (b.mode === "duration") return $(yn(vn(e.duration) ?? 0));
636
+ let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (vn(e.duration) ?? 0) * 1e3;
637
+ if (b.mode === "date") return $(I.value ? [Y(n).day, Y(t).day] : Y(n).day);
638
+ $(I.value ? [Z(n), Z(t)] : Z(n));
588
639
  }
589
- function Bn() {
590
- st.value = null, wt.value?.focus();
640
+ function Wn() {
641
+ ct.value = null, Tt.value?.focus();
591
642
  }
592
- function Vn(e) {
593
- T.value = sn(T.value, e), A.value = sn(A.value, e);
643
+ function Gn(e) {
644
+ T.value = dn(T.value, e), A.value = dn(A.value, e);
594
645
  }
595
- function Hn(e) {
596
- E.value === "days" ? Vn(e) : E.value === "months" ? T.value = sn(T.value, 12 * e) : D.value += 10 * e;
646
+ function Kn(e) {
647
+ E.value === "days" ? Gn(e) : E.value === "months" ? T.value = dn(T.value, 12 * e) : D.value += 10 * e;
597
648
  }
598
- function Un() {
599
- E.value = "months", O.value = Bt.value, Gn();
649
+ function qn() {
650
+ E.value = "months", O.value = Ut.value, Yn();
600
651
  }
601
- function Wn() {
602
- E.value = "years", D.value = Math.floor(U.value / 10) * 10, O.value = U.value, Gn();
652
+ function Jn() {
653
+ E.value = "years", D.value = Math.floor(V.value / 10) * 10, O.value = V.value, Yn();
603
654
  }
604
- function Gn() {
605
- p(() => C.value?.querySelector(`[data-pick="${Gt.value}"]`)?.focus());
655
+ function Yn() {
656
+ p(() => C.value?.querySelector(`[data-pick="${Jt.value}"]`)?.focus());
606
657
  }
607
- function Kn(e) {
658
+ function Xn(e) {
608
659
  if (!e.disabled) {
609
660
  if (E.value === "years") {
610
- T.value = K(e.value, Bt.value + 1, 1), Un();
661
+ T.value = W(e.value, Ut.value + 1, 1), qn();
611
662
  return;
612
663
  }
613
- T.value = K(U.value, e.value + 1, 1), A.value = K(U.value, e.value + 1, Math.min(q(A.value).d, cn(T.value))), E.value = "days", Pn();
664
+ T.value = W(V.value, e.value + 1, 1), A.value = W(V.value, e.value + 1, Math.min(G(A.value).d, fn(T.value))), E.value = "days", In();
614
665
  }
615
666
  }
616
- function qn(e) {
667
+ function Zn(e) {
617
668
  if (e.key === "Escape") {
618
- e.preventDefault(), e.stopPropagation(), E.value === "years" ? Un() : (E.value = "days", Pn());
669
+ e.preventDefault(), e.stopPropagation(), E.value === "years" ? qn() : (E.value = "days", In());
619
670
  return;
620
671
  }
621
672
  if (e.key === "Enter" || e.key === " ") {
622
673
  e.preventDefault();
623
- let t = Ut.value.find((e) => e.value === O.value);
624
- t && Kn(t);
674
+ let t = Kt.value.find((e) => e.value === O.value);
675
+ t && Xn(t);
625
676
  return;
626
677
  }
627
678
  let t = E.value === "years", n = t ? D.value : 0, r = {
@@ -634,15 +685,15 @@ var ye = ["for"], be = {
634
685
  else if (e.key === "Home") i = n;
635
686
  else if (e.key === "End") i = n + 11;
636
687
  else if (e.key === "PageUp" || e.key === "PageDown") {
637
- e.preventDefault(), Hn(e.key === "PageUp" ? -1 : 1), t && (O.value += e.key === "PageUp" ? -10 : 10), Gn();
688
+ e.preventDefault(), Kn(e.key === "PageUp" ? -1 : 1), t && (O.value += e.key === "PageUp" ? -10 : 10), Yn();
638
689
  return;
639
690
  } else return;
640
- e.preventDefault(), t ? i < D.value ? D.value -= 10 : i > D.value + 11 && (D.value += 10) : i = Math.max(0, Math.min(11, i)), O.value = i, Gn();
691
+ e.preventDefault(), t ? i < D.value ? D.value -= 10 : i > D.value + 11 && (D.value += 10) : i = Math.max(0, Math.min(11, i)), O.value = i, Yn();
641
692
  }
642
- function Jn(e) {
643
- k.value = e, e === "time" && p(() => Zn("instant"));
693
+ function Qn(e) {
694
+ k.value = e, e === "time" && p(() => tr("instant"));
644
695
  }
645
- function Yn(e) {
696
+ function $n(e) {
646
697
  if (![
647
698
  "ArrowLeft",
648
699
  "ArrowRight",
@@ -651,12 +702,12 @@ var ye = ["for"], be = {
651
702
  ].includes(e.key)) return;
652
703
  e.preventDefault();
653
704
  let t = e.key === "Home" ? "date" : e.key === "End" || k.value === "date" ? "time" : "date";
654
- Jn(t), p(() => C.value?.querySelector(`[data-tab="${t}"]`)?.focus());
705
+ Qn(t), p(() => C.value?.querySelector(`[data-tab="${t}"]`)?.focus());
655
706
  }
656
- function Xn(e) {
657
- return Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
707
+ function er(e) {
708
+ return e.values ?? Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
658
709
  }
659
- function Zn(e) {
710
+ function tr(e) {
660
711
  let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
661
712
  C.value?.querySelectorAll("[data-time-list]").forEach((e) => {
662
713
  let n = e.querySelector("[aria-selected=true]");
@@ -666,52 +717,53 @@ var ye = ["for"], be = {
666
717
  });
667
718
  });
668
719
  }
669
- function Qn(e) {
720
+ function nr(e) {
670
721
  C.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
671
722
  }
672
- function $n(e, t, n) {
673
- e.set(t), p(() => {
674
- Zn("smooth"), Qn(n);
723
+ function rr(e, t, n) {
724
+ e.set(t), Ln(), p(() => {
725
+ tr("smooth"), nr(n);
675
726
  });
676
727
  }
677
- function er(e, t, n) {
728
+ function ir(e, t, n) {
678
729
  if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
679
730
  e.preventDefault();
680
731
  let t = [...C.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
681
- r && Qn(r);
732
+ r && nr(r);
682
733
  return;
683
734
  }
684
- let r = t.get(), i = {
685
- ArrowUp: r - 1,
686
- ArrowDown: r + 1,
687
- PageUp: r - 5,
688
- PageDown: r + 5,
689
- Home: t.min,
690
- End: t.max
735
+ let r = er(t), i = r.indexOf(t.get()), a = {
736
+ ArrowUp: i - 1,
737
+ ArrowDown: i + 1,
738
+ PageUp: i - 5,
739
+ PageDown: i + 5,
740
+ Home: 0,
741
+ End: r.length - 1
691
742
  };
692
- e.key in i && (e.preventDefault(), $n(t, Math.min(t.max, Math.max(t.min, i[e.key])), n));
743
+ e.key in a && (e.preventDefault(), rr(t, r[Math.min(r.length - 1, Math.max(0, a[e.key]))], n));
693
744
  }
694
- function tr(e) {
695
- let t = A.value, n = (ln(t) - Tt.value + 7) % 7, r = {
696
- ArrowLeft: () => Y(t, -1),
697
- ArrowRight: () => Y(t, 1),
698
- ArrowUp: () => Y(t, -7),
699
- ArrowDown: () => Y(t, 7),
700
- Home: () => Y(t, -n),
701
- End: () => Y(t, 6 - n),
702
- PageUp: () => sn(t, e.shiftKey ? -12 : -1),
703
- PageDown: () => sn(t, e.shiftKey ? 12 : 1)
745
+ function ar(e) {
746
+ let t = A.value, n = (pn(t) - Ot.value + 7) % 7, r = {
747
+ ArrowLeft: () => q(t, -1),
748
+ ArrowRight: () => q(t, 1),
749
+ ArrowUp: () => q(t, -7),
750
+ ArrowDown: () => q(t, 7),
751
+ Home: () => q(t, -n),
752
+ End: () => q(t, 6 - n),
753
+ PageUp: () => dn(t, e.shiftKey ? -12 : -1),
754
+ PageDown: () => dn(t, e.shiftKey ? 12 : 1)
704
755
  };
705
756
  if (e.key === "Enter" || e.key === " ") {
706
- e.preventDefault(), Fn(t);
757
+ e.preventDefault(), zn(t);
707
758
  return;
708
759
  }
709
760
  let i = r[e.key];
710
- i && (e.preventDefault(), A.value = i(), T.value = X(A.value), R.value && M.value && !N.value && (j.value = A.value), Pn());
761
+ i && (e.preventDefault(), A.value = i(), T.value = J(A.value), I.value && j.value && !M.value && (Et.value = A.value), In());
711
762
  }
712
- function nr(e) {
763
+ function or(e) {
764
+ if (b.inline) return;
713
765
  if (e.key === "Escape") {
714
- e.preventDefault(), e.stopPropagation(), Mn();
766
+ e.preventDefault(), e.stopPropagation(), Pn();
715
767
  return;
716
768
  }
717
769
  if (e.key !== "Tab" || !C.value) return;
@@ -720,127 +772,126 @@ var ye = ["for"], be = {
720
772
  let n = t[0], r = t[t.length - 1];
721
773
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
722
774
  }
723
- function rr(e) {
724
- (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), jn());
775
+ function sr(e) {
776
+ (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), Nn());
725
777
  }
726
- function ir(e) {
778
+ function cr(e) {
727
779
  let t = e.target;
728
- Ct.value?.contains(t) || C.value?.contains(t) || Mn(!1);
780
+ wt.value?.contains(t) || C.value?.contains(t) || Pn(!1);
729
781
  }
730
- function ar(e) {
731
- e?.target instanceof Node && C.value?.contains(e.target) || An();
782
+ function lr(e) {
783
+ e?.target instanceof Node && C.value?.contains(e.target) || Mn();
732
784
  }
733
- function or() {
734
- document.addEventListener("pointerdown", ir, !0), window.addEventListener("scroll", ar, !0), window.addEventListener("resize", ar);
785
+ function ur() {
786
+ document.addEventListener("pointerdown", cr, !0), window.addEventListener("scroll", lr, !0), window.addEventListener("resize", lr);
735
787
  }
736
- function sr() {
737
- document.removeEventListener("pointerdown", ir, !0), window.removeEventListener("scroll", ar, !0), window.removeEventListener("resize", ar);
788
+ function dr() {
789
+ document.removeEventListener("pointerdown", cr, !0), window.removeEventListener("scroll", lr, !0), window.removeEventListener("resize", lr);
738
790
  }
739
- return ue(x, (e) => e ? Nn() : sr()), ie(() => {
740
- x.value && Nn();
741
- }), re(sr), ee({ focus: () => wt.value?.focus() }), (t, a) => (h(), c("div", te({
791
+ return ue(x, (e) => e ? Fn() : dr()), ue(ct, () => b.inline && jn(!1)), re(() => {
792
+ b.inline ? jn() : x.value && Fn();
793
+ }), ne(dr), ee({ focus: () => b.inline ? In() : Tt.value?.focus() }), (t, a) => (h(), c("div", te({
742
794
  ref_key: "root",
743
- ref: Ct
744
- }, ht.value, {
795
+ ref: wt
796
+ }, gt.value, {
745
797
  class: ["w-full", f.disabled && "opacity-50"],
746
798
  "data-ac-ds": "",
747
799
  "data-testid": "ac-date-picker"
748
800
  }), [
749
- f.label ? (h(), c("label", {
801
+ f.label || t.$slots["label-icon"] || t.$slots["label-extra"] ? (h(), c("label", {
750
802
  key: 0,
751
- id: _t,
752
- for: `${y(S)}-trigger`,
803
+ id: vt,
804
+ for: f.inline ? void 0 : `${y(S)}-trigger`,
753
805
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
754
- }, [l("span", null, v(f.label), 1), f.required ? (h(), c("span", be, "*")) : s("", !0)], 8, ye)) : s("", !0),
806
+ }, [
807
+ ae(t.$slots, "label-icon"),
808
+ f.label ? (h(), c("span", be, v(f.label), 1)) : s("", !0),
809
+ ae(t.$slots, "label-extra"),
810
+ f.required ? (h(), c("span", xe, "*")) : s("", !0)
811
+ ], 8, ye)) : s("", !0),
755
812
  f.hint ? (h(), c("p", {
756
813
  key: 1,
757
- id: xt,
814
+ id: St,
758
815
  class: "mb-2 text-base text-muted"
759
816
  }, v(f.hint), 1)) : s("", !0),
760
- l("div", xe, [l("button", te({
817
+ f.inline ? s("", !0) : (h(), c("div", Se, [l("button", te({
761
818
  id: `${y(S)}-trigger`,
762
819
  ref_key: "trigger",
763
- ref: wt
764
- }, gt.value, {
820
+ ref: Tt
821
+ }, _t.value, {
765
822
  type: "button",
766
823
  disabled: f.disabled,
767
824
  "aria-haspopup": "dialog",
768
825
  "aria-expanded": x.value,
769
- "aria-labelledby": f.label ? `${_t} ${vt}` : vt,
770
- "aria-describedby": nn.value,
826
+ "aria-labelledby": f.label || t.$slots["label-icon"] || t.$slots["label-extra"] ? `${vt} ${yt}` : yt,
827
+ "aria-describedby": sn.value,
771
828
  "aria-invalid": !!f.errorMsg || void 0,
772
829
  "aria-required": f.required || void 0,
773
830
  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", [
774
831
  f.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
775
- f.clearable && It.value && !f.disabled ? "pr-20" : "pr-10",
832
+ f.clearable && zt.value && !f.disabled ? "pr-20" : "pr-10",
776
833
  f.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
777
- f.errorMsg ? ["border-danger/60", tn.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : tn.value ? "focus-ring" : ["border-border", !f.disabled && "hover:border-accent-active"]
834
+ f.errorMsg ? ["border-danger/60", on.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : on.value ? "focus-ring" : ["border-border", !f.disabled && "hover:border-accent-active"]
778
835
  ]],
779
- onClick: a[0] ||= (e) => x.value ? Mn() : jn(),
780
- onKeydown: rr,
781
- onFocus: a[1] ||= (e) => en.value = !0,
782
- onBlur: a[2] ||= (e) => en.value = !1
836
+ onClick: a[0] ||= (e) => x.value ? Pn() : Nn(),
837
+ onKeydown: sr,
838
+ onFocus: a[1] ||= (e) => an.value = !0,
839
+ onBlur: a[2] ||= (e) => an.value = !1
783
840
  }), [l("span", {
784
- id: vt,
785
- class: m(["truncate tabular-nums", !Lt.value && "text-muted/80"])
786
- }, v(Lt.value || f.placeholder || (f.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Se), l("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", f.size === "small" ? "right-3" : "right-4"]) }, [f.clearable && It.value && !f.disabled ? (h(), c("button", {
841
+ id: yt,
842
+ class: m(["truncate tabular-nums", !Bt.value && "text-muted/80"])
843
+ }, v(Bt.value || f.placeholder || (f.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Ce), l("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", f.size === "small" ? "right-3" : "right-4"]) }, [f.clearable && zt.value && !f.disabled ? (h(), c("button", {
787
844
  key: 0,
788
845
  type: "button",
789
846
  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",
790
847
  "aria-label": f.label ? `Clear ${f.label}` : "Clear",
791
- onClick: Bn
848
+ onClick: Wn
792
849
  }, [d(y(ve), {
793
850
  class: "size-4",
794
851
  "aria-hidden": "true"
795
- })], 8, Ce)) : s("", !0), (h(), o(oe(an.value), {
852
+ })], 8, we)) : s("", !0), (h(), o(oe(ln.value), {
796
853
  class: m(["size-4", x.value && "text-heading"]),
797
854
  "aria-hidden": "true"
798
- }, null, 8, ["class"]))], 2)]),
799
- f.errorMsg ? (h(), c("p", {
800
- key: 2,
801
- id: bt,
802
- class: "mt-1 text-base text-danger-strong",
803
- role: "alert"
804
- }, v(f.errorMsg), 1)) : s("", !0),
805
- f.name ? (h(), c("input", {
806
- key: 3,
807
- type: "hidden",
808
- name: f.name,
809
- value: Rt.value
810
- }, null, 8, we)) : s("", !0),
811
- (h(), o(r, { to: "body" }, [d(i, {
855
+ }, null, 8, ["class"]))], 2)])),
856
+ (h(), o(r, {
857
+ to: "body",
858
+ disabled: f.inline
859
+ }, [d(i, {
812
860
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
813
861
  "enter-from-class": "opacity-0 scale-95",
814
862
  "leave-active-class": "transition duration-100 ease-in",
815
863
  "leave-to-class": "opacity-0"
816
864
  }, {
817
- default: de(() => [x.value ? (h(), c("div", {
865
+ default: de(() => [x.value || f.inline ? (h(), c("div", te({
818
866
  key: 0,
819
867
  ref_key: "panel",
820
868
  ref: C,
821
- role: "dialog",
822
- "aria-modal": "true",
823
- "aria-label": rn.value,
824
- class: "ac-scrollbar fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col rounded-10 border border-border bg-surface shadow-sm sm:flex-row",
825
- style: ne({
869
+ role: f.inline ? "group" : "dialog",
870
+ "aria-modal": f.inline ? void 0 : "true",
871
+ "aria-label": cn.value,
872
+ "aria-describedby": f.inline ? sn.value : void 0,
873
+ inert: f.inline && f.disabled
874
+ }, f.inline ? _t.value : void 0, {
875
+ class: ["flex flex-col sm:flex-row", !f.inline && "ac-scrollbar fixed z-[90] max-w-[calc(100vw-16px)] rounded-10 border border-border bg-surface shadow-sm"],
876
+ style: f.inline ? void 0 : {
826
877
  top: w.value.top === void 0 ? void 0 : `${w.value.top}px`,
827
878
  bottom: w.value.bottom === void 0 ? void 0 : `${w.value.bottom}px`,
828
879
  left: `${w.value.left}px`,
829
880
  maxHeight: `${w.value.maxHeight}px`,
830
881
  minWidth: `${w.value.minWidth}px`
831
- }),
882
+ },
832
883
  "data-ac-ds": "",
833
884
  "data-testid": "ac-date-picker-panel",
834
- onKeydown: nr
835
- }, [f.presets.length ? (h(), c("div", Ee, [(h(!0), c(n, null, _(f.presets, (e) => (h(), c("button", {
885
+ onKeydown: or
886
+ }), [f.presets.length ? (h(), c("div", Ee, [(h(!0), c(n, null, _(f.presets, (e) => (h(), c("button", {
836
887
  key: e.label,
837
888
  type: "button",
838
889
  class: "cursor-pointer rounded-8 px-3 py-2 text-left text-base 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 focus-visible:ring-inset max-sm:rounded-full max-sm:border max-sm:border-border max-sm:px-2.5 max-sm:py-1 max-sm:text-xs",
839
- onClick: (t) => zn(e)
840
- }, v(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: m(["max-w-full min-w-0 flex-auto max-sm:w-auto", f.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [f.mode === "duration" ? (h(), c("div", Oe, [
890
+ onClick: (t) => Un(e)
891
+ }, v(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: m(["max-w-full min-w-0 flex-auto max-sm:w-auto", f.inline ? "w-full" : f.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [f.mode === "duration" ? (h(), c("div", Oe, [
841
892
  l("p", ke, v(f.label || "Duration"), 1),
842
- l("p", Ae, v(_n(Zt.value)), 1),
843
- l("div", je, [(h(!0), c(n, null, _($t.value, (e) => (h(), c("label", {
893
+ l("p", Ae, v(bn(tn.value)), 1),
894
+ l("div", je, [(h(!0), c(n, null, _(rn.value, (e) => (h(), c("label", {
844
895
  key: e.key,
845
896
  class: "block"
846
897
  }, [l("span", Me, v(e.label), 1), l("input", {
@@ -848,24 +899,24 @@ var ye = ["for"], be = {
848
899
  inputmode: "numeric",
849
900
  role: "spinbutton",
850
901
  autocomplete: "off",
851
- value: Tn(e),
902
+ value: Dn(e),
852
903
  "aria-valuenow": e.get(),
853
904
  "aria-valuemin": e.min,
854
905
  "aria-valuemax": e.max,
855
906
  class: "h-10 w-full rounded-10 border border-border bg-background px-2.5 text-center text-base text-heading tabular-nums transition-[border-color,box-shadow] duration-200 outline-none hover:border-accent-active focus:focus-ring",
856
- onKeydown: (t) => En(t, e),
857
- onInput: (t) => Dn(t, e),
858
- onBlur: (t) => On(t, e),
907
+ onKeydown: (t) => On(t, e),
908
+ onInput: (t) => kn(t, e),
909
+ onBlur: (t) => An(t, e),
859
910
  onFocus: a[3] ||= (e) => e.target.select()
860
911
  }, null, 40, Ne)]))), 128))]),
861
- a[10] ||= l("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
862
- ])) : (h(), c(n, { key: 1 }, [z.value ? (h(), c("div", {
912
+ a[9] ||= l("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
913
+ ])) : (h(), c(n, { key: 1 }, [L.value ? (h(), c("div", {
863
914
  key: 0,
864
915
  role: "tablist",
865
916
  "aria-label": "Date or time",
866
917
  class: "flex border-b border-border",
867
- onKeydown: Yn
868
- }, [(h(), c(n, null, _(pt, (e) => l("button", {
918
+ onKeydown: $n
919
+ }, [(h(), c(n, null, _(mt, (e) => l("button", {
869
920
  id: `${y(S)}-tab-${e.key}`,
870
921
  key: e.key,
871
922
  type: "button",
@@ -875,42 +926,42 @@ var ye = ["for"], be = {
875
926
  "aria-controls": `${y(S)}-tabpanel`,
876
927
  tabindex: k.value === e.key ? 0 : -1,
877
928
  class: m(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", k.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
878
- onClick: (t) => Jn(e.key)
929
+ onClick: (t) => Qn(e.key)
879
930
  }, [(h(), o(oe(e.icon), {
880
931
  class: "size-4",
881
932
  "aria-hidden": "true"
882
933
  })), u(" " + v(e.label), 1)], 10, Pe)), 64))], 32)) : s("", !0), l("div", {
883
934
  id: `${y(S)}-tabpanel`,
884
935
  class: "p-3",
885
- role: z.value ? "tabpanel" : void 0,
886
- "aria-labelledby": z.value ? `${y(S)}-tab-${k.value}` : void 0
936
+ role: L.value ? "tabpanel" : void 0,
937
+ "aria-labelledby": L.value ? `${y(S)}-tab-${k.value}` : void 0
887
938
  }, [k.value === "date" ? (h(), c(n, { key: 0 }, [l("div", Ie, [
888
939
  l("button", {
889
940
  type: "button",
890
941
  class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
891
- "aria-label": Kt.value[0],
892
- onClick: a[4] ||= (e) => Hn(-1)
942
+ "aria-label": Yt.value[0],
943
+ onClick: a[4] ||= (e) => Kn(-1)
893
944
  }, [d(y(me), {
894
945
  class: "size-4",
895
946
  "aria-hidden": "true"
896
947
  })], 8, Le),
897
948
  l("span", {
898
- id: yt,
949
+ id: bt,
899
950
  class: "sr-only",
900
951
  "aria-live": "polite"
901
- }, v(W.value), 1),
902
- E.value === "years" ? (h(), c("span", ze, v(W.value), 1)) : (h(), c("button", {
952
+ }, v(H.value), 1),
953
+ E.value === "years" ? (h(), c("span", ze, v(H.value), 1)) : (h(), c("button", {
903
954
  key: 0,
904
955
  type: "button",
905
956
  class: "cursor-pointer rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
906
- "aria-label": E.value === "days" ? `${W.value}, choose month` : `${W.value}, choose year`,
907
- onClick: a[5] ||= (e) => E.value === "days" ? Un() : Wn()
908
- }, v(W.value), 9, Re)),
957
+ "aria-label": E.value === "days" ? `${H.value}, choose month` : `${H.value}, choose year`,
958
+ onClick: a[5] ||= (e) => E.value === "days" ? qn() : Jn()
959
+ }, v(H.value), 9, Re)),
909
960
  l("button", {
910
961
  type: "button",
911
962
  class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
912
- "aria-label": Kt.value[1],
913
- onClick: a[6] ||= (e) => Hn(1)
963
+ "aria-label": Yt.value[1],
964
+ onClick: a[6] ||= (e) => Kn(1)
914
965
  }, [d(y(he), {
915
966
  class: "size-4",
916
967
  "aria-hidden": "true"
@@ -918,36 +969,36 @@ var ye = ["for"], be = {
918
969
  ]), E.value === "days" ? (h(), c("table", {
919
970
  key: 0,
920
971
  role: "grid",
921
- "aria-labelledby": yt,
972
+ "aria-labelledby": bt,
922
973
  class: "w-full table-fixed border-collapse",
923
- onKeydown: tr
924
- }, [l("thead", null, [l("tr", null, [(h(!0), c(n, null, _(jt.value, (e) => (h(), c("th", {
974
+ onKeydown: ar
975
+ }, [l("thead", null, [l("tr", null, [(h(!0), c(n, null, _(Pt.value, (e) => (h(), c("th", {
925
976
  key: e.long,
926
977
  scope: "col",
927
978
  abbr: e.long,
928
979
  class: "pt-2 pb-2 text-center text-xs font-medium text-heading"
929
- }, v(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => j.value = null }, [(h(!0), c(n, null, _(zt.value, (e, t) => (h(), c("tr", { key: t }, [(h(!0), c(n, null, _(e, (e) => (h(), c("td", {
980
+ }, v(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => Et.value = null }, [(h(!0), c(n, null, _(Ht.value, (e, t) => (h(), c("tr", { key: t }, [(h(!0), c(n, null, _(e, (e) => (h(), c("td", {
930
981
  key: e,
931
982
  role: "gridcell",
932
- "aria-selected": bn(e) || xn(e),
983
+ "aria-selected": Cn(e) || wn(e),
933
984
  class: "p-0 py-0.5"
934
- }, [l("div", { class: m(["px-0.5", xn(e) && X(e) === T.value && ["bg-primary/10", ...Sn(e)]]) }, [l("button", {
985
+ }, [l("div", { class: m(["px-0.5", wn(e) && J(e) === T.value && ["bg-primary/10", ...Tn(e)]]) }, [l("button", {
935
986
  type: "button",
936
987
  "data-day": e,
937
988
  tabindex: e === A.value ? 0 : -1,
938
- "aria-label": kt.value.format(J(e)),
939
- "aria-disabled": vn(e) || void 0,
940
- "aria-current": e === Nt.value ? "date" : void 0,
941
- class: m(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [X(e) !== T.value && "invisible", vn(e) ? "cursor-not-allowed text-muted/50 line-through" : bn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === Nt.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
942
- onClick: (t) => Fn(e),
943
- onMouseenter: (t) => R.value && M.value && !N.value && (j.value = e)
944
- }, v(At.value.format(J(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (h(), c("div", {
989
+ "aria-label": Mt.value.format(K(e)),
990
+ "aria-disabled": xn(e) || void 0,
991
+ "aria-current": e === It.value ? "date" : void 0,
992
+ class: m(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [J(e) !== T.value && "invisible", xn(e) ? "cursor-not-allowed text-muted/50 line-through" : Cn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === It.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
993
+ onClick: (t) => zn(e),
994
+ onMouseenter: (t) => I.value && j.value && !M.value && (Et.value = e)
995
+ }, v(Nt.value.format(K(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (h(), c("div", {
945
996
  key: 1,
946
997
  role: "grid",
947
- "aria-label": E.value === "months" ? `Months of ${W.value}` : `Years ${W.value}`,
998
+ "aria-label": E.value === "months" ? `Months of ${H.value}` : `Years ${H.value}`,
948
999
  class: "grid gap-2",
949
- onKeydown: qn
950
- }, [(h(!0), c(n, null, _(Wt.value, (e, t) => (h(), c("div", {
1000
+ onKeydown: Zn
1001
+ }, [(h(!0), c(n, null, _(qt.value, (e, t) => (h(), c("div", {
951
1002
  key: t,
952
1003
  role: "row",
953
1004
  class: "grid grid-cols-4 gap-2"
@@ -956,55 +1007,67 @@ var ye = ["for"], be = {
956
1007
  type: "button",
957
1008
  role: "gridcell",
958
1009
  "data-pick": e.value,
959
- tabindex: e.value === Gt.value ? 0 : -1,
1010
+ tabindex: e.value === Jt.value ? 0 : -1,
960
1011
  "aria-label": e.label,
961
1012
  "aria-selected": e.selected,
962
1013
  "aria-disabled": e.disabled || void 0,
963
1014
  class: m(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
964
- onClick: (t) => Kn(e),
1015
+ onClick: (t) => Xn(e),
965
1016
  onFocus: (t) => O.value = e.value
966
- }, v(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (h(), c(n, { key: 1 }, [l("div", Ke, [(h(!0), c(n, null, _(Qt.value, (e, t) => (h(), c(n, { key: e.key }, [t > 0 ? (h(), c("span", qe)) : s("", !0), l("div", {
1017
+ }, v(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (h(), c(n, { key: 1 }, [l("div", Ke, [(h(!0), c(n, null, _(nn.value, (e, t) => (h(), c(n, { key: e.key }, [t > 0 ? (h(), c("span", qe)) : s("", !0), l("div", {
967
1018
  class: "flex min-w-0 flex-1 flex-col",
968
1019
  role: "group",
969
1020
  "aria-label": `${e.label} time`
970
- }, [R.value ? (h(), c("p", Ye, v(e.label), 1)) : s("", !0), l("div", Xe, [(h(!0), c(n, null, _(e.spinners, (t, r) => (h(), c(n, { key: t.key }, [r > 0 ? (h(), c("span", Ze, ":")) : s("", !0), l("div", Qe, [l("span", $e, v(ft[t.key]), 1), l("div", {
1021
+ }, [I.value ? (h(), c("p", Ye, v(e.label), 1)) : s("", !0), l("div", Xe, [(h(!0), c(n, null, _(e.spinners, (t, r) => (h(), c(n, { key: t.key }, [t.key === "p" ? (h(), c("span", Ze)) : r > 0 ? (h(), c("span", Qe, ":")) : s("", !0), l("div", { class: m(["flex h-full flex-1 flex-col items-center", t.key === "p" ? "min-w-12" : "min-w-10"]) }, [l("span", $e, v(pt[t.key]), 1), l("div", {
971
1022
  role: "listbox",
972
1023
  "aria-label": t.label,
973
1024
  "data-time-list": `${e.key}-${t.key}`,
974
1025
  class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-x-hidden overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
975
- onKeydown: (n) => er(n, t, `${e.key}-${t.key}`)
976
- }, [l("div", tt, [(h(!0), c(n, null, _(Xn(t), (n) => (h(), c("button", {
1026
+ onKeydown: (n) => ir(n, t, `${e.key}-${t.key}`)
1027
+ }, [l("div", tt, [(h(!0), c(n, null, _(er(t), (n) => (h(), c("button", {
977
1028
  key: n,
978
1029
  type: "button",
979
1030
  role: "option",
980
1031
  tabindex: n === t.get() ? 0 : -1,
981
1032
  "aria-selected": n === t.get(),
982
- class: m(["inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", n === t.get() ? "scale-110 bg-primary font-bold text-white" : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]),
983
- onClick: (r) => $n(t, n, `${e.key}-${t.key}`)
984
- }, v(on(n)), 11, nt))), 128))])], 40, et)])], 64))), 128))])], 8, Je)], 64))), 128))]), l("p", rt, [u("Times in " + v(Mt.value), 1), Mt.value === L.value ? s("", !0) : (h(), c(n, { key: 0 }, [u(" (" + v(L.value) + ")", 1)], 64))])], 64))], 8, Fe)], 64)), z.value || f.mode === "duration" || !R.value ? (h(), c("div", it, [
985
- f.mode !== "duration" && !R.value ? (h(), c("button", {
1033
+ class: m(["inline-flex h-10 shrink-0 cursor-pointer 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.key === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", n === t.get() ? ["bg-primary text-white", t.key !== "p" && "scale-110 font-bold"] : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
1034
+ onClick: (r) => rr(t, n, `${e.key}-${t.key}`)
1035
+ }, v(t.text ? t.text(n) : un(n)), 11, nt))), 128))])], 40, et)], 2)], 64))), 128))])], 8, Je)], 64))), 128))]), f.showTimeZone ? (h(), c("p", rt, [u("Times in " + v(Ft.value), 1), Ft.value === F.value ? s("", !0) : (h(), c(n, { key: 0 }, [u(" (" + v(F.value) + ")", 1)], 64))])) : s("", !0)], 64))], 8, Fe)], 64)), $t.value ? (h(), c("div", it, [
1036
+ f.mode !== "duration" && !I.value ? (h(), c("button", {
986
1037
  key: 0,
987
1038
  type: "button",
988
1039
  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",
989
- disabled: vn(Nt.value),
990
- onClick: a[8] ||= (e) => z.value ? Ln() : Rn()
991
- }, v(z.value ? "Now" : "Today"), 9, at)) : s("", !0),
992
- Yt.value ? (h(), c("p", ot, v(Yt.value), 1)) : s("", !0),
993
- a[11] ||= l("span", { class: "flex-1" }, null, -1),
994
- z.value || f.mode === "duration" ? (h(), c(n, { key: 2 }, [d(e, {
1040
+ disabled: xn(It.value),
1041
+ onClick: a[8] ||= (e) => L.value ? Vn() : Hn()
1042
+ }, v(L.value ? "Now" : "Today"), 9, at)) : s("", !0),
1043
+ Qt.value ? (h(), c("p", ot, v(Qt.value), 1)) : s("", !0),
1044
+ a[10] ||= l("span", { class: "flex-1" }, null, -1),
1045
+ L.value && !f.autoApply || f.mode === "duration" ? (h(), c(n, { key: 2 }, [d(e, {
995
1046
  title: "Cancel",
996
1047
  color: "white",
997
1048
  size: "small",
998
- onClick: a[9] ||= (e) => Mn()
1049
+ onClick: Rn
999
1050
  }), d(e, {
1000
1051
  title: "Apply",
1001
1052
  size: "small",
1002
- disabled: !Xt.value,
1003
- onClick: In
1053
+ disabled: !en.value,
1054
+ onClick: Bn
1004
1055
  }, null, 8, ["disabled"])], 64)) : s("", !0)
1005
- ])) : s("", !0)], 2)], 44, Te)) : s("", !0)]),
1056
+ ])) : s("", !0)], 2)], 16, Te)) : s("", !0)]),
1006
1057
  _: 1
1007
- })]))
1058
+ })], 8, ["disabled"])),
1059
+ f.errorMsg ? (h(), c("p", {
1060
+ key: 3,
1061
+ id: xt,
1062
+ class: "mt-1 text-base text-danger-strong",
1063
+ role: "alert"
1064
+ }, v(f.errorMsg), 1)) : s("", !0),
1065
+ f.name ? (h(), c("input", {
1066
+ key: 4,
1067
+ type: "hidden",
1068
+ name: f.name,
1069
+ value: Vt.value
1070
+ }, null, 8, st)) : s("", !0)
1008
1071
  ], 16));
1009
1072
  }
1010
1073
  });