@ac-design/design-system 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,50 +1,51 @@
1
- import { statusMeta as e } from "./status.js";
2
- import t from "./AcSkeleton.js";
3
- import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as ee, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as te, onBeforeUnmount as ne, openBlock as g, ref as _, renderList as re, renderSlot as v, resolveDynamicComponent as ie, toDisplayString as y, unref as b, useId as ae, useModel as oe, vModelText as se, watch as ce, withCtx as le, withDirectives as ue, withModifiers as de } from "vue";
4
- import { Check as fe, ChevronsUpDown as pe, Cloud as me, Plus as he, Search as ge } from "@lucide/vue";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import { statusMeta as t } from "./status.js";
3
+ import n from "./AcSkeleton.js";
4
+ import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as ee, mergeModels as m, nextTick as h, normalizeClass as g, normalizeStyle as te, onBeforeUnmount as ne, openBlock as _, ref as v, renderList as re, renderSlot as y, resolveDynamicComponent as ie, toDisplayString as b, unref as x, useId as ae, useModel as oe, vModelText as se, watch as ce, withCtx as S, withDirectives as le, withModifiers as ue } from "vue";
5
+ import { Check as de, ChevronsUpDown as fe, Cloud as C, Plus as pe, Search as me } from "@lucide/vue";
5
6
  //#region src/lib/components/AcClusterSwitcher.vue?vue&type=script&setup=true&lang.ts
6
- var _e = [
7
+ var he = [
7
8
  "id",
8
9
  "aria-expanded",
9
10
  "aria-controls",
10
11
  "aria-label",
11
12
  "title",
12
13
  "disabled"
13
- ], ve = {
14
+ ], ge = {
14
15
  class: "relative inline-flex size-7 shrink-0 items-center justify-center rounded-8 bg-surface ring-1 ring-border ring-inset",
15
16
  "aria-hidden": "true"
16
- }, ye = ["src"], be = { class: "min-w-0 flex-1" }, xe = {
17
+ }, _e = ["src"], ve = { class: "min-w-0 flex-1" }, ye = {
17
18
  key: 0,
18
19
  class: "block truncate text-sm text-muted"
19
- }, Se = {
20
+ }, be = {
20
21
  key: 0,
21
22
  class: "border-b border-border p-2"
22
- }, Ce = { class: "relative" }, we = [
23
+ }, xe = { class: "relative" }, Se = [
23
24
  "aria-activedescendant",
24
25
  "aria-label",
25
26
  "placeholder"
26
- ], Te = ["tabindex", "aria-activedescendant"], Ee = [
27
+ ], Ce = ["tabindex", "aria-activedescendant"], we = [
27
28
  "id",
28
29
  "aria-selected",
29
30
  "aria-disabled",
30
31
  "onMouseenter",
31
32
  "onClick"
32
- ], De = {
33
+ ], Te = {
33
34
  class: "inline-flex size-8 shrink-0 items-center justify-center rounded-8 bg-surface ring-1 ring-border ring-inset",
34
35
  "aria-hidden": "true"
35
- }, Oe = ["src", "onError"], ke = { class: "min-w-0 flex-1" }, Ae = { class: "block truncate text-base leading-5 font-medium text-heading" }, je = { class: "flex min-w-0 items-center gap-1.5 text-xs text-muted" }, Me = {
36
+ }, Ee = ["src", "onError"], De = { class: "min-w-0 flex-1" }, Oe = { class: "block truncate text-base leading-5 font-medium text-heading" }, ke = { class: "flex min-w-0 items-center gap-1.5 text-xs text-muted" }, Ae = {
36
37
  key: 1,
37
38
  "aria-hidden": "true"
38
- }, Ne = { class: "truncate" }, Pe = {
39
+ }, je = { class: "truncate" }, Me = {
39
40
  key: 0,
40
41
  role: "presentation",
41
42
  class: "px-3 py-6 text-center text-base text-muted"
42
- }, Fe = {
43
+ }, Ne = {
43
44
  key: 1,
44
45
  class: "border-t border-border p-2"
45
- }, x = /*@__PURE__*/ f({
46
+ }, Pe = /*@__PURE__*/ p({
46
47
  __name: "AcClusterSwitcher",
47
- props: /*@__PURE__*/ p({
48
+ props: /*@__PURE__*/ m({
48
49
  clusterOptions: { default: () => [] },
49
50
  sidebarCollapsed: {
50
51
  type: Boolean,
@@ -76,13 +77,13 @@ var _e = [
76
77
  },
77
78
  openModifiers: {}
78
79
  }),
79
- emits: /*@__PURE__*/ p(["select", "import"], ["update:modelValue", "update:open"]),
80
- setup(f, { expose: p, emit: x }) {
81
- let S = f, C = oe(f, "modelValue"), w = oe(f, "open"), T = x, Ie = {
80
+ emits: /*@__PURE__*/ m(["select", "import"], ["update:modelValue", "update:open"]),
81
+ setup(p, { expose: m, emit: Pe }) {
82
+ let w = p, T = oe(p, "modelValue"), E = oe(p, "open"), D = Pe, Fe = {
82
83
  registered: "warning",
83
84
  unknown: "warning",
84
85
  notconnected: "danger"
85
- }, E = {
86
+ }, Ie = {
86
87
  success: "bg-success",
87
88
  danger: "bg-danger",
88
89
  info: "bg-info",
@@ -96,37 +97,37 @@ var _e = [
96
97
  warning: "text-warning-strong",
97
98
  pending: "text-pending-strong",
98
99
  neutral: "text-muted"
99
- }, D = ee("ac-sidebar", null), O = ae(), k = `${O}-panel`, A = `${O}-list`, j = _(null), M = _(null), Re = _(null), N = _(null), P = _(""), F = _(-1), I = _(/* @__PURE__ */ new Set()), L = _({}), R = _(!0), z = a(() => S.sidebarCollapsed ?? D?.rail.value ?? !1), B = a(() => D?.dark.value ?? !1), V = a(() => C.value ? S.clusterOptions.find((e) => e.name === C.value) ?? { name: C.value } : null), H = a(() => {
100
+ }, Re = ee("ac-sidebar", null), O = ae(), k = `${O}-panel`, A = `${O}-list`, j = v(null), M = v(null), ze = v(null), N = v(null), P = v(""), F = v(-1), I = v(/* @__PURE__ */ new Set()), L = v({}), R = v(!0), z = o(() => w.sidebarCollapsed ?? Re?.rail.value ?? !1), B = o(() => Re?.dark.value ?? !1), V = o(() => T.value ? w.clusterOptions.find((e) => e.name === T.value) ?? { name: T.value } : null), H = o(() => {
100
101
  let e = P.value.trim().toLowerCase();
101
- return e ? S.clusterOptions.filter((t) => [
102
+ return e ? w.clusterOptions.filter((t) => [
102
103
  t.name,
103
104
  t.displayName,
104
105
  t.provider,
105
106
  t.location
106
- ].some((t) => t?.toLowerCase().includes(e))) : S.clusterOptions;
107
- }), ze = a(() => V.value ? `Cluster: ${U(V.value)}${V.value.status ? `, ${V.value.status}` : ""}. Switch cluster` : "Select a cluster");
107
+ ].some((t) => t?.toLowerCase().includes(e))) : w.clusterOptions;
108
+ }), Be = o(() => V.value ? `Cluster: ${U(V.value)}${V.value.status ? `, ${V.value.status}` : ""}. Switch cluster` : "Select a cluster");
108
109
  function U(e) {
109
110
  return e.displayName || e.name;
110
111
  }
111
112
  function W(e) {
112
113
  return !!(e.disabled || e.$isDisabled);
113
114
  }
114
- function G(t) {
115
- let n = (t ?? "").toLowerCase().replace(/[^a-z]/g, "");
115
+ function G(e) {
116
+ let n = (e ?? "").toLowerCase().replace(/[^a-z]/g, "");
116
117
  if (!n) return "neutral";
117
- let r = Ie[n] ?? e(t).tone;
118
+ let r = Fe[n] ?? t(e).tone;
118
119
  return r === "default" ? "neutral" : r;
119
120
  }
120
121
  function K(e) {
121
- return !S.providerIconBase || !e || I.value.has(e) ? "" : `${S.providerIconBase}/${e}.png`;
122
+ return !w.providerIconBase || !e || I.value.has(e) ? "" : `${w.providerIconBase}/${e}.png`;
122
123
  }
123
- function Be(e) {
124
+ function q(e) {
124
125
  e && (I.value = new Set(I.value).add(e));
125
126
  }
126
- function q(e) {
127
+ function J(e) {
127
128
  return `${O}-opt-${e}`;
128
129
  }
129
- function J(e = 0, t = 1) {
130
+ function Y(e = 0, t = 1) {
130
131
  let n = H.value;
131
132
  for (let r = e; r >= 0 && r < n.length; r += t) if (!W(n[r])) return r;
132
133
  return -1;
@@ -136,256 +137,256 @@ var _e = [
136
137
  if (!t.length) return;
137
138
  let n = F.value;
138
139
  for (let r = 0; r < t.length && (n = (n + e + t.length) % t.length, W(t[n])); r++);
139
- F.value = n, Y();
140
- }
141
- function Y() {
142
- m(() => N.value?.querySelector(`#${CSS.escape(q(F.value))}`)?.scrollIntoView({ block: "nearest" }));
140
+ F.value = n, X();
143
141
  }
144
142
  function X() {
145
- let e = j.value;
146
- if (!e || !M.value) return;
147
- let t = e.getBoundingClientRect(), n = Math.min(Math.max(z.value ? 288 : t.width, 288), window.innerWidth - 16);
148
- M.value.style.width = `${n}px`;
149
- let r = M.value.offsetHeight;
143
+ h(() => N.value?.querySelector(`#${CSS.escape(J(F.value))}`)?.scrollIntoView({ block: "nearest" }));
144
+ }
145
+ function Z() {
146
+ let t = j.value;
147
+ if (!t || !M.value) return;
148
+ let n = t.getBoundingClientRect(), r = e(), i = Math.min(Math.max(z.value ? 288 : n.width, 288), r.width - 16);
149
+ M.value.style.width = `${i}px`;
150
+ let a = M.value.offsetHeight;
150
151
  if (z.value) {
151
- let e = t.top + r <= window.innerHeight - 8;
152
+ let e = n.top + a <= r.bottom - 8;
152
153
  R.value = e, L.value = {
153
- ...e ? { top: `${t.top}px` } : { bottom: "8px" },
154
- left: `${Math.min(t.right + 6, window.innerWidth - n - 8)}px`,
155
- width: `${n}px`,
156
- maxHeight: `${window.innerHeight - 16}px`
154
+ ...e ? { top: `${n.top - r.top}px` } : { bottom: "8px" },
155
+ left: `${Math.min(n.right + 6 - r.left, r.width - i - 8)}px`,
156
+ width: `${i}px`,
157
+ maxHeight: `${r.height - 16}px`
157
158
  };
158
159
  return;
159
160
  }
160
- let i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i;
161
- R.value = !o, L.value = {
162
- [o ? "bottom" : "top"]: `${o ? window.innerHeight - t.top + 6 : t.bottom + 6}px`,
163
- left: `${Math.max(8, Math.min(t.left, window.innerWidth - n - 8))}px`,
164
- width: `${n}px`,
165
- maxHeight: `${Math.max(o ? a : i, 200)}px`
161
+ let o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o;
162
+ R.value = !c, L.value = {
163
+ [c ? "bottom" : "top"]: `${c ? r.bottom - n.top + 6 : n.bottom + 6 - r.top}px`,
164
+ left: `${Math.max(8, Math.min(n.left - r.left, r.width - i - 8))}px`,
165
+ width: `${i}px`,
166
+ maxHeight: `${Math.max(c ? s : o, 200)}px`
166
167
  };
167
168
  }
168
- function He() {
169
- S.disabled || S.loading || (w.value = !0);
169
+ function Q() {
170
+ w.disabled || w.loading || (E.value = !0);
170
171
  }
171
- function Z(e = !0) {
172
- w.value && (w.value = !1, e && j.value?.focus());
172
+ function $(e = !0) {
173
+ E.value && (E.value = !1, e && j.value?.focus());
173
174
  }
174
- function Ue(e) {
175
- W(e) || (C.value = e.name, T("select", e), Z());
175
+ function He(e) {
176
+ W(e) || (T.value = e.name, D("select", e), $());
176
177
  }
177
- function We() {
178
- T("import"), Z(!1);
178
+ function Ue() {
179
+ D("import"), $(!1);
179
180
  }
180
- function Ge(e) {
181
- !w.value && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), He());
181
+ function We(e) {
182
+ !E.value && ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), Q());
182
183
  }
183
- function Q(e) {
184
+ function Ge(e) {
184
185
  if (e.key === "ArrowDown" || e.key === "ArrowUp") e.preventDefault(), Ve(e.key === "ArrowDown" ? 1 : -1);
185
- else if ((e.key === "Home" || e.key === "End") && !S.searchable) e.preventDefault(), F.value = e.key === "Home" ? J() : J(H.value.length - 1, -1), Y();
186
- else if (e.key === "Enter" || e.key === " " && !S.searchable) {
186
+ else if ((e.key === "Home" || e.key === "End") && !w.searchable) e.preventDefault(), F.value = e.key === "Home" ? Y() : Y(H.value.length - 1, -1), X();
187
+ else if (e.key === "Enter" || e.key === " " && !w.searchable) {
187
188
  e.preventDefault();
188
189
  let t = H.value[F.value];
189
- t && Ue(t);
190
+ t && He(t);
190
191
  }
191
192
  }
192
193
  function Ke(e) {
193
- e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && qe(e);
194
+ e.key === "Escape" ? (e.preventDefault(), $()) : e.key === "Tab" && qe(e);
194
195
  }
195
196
  function qe(e) {
196
197
  let t = [...M.value?.querySelectorAll("input, a[href], button:not([disabled]), [tabindex=\"0\"]") ?? []], n = t[0], r = t[t.length - 1];
197
- e.shiftKey && document.activeElement === n ? (e.preventDefault(), Z()) : !e.shiftKey && document.activeElement === r && Z();
198
+ e.shiftKey && document.activeElement === n ? (e.preventDefault(), $()) : !e.shiftKey && document.activeElement === r && $();
198
199
  }
199
200
  function Je(e) {
200
201
  let t = e.target;
201
- j.value?.contains(t) || M.value?.contains(t) || Z(!1);
202
+ j.value?.contains(t) || M.value?.contains(t) || $(!1);
202
203
  }
203
204
  function Ye(e) {
204
- e?.target instanceof Node && M.value?.contains(e.target) || X();
205
+ e?.target instanceof Node && M.value?.contains(e.target) || Z();
205
206
  }
206
- function $(e) {
207
+ function Xe(e) {
207
208
  let t = e ? "addEventListener" : "removeEventListener";
208
209
  document[t]("pointerdown", Je, !0), window[t]("scroll", Ye, !0), window[t]("resize", Ye);
209
210
  }
210
- return ce(w, async (e) => {
211
- if ($(e), !e) return;
211
+ return ce(E, async (e) => {
212
+ if (Xe(e), !e) return;
212
213
  P.value = "";
213
- let t = H.value.findIndex((e) => e.name === C.value);
214
- F.value = t >= 0 ? t : J(), await m(), X(), (S.searchable ? Re.value : N.value)?.focus(), Y();
214
+ let t = H.value.findIndex((e) => e.name === T.value);
215
+ F.value = t >= 0 ? t : Y(), await h(), Z(), (w.searchable ? ze.value : N.value)?.focus(), X();
215
216
  }), ce(P, () => {
216
- F.value = J(), m(X);
217
- }), ne(() => $(!1)), p({ focus: () => j.value?.focus() }), (e, a) => (g(), c("div", {
218
- class: h(["min-w-0", z.value ? "inline-flex" : "flex w-full"]),
217
+ F.value = Y(), h(Z);
218
+ }), ne(() => Xe(!1)), m({ focus: () => j.value?.focus() }), (e, t) => (_(), l("div", {
219
+ class: g(["min-w-0", z.value ? "inline-flex" : "flex w-full"]),
219
220
  "data-ac-ds": "",
220
221
  "data-testid": "ac-cluster-switcher"
221
- }, [f.loading ? (g(), c("div", {
222
+ }, [p.loading ? (_(), l("div", {
222
223
  key: 0,
223
224
  role: "status",
224
225
  "aria-label": "Loading clusters",
225
- class: h(["flex h-10 items-center rounded-10 border", [z.value ? "size-10 justify-center" : "w-full gap-2.5 px-2", B.value ? "border-white/10" : "border-border"]]),
226
+ class: g(["flex h-10 items-center rounded-10 border", [z.value ? "size-10 justify-center" : "w-full gap-2.5 px-2", B.value ? "border-white/10" : "border-border"]]),
226
227
  "data-ac-ds": "",
227
228
  "data-testid": "ac-cluster-switcher-loading"
228
- }, [d(t, {
229
+ }, [f(n, {
229
230
  shape: "rect",
230
231
  width: "28px",
231
232
  height: "28px",
232
233
  label: "",
233
234
  class: "shrink-0"
234
- }), z.value ? s("", !0) : (g(), o(t, {
235
+ }), z.value ? c("", !0) : (_(), s(n, {
235
236
  key: 0,
236
237
  shape: "text",
237
238
  width: "60%",
238
239
  height: "10px",
239
240
  label: ""
240
- }))], 2)) : (g(), c("button", {
241
+ }))], 2)) : (_(), l("button", {
241
242
  key: 1,
242
- id: `${b(O)}-trigger`,
243
+ id: `${x(O)}-trigger`,
243
244
  ref_key: "trigger",
244
245
  ref: j,
245
246
  type: "button",
246
247
  "aria-haspopup": "dialog",
247
- "aria-expanded": w.value,
248
- "aria-controls": w.value ? k : void 0,
249
- "aria-label": ze.value,
248
+ "aria-expanded": E.value,
249
+ "aria-controls": E.value ? k : void 0,
250
+ "aria-label": Be.value,
250
251
  title: z.value && V.value ? U(V.value) : void 0,
251
- disabled: f.disabled,
252
- class: h(["group relative flex h-10 min-w-0 cursor-pointer items-center rounded-10 border text-left transition-[color,background-color,border-color,box-shadow] duration-200 disabled:cursor-not-allowed disabled:opacity-50", [
252
+ disabled: p.disabled,
253
+ class: g(["group relative flex h-10 min-w-0 cursor-pointer items-center rounded-10 border text-left transition-[color,background-color,border-color,box-shadow] duration-200 disabled:cursor-not-allowed disabled:opacity-50", [
253
254
  z.value ? "size-10 justify-center" : "w-full gap-2.5 pr-2.5 pl-1.5",
254
255
  B.value ? "border-white/10 bg-white/4 enabled:hover:bg-white/8 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : "border-border bg-background enabled:hover:border-accent-active focus-visible:focus-ring",
255
- w.value && (B.value ? "bg-white/8" : "focus-ring")
256
+ E.value && (B.value ? "bg-white/8" : "focus-ring")
256
257
  ]]),
257
258
  "data-ac-ds": "",
258
259
  "data-testid": "ac-cluster-switcher-trigger",
259
- onClick: a[1] ||= (e) => w.value ? Z() : He(),
260
- onKeydown: Ge
261
- }, [l("span", ve, [K(V.value?.provider) ? (g(), c("img", {
260
+ onClick: t[1] ||= (e) => E.value ? $() : Q(),
261
+ onKeydown: We
262
+ }, [u("span", ge, [K(V.value?.provider) ? (_(), l("img", {
262
263
  key: 0,
263
264
  src: K(V.value?.provider),
264
265
  alt: "",
265
266
  class: "size-5 object-contain",
266
- onError: a[0] ||= (e) => Be(V.value?.provider)
267
- }, null, 40, ye)) : (g(), o(b(me), {
267
+ onError: t[0] ||= (e) => q(V.value?.provider)
268
+ }, null, 40, _e)) : (_(), s(x(C), {
268
269
  key: 1,
269
270
  class: "size-4 text-muted"
270
- })), V.value ? (g(), c("span", {
271
+ })), V.value ? (_(), l("span", {
271
272
  key: 2,
272
- class: h(["absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2", [E[G(V.value.status)], B.value ? "ring-sidebar" : "ring-surface"]])
273
- }, null, 2)) : s("", !0)]), z.value ? s("", !0) : (g(), c(n, { key: 0 }, [l("span", be, [l("span", { class: h(["block truncate text-base leading-5 font-medium", V.value ? "text-heading" : "text-muted"]) }, y(V.value ? U(V.value) : f.placeholder), 3), V.value?.location ? (g(), c("span", xe, y(V.value.location), 1)) : s("", !0)]), d(b(pe), {
273
+ class: g(["absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2", [Ie[G(V.value.status)], B.value ? "ring-sidebar" : "ring-surface"]])
274
+ }, null, 2)) : c("", !0)]), z.value ? c("", !0) : (_(), l(r, { key: 0 }, [u("span", ve, [u("span", { class: g(["block truncate text-base leading-5 font-medium", V.value ? "text-heading" : "text-muted"]) }, b(V.value ? U(V.value) : p.placeholder), 3), V.value?.location ? (_(), l("span", ye, b(V.value.location), 1)) : c("", !0)]), f(x(fe), {
274
275
  class: "size-4 shrink-0 text-muted transition-colors group-hover:text-heading",
275
276
  "aria-hidden": "true"
276
- })], 64))], 42, _e)), (g(), o(r, { to: "body" }, [d(i, {
277
+ })], 64))], 42, he)), (_(), s(i, { to: "body" }, [f(a, {
277
278
  "enter-active-class": "transition duration-150 ease-out",
278
279
  "enter-from-class": `opacity-0 motion-safe:scale-[0.98] ${z.value ? "motion-safe:-translate-x-1" : R.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
279
280
  "leave-active-class": "transition duration-100 ease-in",
280
281
  "leave-to-class": "opacity-0"
281
282
  }, {
282
- default: le(() => [w.value ? (g(), c("div", {
283
+ default: S(() => [E.value ? (_(), l("div", {
283
284
  key: 0,
284
285
  id: k,
285
286
  ref_key: "panel",
286
287
  ref: M,
287
288
  role: "dialog",
288
289
  "aria-label": "Switch cluster",
289
- class: h(["fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-14 border border-border bg-surface shadow-lg", z.value ? "origin-left" : R.value ? "origin-top" : "origin-bottom"]),
290
+ class: g(["fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-14 border border-border bg-surface shadow-lg", z.value ? "origin-left" : R.value ? "origin-top" : "origin-bottom"]),
290
291
  style: te(L.value),
291
292
  "data-ac-ds": "",
292
293
  "data-testid": "ac-cluster-switcher-panel",
293
294
  onKeydown: Ke
294
295
  }, [
295
- f.searchable ? (g(), c("div", Se, [l("div", Ce, [d(b(ge), {
296
+ p.searchable ? (_(), l("div", be, [u("div", xe, [f(x(me), {
296
297
  class: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted",
297
298
  "aria-hidden": "true"
298
- }), ue(l("input", {
299
+ }), le(u("input", {
299
300
  ref_key: "searchInput",
300
- ref: Re,
301
- "onUpdate:modelValue": a[2] ||= (e) => P.value = e,
301
+ ref: ze,
302
+ "onUpdate:modelValue": t[2] ||= (e) => P.value = e,
302
303
  type: "text",
303
304
  role: "combobox",
304
305
  "aria-autocomplete": "list",
305
306
  "aria-expanded": "true",
306
307
  "aria-controls": A,
307
- "aria-activedescendant": F.value >= 0 ? q(F.value) : void 0,
308
- "aria-label": f.searchPlaceholder,
309
- placeholder: f.searchPlaceholder,
308
+ "aria-activedescendant": F.value >= 0 ? J(F.value) : void 0,
309
+ "aria-label": p.searchPlaceholder,
310
+ placeholder: p.searchPlaceholder,
310
311
  autocomplete: "off",
311
312
  spellcheck: "false",
312
313
  class: "h-9 w-full rounded-10 border border-border bg-background pr-3 pl-9 text-base text-heading outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-muted/80 hover:border-accent-active focus:focus-ring",
313
314
  "data-ac-ds": "",
314
315
  "data-testid": "ac-cluster-switcher-search",
315
- onKeydown: Q
316
- }, null, 40, we), [[se, P.value]])])])) : s("", !0),
317
- l("ul", {
316
+ onKeydown: Ge
317
+ }, null, 40, Se), [[se, P.value]])])])) : c("", !0),
318
+ u("ul", {
318
319
  id: A,
319
320
  ref_key: "listEl",
320
321
  ref: N,
321
322
  role: "listbox",
322
323
  "aria-label": "Clusters",
323
- tabindex: f.searchable ? -1 : 0,
324
- "aria-activedescendant": !f.searchable && F.value >= 0 ? q(F.value) : void 0,
324
+ tabindex: p.searchable ? -1 : 0,
325
+ "aria-activedescendant": !p.searchable && F.value >= 0 ? J(F.value) : void 0,
325
326
  class: "ac-scrollbar max-h-72 min-h-0 flex-1 p-2 outline-none",
326
- onKeydown: Q
327
- }, [(g(!0), c(n, null, re(H.value, (t, n) => (g(), c("li", {
328
- id: q(n),
329
- key: t.name,
327
+ onKeydown: Ge
328
+ }, [(_(!0), l(r, null, re(H.value, (n, r) => (_(), l("li", {
329
+ id: J(r),
330
+ key: n.name,
330
331
  role: "option",
331
- "aria-selected": t.name === C.value,
332
- "aria-disabled": W(t) || void 0,
333
- class: h(["flex items-center gap-2.5 rounded-8 px-2.5 py-2 transition-colors duration-75", [W(t) ? "cursor-not-allowed opacity-50" : "cursor-pointer", n === F.value ? "bg-accent-hover" : t.name === C.value && "bg-accent"]]),
332
+ "aria-selected": n.name === T.value,
333
+ "aria-disabled": W(n) || void 0,
334
+ class: g(["flex items-center gap-2.5 rounded-8 px-2.5 py-2 transition-colors duration-75", [W(n) ? "cursor-not-allowed opacity-50" : "cursor-pointer", r === F.value ? "bg-accent-hover" : n.name === T.value && "bg-accent"]]),
334
335
  "data-ac-ds": "",
335
336
  "data-testid": "ac-cluster-switcher-option",
336
- onMouseenter: (e) => !W(t) && (F.value = n),
337
- onMousedown: a[3] ||= de(() => {}, ["prevent"]),
338
- onClick: (e) => Ue(t)
339
- }, [v(e.$slots, "option", {
340
- cluster: t,
341
- selected: t.name === C.value,
342
- active: n === F.value
337
+ onMouseenter: (e) => !W(n) && (F.value = r),
338
+ onMousedown: t[3] ||= ue(() => {}, ["prevent"]),
339
+ onClick: (e) => He(n)
340
+ }, [y(e.$slots, "option", {
341
+ cluster: n,
342
+ selected: n.name === T.value,
343
+ active: r === F.value
343
344
  }, () => [
344
- l("span", De, [K(t.provider) ? (g(), c("img", {
345
+ u("span", Te, [K(n.provider) ? (_(), l("img", {
345
346
  key: 0,
346
- src: K(t.provider),
347
+ src: K(n.provider),
347
348
  alt: "",
348
349
  class: "size-5 object-contain",
349
- onError: (e) => Be(t.provider)
350
- }, null, 40, Oe)) : (g(), o(b(me), {
350
+ onError: (e) => q(n.provider)
351
+ }, null, 40, Ee)) : (_(), s(x(C), {
351
352
  key: 1,
352
353
  class: "size-4 text-muted"
353
354
  }))]),
354
- l("span", ke, [l("span", Ae, y(U(t)), 1), l("span", je, [
355
- t.status ? (g(), c("span", {
355
+ u("span", De, [u("span", Oe, b(U(n)), 1), u("span", ke, [
356
+ n.status ? (_(), l("span", {
356
357
  key: 0,
357
- class: h(["inline-flex shrink-0 items-center gap-1", Le[G(t.status)]])
358
- }, [l("span", {
359
- class: h(["size-1.5 rounded-full", E[G(t.status)]]),
358
+ class: g(["inline-flex shrink-0 items-center gap-1", Le[G(n.status)]])
359
+ }, [u("span", {
360
+ class: g(["size-1.5 rounded-full", Ie[G(n.status)]]),
360
361
  "aria-hidden": "true"
361
- }, null, 2), u(" " + y(t.status), 1)], 2)) : s("", !0),
362
- t.status && (t.location || t.provider) ? (g(), c("span", Me, "·")) : s("", !0),
363
- l("span", Ne, y([t.provider, t.location].filter(Boolean).join(" · ")), 1)
362
+ }, null, 2), d(" " + b(n.status), 1)], 2)) : c("", !0),
363
+ n.status && (n.location || n.provider) ? (_(), l("span", Ae, "·")) : c("", !0),
364
+ u("span", je, b([n.provider, n.location].filter(Boolean).join(" · ")), 1)
364
365
  ])]),
365
- t.name === C.value ? (g(), o(b(fe), {
366
+ n.name === T.value ? (_(), s(x(de), {
366
367
  key: 0,
367
368
  class: "size-4 shrink-0 text-primary-strong",
368
369
  "aria-hidden": "true"
369
- })) : s("", !0)
370
- ])], 42, Ee))), 128)), H.value.length ? s("", !0) : (g(), c("li", Pe, [v(e.$slots, "empty", { query: P.value }, () => [u(y(P.value ? `No clusters match “${P.value}”` : "No clusters yet"), 1)])]))], 40, Te),
371
- e.$slots.footer || f.importLabel ? (g(), c("div", Fe, [v(e.$slots, "footer", { close: Z }, () => [(g(), o(ie(f.importUrl ? "a" : "button"), {
372
- href: f.importUrl || void 0,
373
- type: f.importUrl ? void 0 : "button",
370
+ })) : c("", !0)
371
+ ])], 42, we))), 128)), H.value.length ? c("", !0) : (_(), l("li", Me, [y(e.$slots, "empty", { query: P.value }, () => [d(b(P.value ? `No clusters match “${P.value}”` : "No clusters yet"), 1)])]))], 40, Ce),
372
+ e.$slots.footer || p.importLabel ? (_(), l("div", Ne, [y(e.$slots, "footer", { close: $ }, () => [(_(), s(ie(p.importUrl ? "a" : "button"), {
373
+ href: p.importUrl || void 0,
374
+ type: p.importUrl ? void 0 : "button",
374
375
  class: "flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-8 px-3 py-2 text-base font-medium text-heading no-underline outline-none transition-colors duration-150 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
375
376
  "data-ac-ds": "",
376
377
  "data-testid": "ac-cluster-switcher-import",
377
- onClick: We
378
+ onClick: Ue
378
379
  }, {
379
- default: le(() => [d(b(he), {
380
+ default: S(() => [f(x(pe), {
380
381
  class: "size-4 shrink-0 text-muted",
381
382
  "aria-hidden": "true"
382
- }), u(" " + y(f.importLabel), 1)]),
383
+ }), d(" " + b(p.importLabel), 1)]),
383
384
  _: 1
384
- }, 8, ["href", "type"]))])])) : s("", !0)
385
- ], 38)) : s("", !0)]),
385
+ }, 8, ["href", "type"]))])])) : c("", !0)
386
+ ], 38)) : c("", !0)]),
386
387
  _: 3
387
388
  }, 8, ["enter-from-class"])]))], 2));
388
389
  }
389
390
  });
390
391
  //#endregion
391
- export { x as default };
392
+ export { Pe as default };