@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,6 +1,6 @@
1
1
  import e from "./AcSpinner.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 ee, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as te, nextTick as ne, normalizeClass as p, normalizeStyle as re, onBeforeUnmount as ie, openBlock as m, ref as h, renderList as g, renderSlot as ae, resolveDynamicComponent as oe, toDisplayString as _, unref as v, useAttrs as se, useId as ce, useModel as le, vModelText as ue, watch as de, withCtx as fe, withDirectives as pe, withModifiers as y } 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 ee, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as te, nextTick as ne, normalizeClass as p, normalizeStyle as re, onBeforeUnmount as ie, onMounted as ae, openBlock as m, ref as h, renderList as g, renderSlot as _, resolveDynamicComponent as oe, toDisplayString as v, unref as y, useAttrs as se, useId as ce, useModel as le, useSlots as ue, vModelText as de, watch as b, withCtx as fe, withDirectives as pe, withModifiers as x } from "vue";
4
4
  import { Check as me, ChevronDown as he, ChevronUp as ge, Plus as _e, RefreshCw as ve, X as ye } from "@lucide/vue";
5
5
  //#region src/lib/components/AcSelect.vue?vue&type=script&setup=true&lang.ts
6
6
  var be = {
@@ -20,16 +20,17 @@ var be = {
20
20
  "aria-disabled",
21
21
  "aria-invalid",
22
22
  "aria-required",
23
- "aria-activedescendant"
23
+ "aria-activedescendant",
24
+ "aria-busy"
24
25
  ], Ce = { class: "flex min-w-0 flex-1 flex-wrap items-center gap-2" }, we = { class: "truncate" }, Te = [
25
26
  "aria-label",
26
27
  "disabled",
27
28
  "onClick"
28
29
  ], Ee = {
29
- key: 1,
30
+ key: 2,
30
31
  class: "truncate"
31
32
  }, De = {
32
- key: 2,
33
+ key: 3,
33
34
  class: "truncate text-muted"
34
35
  }, Oe = { class: "flex shrink-0 items-center gap-1 text-muted" }, ke = ["disabled"], Ae = {
35
36
  class: "inline-flex rounded-full p-1 transition-colors hover:bg-accent-hover hover:text-primary",
@@ -54,7 +55,7 @@ var be = {
54
55
  key: 1,
55
56
  role: "presentation",
56
57
  class: "px-4 py-3 text-center text-base text-muted"
57
- }, b = /*@__PURE__*/ d({
58
+ }, He = /*@__PURE__*/ d({
58
59
  inheritAttrs: !1,
59
60
  __name: "AcSelect",
60
61
  props: /*@__PURE__*/ f({
@@ -90,6 +91,10 @@ var be = {
90
91
  type: Boolean,
91
92
  default: !1
92
93
  },
94
+ refreshing: {
95
+ type: Boolean,
96
+ default: !1
97
+ },
93
98
  disabled: {
94
99
  type: Boolean,
95
100
  default: !1
@@ -101,10 +106,16 @@ var be = {
101
106
  errorMsg: { default: "" },
102
107
  hint: { default: "" },
103
108
  size: { default: "normal" },
104
- noResultText: { default: "No results" }
109
+ noResultText: { default: "No results" },
110
+ placement: { default: "bottom" }
105
111
  }, {
106
112
  modelValue: { default: null },
107
- modelModifiers: {}
113
+ modelModifiers: {},
114
+ open: {
115
+ type: Boolean,
116
+ default: !1
117
+ },
118
+ openModifiers: {}
108
119
  }),
109
120
  emits: /*@__PURE__*/ f([
110
121
  "select",
@@ -112,46 +123,46 @@ var be = {
112
123
  "remove",
113
124
  "search",
114
125
  "refresh"
115
- ], ["update:modelValue"]),
116
- setup(d, { expose: f, emit: b }) {
117
- let x = d, S = b, C = le(d, "modelValue"), w = ce(), T = se(), He = a(() => ({
118
- class: T.class,
119
- style: T.style
120
- })), Ue = a(() => {
121
- let { class: e, style: t, ...n } = T;
126
+ ], ["update:modelValue", "update:open"]),
127
+ setup(d, { expose: f, emit: He }) {
128
+ let S = d, C = He, Ue = ue(), w = le(d, "modelValue"), T = le(d, "open"), E = ce(), D = se(), We = a(() => ({
129
+ class: D.class,
130
+ style: D.style
131
+ })), Ge = a(() => {
132
+ let { class: e, style: t, ...n } = D;
122
133
  return n;
123
- }), E = `${w}-list`, D = `${w}-label`, We = `${w}-hint`, Ge = `${w}-msg`, Ke = h(null), O = h(null), k = h(null), qe = h(null), A = h(!1), j = h(""), M = h(-1), N = h({
134
+ }), O = `${E}-list`, k = `${E}-label`, Ke = `${E}-hint`, qe = `${E}-msg`, Je = h(null), A = h(null), j = h(null), Ye = h(null), M = h(""), N = h(-1), P = h({
124
135
  left: 0,
125
136
  width: 0,
126
137
  maxHeight: 288
127
- }), P = a(() => {
128
- let e = C.value;
138
+ }), F = a(() => {
139
+ let e = w.value;
129
140
  return e == null || e === "" ? [] : Array.isArray(e) ? e : [e];
130
- }), F = (e, t) => {
131
- let n = x.by;
141
+ }), I = (e, t) => {
142
+ let n = S.by;
132
143
  return typeof n == "function" ? n(e, t) : n && e && t && typeof e == "object" && typeof t == "object" ? e[n] === t[n] : e === t;
133
- }, I = (e) => {
134
- let t = x.by;
144
+ }, L = (e) => {
145
+ let t = S.by;
135
146
  return String(typeof t == "string" && e && typeof e == "object" ? e[t] : e);
136
- }, Je = (e, t) => {
137
- let n = x.by;
147
+ }, Xe = (e, t) => {
148
+ let n = S.by;
138
149
  return e && typeof e == "object" ? typeof n == "string" ? String(e[n]) : `i${t}` : String(e);
139
- }, L = (e) => P.value.some((t) => F(t, e.value)), R = a(() => P.value.map((e) => x.options.find((t) => F(t.value, e)) ?? {
150
+ }, R = (e) => F.value.some((t) => I(t, e.value)), z = a(() => F.value.map((e) => S.options.find((t) => I(t.value, e)) ?? {
140
151
  value: e,
141
- label: I(e)
142
- })), z = a(() => P.value.length > 0), Ye = (e) => {
152
+ label: L(e)
153
+ })), B = a(() => F.value.length > 0), Ze = (e) => {
143
154
  if (!e.some((e) => e.group)) return e;
144
155
  let t = [];
145
156
  return e.forEach((e) => {
146
157
  let n = e.group ?? "";
147
158
  t.includes(n) || t.push(n);
148
159
  }), [...e].sort((e, n) => t.indexOf(e.group ?? "") - t.indexOf(n.group ?? ""));
149
- }, B = a(() => {
150
- let e = j.value.trim().toLowerCase();
151
- return Ye(e ? x.options.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e) || t.group?.toLowerCase().includes(e)) : x.options);
152
- }), Xe = a(() => {
160
+ }, V = a(() => {
161
+ let e = M.value.trim().toLowerCase();
162
+ return Ze(e ? S.options.filter((t) => t.label.toLowerCase().includes(e) || t.description?.toLowerCase().includes(e) || t.group?.toLowerCase().includes(e)) : S.options);
163
+ }), Qe = a(() => {
153
164
  let e = [];
154
- return B.value.forEach((t, n) => {
165
+ return V.value.forEach((t, n) => {
155
166
  let r = t.group ?? "", i = e.find((e) => e.name === r);
156
167
  i || e.push(i = {
157
168
  name: r,
@@ -161,16 +172,16 @@ var be = {
161
172
  index: n
162
173
  });
163
174
  }), e;
164
- }), V = (e) => `${w}-opt-${e}`, H = a(() => j.value.trim()), U = a(() => {
165
- let e = H.value.toLowerCase();
166
- if (!x.creatable || !x.searchable || !e) return !1;
167
- let t = x.options.some((t) => t.label.toLowerCase() === e || I(t.value).toLowerCase() === e), n = P.value.some((t) => I(t).toLowerCase() === e);
175
+ }), H = (e) => `${E}-opt-${e}`, U = a(() => M.value.trim()), W = a(() => {
176
+ let e = U.value.toLowerCase();
177
+ if (!S.creatable || !S.searchable || !e) return !1;
178
+ let t = S.options.some((t) => t.label.toLowerCase() === e || L(t.value).toLowerCase() === e), n = F.value.some((t) => L(t).toLowerCase() === e);
168
179
  return !t && !n;
169
- }), W = a(() => B.value.length + +!!U.value - 1), G = a(() => B.value.length), Ze = () => {
170
- let e = O.value;
180
+ }), G = a(() => V.value.length + +!!W.value - 1), K = a(() => V.value.length), $e = () => {
181
+ let e = A.value;
171
182
  if (!e) return;
172
- let n = e.getBoundingClientRect(), r = t(), i = r.bottom - n.bottom - 4 - 8, a = n.top - r.top - 4 - 8;
173
- N.value = i < 180 && a > i ? {
183
+ let n = e.getBoundingClientRect(), r = t(), i = r.bottom - n.bottom - 4 - 8, a = n.top - r.top - 4 - 8, [o, s] = S.placement === "top" ? [a, i] : [i, a], c = o < 180 && s > o, l = S.placement === "top" ? !c : c;
184
+ P.value = l ? {
174
185
  bottom: r.bottom - n.top + 4,
175
186
  left: n.left - r.left,
176
187
  width: n.width,
@@ -181,140 +192,145 @@ var be = {
181
192
  width: n.width,
182
193
  maxHeight: Math.min(288, i)
183
194
  };
184
- }, K = (e = 0, t = 1) => {
185
- for (let n = e; n >= 0 && n <= W.value; n += t) if (!B.value[n]?.disabled) return n;
195
+ }, q = (e = 0, t = 1) => {
196
+ for (let n = e; n >= 0 && n <= G.value; n += t) if (!V.value[n]?.disabled) return n;
186
197
  return -1;
187
- }, Qe = async () => {
188
- if (x.disabled || x.loading || A.value) return;
189
- A.value = !0, j.value = "", Ze();
190
- let e = B.value.findIndex((e) => L(e));
191
- M.value = e >= 0 ? e : K(), await ne(), x.searchable && qe.value?.focus(), X();
192
- }, q = (e = !0) => {
193
- A.value && (A.value = !1, M.value = -1, e && O.value?.focus());
194
- }, $e = () => A.value ? q() : Qe(), J = (e) => {
198
+ }, et = () => {
199
+ S.disabled || S.loading || T.value || (T.value = !0);
200
+ }, tt = async () => {
201
+ M.value = "", $e();
202
+ let e = V.value.findIndex((e) => R(e));
203
+ N.value = e >= 0 ? e : q(), document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), await ne(), S.searchable && Ye.value?.focus(), X();
204
+ }, J = (e = !0) => {
205
+ T.value && (T.value = !1, N.value = -1, e && A.value?.focus());
206
+ }, nt = () => T.value ? J() : et(), rt = (e) => {
195
207
  if (!e.disabled) {
196
- if (x.multiple) {
197
- let t = [...P.value], n = t.findIndex((t) => F(t, e.value));
198
- n >= 0 ? (t.splice(n, 1), S("remove", e)) : (t.push(e.value), S("select", e)), C.value = t;
199
- } else C.value = e.value, S("select", e), q();
208
+ if (S.multiple) {
209
+ let t = [...F.value], n = t.findIndex((t) => I(t, e.value));
210
+ n >= 0 ? (t.splice(n, 1), C("remove", e)) : (t.push(e.value), C("select", e)), w.value = t;
211
+ } else w.value = e.value, C("select", e), J();
200
212
  }
201
- }, et = (e) => {
202
- C.value = x.multiple ? P.value.filter((t) => !F(t, e.value)) : null, S("remove", e);
203
- }, tt = () => {
204
- let e = H.value;
205
- if (!U.value || !e) return;
213
+ }, it = (e) => {
214
+ w.value = S.multiple ? F.value.filter((t) => !I(t, e.value)) : null, C("remove", e);
215
+ }, at = () => {
216
+ let e = U.value;
217
+ if (!W.value || !e) return;
206
218
  let t = e, n = {
207
219
  value: t,
208
220
  label: e
209
221
  };
210
- x.multiple ? (C.value = [...P.value, t], j.value = "") : (C.value = t, q()), S("select", n), S("create", e);
211
- }, nt = () => {
212
- R.value.forEach((e) => S("remove", e)), C.value = x.multiple ? [] : null, O.value?.focus();
213
- }, Y = "", rt, X = () => ne(() => k.value?.querySelector(`#${CSS.escape(V(M.value))}`)?.scrollIntoView({ block: "nearest" })), it = (e) => {
214
- let t = W.value + 1;
222
+ S.multiple ? (w.value = [...F.value, t], M.value = "") : (w.value = t, J()), C("select", n), C("create", e);
223
+ }, ot = () => {
224
+ z.value.forEach((e) => C("remove", e)), w.value = S.multiple ? [] : null, A.value?.focus();
225
+ }, Y = "", st, X = () => ne(() => j.value?.querySelector(`#${CSS.escape(H(N.value))}`)?.scrollIntoView({ block: "nearest" })), ct = (e) => {
226
+ let t = G.value + 1;
215
227
  if (!t) return;
216
- let n = M.value;
217
- for (let r = 0; r < t && (n = (n + e + t) % t, B.value[n]?.disabled); r++);
218
- M.value = n, X();
219
- }, at = (e) => {
220
- if (x.disabled) return;
228
+ let n = N.value;
229
+ for (let r = 0; r < t && (n = (n + e + t) % t, V.value[n]?.disabled); r++);
230
+ N.value = n, X();
231
+ }, lt = (e) => {
232
+ if (S.disabled) return;
221
233
  let t = e.key;
222
- if (!A.value) {
234
+ if (!T.value) {
223
235
  [
224
236
  "Enter",
225
237
  " ",
226
238
  "ArrowDown",
227
239
  "ArrowUp"
228
- ].includes(t) ? (e.preventDefault(), Qe()) : t === "Backspace" && x.multiple && z.value && e.target === O.value && et(R.value[R.value.length - 1]);
240
+ ].includes(t) ? (e.preventDefault(), et()) : t === "Backspace" && S.multiple && B.value && e.target === A.value && it(z.value[z.value.length - 1]);
229
241
  return;
230
242
  }
231
- if (t === "ArrowDown") e.preventDefault(), it(1);
232
- else if (t === "ArrowUp") e.preventDefault(), it(-1);
233
- else if (t === "Home") e.preventDefault(), M.value = K(), X();
234
- else if (t === "End") e.preventDefault(), M.value = K(W.value, -1), X();
235
- else if (t === "Enter" || t === " " && !x.searchable) {
243
+ if (t === "ArrowDown") e.preventDefault(), ct(1);
244
+ else if (t === "ArrowUp") e.preventDefault(), ct(-1);
245
+ else if (t === "Home") e.preventDefault(), N.value = q(), X();
246
+ else if (t === "End") e.preventDefault(), N.value = q(G.value, -1), X();
247
+ else if (t === "Enter" || t === " " && !S.searchable) {
236
248
  e.preventDefault();
237
- let t = B.value[M.value];
238
- t ? J(t) : U.value && tt();
239
- } else if (t === "Escape") e.preventDefault(), q();
240
- else if (t === "Tab") q(!1);
241
- else if (!x.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey) {
242
- Y += t.toLowerCase(), clearTimeout(rt), rt = setTimeout(() => Y = "", 500);
243
- let e = B.value.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(Y));
244
- e >= 0 && (M.value = e, X());
249
+ let t = V.value[N.value];
250
+ t ? rt(t) : W.value && at();
251
+ } else if (t === "Escape") e.preventDefault(), J();
252
+ else if (t === "Tab") J(!1);
253
+ else if (!S.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey) {
254
+ Y += t.toLowerCase(), clearTimeout(st), st = setTimeout(() => Y = "", 500);
255
+ let e = V.value.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(Y));
256
+ e >= 0 && (N.value = e, X());
245
257
  }
246
- }, ot = (e) => {
247
- let t = e.target;
248
- Ke.value?.contains(t) || k.value?.contains(t) || q(!1);
249
258
  }, Z = (e) => {
250
- e?.target instanceof Node && k.value?.contains(e.target) || Ze();
251
- }, st = () => {
252
- document.removeEventListener("pointerdown", ot, !0), window.removeEventListener("scroll", Z, !0), window.removeEventListener("resize", Z);
259
+ let t = e.target;
260
+ Je.value?.contains(t) || j.value?.contains(t) || J(!1);
261
+ }, Q = (e) => {
262
+ e?.target instanceof Node && j.value?.contains(e.target) || $e();
263
+ }, ut = () => {
264
+ document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
253
265
  };
254
- de(A, (e) => {
255
- if (!e) return st();
256
- document.addEventListener("pointerdown", ot, !0), window.addEventListener("scroll", Z, !0), window.addEventListener("resize", Z);
257
- }), de(j, (e) => {
258
- S("search", e), M.value = K();
259
- }), ie(st);
260
- let Q = h(!1), ct = a(() => A.value || Q.value), lt = a(() => [x.hint && We, x.errorMsg && Ge].filter(Boolean).join(" ") || void 0), $ = a(() => !x.multiple && R.value[0]?.label || "");
261
- return f({ focus: () => O.value?.focus() }), (t, a) => (m(), c("div", te({
266
+ b(T, (e) => {
267
+ if (e) return tt();
268
+ N.value = -1, ut();
269
+ }), b(M, (e) => {
270
+ C("search", e), N.value = q();
271
+ }), ae(() => T.value && tt()), ie(ut);
272
+ let $ = h(!1), dt = a(() => T.value || $.value), ft = a(() => [S.hint && Ke, S.errorMsg && qe].filter(Boolean).join(" ") || void 0), pt = a(() => !S.multiple && z.value[0]?.label || ""), mt = a(() => !S.multiple && Ue.selected && z.value[0] || null);
273
+ return f({ focus: () => A.value?.focus() }), (t, a) => (m(), c("div", te({
262
274
  ref_key: "root",
263
- ref: Ke
264
- }, He.value, {
275
+ ref: Je
276
+ }, We.value, {
265
277
  class: ["w-full", d.disabled && "opacity-50"],
266
278
  "data-ac-ds": "",
267
279
  "data-testid": "ac-select"
268
280
  }), [
269
281
  d.label ? (m(), c("div", be, [l("label", {
270
- id: D,
271
- onClick: a[0] ||= (e) => O.value?.focus()
272
- }, _(d.label), 1), d.required ? (m(), c("span", xe, "*")) : s("", !0)])) : s("", !0),
282
+ id: k,
283
+ onClick: a[0] ||= (e) => A.value?.focus()
284
+ }, v(d.label), 1), d.required ? (m(), c("span", xe, "*")) : s("", !0)])) : s("", !0),
273
285
  d.hint ? (m(), c("p", {
274
286
  key: 1,
275
- id: We,
287
+ id: Ke,
276
288
  class: "mb-2 text-base text-muted"
277
- }, _(d.hint), 1)) : s("", !0),
289
+ }, v(d.hint), 1)) : s("", !0),
278
290
  l("div", te({
279
- id: `${v(w)}-trigger`,
291
+ id: `${y(E)}-trigger`,
280
292
  ref_key: "trigger",
281
- ref: O
282
- }, Ue.value, {
293
+ ref: A
294
+ }, Ge.value, {
283
295
  role: "combobox",
284
296
  tabindex: d.disabled ? -1 : 0,
285
297
  "aria-haspopup": "listbox",
286
- "aria-expanded": A.value,
287
- "aria-controls": E,
288
- "aria-labelledby": d.label ? D : void 0,
289
- "aria-label": d.label ? void 0 : v(T)["aria-label"] ?? d.placeholder,
290
- "aria-describedby": lt.value,
298
+ "aria-expanded": T.value,
299
+ "aria-controls": O,
300
+ "aria-labelledby": d.label ? k : void 0,
301
+ "aria-label": d.label ? void 0 : y(D)["aria-label"] ?? d.placeholder,
302
+ "aria-describedby": ft.value,
291
303
  "aria-disabled": d.disabled || void 0,
292
304
  "aria-invalid": !!d.errorMsg || void 0,
293
305
  "aria-required": d.required || void 0,
294
- "aria-activedescendant": A.value && !d.searchable && M.value >= 0 ? V(M.value) : void 0,
306
+ "aria-activedescendant": T.value && !d.searchable && N.value >= 0 ? H(N.value) : void 0,
307
+ "aria-busy": d.refreshing || void 0,
295
308
  class: ["group flex w-full items-center gap-2 rounded-10 border bg-background text-left text-base font-medium text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none", [
296
309
  d.size === "compact" ? "min-h-8 pr-1 pl-3" : d.size === "small" ? "min-h-9 pr-1 pl-4" : "min-h-10.5 pr-1 pl-5",
297
- d.multiple && z.value && (d.size === "normal" ? "py-1.5" : "py-1"),
310
+ d.multiple && B.value && (d.size === "normal" ? "py-1.5" : "py-1"),
298
311
  d.disabled || d.loading ? "cursor-not-allowed" : "cursor-pointer",
299
- d.errorMsg ? ["border-danger/50", ct.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : ct.value ? "focus-ring" : ["border-border", !d.disabled && "hover:border-accent-active"]
312
+ d.errorMsg ? ["border-danger/50", dt.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : dt.value ? "focus-ring" : ["border-border", !d.disabled && "hover:border-accent-active"]
300
313
  ]],
301
- onClick: $e,
302
- onKeydown: at,
303
- onFocus: a[2] ||= (e) => Q.value = !0,
304
- onBlur: a[3] ||= (e) => Q.value = !1
305
- }), [l("div", Ce, [d.multiple && z.value ? (m(!0), c(n, { key: 0 }, g(R.value, (e, t) => (m(), c("span", {
306
- key: Je(e.value, t),
314
+ onClick: nt,
315
+ onKeydown: lt,
316
+ onFocus: a[2] ||= (e) => $.value = !0,
317
+ onBlur: a[3] ||= (e) => $.value = !1
318
+ }), [l("div", Ce, [d.multiple && B.value ? (m(!0), c(n, { key: 0 }, g(z.value, (e, t) => (m(), c("span", {
319
+ key: Xe(e.value, t),
307
320
  class: "inline-flex max-w-full items-center gap-2 rounded-10 bg-accent px-2 text-xs text-heading"
308
- }, [l("span", we, _(e.label), 1), l("button", {
321
+ }, [l("span", we, v(e.label), 1), l("button", {
309
322
  type: "button",
310
323
  class: "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full p-1 transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
311
324
  "aria-label": `Remove ${e.label}`,
312
325
  disabled: d.disabled,
313
- onClick: y((t) => et(e), ["stop"])
314
- }, [u(v(ye), {
326
+ onClick: x((t) => it(e), ["stop"])
327
+ }, [u(y(ye), {
315
328
  class: "size-4",
316
329
  "aria-hidden": "true"
317
- })], 8, Te)]))), 128)) : $.value ? (m(), c("span", Ee, _($.value), 1)) : (m(), c("span", De, _(d.placeholder), 1))]), l("span", Oe, [
330
+ })], 8, Te)]))), 128)) : mt.value ? (m(), c("span", {
331
+ key: 1,
332
+ class: p(["min-w-0 flex-1", d.size === "normal" ? "py-2.5" : d.size === "small" ? "py-[7px]" : "py-[5px]"])
333
+ }, [_(t.$slots, "selected", { option: mt.value })], 2)) : pt.value ? (m(), c("span", Ee, v(pt.value), 1)) : (m(), c("span", De, v(d.placeholder), 1))]), l("span", Oe, [
318
334
  d.loading ? (m(), o(e, {
319
335
  key: 0,
320
336
  class: "text-primary"
@@ -324,106 +340,106 @@ var be = {
324
340
  class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
325
341
  "aria-label": "Refresh options",
326
342
  disabled: d.disabled,
327
- onClick: a[1] ||= y((e) => S("refresh"), ["stop"])
328
- }, [u(v(ve), {
329
- class: "size-4",
343
+ onClick: a[1] ||= x((e) => C("refresh"), ["stop"])
344
+ }, [u(y(ve), {
345
+ class: p(["size-4", d.refreshing && "motion-safe:animate-spin"]),
330
346
  "aria-hidden": "true"
331
- })], 8, ke)) : s("", !0),
332
- d.clearable && z.value && !d.disabled && !d.loading ? (m(), c("button", {
347
+ }, null, 8, ["class"])], 8, ke)) : s("", !0),
348
+ d.clearable && B.value && !d.disabled && !d.loading ? (m(), c("button", {
333
349
  key: 2,
334
350
  type: "button",
335
351
  class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
336
352
  "aria-label": "Clear selection",
337
- onClick: y(nt, ["stop"])
338
- }, [u(v(ye), {
353
+ onClick: x(ot, ["stop"])
354
+ }, [u(y(ye), {
339
355
  class: "size-4",
340
356
  "aria-hidden": "true"
341
357
  })])) : s("", !0),
342
- l("span", Ae, [(m(), o(oe(A.value ? v(ge) : v(he)), { class: "size-4" }))])
358
+ l("span", Ae, [(m(), o(oe(T.value ? y(ge) : y(he)), { class: "size-4" }))])
343
359
  ])], 16, Se),
344
360
  d.errorMsg ? (m(), c("p", {
345
361
  key: 2,
346
- id: Ge,
362
+ id: qe,
347
363
  class: "mt-1 text-base text-danger-strong",
348
364
  role: "alert"
349
- }, _(d.errorMsg), 1)) : s("", !0),
365
+ }, v(d.errorMsg), 1)) : s("", !0),
350
366
  (m(), o(r, { to: "body" }, [u(i, {
351
367
  "enter-active-class": "transition-opacity duration-100 ease-out motion-reduce:transition-none",
352
368
  "enter-from-class": "opacity-0",
353
369
  "leave-active-class": "transition-opacity duration-75 ease-in motion-reduce:transition-none",
354
370
  "leave-to-class": "opacity-0"
355
371
  }, {
356
- default: fe(() => [A.value ? (m(), c("div", {
372
+ default: fe(() => [T.value ? (m(), c("div", {
357
373
  key: 0,
358
374
  ref_key: "panel",
359
- ref: k,
375
+ ref: j,
360
376
  class: "fixed z-[90] flex flex-col overflow-hidden rounded-10 border border-border bg-background shadow-lg",
361
377
  style: re({
362
- top: N.value.top === void 0 ? void 0 : `${N.value.top}px`,
363
- bottom: N.value.bottom === void 0 ? void 0 : `${N.value.bottom}px`,
364
- left: `${N.value.left}px`,
365
- width: `${N.value.width}px`,
366
- maxHeight: `${N.value.maxHeight}px`
378
+ top: P.value.top === void 0 ? void 0 : `${P.value.top}px`,
379
+ bottom: P.value.bottom === void 0 ? void 0 : `${P.value.bottom}px`,
380
+ left: `${P.value.left}px`,
381
+ width: `${P.value.width}px`,
382
+ maxHeight: `${P.value.maxHeight}px`
367
383
  }),
368
384
  "data-ac-ds": "",
369
385
  "data-testid": "ac-select-panel"
370
386
  }, [d.searchable ? (m(), c("div", je, [pe(l("input", {
371
387
  ref_key: "searchInput",
372
- ref: qe,
373
- "onUpdate:modelValue": a[4] ||= (e) => j.value = e,
388
+ ref: Ye,
389
+ "onUpdate:modelValue": a[4] ||= (e) => M.value = e,
374
390
  type: "text",
375
391
  placeholder: "Search…",
376
392
  "aria-label": "Search options",
377
- "aria-controls": E,
378
- "aria-activedescendant": M.value >= 0 ? V(M.value) : void 0,
393
+ "aria-controls": O,
394
+ "aria-activedescendant": N.value >= 0 ? H(N.value) : void 0,
379
395
  class: "h-9.5 w-full rounded-10 border border-border bg-background px-3 text-base text-heading transition-[border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 hover:border-accent-active focus:focus-ring",
380
- onKeydown: at
381
- }, null, 40, Me), [[ue, j.value]])])) : s("", !0), l("ul", {
382
- id: E,
396
+ onKeydown: lt
397
+ }, null, 40, Me), [[de, M.value]])])) : s("", !0), l("ul", {
398
+ id: O,
383
399
  role: "listbox",
384
400
  "aria-multiselectable": d.multiple || void 0,
385
- "aria-labelledby": d.label ? D : void 0,
401
+ "aria-labelledby": d.label ? k : void 0,
386
402
  class: "ac-scrollbar max-h-60 min-h-0 flex-1 p-1"
387
403
  }, [
388
- (m(!0), c(n, null, g(Xe.value, (e) => (m(), c(n, { key: e.name }, [e.name ? (m(), c("li", Pe, _(e.name), 1)) : s("", !0), (m(!0), c(n, null, g(e.items, ({ option: e, index: n }) => (m(), c("li", {
389
- id: V(n),
390
- key: Je(e.value, n),
404
+ (m(!0), c(n, null, g(Qe.value, (e) => (m(), c(n, { key: e.name }, [e.name ? (m(), c("li", Pe, v(e.name), 1)) : s("", !0), (m(!0), c(n, null, g(e.items, ({ option: e, index: n }) => (m(), c("li", {
405
+ id: H(n),
406
+ key: Xe(e.value, n),
391
407
  role: "option",
392
- "aria-selected": L(e),
408
+ "aria-selected": R(e),
393
409
  "aria-disabled": e.disabled || void 0,
394
- class: p(["flex cursor-pointer items-start gap-2.5 rounded-6 px-4 py-2 text-base text-heading transition-colors", [e.disabled && "cursor-not-allowed opacity-50", n === M.value ? "bg-accent-hover" : L(e) && "bg-accent"]]),
395
- onMouseenter: (t) => !e.disabled && (M.value = n),
396
- onMousedown: a[5] ||= y(() => {}, ["prevent"]),
397
- onClick: (t) => J(e)
410
+ class: p(["flex cursor-pointer items-start gap-2.5 rounded-6 px-4 py-2 text-base text-heading transition-colors", [e.disabled && "cursor-not-allowed opacity-50", n === N.value ? "bg-accent-hover" : R(e) && "bg-accent"]]),
411
+ onMouseenter: (t) => !e.disabled && (N.value = n),
412
+ onMousedown: a[5] ||= x(() => {}, ["prevent"]),
413
+ onClick: (t) => rt(e)
398
414
  }, [d.multiple ? (m(), c("span", {
399
415
  key: 0,
400
- class: p(["mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-4 border transition-colors", L(e) ? "border-primary bg-primary text-white" : "border-muted/70 bg-surface"]),
416
+ class: p(["mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-4 border transition-colors", R(e) ? "border-primary bg-primary text-white" : "border-muted/70 bg-surface"]),
401
417
  "aria-hidden": "true"
402
- }, [L(e) ? (m(), o(v(me), {
418
+ }, [R(e) ? (m(), o(y(me), {
403
419
  key: 0,
404
420
  class: "size-3",
405
421
  "stroke-width": 3,
406
422
  "aria-hidden": "true"
407
- })) : s("", !0)], 2)) : s("", !0), l("span", Ie, [ae(t.$slots, "option", {
423
+ })) : s("", !0)], 2)) : s("", !0), l("span", Ie, [_(t.$slots, "option", {
408
424
  option: e,
409
- selected: L(e),
410
- active: n === M.value
411
- }, () => [l("span", Le, _(e.label), 1), e.description ? (m(), c("span", Re, _(e.description), 1)) : s("", !0)])])], 42, Fe))), 128))], 64))), 128)),
412
- U.value ? (m(), c("li", {
425
+ selected: R(e),
426
+ active: n === N.value
427
+ }, () => [l("span", Le, v(e.label), 1), e.description ? (m(), c("span", Re, v(e.description), 1)) : s("", !0)])])], 42, Fe))), 128))], 64))), 128)),
428
+ W.value ? (m(), c("li", {
413
429
  key: 0,
414
- id: V(G.value),
430
+ id: H(K.value),
415
431
  role: "option",
416
432
  "aria-selected": "false",
417
- class: p(["flex cursor-pointer items-center gap-2.5 rounded-6 px-4 py-2 text-base text-heading transition-colors", G.value === M.value && "bg-accent-hover"]),
433
+ class: p(["flex cursor-pointer items-center gap-2.5 rounded-6 px-4 py-2 text-base text-heading transition-colors", K.value === N.value && "bg-accent-hover"]),
418
434
  "data-testid": "ac-select-create",
419
- onMouseenter: a[6] ||= (e) => M.value = G.value,
420
- onMousedown: a[7] ||= y(() => {}, ["prevent"]),
421
- onClick: tt
422
- }, [u(v(_e), {
435
+ onMouseenter: a[6] ||= (e) => N.value = K.value,
436
+ onMousedown: a[7] ||= x(() => {}, ["prevent"]),
437
+ onClick: at
438
+ }, [u(y(_e), {
423
439
  class: "size-4 shrink-0 text-primary-strong",
424
440
  "aria-hidden": "true"
425
- }), l("span", Be, _(d.createText) + " “" + _(H.value) + "”", 1)], 42, ze)) : s("", !0),
426
- !B.value.length && !U.value ? (m(), c("li", Ve, [ae(t.$slots, "empty", { query: j.value }, () => [ee(_(j.value ? `${d.noResultText} for “${j.value}”` : "No options"), 1)])])) : s("", !0)
441
+ }), l("span", Be, v(d.createText) + " “" + v(U.value) + "”", 1)], 42, ze)) : s("", !0),
442
+ !V.value.length && !W.value ? (m(), c("li", Ve, [_(t.$slots, "empty", { query: M.value }, () => [ee(v(M.value ? `${d.noResultText} for “${M.value}”` : "No options"), 1)])])) : s("", !0)
427
443
  ], 8, Ne)], 4)) : s("", !0)]),
428
444
  _: 3
429
445
  })]))
@@ -431,4 +447,4 @@ var be = {
431
447
  }
432
448
  });
433
449
  //#endregion
434
- export { b as default };
450
+ export { He as default };
@@ -13,6 +13,12 @@ export interface Props {
13
13
  hoverExpand?: boolean;
14
14
  /** Offset from the top of the viewport on desktop, e.g. `"72px"` under a full-width navbar. The height shrinks to match. */
15
15
  top?: string;
16
+ /** Pins the sidebar to the viewport's left edge with `position: fixed` on desktop, instead of `sticky`. The page then makes room itself, e.g. cloud-ui's `lg:pl-52 xl:pl-64`. */
17
+ fixed?: boolean;
18
+ /** Puts the `footer` items at the end of the scrolling list instead of pinning them: they sit at the bottom while the list is short and scroll with it when it's long, as in cloud-ui. */
19
+ footerScrolls?: boolean;
20
+ /** Space between sections. `compact` is cloud-ui's console: 16px either side of the rule between sections, 24px-high section headings and 8px between sub-groups. */
21
+ spacing?: "normal" | "compact";
16
22
  }
17
23
  type __VLS_Props = Props;
18
24
  type __VLS_Slots = {
@@ -48,13 +54,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
48
54
  "onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
49
55
  "onUpdate:mobileOpen"?: ((value: boolean) => any) | undefined;
50
56
  }>, {
57
+ fixed: boolean;
51
58
  label: string;
59
+ spacing: "normal" | "compact";
52
60
  top: string;
53
61
  dark: boolean;
54
62
  collapsible: boolean;
55
63
  contained: boolean;
56
64
  breakpoint: number;
57
65
  hoverExpand: boolean;
66
+ footerScrolls: boolean;
58
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
59
68
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
60
69
  declare const _default: typeof __VLS_export;