@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,28 +1,29 @@
1
- import e from "../components/AcSkeleton.js";
2
- import t from "../components/AcEmptyState.js";
3
- import { Fragment as n, Teleport as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, useModel as b, watch as x } from "vue";
1
+ import { fixedFrame as e } from "../components/fixedFrame.js";
2
+ import t from "../components/AcSkeleton.js";
3
+ import n from "../components/AcEmptyState.js";
4
+ import { Fragment as r, Teleport as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, useModel as x, watch as S } from "vue";
4
5
  //#region src/lib/charts/ChartFrame.vue?vue&type=script&setup=true&lang.ts
5
- var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate" }, T = {
6
+ var C = ["data-testid"], w = ["aria-pressed", "onClick"], T = { class: "truncate" }, E = {
6
7
  key: 0,
7
8
  class: "ml-auto pl-3 font-medium text-heading tabular-nums"
8
- }, E = ["role", "aria-label"], D = ["aria-label"], O = {
9
+ }, D = ["role", "aria-label"], O = ["aria-label"], k = {
9
10
  key: 4,
10
11
  class: "sr-only"
11
- }, k = {
12
+ }, A = {
12
13
  key: 5,
13
14
  class: "sr-only"
14
- }, A = {
15
+ }, j = {
15
16
  scope: "row",
16
17
  class: "text-left"
17
- }, j = {
18
+ }, M = {
18
19
  key: 0,
19
20
  class: "mb-1.5 font-medium text-heading"
20
- }, M = { class: "m-0 flex list-none flex-col gap-1 p-0" }, N = { class: "min-w-0 flex-1 truncate text-muted" }, P = { class: "pl-4 font-medium text-heading tabular-nums" }, F = {
21
+ }, N = { class: "m-0 flex list-none flex-col gap-1 p-0" }, P = { class: "min-w-0 flex-1 truncate text-muted" }, F = { class: "pl-4 font-medium text-heading tabular-nums" }, I = {
21
22
  key: 1,
22
23
  class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
23
- }, I = { class: "font-medium text-heading tabular-nums" }, L = 14, R = 300, z = 200, B = /*@__PURE__*/ l({
24
+ }, L = { class: "font-medium text-heading tabular-nums" }, R = 14, z = 300, B = 200, V = /*@__PURE__*/ u({
24
25
  __name: "ChartFrame",
25
- props: /*@__PURE__*/ u({
26
+ props: /*@__PURE__*/ d({
26
27
  testid: {},
27
28
  height: {},
28
29
  loading: { type: Boolean },
@@ -48,126 +49,126 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
48
49
  widthModifiers: {}
49
50
  }),
50
51
  emits: ["update:hidden", "update:width"],
51
- setup(l) {
52
- let u = l, B = b(l, "hidden"), V = b(l, "width"), H = g(), U;
53
- function W(e) {
54
- let t = B.value.includes(e);
55
- !t && u.legendItems.length - B.value.length <= 1 || (B.value = t ? B.value.filter((t) => t !== e) : [...B.value, e]);
56
- }
52
+ setup(u) {
53
+ let d = u, V = x(u, "hidden"), H = x(u, "width"), U = _(), W;
57
54
  function G(e) {
58
- let t = e.clientX > window.innerWidth - R, n = e.clientY > window.innerHeight - z;
55
+ let t = V.value.includes(e);
56
+ !t && d.legendItems.length - V.value.length <= 1 || (V.value = t ? V.value.filter((t) => t !== e) : [...V.value, e]);
57
+ }
58
+ function K(t) {
59
+ let n = e(), r = t.clientX > n.right - z, i = t.clientY > n.bottom - B;
59
60
  return {
60
- left: t ? void 0 : `${e.clientX + L}px`,
61
- right: t ? `${window.innerWidth - e.clientX + L}px` : void 0,
62
- top: n ? void 0 : `${e.clientY + L}px`,
63
- bottom: n ? `${window.innerHeight - e.clientY + L}px` : void 0
61
+ left: r ? void 0 : `${t.clientX - n.left + R}px`,
62
+ right: r ? `${n.right - t.clientX + R}px` : void 0,
63
+ top: i ? void 0 : `${t.clientY - n.top + R}px`,
64
+ bottom: i ? `${n.bottom - t.clientY + R}px` : void 0
64
65
  };
65
66
  }
66
- function K() {
67
- U?.disconnect(), H.value && typeof ResizeObserver < "u" && (U = new ResizeObserver(([e]) => {
68
- e && (V.value = Math.round(e.contentRect.width));
69
- }), U.observe(H.value));
67
+ function q() {
68
+ W?.disconnect(), U.value && typeof ResizeObserver < "u" && (W = new ResizeObserver(([e]) => {
69
+ e && (H.value = Math.round(e.contentRect.width));
70
+ }), W.observe(U.value));
70
71
  }
71
- return x(H, K), m(K), p(() => U?.disconnect()), (u, p) => (h(), o("figure", {
72
- class: d(["m-0 flex w-full min-w-0 gap-3", l.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
72
+ return S(U, q), h(q), m(() => W?.disconnect()), (e, d) => (g(), s("figure", {
73
+ class: f(["m-0 flex w-full min-w-0 gap-3", u.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
73
74
  "data-ac-ds": "",
74
75
  "data-ac-chart": "",
75
- "data-testid": l.testid
76
+ "data-testid": u.testid
76
77
  }, [
77
- l.legend !== "none" && l.legendItems.length > 1 && !l.loading && !l.empty ? (h(), o("ul", {
78
+ u.legend !== "none" && u.legendItems.length > 1 && !u.loading && !u.empty ? (g(), s("ul", {
78
79
  key: 0,
79
- class: d(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
80
- l.legend === "bottom" && "order-last",
81
- l.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
82
- l.legendCentered && l.legend !== "right" && "justify-center"
80
+ class: f(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
81
+ u.legend === "bottom" && "order-last",
82
+ u.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
83
+ u.legendCentered && u.legend !== "right" && "justify-center"
83
84
  ]]),
84
85
  "aria-label": "Legend"
85
- }, [(h(!0), o(n, null, _(l.legendItems, (e) => (h(), o("li", {
86
+ }, [(g(!0), s(r, null, v(u.legendItems, (e) => (g(), s("li", {
86
87
  key: e.key,
87
88
  class: "flex"
88
- }, [s("button", {
89
+ }, [c("button", {
89
90
  type: "button",
90
- class: d(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [B.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", l.legend === "right" && "w-full"]]),
91
- "aria-pressed": !B.value.includes(e.key),
92
- onClick: (t) => W(e.key)
91
+ class: f(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [V.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", u.legend === "right" && "w-full"]]),
92
+ "aria-pressed": !V.value.includes(e.key),
93
+ onClick: (t) => G(e.key)
93
94
  }, [
94
- s("span", {
95
- class: d(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", B.value.includes(e.key) && "opacity-30"]),
96
- style: f({ backgroundColor: e.color }),
95
+ c("span", {
96
+ class: f(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", V.value.includes(e.key) && "opacity-30"]),
97
+ style: p({ backgroundColor: e.color }),
97
98
  "aria-hidden": "true"
98
99
  }, null, 6),
99
- s("span", w, y(e.name), 1),
100
- e.value ? (h(), o("span", T, y(e.value), 1)) : a("", !0)
101
- ], 10, C)]))), 128))], 2)) : a("", !0),
102
- l.loading ? (h(), i(e, {
100
+ c("span", T, b(e.name), 1),
101
+ e.value ? (g(), s("span", E, b(e.value), 1)) : o("", !0)
102
+ ], 10, w)]))), 128))], 2)) : o("", !0),
103
+ u.loading ? (g(), a(t, {
103
104
  key: 1,
104
105
  shape: "rect",
105
- height: `${l.height}px`,
106
+ height: `${u.height}px`,
106
107
  label: "Loading chart"
107
- }, null, 8, ["height"])) : l.empty ? (h(), o("div", {
108
+ }, null, 8, ["height"])) : u.empty ? (g(), s("div", {
108
109
  key: 2,
109
110
  class: "flex w-full items-center justify-center overflow-hidden",
110
- style: f({ height: `${l.height}px` })
111
- }, [c(t, {
111
+ style: p({ height: `${u.height}px` })
112
+ }, [l(n, {
112
113
  size: "small",
113
- icon: l.emptyIcon,
114
- title: l.emptyText
115
- }, null, 8, ["icon", "title"])], 4)) : (h(), o("div", {
114
+ icon: u.emptyIcon,
115
+ title: u.emptyText
116
+ }, null, 8, ["icon", "title"])], 4)) : (g(), s("div", {
116
117
  key: 3,
117
118
  ref_key: "plot",
118
- ref: H,
119
- class: d(["relative min-w-0", l.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
120
- style: f(l.legend === "right" ? {
121
- height: `${l.height}px`,
122
- width: `${l.height}px`
123
- } : { height: `${l.height}px` }),
124
- role: u.$slots.controls ? void 0 : "img",
125
- "aria-label": u.$slots.controls ? void 0 : l.summary
126
- }, [u.$slots.controls ? (h(), o("div", {
119
+ ref: U,
120
+ class: f(["relative min-w-0", u.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
121
+ style: p(u.legend === "right" ? {
122
+ height: `${u.height}px`,
123
+ width: `${u.height}px`
124
+ } : { height: `${u.height}px` }),
125
+ role: e.$slots.controls ? void 0 : "img",
126
+ "aria-label": e.$slots.controls ? void 0 : u.summary
127
+ }, [e.$slots.controls ? (g(), s("div", {
127
128
  key: 0,
128
129
  class: "size-full",
129
130
  role: "img",
130
- "aria-label": l.summary
131
- }, [v(u.$slots, "default")], 8, D)) : v(u.$slots, "default", {}, void 0, void 0, 1), v(u.$slots, "controls")], 14, E)),
132
- l.title || l.description ? (h(), o("figcaption", O, y([l.title, l.description].filter(Boolean).join(". ")), 1)) : a("", !0),
133
- !l.loading && !l.empty ? (h(), o("table", k, [
134
- s("caption", null, y(l.title ? `${l.title}: data` : "Chart data"), 1),
135
- s("thead", null, [s("tr", null, [(h(!0), o(n, null, _(l.table.columns, (e, t) => (h(), o("th", {
131
+ "aria-label": u.summary
132
+ }, [y(e.$slots, "default")], 8, O)) : y(e.$slots, "default", {}, void 0, void 0, 1), y(e.$slots, "controls")], 14, D)),
133
+ u.title || u.description ? (g(), s("figcaption", k, b([u.title, u.description].filter(Boolean).join(". ")), 1)) : o("", !0),
134
+ !u.loading && !u.empty ? (g(), s("table", A, [
135
+ c("caption", null, b(u.title ? `${u.title}: data` : "Chart data"), 1),
136
+ c("thead", null, [c("tr", null, [(g(!0), s(r, null, v(u.table.columns, (e, t) => (g(), s("th", {
136
137
  key: t,
137
138
  scope: "col",
138
139
  class: "text-left"
139
- }, y(e), 1))), 128))])]),
140
- s("tbody", null, [(h(!0), o(n, null, _(l.table.rows, (e, t) => (h(), o("tr", { key: t }, [s("th", A, y(e[0]), 1), (h(!0), o(n, null, _(e.slice(1), (e, t) => (h(), o("td", { key: t }, y(e), 1))), 128))]))), 128))])
141
- ])) : a("", !0),
142
- (h(), i(r, { to: "body" }, [l.tooltip && l.tip && !l.loading && !l.empty ? (h(), o("div", {
140
+ }, b(e), 1))), 128))])]),
141
+ c("tbody", null, [(g(!0), s(r, null, v(u.table.rows, (e, t) => (g(), s("tr", { key: t }, [c("th", j, b(e[0]), 1), (g(!0), s(r, null, v(e.slice(1), (e, t) => (g(), s("td", { key: t }, b(e), 1))), 128))]))), 128))])
142
+ ])) : o("", !0),
143
+ (g(), a(i, { to: "body" }, [u.tooltip && u.tip && !u.loading && !u.empty ? (g(), s("div", {
143
144
  key: 0,
144
145
  class: "pointer-events-none fixed z-[100] w-max max-w-[280px] min-w-[160px] rounded-10 border border-border bg-surface px-3 py-2.5 text-xs text-body shadow-lg",
145
- style: f(G(l.tip)),
146
+ style: p(K(u.tip)),
146
147
  "aria-hidden": "true",
147
148
  "data-ac-ds": "",
148
149
  "data-testid": "ac-chart-tooltip"
149
- }, [v(u.$slots, "tooltip", {
150
- datum: l.tip.datum,
151
- index: l.tip.index,
152
- title: l.tip.title,
153
- items: l.tip.items
150
+ }, [y(e.$slots, "tooltip", {
151
+ datum: u.tip.datum,
152
+ index: u.tip.index,
153
+ title: u.tip.title,
154
+ items: u.tip.items
154
155
  }, () => [
155
- l.tip.title ? (h(), o("p", j, y(l.tip.title), 1)) : a("", !0),
156
- s("ul", M, [(h(!0), o(n, null, _(l.tip.items, (e) => (h(), o("li", {
156
+ u.tip.title ? (g(), s("p", M, b(u.tip.title), 1)) : o("", !0),
157
+ c("ul", N, [(g(!0), s(r, null, v(u.tip.items, (e) => (g(), s("li", {
157
158
  key: e.key,
158
159
  class: "flex items-center gap-2"
159
160
  }, [
160
- s("span", {
161
+ c("span", {
161
162
  class: "size-2 shrink-0 rounded-full",
162
- style: f({ backgroundColor: e.color })
163
+ style: p({ backgroundColor: e.color })
163
164
  }, null, 4),
164
- s("span", N, y(e.name), 1),
165
- s("span", P, y(e.formatted), 1)
165
+ c("span", P, b(e.name), 1),
166
+ c("span", F, b(e.formatted), 1)
166
167
  ]))), 128))]),
167
- l.tip.total ? (h(), o("p", F, [p[0] ||= s("span", { class: "text-muted" }, "Total", -1), s("span", I, y(l.tip.total), 1)])) : a("", !0)
168
- ])], 4)) : a("", !0)]))
169
- ], 10, S));
168
+ u.tip.total ? (g(), s("p", I, [d[0] ||= c("span", { class: "text-muted" }, "Total", -1), c("span", L, b(u.tip.total), 1)])) : o("", !0)
169
+ ])], 4)) : o("", !0)]))
170
+ ], 10, C));
170
171
  }
171
172
  });
172
173
  //#endregion
173
- export { B as default };
174
+ export { V as default };
@@ -1,6 +1,7 @@
1
1
  import e from "./AcLogo.js";
2
2
  import t from "./AcNavbarItem.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, createVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as ee, openBlock as g, ref as _, renderList as v, renderSlot as te, resolveDynamicComponent as ne, toDisplayString as y, unref as b, useId as re, useModel as ie, watch as ae, withCtx as oe } from "vue";
3
+ import { fixedFrame as n } from "./fixedFrame.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, createVNode as d, defineComponent as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as ee, openBlock as _, ref as v, renderList as te, renderSlot as ne, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as re, useModel as ie, watch as ae, withCtx as oe } from "vue";
4
5
  import { ChartLine as se, Check as ce, Database as le, GraduationCap as ue, Grip as de, Receipt as fe, Server as pe, ServerCog as me, Telescope as he } from "@lucide/vue";
5
6
  //#region src/lib/components/AcAppSwitcher.vue?vue&type=script&setup=true&lang.ts
6
7
  var ge = {
@@ -15,22 +16,22 @@ var ge = {
15
16
  "aria-current",
16
17
  "title",
17
18
  "onClick"
18
- ], x = ["src"], S = {
19
+ ], S = ["src"], C = {
19
20
  key: 3,
20
21
  class: "text-lg font-semibold"
21
- }, C = { class: "w-full truncate text-xs font-medium text-heading" }, w = {
22
+ }, w = { class: "w-full truncate text-xs font-medium text-heading" }, T = {
22
23
  key: 0,
23
24
  class: "sr-only"
24
- }, T = {
25
+ }, E = {
25
26
  key: 1,
26
27
  class: "absolute top-1.5 right-1.5 inline-flex size-4 items-center justify-center rounded-full bg-primary text-white",
27
28
  "aria-hidden": "true"
28
- }, E = {
29
+ }, D = {
29
30
  key: 0,
30
31
  class: "mt-2 border-t border-border pt-2"
31
- }, D = "id", O = 3, k = 6, A = /*@__PURE__*/ d({
32
+ }, O = "id", k = 3, A = 6, j = /*@__PURE__*/ f({
32
33
  __name: "AcAppSwitcher",
33
- props: /*@__PURE__*/ f({
34
+ props: /*@__PURE__*/ p({
34
35
  currentApp: { default: "platform" },
35
36
  baseUrl: { default: "https://appscode.com" },
36
37
  activeOrganization: { default: "" },
@@ -54,11 +55,11 @@ var ge = {
54
55
  },
55
56
  openModifiers: {}
56
57
  }),
57
- emits: /*@__PURE__*/ f(["select"], ["update:open"]),
58
- setup(d, { emit: f }) {
59
- let A = d, j = ie(d, "open"), M = f, N = [
58
+ emits: /*@__PURE__*/ p(["select"], ["update:open"]),
59
+ setup(f, { emit: p }) {
60
+ let j = f, M = ie(f, "open"), N = p, P = [
60
61
  {
61
- name: D,
62
+ name: O,
62
63
  title: "Platform",
63
64
  port: "8080",
64
65
  subtitle: "Manage your platform & accounts"
@@ -111,14 +112,14 @@ var ge = {
111
112
  icon: ue,
112
113
  color: "red"
113
114
  }
114
- ], P = {
115
+ ], F = {
115
116
  name: "console",
116
117
  title: "Console",
117
118
  port: "5990",
118
119
  subtitle: "Manage your kubernetes clusters",
119
120
  icon: pe,
120
121
  color: "blue"
121
- }, F = [
122
+ }, ye = [
122
123
  "https://appscode.ninja",
123
124
  "https://appscode.com",
124
125
  "http://bb.test:8080"
@@ -126,7 +127,7 @@ var ge = {
126
127
  "billing",
127
128
  "selfhost",
128
129
  "learn"
129
- ], ye = {
130
+ ], be = {
130
131
  primary: "bg-primary/10 text-primary-strong ring-primary/25",
131
132
  blue: "bg-info/10 text-info-strong ring-info/25",
132
133
  green: "bg-success/10 text-success-strong ring-success/25",
@@ -134,15 +135,15 @@ var ge = {
134
135
  purple: "bg-pending/10 text-pending-strong ring-pending/25",
135
136
  red: "bg-danger/10 text-danger-strong ring-danger/25",
136
137
  slate: "bg-surface-sunken text-muted ring-border"
137
- }, L = re(), R = `${L}-panel`, z = `${L}-heading`, B = _(null), V = _(null), H = _({}), U = _(!0), W = a(() => A.currentApp === "platform" ? D : A.currentApp), be = a(() => !F.includes(A.baseUrl)), xe = a(() => {
138
- let e = [...N];
139
- return A.activeOrgType !== O && e.splice(1, 0, P), e.filter((e) => !be.value || !I.includes(e.name) || e.name === "billing" && A.isOfflineInstaller && A.activeOrgType === k);
140
- }), G = a(() => (A.apps ?? xe.value).filter((e) => !A.hideCurrent || e.name !== W.value).map((e) => ({
138
+ }, L = re(), R = `${L}-panel`, z = `${L}-heading`, B = v(null), V = v(null), H = v({}), U = v(!0), W = o(() => j.currentApp === "platform" ? O : j.currentApp), xe = o(() => !ye.includes(j.baseUrl)), Se = o(() => {
139
+ let e = [...P];
140
+ return j.activeOrgType !== k && e.splice(1, 0, F), e.filter((e) => !xe.value || !I.includes(e.name) || e.name === "billing" && j.isOfflineInstaller && j.activeOrgType === A);
141
+ }), G = o(() => (j.apps ?? Se.value).filter((e) => !j.hideCurrent || e.name !== W.value).map((e) => ({
141
142
  ...e,
142
- url: e.url ?? Se(e)
143
+ url: e.url ?? Ce(e)
143
144
  })));
144
- function Se(e) {
145
- return A.baseUrl.includes("bb.test") ? `http://bb.test:${e.port}/${e.name}/` : A.baseUrl.includes("localhost") ? `http://localhost:${e.port}/${e.name}/` : `${A.baseUrl}/${e.name}/`;
145
+ function Ce(e) {
146
+ return j.baseUrl.includes("bb.test") ? `http://bb.test:${e.port}/${e.name}/` : j.baseUrl.includes("localhost") ? `http://localhost:${e.port}/${e.name}/` : `${j.baseUrl}/${e.name}/`;
146
147
  }
147
148
  function K(e) {
148
149
  return e.name === W.value;
@@ -153,7 +154,7 @@ var ge = {
153
154
  function J() {
154
155
  return [...V.value?.querySelectorAll("[data-app-tile]") ?? []];
155
156
  }
156
- function Ce(e) {
157
+ function we(e) {
157
158
  let t = e[0]?.offsetTop, n = e.filter((e) => e.offsetTop === t).length;
158
159
  return Math.max(n, 1);
159
160
  }
@@ -164,43 +165,43 @@ var ge = {
164
165
  function X() {
165
166
  let e = q();
166
167
  if (!e || !V.value) return;
167
- let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = V.value, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = A.align === "end" ? t.right - n : t.left;
168
- U.value = !o, H.value = {
169
- [o ? "bottom" : "top"]: `${o ? window.innerHeight - t.top + 6 : t.bottom + 6}px`,
170
- left: `${Math.max(8, Math.min(s, window.innerWidth - n - 8))}px`,
171
- maxHeight: `${Math.max(o ? a : i, 160)}px`
168
+ let t = e.getBoundingClientRect(), r = n(), { offsetWidth: i, offsetHeight: a } = V.value, o = r.bottom - t.bottom - 6 - 8, s = t.top - r.top - 6 - 8, c = o < a && s > o, l = (j.align === "end" ? t.right - i : t.left) - r.left;
169
+ U.value = !c, H.value = {
170
+ [c ? "bottom" : "top"]: `${c ? r.bottom - t.top + 6 : t.bottom + 6 - r.top}px`,
171
+ left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
172
+ maxHeight: `${Math.max(c ? s : o, 160)}px`
172
173
  };
173
174
  }
174
175
  function Z(e = !0) {
175
- j.value && (j.value = !1, e && q()?.focus());
176
- }
177
- function we() {
178
- j.value ? Z() : j.value = !0;
176
+ M.value && (M.value = !1, e && q()?.focus());
179
177
  }
180
178
  function Te() {
181
- let e = [`gorg=${encodeURIComponent(A.activeOrganization)}`, "path=/"];
182
- A.rootDomain && e.push(`domain=${A.rootDomain}`), document.cookie = e.join("; ");
179
+ M.value ? Z() : M.value = !0;
183
180
  }
184
- function Ee(e) {
185
- e.name === "grafana" && Te(), M("select", e);
181
+ function Ee() {
182
+ let e = [`gorg=${encodeURIComponent(j.activeOrganization)}`, "path=/"];
183
+ j.rootDomain && e.push(`domain=${j.rootDomain}`), document.cookie = e.join("; ");
186
184
  }
187
185
  function De(e) {
188
- e.key !== "ArrowDown" || j.value || (e.preventDefault(), j.value = !0);
186
+ e.name === "grafana" && Ee(), N("select", e);
189
187
  }
190
188
  function Oe(e) {
191
- let t = J(), n = t.indexOf(document.activeElement), r = Ce(t), i = {
189
+ e.key !== "ArrowDown" || M.value || (e.preventDefault(), M.value = !0);
190
+ }
191
+ function ke(e) {
192
+ let t = J(), n = t.indexOf(document.activeElement), r = we(t), i = {
192
193
  ArrowRight: 1,
193
194
  ArrowLeft: -1,
194
195
  ArrowDown: r,
195
196
  ArrowUp: -r
196
197
  };
197
- e.key in i && n >= 0 ? (e.preventDefault(), Y(n + i[e.key])) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Y(e.key === "Home" ? 0 : t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && ke(e);
198
+ e.key in i && n >= 0 ? (e.preventDefault(), Y(n + i[e.key])) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Y(e.key === "Home" ? 0 : t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && Ae(e);
198
199
  }
199
- function ke(e) {
200
+ function Ae(e) {
200
201
  let t = [...V.value?.querySelectorAll("a[href], button:not([disabled])") ?? []], n = t[0], r = t[t.length - 1];
201
202
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), Z()) : !e.shiftKey && document.activeElement === r && Z();
202
203
  }
203
- function Ae(e) {
204
+ function je(e) {
204
205
  let t = e.target;
205
206
  q()?.contains(t) || V.value?.contains(t) || Z(!1);
206
207
  }
@@ -209,57 +210,57 @@ var ge = {
209
210
  }
210
211
  function $(e) {
211
212
  let t = e ? "addEventListener" : "removeEventListener";
212
- document[t]("pointerdown", Ae, !0), window[t]("scroll", Q, !0), window[t]("resize", Q);
213
+ document[t]("pointerdown", je, !0), window[t]("scroll", Q, !0), window[t]("resize", Q);
213
214
  }
214
- return ae(j, async (e) => {
215
+ return ae(M, async (e) => {
215
216
  if ($(e), !e) return;
216
- await p(), X();
217
+ await m(), X();
217
218
  let t = J(), n = G.value.findIndex(K);
218
219
  Y(n >= 0 && t[n] ? n : 0);
219
- }), ee(() => $(!1)), (a, f) => (g(), c("div", ge, [u(t, {
220
+ }), ee(() => $(!1)), (n, o) => (_(), l("div", ge, [d(t, {
220
221
  ref_key: "trigger",
221
222
  ref: B,
222
- label: d.label,
223
- icon: b(de),
223
+ label: f.label,
224
+ icon: x(de),
224
225
  "icon-only": "",
225
226
  "aria-haspopup": "dialog",
226
- "aria-expanded": j.value,
227
- "aria-controls": j.value ? R : void 0,
228
- class: m(j.value && "bg-surface-sunken text-heading"),
227
+ "aria-expanded": M.value,
228
+ "aria-controls": M.value ? R : void 0,
229
+ class: h(M.value && "bg-surface-sunken text-heading"),
229
230
  "data-ac-ds": "",
230
231
  "data-testid": "ac-app-switcher-trigger",
231
- onClick: we,
232
- onKeydown: De
232
+ onClick: Te,
233
+ onKeydown: Oe
233
234
  }, null, 8, [
234
235
  "label",
235
236
  "icon",
236
237
  "aria-expanded",
237
238
  "aria-controls",
238
239
  "class"
239
- ]), (g(), o(r, { to: "body" }, [u(i, {
240
+ ]), (_(), s(i, { to: "body" }, [d(a, {
240
241
  "enter-active-class": "transition duration-150 ease-out",
241
242
  "enter-from-class": "opacity-0 motion-safe:scale-95",
242
243
  "leave-active-class": "transition duration-100 ease-in",
243
244
  "leave-to-class": "opacity-0"
244
245
  }, {
245
- default: oe(() => [j.value ? (g(), c("div", {
246
+ default: oe(() => [M.value ? (_(), l("div", {
246
247
  key: 0,
247
248
  id: R,
248
249
  ref_key: "panel",
249
250
  ref: V,
250
251
  role: "dialog",
251
252
  "aria-labelledby": z,
252
- class: m(["ac-scrollbar fixed z-[90] flex w-[calc(340px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg", U.value ? "origin-top-right" : "origin-bottom-right"]),
253
- style: h(H.value),
253
+ class: h(["ac-scrollbar fixed z-[90] flex w-[calc(340px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg", U.value ? "origin-top-right" : "origin-bottom-right"]),
254
+ style: g(H.value),
254
255
  "data-ac-ds": "",
255
256
  "data-testid": "ac-app-switcher-panel",
256
- onKeydown: Oe
257
+ onKeydown: ke
257
258
  }, [
258
- l("p", {
259
+ u("p", {
259
260
  id: z,
260
261
  class: "px-3 pt-2 pb-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
261
- }, y(d.label), 1),
262
- l("ul", _e, [(g(!0), c(n, null, v(G.value, (t) => (g(), c("li", { key: t.name }, [l("a", {
262
+ }, b(f.label), 1),
263
+ u("ul", _e, [(_(!0), l(r, null, te(G.value, (t) => (_(), l("li", { key: t.name }, [u("a", {
263
264
  href: t.url,
264
265
  "data-app-tile": "",
265
266
  "aria-current": K(t) ? "page" : void 0,
@@ -267,37 +268,37 @@ var ge = {
267
268
  class: "group relative flex h-full flex-col items-center gap-2 rounded-8 px-1.5 pt-3 pb-2.5 text-center no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-[current=page]:bg-accent",
268
269
  "data-ac-ds": "",
269
270
  "data-testid": "ac-app-switcher-app",
270
- onClick: (e) => Ee(t)
271
+ onClick: (e) => De(t)
271
272
  }, [
272
- l("span", {
273
- class: m(["relative inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-10 ring-1 transition-transform duration-200 ring-inset motion-safe:group-hover:-translate-y-px", t.iconUrl || t.name === D && !t.icon ? "bg-surface ring-border" : ye[t.color ?? "slate"]]),
273
+ u("span", {
274
+ class: h(["relative inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-10 ring-1 transition-transform duration-200 ring-inset motion-safe:group-hover:-translate-y-px", t.iconUrl || t.name === O && !t.icon ? "bg-surface ring-border" : be[t.color ?? "slate"]]),
274
275
  "aria-hidden": "true"
275
- }, [t.iconUrl ? (g(), c("img", {
276
+ }, [t.iconUrl ? (_(), l("img", {
276
277
  key: 0,
277
278
  src: t.iconUrl,
278
279
  alt: "",
279
280
  class: "size-7 object-contain"
280
- }, null, 8, x)) : t.icon ? (g(), o(ne(t.icon), {
281
+ }, null, 8, S)) : t.icon ? (_(), s(y(t.icon), {
281
282
  key: 1,
282
283
  class: "size-5"
283
- })) : t.name === D ? (g(), o(e, {
284
+ })) : t.name === O ? (_(), s(e, {
284
285
  key: 2,
285
286
  variant: "mark",
286
287
  size: 28,
287
288
  label: ""
288
- })) : (g(), c("span", S, y(t.title.charAt(0)), 1))], 2),
289
- l("span", C, y(t.title), 1),
290
- t.subtitle ? (g(), c("span", w, y(t.subtitle), 1)) : s("", !0),
291
- K(t) ? (g(), c("span", T, [u(b(ce), {
289
+ })) : (_(), l("span", C, b(t.title.charAt(0)), 1))], 2),
290
+ u("span", w, b(t.title), 1),
291
+ t.subtitle ? (_(), l("span", T, b(t.subtitle), 1)) : c("", !0),
292
+ K(t) ? (_(), l("span", E, [d(x(ce), {
292
293
  class: "size-2.5",
293
294
  "stroke-width": 3
294
- })])) : s("", !0)
295
+ })])) : c("", !0)
295
296
  ], 8, ve)]))), 128))]),
296
- a.$slots.footer ? (g(), c("div", E, [te(a.$slots, "footer", { close: Z })])) : s("", !0)
297
- ], 38)) : s("", !0)]),
297
+ n.$slots.footer ? (_(), l("div", D, [ne(n.$slots, "footer", { close: Z })])) : c("", !0)
298
+ ], 38)) : c("", !0)]),
298
299
  _: 3
299
300
  })]))]));
300
301
  }
301
302
  });
302
303
  //#endregion
303
- export { A as default };
304
+ export { j as default };