@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,33 +1,34 @@
1
- import e from "./AcAvatar.js";
2
- import t from "./AcFontScale.js";
3
- import n from "./AcThemeMode.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, getCurrentInstance as m, mergeModels as h, mergeProps as ee, nextTick as g, normalizeClass as _, normalizeStyle as te, onBeforeUnmount as ne, openBlock as v, ref as y, renderList as b, renderSlot as re, resolveDynamicComponent as x, toDisplayString as S, unref as C, useId as ie, useModel as w, watch as T, withCtx as E } from "vue";
5
- import { Building2 as ae, Check as oe, ChevronDown as se, LogOut as ce } from "@lucide/vue";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import t from "./AcAvatar.js";
3
+ import n from "./AcFontScale.js";
4
+ import r from "./AcThemeMode.js";
5
+ import { Fragment as i, Teleport as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as ee, mergeModels as h, mergeProps as te, nextTick as g, normalizeClass as _, normalizeStyle as ne, onBeforeUnmount as re, openBlock as v, ref as y, renderList as b, renderSlot as ie, resolveDynamicComponent as x, toDisplayString as S, unref as C, useId as ae, useModel as w, watch as T, withCtx as E } from "vue";
6
+ import { Building2 as oe, Check as se, ChevronDown as ce, LogOut as le } from "@lucide/vue";
6
7
  //#region src/lib/components/AcUserMenu.vue?vue&type=script&setup=true&lang.ts
7
- var le = {
8
+ var ue = {
8
9
  class: "inline-flex",
9
10
  "data-ac-ds": "",
10
11
  "data-testid": "ac-user-menu"
11
- }, ue = [
12
+ }, de = [
12
13
  "aria-expanded",
13
14
  "aria-controls",
14
15
  "aria-label"
15
- ], de = {
16
+ ], fe = {
16
17
  key: 0,
17
18
  class: "hidden max-w-36 truncate text-base font-medium text-heading md:block"
18
- }, fe = {
19
+ }, pe = {
19
20
  class: "inline-flex size-9 shrink-0 rounded-full bg-linear-to-r from-primary/70 to-primary/90 p-0.5",
20
21
  "aria-hidden": "true"
21
- }, pe = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, me = ["src"], he = {
22
+ }, me = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, he = ["src"], ge = {
22
23
  class: "inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/10 text-base font-semibold text-primary-strong ring-1 ring-primary/25 ring-inset",
23
24
  "aria-hidden": "true"
24
- }, ge = ["src"], _e = { class: "min-w-0 flex-1" }, ve = { class: "block truncate text-base font-medium text-heading" }, ye = {
25
+ }, _e = ["src"], ve = { class: "min-w-0 flex-1" }, ye = { class: "block truncate text-base font-medium text-heading" }, be = {
25
26
  key: 0,
26
27
  class: "block truncate text-xs text-muted"
27
- }, be = ["aria-labelledby"], xe = ["id"], Se = { class: "flex flex-col gap-1" }, Ce = ["aria-checked", "onClick"], we = { class: "flex min-w-0 items-center gap-2" }, Te = { class: "min-w-0" }, Ee = { class: "block truncate font-medium text-heading" }, D = { class: "block truncate text-xs text-muted" }, De = ["aria-labelledby"], Oe = ["id"], ke = ["aria-labelledby"], Ae = ["id"], je = {
28
+ }, xe = ["aria-labelledby"], Se = ["id"], Ce = { class: "flex flex-col gap-1" }, we = ["aria-checked", "onClick"], Te = { class: "flex min-w-0 items-center gap-2" }, Ee = { class: "min-w-0" }, D = { class: "block truncate font-medium text-heading" }, De = { class: "block truncate text-xs text-muted" }, Oe = ["aria-labelledby"], ke = ["id"], Ae = ["aria-labelledby"], je = ["id"], Me = {
28
29
  role: "group",
29
30
  class: "mt-1 flex flex-col border-t border-border py-1"
30
- }, Me = { class: "min-w-0 flex-1 truncate" }, O = "flex min-h-10 w-full cursor-pointer items-center gap-2 rounded-8 px-4 py-2.5 text-left text-base font-medium no-underline outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", Ne = "[role=\"menuitem\"]:not([aria-disabled=\"true\"]), [role=\"menuitemradio\"], [role=\"radio\"]", k = /*@__PURE__*/ p({
31
+ }, O = { class: "min-w-0 flex-1 truncate" }, k = "flex min-h-10 w-full cursor-pointer items-center gap-2 rounded-8 px-4 py-2.5 text-left text-base font-medium no-underline outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", Ne = "[role=\"menuitem\"]:not([aria-disabled=\"true\"]), [role=\"menuitemradio\"], [role=\"radio\"]", A = /*@__PURE__*/ m({
31
32
  __name: "AcUserMenu",
32
33
  props: /*@__PURE__*/ h({
33
34
  name: {},
@@ -66,146 +67,146 @@ var le = {
66
67
  "set:theme",
67
68
  "switch-workspace"
68
69
  ], ["update:open", "update:workspace"]),
69
- setup(p, { emit: h }) {
70
- let k = p, A = w(p, "open"), j = w(p, "workspace"), M = h, N = `${O} text-heading [&>svg]:text-muted`, Pe = `${O} text-danger-strong`, P = m()?.appContext.components.RouterLink, F = ie(), I = `${F}-trigger`, L = `${F}-menu`, R = y(null), z = y(null), B = y(!1), V = y({
70
+ setup(m, { emit: h }) {
71
+ let A = m, j = w(m, "open"), M = w(m, "workspace"), N = h, P = `${k} text-heading [&>svg]:text-muted`, Pe = `${k} text-danger-strong`, F = ee()?.appContext.components.RouterLink, I = ae(), L = `${I}-trigger`, R = `${I}-menu`, z = y(null), B = y(null), V = y(!1), H = y({
71
72
  top: 0,
72
73
  right: 0
73
- }), H = o(() => {
74
- let e = k.name.trim().split(/[\s._-]+/).filter(Boolean);
74
+ }), U = s(() => {
75
+ let e = A.name.trim().split(/[\s._-]+/).filter(Boolean);
75
76
  return e.length ? (e[0].charAt(0) + (e.length > 1 ? e[e.length - 1].charAt(0) : "")).toUpperCase() : "?";
76
- }), U = o(() => !!k.avatarUrl && !B.value);
77
- function W(e) {
78
- return e.to && P && !e.disabled ? P : e.to || e.href ? "a" : "button";
77
+ }), W = s(() => !!A.avatarUrl && !V.value);
78
+ function G(e) {
79
+ return e.to && F && !e.disabled ? F : e.to || e.href ? "a" : "button";
79
80
  }
80
81
  function Fe(e) {
81
- let t = W(e);
82
- return t === P ? { to: e.to } : t === "a" ? e.disabled ? { "aria-disabled": "true" } : { href: e.href ?? (typeof e.to == "string" ? e.to : void 0) } : {
82
+ let t = G(e);
83
+ return t === F ? { to: e.to } : t === "a" ? e.disabled ? { "aria-disabled": "true" } : { href: e.href ?? (typeof e.to == "string" ? e.to : void 0) } : {
83
84
  type: "button",
84
85
  "aria-disabled": e.disabled ? "true" : void 0
85
86
  };
86
87
  }
87
- function G() {
88
- return [...z.value?.querySelectorAll(Ne) ?? []];
88
+ function K() {
89
+ return [...B.value?.querySelectorAll(Ne) ?? []];
89
90
  }
90
- function K(e) {
91
- let t = G();
91
+ function q(e) {
92
+ let t = K();
92
93
  t.length && t[(e + t.length) % t.length].focus();
93
94
  }
94
- function q() {
95
- let e = R.value;
96
- if (!e) return;
97
- let t = e.getBoundingClientRect(), n = z.value?.offsetHeight ?? 320, r = z.value?.offsetWidth ?? 256, i = Math.max(8, Math.min(window.innerWidth - t.right, window.innerWidth - r - 8)), a = window.innerHeight - t.bottom - 6 - 8;
98
- V.value = a < n && t.top > a ? {
99
- bottom: window.innerHeight - t.top + 6,
100
- right: i
95
+ function J() {
96
+ let t = z.value;
97
+ if (!t) return;
98
+ let n = t.getBoundingClientRect(), r = e(), i = B.value?.offsetHeight ?? 320, a = B.value?.offsetWidth ?? 256, o = Math.max(8, Math.min(r.right - n.right, r.width - a - 8)), s = r.bottom - n.bottom - 6 - 8;
99
+ H.value = s < i && n.top - r.top > s ? {
100
+ bottom: r.bottom - n.top + 6,
101
+ right: o
101
102
  } : {
102
- top: t.bottom + 6,
103
- right: i
103
+ top: n.bottom + 6 - r.top,
104
+ right: o
104
105
  };
105
106
  }
106
- async function J(e = "first") {
107
- A.value = !0, await g(), q(), K(e === "first" ? 0 : -1);
107
+ async function Y(e = "first") {
108
+ j.value = !0, await g(), J(), q(e === "first" ? 0 : -1);
108
109
  }
109
- function Y(e = !0) {
110
- A.value && (A.value = !1, e && R.value?.focus());
110
+ function X(e = !0) {
111
+ j.value && (j.value = !1, e && z.value?.focus());
111
112
  }
112
113
  function Ie(e) {
113
114
  [
114
115
  "Enter",
115
116
  " ",
116
117
  "ArrowDown"
117
- ].includes(e.key) ? (e.preventDefault(), J("first")) : e.key === "ArrowUp" && (e.preventDefault(), J("last"));
118
- }
119
- function X(e) {
120
- let t = G().indexOf(document.activeElement);
121
- e.key === "ArrowDown" ? (e.preventDefault(), K(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), K(t - 1)) : e.key === "Home" ? (e.preventDefault(), K(0)) : e.key === "End" ? (e.preventDefault(), K(-1)) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), Y()) : e.key === "Tab" && Y();
118
+ ].includes(e.key) ? (e.preventDefault(), Y("first")) : e.key === "ArrowUp" && (e.preventDefault(), Y("last"));
122
119
  }
123
120
  function Le(e) {
124
- e.disabled || (M("select", e), Y());
121
+ let t = K().indexOf(document.activeElement);
122
+ e.key === "ArrowDown" ? (e.preventDefault(), q(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), q(t - 1)) : e.key === "Home" ? (e.preventDefault(), q(0)) : e.key === "End" ? (e.preventDefault(), q(-1)) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), X()) : e.key === "Tab" && X();
125
123
  }
126
124
  function Re(e) {
127
- e.name !== j.value && (j.value = e.name, M("switch-workspace", e)), Y();
125
+ e.disabled || (N("select", e), X());
126
+ }
127
+ function ze(e) {
128
+ e.name !== M.value && (M.value = e.name, N("switch-workspace", e)), X();
128
129
  }
129
- function ze() {
130
- M("logout"), Y(!1);
130
+ function Be() {
131
+ N("logout"), X(!1);
131
132
  }
132
133
  function Z(e) {
133
134
  let t = e.target;
134
- R.value?.contains(t) || z.value?.contains(t) || Y(!1);
135
+ z.value?.contains(t) || B.value?.contains(t) || X(!1);
135
136
  }
136
137
  function Q() {
137
- q();
138
+ J();
138
139
  }
139
140
  function $() {
140
141
  document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
141
142
  }
142
- return T(A, (e) => {
143
+ return T(j, (e) => {
143
144
  if (!e) return $();
144
- document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(q);
145
- }), T(() => k.avatarUrl, () => B.value = !1), ne($), (o, m) => (v(), l("div", le, [u("button", {
146
- id: I,
145
+ document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(J);
146
+ }), T(() => A.avatarUrl, () => V.value = !1), re($), (e, s) => (v(), u("div", ue, [d("button", {
147
+ id: L,
147
148
  ref_key: "trigger",
148
- ref: R,
149
+ ref: z,
149
150
  type: "button",
150
151
  "aria-haspopup": "menu",
151
- "aria-expanded": A.value,
152
- "aria-controls": A.value ? L : void 0,
153
- "aria-label": `${p.name}, account menu`,
154
- class: _(["group inline-flex shrink-0 cursor-pointer items-center gap-2 rounded-10 border border-transparent p-2 transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface", [p.showName && "md:px-4", A.value && "border-border bg-surface-sunken/50"]]),
152
+ "aria-expanded": j.value,
153
+ "aria-controls": j.value ? R : void 0,
154
+ "aria-label": `${m.name}, account menu`,
155
+ class: _(["group inline-flex shrink-0 cursor-pointer items-center gap-2 rounded-10 border border-transparent p-2 transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface", [m.showName && "md:px-4", j.value && "border-border bg-surface-sunken/50"]]),
155
156
  "data-ac-ds": "",
156
157
  "data-testid": "ac-user-menu-trigger",
157
- onClick: m[1] ||= (e) => A.value ? Y() : J(),
158
+ onClick: s[1] ||= (e) => j.value ? X() : Y(),
158
159
  onKeydown: Ie
159
160
  }, [
160
- p.showName ? (v(), l("span", de, S(p.name), 1)) : c("", !0),
161
- u("span", fe, [u("span", pe, [U.value ? (v(), l("img", {
161
+ m.showName ? (v(), u("span", fe, S(m.name), 1)) : l("", !0),
162
+ d("span", pe, [d("span", me, [W.value ? (v(), u("img", {
162
163
  key: 0,
163
- src: p.avatarUrl,
164
+ src: m.avatarUrl,
164
165
  alt: "",
165
166
  class: "size-full object-cover",
166
- onError: m[0] ||= (e) => B.value = !0
167
- }, null, 40, me)) : (v(), l(r, { key: 1 }, [d(S(H.value), 1)], 64))])]),
168
- p.showName ? (v(), s(C(se), {
167
+ onError: s[0] ||= (e) => V.value = !0
168
+ }, null, 40, he)) : (v(), u(i, { key: 1 }, [f(S(U.value), 1)], 64))])]),
169
+ m.showName ? (v(), c(C(ce), {
169
170
  key: 1,
170
- class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", A.value && "rotate-180"]),
171
+ class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", j.value && "rotate-180"]),
171
172
  "aria-hidden": "true"
172
- }, null, 8, ["class"])) : c("", !0)
173
- ], 42, ue), (v(), s(i, { to: "body" }, [f(a, {
173
+ }, null, 8, ["class"])) : l("", !0)
174
+ ], 42, de), (v(), c(a, { to: "body" }, [p(o, {
174
175
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
175
176
  "enter-from-class": "opacity-0 scale-95",
176
177
  "leave-active-class": "transition duration-100 ease-in",
177
178
  "leave-to-class": "opacity-0"
178
179
  }, {
179
- default: E(() => [A.value ? (v(), l("div", {
180
+ default: E(() => [j.value ? (v(), u("div", {
180
181
  key: 0,
181
- id: L,
182
+ id: R,
182
183
  ref_key: "panel",
183
- ref: z,
184
+ ref: B,
184
185
  role: "menu",
185
- "aria-labelledby": I,
186
+ "aria-labelledby": L,
186
187
  class: "fixed z-[90] w-64 max-w-[calc(100vw-16px)] origin-top-right overflow-hidden rounded-14 border border-border/80 bg-surface p-1 shadow-lg",
187
- style: te({
188
- top: V.value.top === void 0 ? void 0 : `${V.value.top}px`,
189
- bottom: V.value.bottom === void 0 ? void 0 : `${V.value.bottom}px`,
190
- right: `${V.value.right}px`
188
+ style: ne({
189
+ top: H.value.top === void 0 ? void 0 : `${H.value.top}px`,
190
+ bottom: H.value.bottom === void 0 ? void 0 : `${H.value.bottom}px`,
191
+ right: `${H.value.right}px`
191
192
  }),
192
193
  "data-ac-ds": "",
193
194
  "data-testid": "ac-user-menu-panel",
194
- onKeydown: X
195
+ onKeydown: Le
195
196
  }, [
196
- (v(), s(x(p.profileUrl ? "a" : "div"), {
197
- href: p.profileUrl || void 0,
198
- role: p.profileUrl ? "menuitem" : "presentation",
199
- tabindex: p.profileUrl ? -1 : void 0,
200
- class: _(["flex items-center gap-3 rounded-8 px-3 py-2.5 no-underline outline-none", p.profileUrl && "transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"])
197
+ (v(), c(x(m.profileUrl ? "a" : "div"), {
198
+ href: m.profileUrl || void 0,
199
+ role: m.profileUrl ? "menuitem" : "presentation",
200
+ tabindex: m.profileUrl ? -1 : void 0,
201
+ class: _(["flex items-center gap-3 rounded-8 px-3 py-2.5 no-underline outline-none", m.profileUrl && "transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"])
201
202
  }, {
202
- default: E(() => [u("span", he, [U.value ? (v(), l("img", {
203
+ default: E(() => [d("span", ge, [W.value ? (v(), u("img", {
203
204
  key: 0,
204
- src: p.avatarUrl,
205
+ src: m.avatarUrl,
205
206
  alt: "",
206
207
  class: "size-full object-cover",
207
- onError: m[2] ||= (e) => B.value = !0
208
- }, null, 40, ge)) : (v(), l(r, { key: 1 }, [d(S(H.value), 1)], 64))]), u("span", _e, [u("span", ve, S(p.name), 1), p.email ? (v(), l("span", ye, S(p.email), 1)) : c("", !0)])]),
208
+ onError: s[2] ||= (e) => V.value = !0
209
+ }, null, 40, _e)) : (v(), u(i, { key: 1 }, [f(S(U.value), 1)], 64))]), d("span", ve, [d("span", ye, S(m.name), 1), m.email ? (v(), u("span", be, S(m.email), 1)) : l("", !0)])]),
209
210
  _: 1
210
211
  }, 8, [
211
212
  "href",
@@ -213,97 +214,97 @@ var le = {
213
214
  "tabindex",
214
215
  "class"
215
216
  ])),
216
- p.workspaces.length ? (v(), l("div", {
217
+ m.workspaces.length ? (v(), u("div", {
217
218
  key: 0,
218
219
  role: "group",
219
- "aria-labelledby": `${C(F)}-workspaces`,
220
+ "aria-labelledby": `${C(I)}-workspaces`,
220
221
  class: "mt-1 border-t border-border px-3 py-2"
221
- }, [u("p", {
222
- id: `${C(F)}-workspaces`,
222
+ }, [d("p", {
223
+ id: `${C(I)}-workspaces`,
223
224
  class: "mb-2 flex items-center gap-2 text-xs font-semibold tracking-wide text-muted uppercase"
224
- }, [f(C(ae), {
225
+ }, [p(C(oe), {
225
226
  class: "size-4",
226
227
  "aria-hidden": "true"
227
- }), d(" " + S(p.workspacesLabel), 1)], 8, xe), u("div", Se, [(v(!0), l(r, null, b(p.workspaces, (t) => (v(), l("button", {
228
- key: t.name,
228
+ }), f(" " + S(m.workspacesLabel), 1)], 8, Se), d("div", Ce, [(v(!0), u(i, null, b(m.workspaces, (e) => (v(), u("button", {
229
+ key: e.name,
229
230
  type: "button",
230
231
  role: "menuitemradio",
231
232
  tabindex: "-1",
232
- "aria-checked": t.name === j.value,
233
- class: _(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-2 py-2 text-left text-base outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", t.name === j.value && "bg-surface-sunken/50"]),
233
+ "aria-checked": e.name === M.value,
234
+ class: _(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-2 py-2 text-left text-base outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", e.name === M.value && "bg-surface-sunken/50"]),
234
235
  "data-ac-ds": "",
235
236
  "data-testid": "ac-user-menu-workspace",
236
- onClick: (e) => Re(t)
237
- }, [u("span", we, [f(e, {
238
- name: t.displayName || t.name,
239
- "img-url": t.avatarUrl,
240
- kind: t.type === "user" ? "person" : "organization",
237
+ onClick: (t) => ze(e)
238
+ }, [d("span", Te, [p(t, {
239
+ name: e.displayName || e.name,
240
+ "img-url": e.avatarUrl,
241
+ kind: e.type === "user" ? "person" : "organization",
241
242
  alt: ""
242
243
  }, null, 8, [
243
244
  "name",
244
245
  "img-url",
245
246
  "kind"
246
- ]), u("span", Te, [u("span", Ee, S(t.displayName || t.name), 1), u("span", D, [d(S(t.name), 1), t.type === "user" ? (v(), l(r, { key: 0 }, [d(" (Personal)")], 64)) : c("", !0)])])]), t.name === j.value ? (v(), s(C(oe), {
247
+ ]), d("span", Ee, [d("span", D, S(e.displayName || e.name), 1), d("span", De, [f(S(e.name), 1), e.type === "user" ? (v(), u(i, { key: 0 }, [f(" (Personal)")], 64)) : l("", !0)])])]), e.name === M.value ? (v(), c(C(se), {
247
248
  key: 0,
248
249
  class: "size-4 shrink-0 text-primary",
249
250
  "aria-hidden": "true"
250
- })) : c("", !0)], 10, Ce))), 128))])], 8, be)) : c("", !0),
251
- p.showThemeMode ? (v(), l("div", {
251
+ })) : l("", !0)], 10, we))), 128))])], 8, xe)) : l("", !0),
252
+ m.showThemeMode ? (v(), u("div", {
252
253
  key: 1,
253
254
  role: "group",
254
- "aria-labelledby": `${C(F)}-theme`,
255
+ "aria-labelledby": `${C(I)}-theme`,
255
256
  class: "mt-1 border-t border-border px-1 pt-2 pb-1"
256
- }, [u("p", {
257
- id: `${C(F)}-theme`,
257
+ }, [d("p", {
258
+ id: `${C(I)}-theme`,
258
259
  class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
259
- }, "Theme", 8, Oe), f(n, {
260
+ }, "Theme", 8, ke), p(r, {
260
261
  display: "labels",
261
- "onSet:theme": m[3] ||= (e) => M("set:theme", e)
262
- })], 8, De)) : c("", !0),
263
- p.showFontScale ? (v(), l("div", {
262
+ "onSet:theme": s[3] ||= (e) => N("set:theme", e)
263
+ })], 8, Oe)) : l("", !0),
264
+ m.showFontScale ? (v(), u("div", {
264
265
  key: 2,
265
266
  role: "group",
266
- "aria-labelledby": `${C(F)}-scale`,
267
+ "aria-labelledby": `${C(I)}-scale`,
267
268
  class: "mt-1 border-t border-border px-1 pt-2 pb-1"
268
- }, [u("p", {
269
- id: `${C(F)}-scale`,
269
+ }, [d("p", {
270
+ id: `${C(I)}-scale`,
270
271
  class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
271
- }, "Text size", 8, Ae), f(t, { display: "labels" })], 8, ke)) : c("", !0),
272
- u("div", je, [
273
- (v(!0), l(r, null, b(p.items, (e) => (v(), s(x(W(e)), ee({ key: e.label }, { ref_for: !0 }, Fe(e), {
272
+ }, "Text size", 8, je), p(n, { display: "labels" })], 8, Ae)) : l("", !0),
273
+ d("div", Me, [
274
+ (v(!0), u(i, null, b(m.items, (e) => (v(), c(x(G(e)), te({ key: e.label }, { ref_for: !0 }, Fe(e), {
274
275
  role: "menuitem",
275
276
  tabindex: "-1",
276
- class: N,
277
- onClick: (t) => Le(e)
277
+ class: P,
278
+ onClick: (t) => Re(e)
278
279
  }), {
279
- default: E(() => [e.icon ? (v(), s(x(e.icon), {
280
+ default: E(() => [e.icon ? (v(), c(x(e.icon), {
280
281
  key: 0,
281
282
  "aria-hidden": "true"
282
- })) : c("", !0), u("span", Me, S(e.label), 1)]),
283
+ })) : l("", !0), d("span", O, S(e.label), 1)]),
283
284
  _: 2
284
285
  }, 1040, ["onClick"]))), 128)),
285
- re(o.$slots, "default", {
286
- close: Y,
287
- itemClass: N
286
+ ie(e.$slots, "default", {
287
+ close: X,
288
+ itemClass: P
288
289
  }),
289
- (v(), s(x(p.logoutUrl ? "a" : "button"), {
290
- href: p.logoutUrl || void 0,
291
- type: p.logoutUrl ? void 0 : "button",
290
+ (v(), c(x(m.logoutUrl ? "a" : "button"), {
291
+ href: m.logoutUrl || void 0,
292
+ type: m.logoutUrl ? void 0 : "button",
292
293
  role: "menuitem",
293
294
  tabindex: "-1",
294
295
  class: _(Pe),
295
296
  "data-ac-ds": "",
296
297
  "data-testid": "ac-user-menu-logout",
297
- onClick: ze
298
+ onClick: Be
298
299
  }, {
299
- default: E(() => [f(C(ce), { "aria-hidden": "true" }), u("span", null, S(p.logoutLabel), 1)]),
300
+ default: E(() => [p(C(le), { "aria-hidden": "true" }), d("span", null, S(m.logoutLabel), 1)]),
300
301
  _: 1
301
302
  }, 8, ["href", "type"]))
302
303
  ])
303
- ], 36)) : c("", !0)]),
304
+ ], 36)) : l("", !0)]),
304
305
  _: 3
305
306
  })]))]));
306
307
  }
307
308
  });
308
309
  //#endregion
309
- export { k as default };
310
+ export { A as default };
@@ -0,0 +1,11 @@
1
+ /** The box `position: fixed` offsets are measured from, in viewport px. Matches the viewport when there's no gutter. */
2
+ export interface FixedFrame {
3
+ left: number;
4
+ top: number;
5
+ right: number;
6
+ bottom: number;
7
+ width: number;
8
+ height: number;
9
+ }
10
+ /** Measures the fixed containing block with a hidden probe. Call it once per positioning pass. */
11
+ export declare function fixedFrame(): FixedFrame;
@@ -0,0 +1,24 @@
1
+ //#region src/lib/components/fixedFrame.ts
2
+ function e() {
3
+ if (typeof document > "u") return {
4
+ left: 0,
5
+ top: 0,
6
+ right: 0,
7
+ bottom: 0,
8
+ width: 0,
9
+ height: 0
10
+ };
11
+ let e = document.createElement("div");
12
+ e.style.cssText = "position:fixed;inset:0;visibility:hidden;pointer-events:none", document.body.appendChild(e);
13
+ let { left: t, top: n, right: r, bottom: i, width: a, height: o } = e.getBoundingClientRect();
14
+ return e.remove(), {
15
+ left: t,
16
+ top: n,
17
+ right: r,
18
+ bottom: i,
19
+ width: a,
20
+ height: o
21
+ };
22
+ }
23
+ //#endregion
24
+ export { e as fixedFrame };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ac-design/design-system",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "AppsCode design system: Tailwind CSS v4 theme and Vue 3 components.",
5
5
  "repository": {
6
6
  "type": "git",