@ac-design/design-system 2.6.1 → 2.8.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 (78) hide show
  1. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +2 -2
  2. package/dist/lib/charts/graph.d.ts +9 -15
  3. package/dist/lib/charts/graph.js +79 -75
  4. package/dist/lib/charts/index.d.ts +4 -2
  5. package/dist/lib/charts/index.js +2 -1
  6. package/dist/lib/charts/nodeSymbol.d.ts +15 -0
  7. package/dist/lib/charts/nodeSymbol.js +27 -0
  8. package/dist/lib/charts/tree.d.ts +15 -0
  9. package/dist/lib/charts/tree.js +89 -0
  10. package/dist/lib/compat.css +162 -10
  11. package/dist/lib/components/AcAccordionItem.vue.d.ts +3 -1
  12. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +35 -26
  13. package/dist/lib/components/AcAlert.vue.d.ts +1 -1
  14. package/dist/lib/components/AcBadge.vue.d.ts +1 -1
  15. package/dist/lib/components/AcBanner.vue.d.ts +1 -1
  16. package/dist/lib/components/AcCard.vue.d.ts +1 -1
  17. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +2 -2
  18. package/dist/lib/components/AcCellValue.vue.d.ts +1 -1
  19. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +46 -43
  20. package/dist/lib/components/AcCheckList.vue.d.ts +1 -1
  21. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +3 -3
  22. package/dist/lib/components/AcColorInput.vue.d.ts +4 -0
  23. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +12 -2
  24. package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
  25. package/dist/lib/components/AcDatePicker.vue.d.ts +3 -0
  26. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +12 -2
  27. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  28. package/dist/lib/components/AcFeatureCard.vue.d.ts +1 -1
  29. package/dist/lib/components/AcGraphChart.vue.d.ts +53 -3
  30. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +401 -233
  31. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +1 -1
  32. package/dist/lib/components/AcInput.vue.d.ts +2 -0
  33. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +18 -8
  34. package/dist/lib/components/AcList.js +5 -0
  35. package/dist/lib/components/AcList.vue.d.ts +56 -0
  36. package/dist/lib/components/AcList.vue_vue_type_script_setup_true_lang.js +74 -0
  37. package/dist/lib/components/AcListItem.js +5 -0
  38. package/dist/lib/components/AcListItem.vue.d.ts +53 -0
  39. package/dist/lib/components/AcListItem.vue_vue_type_script_setup_true_lang.js +105 -0
  40. package/dist/lib/components/AcMapChart.vue.d.ts +66 -3
  41. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +403 -201
  42. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +12 -8
  43. package/dist/lib/components/AcMonthPicker.js +5 -0
  44. package/dist/lib/components/AcMonthPicker.vue.d.ts +105 -0
  45. package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +605 -0
  46. package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
  47. package/dist/lib/components/AcNumberInput.vue.d.ts +3 -0
  48. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +11 -1
  49. package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
  50. package/dist/lib/components/AcSelect.vue.d.ts +3 -0
  51. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +241 -218
  52. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +11 -7
  53. package/dist/lib/components/AcSideTabs.vue.d.ts +3 -1
  54. package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +53 -33
  55. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +1 -1
  56. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  57. package/dist/lib/components/AcStatCard.vue.d.ts +1 -1
  58. package/dist/lib/components/AcSteps.vue.d.ts +3 -0
  59. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +33 -29
  60. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +1 -1
  61. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +83 -72
  62. package/dist/lib/components/AcTextarea.vue.d.ts +3 -0
  63. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +11 -1
  64. package/dist/lib/components/AcTimePicker.vue.d.ts +3 -0
  65. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +12 -2
  66. package/dist/lib/components/AcToaster.vue.d.ts +3 -0
  67. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +71 -68
  68. package/dist/lib/components/AcTreeChart.js +5 -0
  69. package/dist/lib/components/AcTreeChart.vue.d.ts +135 -0
  70. package/dist/lib/components/AcTreeChart.vue_vue_type_script_setup_true_lang.js +809 -0
  71. package/dist/lib/components/AcUsageCard.vue.d.ts +1 -1
  72. package/dist/lib/components/index.d.ts +5 -2
  73. package/dist/lib/composables/copyText.d.ts +5 -1
  74. package/dist/lib/composables/copyText.js +15 -3
  75. package/dist/lib/index.d.ts +3 -0
  76. package/dist/lib/index.js +85 -81
  77. package/dist/lib/theme.css +11 -0
  78. package/package.json +1 -1
@@ -0,0 +1,605 @@
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 ee, mergeProps as d, nextTick as f, normalizeClass as p, onBeforeUnmount as te, onMounted as ne, openBlock as m, ref as h, renderList as g, renderSlot as re, resolveDynamicComponent as ie, toDisplayString as _, unref as v, useAttrs as ae, useId as oe, useModel as se, watch as ce, withCtx as le } from "vue";
3
+ import { Calendar as ue, CalendarRange as de, ChevronLeft as fe, ChevronRight as pe, X as me } from "@lucide/vue";
4
+ //#region src/lib/components/AcMonthPicker.vue?vue&type=script&setup=true&lang.ts
5
+ var he = ["for"], ge = { key: 0 }, _e = {
6
+ key: 1,
7
+ class: "text-danger",
8
+ "aria-hidden": "true"
9
+ }, ve = [
10
+ "id",
11
+ "disabled",
12
+ "aria-expanded",
13
+ "aria-labelledby",
14
+ "aria-describedby",
15
+ "aria-invalid",
16
+ "aria-required"
17
+ ], ye = ["aria-label"], be = [
18
+ "role",
19
+ "aria-modal",
20
+ "aria-label",
21
+ "aria-describedby",
22
+ "inert"
23
+ ], xe = {
24
+ key: 0,
25
+ 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",
26
+ role: "group",
27
+ "aria-label": "Presets"
28
+ }, Se = ["onClick"], Ce = { class: "p-3" }, we = { class: "mb-2 flex items-center justify-between gap-2" }, Te = ["aria-label", "aria-disabled"], Ee = ["aria-label"], De = {
29
+ key: 1,
30
+ class: "rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums",
31
+ "aria-hidden": "true"
32
+ }, Oe = ["aria-label", "aria-disabled"], ke = ["aria-label"], Ae = ["aria-selected"], je = [
33
+ "data-month",
34
+ "tabindex",
35
+ "aria-label",
36
+ "aria-disabled",
37
+ "aria-current",
38
+ "onClick",
39
+ "onFocus",
40
+ "onMouseenter"
41
+ ], Me = ["aria-label"], Ne = ["aria-selected"], Pe = [
42
+ "data-year",
43
+ "tabindex",
44
+ "aria-label",
45
+ "aria-disabled",
46
+ "aria-current",
47
+ "onClick",
48
+ "onFocus"
49
+ ], Fe = {
50
+ key: 0,
51
+ class: "flex flex-wrap items-center gap-2 border-t border-border px-3 py-3"
52
+ }, Ie = ["disabled"], Le = ["name", "value"], y = 12, b = /*@__PURE__*/ u({
53
+ inheritAttrs: !1,
54
+ __name: "AcMonthPicker",
55
+ props: /*@__PURE__*/ ee({
56
+ label: { default: "" },
57
+ labelClass: {
58
+ type: [
59
+ Boolean,
60
+ null,
61
+ String,
62
+ Object,
63
+ Array
64
+ ],
65
+ default: void 0
66
+ },
67
+ placeholder: { default: "" },
68
+ range: {
69
+ type: Boolean,
70
+ default: !1
71
+ },
72
+ minMonth: { default: "" },
73
+ maxMonth: { default: "" },
74
+ minDate: { default: "" },
75
+ maxDate: { default: "" },
76
+ isMonthDisabled: {
77
+ type: Function,
78
+ default: void 0
79
+ },
80
+ presets: { default: () => [] },
81
+ locale: { default: void 0 },
82
+ clearable: {
83
+ type: Boolean,
84
+ default: !1
85
+ },
86
+ disabled: {
87
+ type: Boolean,
88
+ default: !1
89
+ },
90
+ required: {
91
+ type: Boolean,
92
+ default: !1
93
+ },
94
+ errorMsg: { default: "" },
95
+ hint: { default: "" },
96
+ size: { default: "normal" },
97
+ name: { default: "" },
98
+ inline: {
99
+ type: Boolean,
100
+ default: !1
101
+ },
102
+ valueType: { default: "string" },
103
+ fieldClass: {
104
+ type: [
105
+ Boolean,
106
+ null,
107
+ String,
108
+ Object,
109
+ Array
110
+ ],
111
+ default: void 0
112
+ }
113
+ }, {
114
+ modelValue: { default: null },
115
+ modelModifiers: {},
116
+ open: {
117
+ type: Boolean,
118
+ default: !1
119
+ },
120
+ openModifiers: {}
121
+ }),
122
+ emits: ["update:modelValue", "update:open"],
123
+ setup(u, { expose: ee }) {
124
+ let b = u, x = se(u, "modelValue"), S = se(u, "open"), Re = /^(\d{4})-(\d{2})/, C = oe(), w = ae(), ze = i(() => ({
125
+ class: w.class,
126
+ style: w.style
127
+ })), Be = i(() => {
128
+ let { class: e, style: t, ...n } = w;
129
+ return n;
130
+ }), Ve = `${C}-label`, T = `${C}-value`, He = `${C}-title`, Ue = `${C}-msg`, We = `${C}-hint`, Ge = h(null), E = h(null), D = h(null), O = h({
131
+ left: 0,
132
+ maxHeight: 480,
133
+ minWidth: 0
134
+ }), k = h("months"), A = h(2026), j = h(2020), M = h("2026-01"), N = h(2026), P = h(null), F = h(null), I = h(null), L = h(!1), Ke = i(() => new Intl.DateTimeFormat(b.locale, {
135
+ month: "short",
136
+ timeZone: "UTC"
137
+ })), qe = i(() => new Intl.DateTimeFormat(b.locale, {
138
+ month: "long",
139
+ year: "numeric",
140
+ timeZone: "UTC"
141
+ })), Je = i(() => new Intl.DateTimeFormat(b.locale, {
142
+ month: "short",
143
+ year: "numeric",
144
+ timeZone: "UTC"
145
+ })), R = i(() => ft(/* @__PURE__ */ new Date())), z = i(() => K(b.minMonth) ?? K(b.minDate)), B = i(() => K(b.maxMonth) ?? K(b.maxDate)), V = i({
146
+ get() {
147
+ let e = x.value;
148
+ return e instanceof Date ? Number.isNaN(e.getTime()) ? null : ft(e) : e || null;
149
+ },
150
+ set(e) {
151
+ if (b.range || Array.isArray(e) || b.valueType !== "date" && !(x.value instanceof Date)) {
152
+ x.value = e;
153
+ return;
154
+ }
155
+ x.value = e ? pt(K(e) ?? e) : null;
156
+ }
157
+ }), H = i(() => {
158
+ let e = V.value;
159
+ return b.range ? Array.isArray(e) ? [K(e[0]), K(e[1])] : [null, null] : [typeof e == "string" ? K(e) : null];
160
+ }), U = i(() => H.value.some(Boolean)), Ye = i(() => {
161
+ let [e, t] = H.value;
162
+ if (!e) return typeof V.value == "string" ? V.value : "";
163
+ if (!b.range) return qe.value.format(Y(e));
164
+ let n = Je.value.format(Y(e));
165
+ return t ? e === t ? n : `${n} – ${Je.value.format(Y(t))}` : `${n} –`;
166
+ }), Xe = i(() => H.value.filter(Boolean).join("/")), Ze = i(() => Array.from({ length: 12 }, (e, t) => {
167
+ let n = `${A.value}-${G(t + 1)}`;
168
+ return {
169
+ key: n,
170
+ text: Ke.value.format(Y(n)),
171
+ label: qe.value.format(Y(n)),
172
+ disabled: mt(n)
173
+ };
174
+ })), Qe = i(() => [
175
+ 0,
176
+ 3,
177
+ 6,
178
+ 9
179
+ ].map((e) => Ze.value.slice(e, e + 3))), $e = i(() => q(M.value) === A.value ? M.value : Ze.value[0].key), et = i(() => Array.from({ length: y }, (e, t) => {
180
+ let n = j.value + t;
181
+ return {
182
+ year: n,
183
+ disabled: ht(n),
184
+ selected: n === A.value
185
+ };
186
+ })), tt = i(() => [
187
+ 0,
188
+ 3,
189
+ 6,
190
+ 9
191
+ ].map((e) => et.value.slice(e, e + 3))), nt = i(() => et.value.some((e) => e.year === N.value) ? N.value : j.value), W = i(() => k.value === "months" ? String(A.value) : `${j.value}–${j.value + y - 1}`), rt = i(() => k.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), it = i(() => z.value ? k.value === "months" ? `${A.value - 1}-12` < z.value : q(z.value) >= j.value : !1), at = i(() => B.value ? k.value === "months" ? `${A.value + 1}-01` > B.value : q(B.value) <= j.value + y - 1 : !1), ot = i(() => !b.range || !F.value ? null : I.value ?? P.value ?? null), st = i(() => b.clearable && U.value || !b.range && !b.inline), ct = i(() => S.value || L.value), lt = i(() => [b.hint && We, b.errorMsg && Ue].filter(Boolean).join(" ") || void 0), ut = i(() => {
192
+ let e = b.range ? "month range" : "month";
193
+ return b.label ? `${b.label}: choose ${e}` : `Choose ${e}`;
194
+ });
195
+ function G(e) {
196
+ return String(e).padStart(2, "0");
197
+ }
198
+ function K(e) {
199
+ let t = e ? Re.exec(e) : null;
200
+ if (!t) return null;
201
+ let n = Number(t[2]);
202
+ return n >= 1 && n <= 12 ? `${t[1]}-${t[2]}` : null;
203
+ }
204
+ function q(e) {
205
+ return Number(e.slice(0, 4));
206
+ }
207
+ function J(e) {
208
+ return Number(e.slice(5, 7)) - 1;
209
+ }
210
+ function dt(e, t) {
211
+ let n = q(e) * 12 + J(e) + t;
212
+ return `${Math.floor(n / 12)}-${G(n % 12 + 1)}`;
213
+ }
214
+ function Y(e) {
215
+ return new Date(Date.UTC(q(e), J(e), 1));
216
+ }
217
+ function ft(e) {
218
+ return `${e.getFullYear()}-${G(e.getMonth() + 1)}`;
219
+ }
220
+ function pt(e) {
221
+ return new Date(q(e), J(e), 1);
222
+ }
223
+ function mt(e) {
224
+ return z.value && e < z.value || B.value && e > B.value ? !0 : b.isMonthDisabled?.(e) ?? !1;
225
+ }
226
+ function ht(e) {
227
+ return !!z.value && `${e}-12` < z.value || !!B.value && `${e}-01` > B.value;
228
+ }
229
+ function gt(e) {
230
+ return e === F.value || b.range && e === (I.value ?? ot.value);
231
+ }
232
+ function _t(e) {
233
+ let t = F.value, n = ot.value;
234
+ if (!t || !n) return !1;
235
+ let [r, i] = t <= n ? [t, n] : [n, t];
236
+ return e >= r && e <= i;
237
+ }
238
+ function vt(e) {
239
+ let t = F.value, n = ot.value, [r, i] = t <= n ? [t, n] : [n, t];
240
+ return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
241
+ }
242
+ function yt(e = !0) {
243
+ P.value = null, e && (k.value = "months");
244
+ let [t, n] = H.value;
245
+ F.value = t ?? null, I.value = b.range ? n ?? null : null;
246
+ let r = t ?? R.value;
247
+ !t && z.value && r < z.value && (r = z.value), !t && B.value && r > B.value && (r = B.value), M.value = r, A.value = q(r);
248
+ }
249
+ function bt() {
250
+ let t = E.value;
251
+ if (!t) return;
252
+ let n = t.getBoundingClientRect(), r = e(), i = D.value?.offsetWidth ?? 300, a = D.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);
253
+ O.value = c ? {
254
+ bottom: r.bottom - n.top + 6,
255
+ left: l,
256
+ maxHeight: Math.max(200, s),
257
+ minWidth: u
258
+ } : {
259
+ top: n.bottom + 6 - r.top,
260
+ left: l,
261
+ maxHeight: Math.max(200, o),
262
+ minWidth: u
263
+ };
264
+ }
265
+ function xt() {
266
+ b.disabled || S.value || (S.value = !0);
267
+ }
268
+ function X(e = !0) {
269
+ S.value && (S.value = !1, e && E.value?.focus());
270
+ }
271
+ async function St() {
272
+ yt(), bt(), Lt(), await f(), bt(), Z();
273
+ }
274
+ function Z() {
275
+ f(() => D.value?.querySelector(`[data-month="${$e.value}"]`)?.focus());
276
+ }
277
+ function Ct() {
278
+ f(() => D.value?.querySelector(`[data-year="${nt.value}"]`)?.focus());
279
+ }
280
+ function Q(e) {
281
+ V.value = e, X();
282
+ }
283
+ function wt(e) {
284
+ if (!mt(e)) {
285
+ if (M.value = e, A.value = q(e), !b.range) {
286
+ F.value = e, Q(e);
287
+ return;
288
+ }
289
+ if (!F.value || I.value) {
290
+ F.value = e, I.value = null;
291
+ return;
292
+ }
293
+ e < F.value ? (I.value = F.value, F.value = e) : I.value = e, P.value = null, Q([F.value, I.value]);
294
+ }
295
+ }
296
+ function Tt(e) {
297
+ let t = e.value();
298
+ if (!Array.isArray(t)) return Q(K(t) ?? t);
299
+ let n = K(t[0]) ?? t[0], r = K(t[1]) ?? t[1];
300
+ Q(n <= r ? [n, r] : [r, n]);
301
+ }
302
+ function Et() {
303
+ if (V.value = null, b.inline) return Z();
304
+ X(!1), E.value?.focus();
305
+ }
306
+ function Dt(e) {
307
+ (e < 0 ? it.value : at.value) || (k.value === "months" ? (A.value += e, M.value = dt(M.value, 12 * e)) : (j.value += y * e, N.value += y * e));
308
+ }
309
+ function Ot() {
310
+ k.value = "months", Z();
311
+ }
312
+ function kt() {
313
+ k.value = "years", j.value = Math.floor(A.value / 10) * 10, N.value = A.value, Ct();
314
+ }
315
+ function At(e) {
316
+ e.disabled || (A.value = e.year, M.value = `${e.year}-${G(J(M.value) + 1)}`, Ot());
317
+ }
318
+ function jt(e, t) {
319
+ return {
320
+ ArrowLeft: -1,
321
+ ArrowRight: 1,
322
+ ArrowUp: -3,
323
+ ArrowDown: 3,
324
+ PageUp: -12,
325
+ PageDown: 12,
326
+ Home: -t,
327
+ End: 2 - t
328
+ }[e] ?? null;
329
+ }
330
+ function Mt(e) {
331
+ if (e.key === "Enter" || e.key === " ") {
332
+ e.preventDefault(), wt(M.value);
333
+ return;
334
+ }
335
+ let t = jt(e.key, J(M.value) % 3);
336
+ t !== null && (e.preventDefault(), M.value = dt(M.value, t), A.value = q(M.value), b.range && F.value && !I.value && (P.value = M.value), Z());
337
+ }
338
+ function Nt(e) {
339
+ if (e.key === "Escape") {
340
+ e.preventDefault(), e.stopPropagation(), Ot();
341
+ return;
342
+ }
343
+ if (e.key === "Enter" || e.key === " ") {
344
+ e.preventDefault();
345
+ let t = et.value.find((e) => e.year === N.value);
346
+ t && At(t);
347
+ return;
348
+ }
349
+ let t = jt(e.key, (N.value - j.value) % 3);
350
+ if (t === null) return;
351
+ e.preventDefault();
352
+ let n = N.value + t;
353
+ j.value += Math.floor((n - j.value) / y) * y, N.value = n, Ct();
354
+ }
355
+ function Pt(e) {
356
+ if (b.inline) return;
357
+ if (e.key === "Escape") {
358
+ e.preventDefault(), e.stopPropagation(), X();
359
+ return;
360
+ }
361
+ if (e.key !== "Tab" || !D.value) return;
362
+ let t = [...D.value.querySelectorAll("button:not([disabled])")].filter((e) => e.tabIndex >= 0);
363
+ if (!t.length) return;
364
+ let n = t[0], r = t[t.length - 1];
365
+ e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
366
+ }
367
+ function Ft(e) {
368
+ (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), xt());
369
+ }
370
+ function It(e) {
371
+ let t = e.target;
372
+ Ge.value?.contains(t) || D.value?.contains(t) || X(!1);
373
+ }
374
+ function $(e) {
375
+ e?.target instanceof Node && D.value?.contains(e.target) || bt();
376
+ }
377
+ function Lt() {
378
+ document.addEventListener("pointerdown", It, !0), window.addEventListener("scroll", $, !0), window.addEventListener("resize", $);
379
+ }
380
+ function Rt() {
381
+ document.removeEventListener("pointerdown", It, !0), window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $);
382
+ }
383
+ return ce(S, (e) => e ? St() : Rt()), ce(V, () => b.inline && yt(!1)), ne(() => {
384
+ b.inline ? yt() : S.value && St();
385
+ }), te(Rt), ee({ focus: () => b.inline ? Z() : E.value?.focus() }), (e, i) => (m(), s("div", d({
386
+ ref_key: "root",
387
+ ref: Ge
388
+ }, ze.value, {
389
+ class: ["w-full", u.disabled && "opacity-50"],
390
+ "data-ac-ds": "",
391
+ "data-testid": "ac-month-picker"
392
+ }), [
393
+ u.label || e.$slots["label-icon"] || e.$slots["label-extra"] ? (m(), s("label", {
394
+ key: 0,
395
+ id: Ve,
396
+ for: u.inline ? void 0 : `${v(C)}-trigger`,
397
+ class: p(["mb-2 flex items-center gap-1 text-base font-medium text-heading", u.labelClass])
398
+ }, [
399
+ re(e.$slots, "label-icon"),
400
+ u.label ? (m(), s("span", ge, _(u.label), 1)) : o("", !0),
401
+ re(e.$slots, "label-extra"),
402
+ u.required ? (m(), s("span", _e, "*")) : o("", !0)
403
+ ], 10, he)) : o("", !0),
404
+ u.hint ? (m(), s("p", {
405
+ key: 1,
406
+ id: We,
407
+ class: "mb-2 text-base text-muted"
408
+ }, _(u.hint), 1)) : o("", !0),
409
+ u.inline ? o("", !0) : (m(), s("div", {
410
+ key: 2,
411
+ class: p(["relative", u.fieldClass])
412
+ }, [c("button", d({
413
+ id: `${v(C)}-trigger`,
414
+ ref_key: "trigger",
415
+ ref: E
416
+ }, Be.value, {
417
+ type: "button",
418
+ disabled: u.disabled,
419
+ "aria-haspopup": "dialog",
420
+ "aria-expanded": S.value,
421
+ "aria-labelledby": u.label || e.$slots["label-icon"] || e.$slots["label-extra"] ? `${Ve} ${T}` : T,
422
+ "aria-describedby": lt.value,
423
+ "aria-invalid": !!u.errorMsg || void 0,
424
+ "aria-required": u.required || void 0,
425
+ class: ["flex w-full items-center rounded-10 border bg-background text-left text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
426
+ u.size === "small" ? "h-9 pl-3 text-base font-normal" : u.size === "large" ? "h-[50px] pl-4 text-lg font-medium" : "h-10.5 pl-4 text-base font-normal",
427
+ u.clearable && U.value && !u.disabled ? "pr-20" : "pr-10",
428
+ u.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
429
+ u.errorMsg ? ["border-danger/60", ct.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : ct.value ? "focus-ring" : ["border-border", !u.disabled && "hover:border-accent-active"]
430
+ ]],
431
+ onClick: i[0] ||= (e) => S.value ? X() : xt(),
432
+ onKeydown: Ft,
433
+ onFocus: i[1] ||= (e) => L.value = !0,
434
+ onBlur: i[2] ||= (e) => L.value = !1
435
+ }), [c("span", {
436
+ id: T,
437
+ class: p(["truncate tabular-nums", !Ye.value && "text-muted/80"])
438
+ }, _(Ye.value || u.placeholder || (u.range ? "Choose months" : "Choose month")), 3)], 16, ve), c("span", { class: p(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", u.size === "small" ? "right-3" : "right-4"]) }, [u.clearable && U.value && !u.disabled ? (m(), s("button", {
439
+ key: 0,
440
+ type: "button",
441
+ 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",
442
+ "aria-label": u.label ? `Clear ${u.label}` : "Clear",
443
+ onClick: Et
444
+ }, [l(v(me), {
445
+ class: "size-4",
446
+ "aria-hidden": "true"
447
+ })], 8, ye)) : o("", !0), (m(), a(ie(u.range ? v(de) : v(ue)), {
448
+ class: p(["size-4", S.value && "text-heading"]),
449
+ "aria-hidden": "true"
450
+ }, null, 8, ["class"]))], 2)], 2)),
451
+ (m(), a(n, {
452
+ to: "body",
453
+ disabled: u.inline
454
+ }, [l(r, {
455
+ "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
456
+ "enter-from-class": "opacity-0 scale-95",
457
+ "leave-active-class": "transition duration-100 ease-in",
458
+ "leave-to-class": "opacity-0"
459
+ }, {
460
+ default: le(() => [S.value || u.inline ? (m(), s("div", d({
461
+ key: 0,
462
+ ref_key: "panel",
463
+ ref: D,
464
+ role: u.inline ? "group" : "dialog",
465
+ "aria-modal": u.inline ? void 0 : "true",
466
+ "aria-label": ut.value,
467
+ "aria-describedby": u.inline ? lt.value : void 0,
468
+ inert: u.inline && u.disabled
469
+ }, u.inline ? Be.value : void 0, {
470
+ class: ["flex flex-col sm:flex-row", !u.inline && "ac-scrollbar fixed z-[90] max-w-[calc(100vw-16px)] rounded-10 border border-border bg-surface shadow-sm"],
471
+ style: u.inline ? void 0 : {
472
+ top: O.value.top === void 0 ? void 0 : `${O.value.top}px`,
473
+ bottom: O.value.bottom === void 0 ? void 0 : `${O.value.bottom}px`,
474
+ left: `${O.value.left}px`,
475
+ maxHeight: `${O.value.maxHeight}px`,
476
+ minWidth: `${O.value.minWidth}px`
477
+ },
478
+ "data-ac-ds": "",
479
+ "data-testid": "ac-month-picker-panel",
480
+ onKeydown: Pt
481
+ }), [u.presets.length ? (m(), s("div", xe, [(m(!0), s(t, null, g(u.presets, (e) => (m(), s("button", {
482
+ key: e.label,
483
+ type: "button",
484
+ 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",
485
+ onClick: (t) => Tt(e)
486
+ }, _(e.label), 9, Se))), 128))])) : o("", !0), c("div", { class: p(["max-w-full min-w-0 flex-auto max-sm:w-auto", u.inline ? "w-full" : "w-[calc(296px*var(--ac-scale))]"]) }, [c("div", Ce, [c("div", we, [
487
+ c("button", {
488
+ type: "button",
489
+ class: p(["inline-flex items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", it.value ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-accent-hover hover:text-heading active:bg-accent-active"]),
490
+ "aria-label": rt.value[0],
491
+ "aria-disabled": it.value || void 0,
492
+ onClick: i[3] ||= (e) => Dt(-1)
493
+ }, [l(v(fe), {
494
+ class: "size-4",
495
+ "aria-hidden": "true"
496
+ })], 10, Te),
497
+ c("span", {
498
+ id: He,
499
+ class: "sr-only",
500
+ "aria-live": "polite"
501
+ }, _(W.value), 1),
502
+ k.value === "months" ? (m(), s("button", {
503
+ key: 0,
504
+ type: "button",
505
+ 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",
506
+ "aria-label": `${W.value}, choose year`,
507
+ onClick: kt
508
+ }, _(W.value), 9, Ee)) : (m(), s("span", De, _(W.value), 1)),
509
+ c("button", {
510
+ type: "button",
511
+ class: p(["inline-flex items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", at.value ? "cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-accent-hover hover:text-heading active:bg-accent-active"]),
512
+ "aria-label": rt.value[1],
513
+ "aria-disabled": at.value || void 0,
514
+ onClick: i[4] ||= (e) => Dt(1)
515
+ }, [l(v(pe), {
516
+ class: "size-4",
517
+ "aria-hidden": "true"
518
+ })], 10, Oe)
519
+ ]), k.value === "months" ? (m(), s("div", {
520
+ key: 0,
521
+ role: "grid",
522
+ "aria-label": `Months of ${A.value}`,
523
+ class: "grid gap-1",
524
+ onKeydown: Mt,
525
+ onMouseleave: i[5] ||= (e) => P.value = null
526
+ }, [(m(!0), s(t, null, g(Qe.value, (e, n) => (m(), s("div", {
527
+ key: n,
528
+ role: "row",
529
+ class: "grid grid-cols-3"
530
+ }, [(m(!0), s(t, null, g(e, (e) => (m(), s("div", {
531
+ key: e.key,
532
+ role: "gridcell",
533
+ "aria-selected": gt(e.key) || _t(e.key),
534
+ class: p(["px-1", _t(e.key) && ["bg-primary/10", ...vt(e.key)]])
535
+ }, [c("button", {
536
+ type: "button",
537
+ "data-month": e.key,
538
+ tabindex: e.key === $e.value ? 0 : -1,
539
+ "aria-label": e.label,
540
+ "aria-disabled": e.disabled || void 0,
541
+ "aria-current": e.key === R.value ? "date" : void 0,
542
+ class: p(["w-full rounded-8 px-2 py-3 text-base 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" : gt(e.key) ? "cursor-pointer bg-primary font-semibold text-white" : e.key === R.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"]),
543
+ onClick: (t) => wt(e.key),
544
+ onFocus: (t) => M.value = e.key,
545
+ onMouseenter: (t) => u.range && F.value && !I.value && (P.value = e.key)
546
+ }, _(e.text), 43, je)], 10, Ae))), 128))]))), 128))], 40, ke)) : (m(), s("div", {
547
+ key: 1,
548
+ role: "grid",
549
+ "aria-label": `Years ${W.value}`,
550
+ class: "grid gap-1",
551
+ onKeydown: Nt
552
+ }, [(m(!0), s(t, null, g(tt.value, (e, n) => (m(), s("div", {
553
+ key: n,
554
+ role: "row",
555
+ class: "grid grid-cols-3"
556
+ }, [(m(!0), s(t, null, g(e, (e) => (m(), s("div", {
557
+ key: e.year,
558
+ role: "gridcell",
559
+ "aria-selected": e.selected,
560
+ class: "px-1"
561
+ }, [c("button", {
562
+ type: "button",
563
+ "data-year": e.year,
564
+ tabindex: e.year === nt.value ? 0 : -1,
565
+ "aria-label": String(e.year),
566
+ "aria-disabled": e.disabled || void 0,
567
+ "aria-current": e.year === q(R.value) ? "date" : void 0,
568
+ class: p(["w-full rounded-8 px-2 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" : e.year === q(R.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"]),
569
+ onClick: (t) => At(e),
570
+ onFocus: (t) => N.value = e.year
571
+ }, _(e.year), 43, Pe)], 8, Ne))), 128))]))), 128))], 40, Me))]), st.value ? (m(), s("div", Fe, [
572
+ !u.range && !u.inline ? (m(), s("button", {
573
+ key: 0,
574
+ type: "button",
575
+ 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",
576
+ disabled: mt(R.value),
577
+ onClick: i[6] ||= (e) => wt(R.value)
578
+ }, " This month ", 8, Ie)) : o("", !0),
579
+ i[7] ||= c("span", { class: "flex-1" }, null, -1),
580
+ u.clearable && U.value ? (m(), s("button", {
581
+ key: 1,
582
+ type: "button",
583
+ class: "cursor-pointer rounded-8 px-3 py-1.5 text-xs font-medium 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",
584
+ onClick: Et
585
+ }, " Clear ")) : o("", !0)
586
+ ])) : o("", !0)], 2)], 16, be)) : o("", !0)]),
587
+ _: 1
588
+ })], 8, ["disabled"])),
589
+ u.errorMsg ? (m(), s("p", {
590
+ key: 3,
591
+ id: Ue,
592
+ class: "mt-1 text-base text-danger-strong",
593
+ role: "alert"
594
+ }, _(u.errorMsg), 1)) : o("", !0),
595
+ u.name ? (m(), s("input", {
596
+ key: 4,
597
+ type: "hidden",
598
+ name: u.name,
599
+ value: Xe.value
600
+ }, null, 8, Le)) : o("", !0)
601
+ ], 16));
602
+ }
603
+ });
604
+ //#endregion
605
+ export { b as default };
@@ -27,9 +27,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
27
27
  onClick?: ((e: MouseEvent) => any) | undefined;
28
28
  }>, {
29
29
  disabled: boolean;
30
- icon: Component;
31
30
  href: string;
32
31
  to: string | object;
32
+ icon: Component;
33
33
  iconOnly: boolean;
34
34
  active: boolean;
35
35
  badge: string | number;
@@ -1,6 +1,9 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  export interface Props<K extends "null" | "undefined" = "null"> {
2
3
  /** Label above the field. Without one, pass `aria-label` so the field still has a name. */
3
4
  label?: string;
5
+ /** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
6
+ labelClass?: HTMLAttributes["class"];
4
7
  /** Native `name` attribute. */
5
8
  name?: string;
6
9
  /** Text shown inside the empty field, e.g. "Enter number". */
@@ -21,6 +21,16 @@ var oe = ["for"], g = { key: 0 }, _ = ["id"], se = { class: "flex items-center g
21
21
  __name: "AcNumberInput",
22
22
  props: /*@__PURE__*/ o({
23
23
  label: { default: "" },
24
+ labelClass: {
25
+ type: [
26
+ Boolean,
27
+ null,
28
+ String,
29
+ Object,
30
+ Array
31
+ ],
32
+ default: void 0
33
+ },
24
34
  name: { default: "" },
25
35
  placeholder: { default: void 0 },
26
36
  min: { default: void 0 },
@@ -213,7 +223,7 @@ var oe = ["for"], g = { key: 0 }, _ = ["id"], se = { class: "flex items-center g
213
223
  pe.value ? (l(), n("label", {
214
224
  key: 0,
215
225
  for: p(S),
216
- class: c(["mb-2 flex items-center text-base font-medium text-heading", !a.flushLabelSlots && "gap-1"])
226
+ class: c(["mb-2 flex items-center text-base font-medium text-heading", [!a.flushLabelSlots && "gap-1", a.labelClass]])
217
227
  }, [
218
228
  d(e.$slots, "label-icon"),
219
229
  a.label ? (l(), n("span", g, f(a.label), 1)) : t("", !0),
@@ -81,10 +81,10 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
81
81
  }>, {
82
82
  details: ResourceDetail[];
83
83
  disabled: boolean;
84
- icon: Component;
85
84
  target: string;
86
85
  href: string;
87
86
  to: string | Record<string, unknown>;
87
+ icon: Component;
88
88
  status: string;
89
89
  loading: boolean;
90
90
  subtitle: string;
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  import type { SelectOption } from "./types";
2
3
  export interface Props<T> {
3
4
  /** The choices: `{ value, label, description?, disabled?, group? }`. */
@@ -6,6 +7,8 @@ export interface Props<T> {
6
7
  by?: string | ((a: T, b: T) => boolean);
7
8
  /** Label above the field. Also the accessible name of the select. */
8
9
  label?: string;
10
+ /** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
11
+ labelClass?: HTMLAttributes["class"];
9
12
  /** Text shown in the field while nothing is selected, e.g. "Select a version". */
10
13
  placeholder?: string;
11
14
  /** Allow several values; `v-model` becomes an array. */