@ac-design/design-system 2.1.1 → 2.2.1

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