@ac-design/design-system 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +89 -88
- package/dist/lib/compat.css +210 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcButton.vue.d.ts +18 -12
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +28 -7
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +12 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcTable.vue.d.ts +13 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
- package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/index.js +34 -33
- package/package.json +1 -1
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
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 x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useId as ie, useModel as T, useSlots as ae, watch as E, withCtx as D } 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
|
|
8
|
+
var ue = {
|
|
8
9
|
class: "inline-flex",
|
|
9
10
|
"data-ac-ds": "",
|
|
10
11
|
"data-testid": "ac-user-menu"
|
|
11
|
-
},
|
|
12
|
+
}, de = [
|
|
12
13
|
"aria-expanded",
|
|
13
14
|
"aria-controls",
|
|
14
15
|
"aria-label"
|
|
15
|
-
],
|
|
16
|
+
], fe = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "hidden max-w-36 truncate text-base font-medium text-heading md:block"
|
|
18
|
-
},
|
|
19
|
+
}, pe = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "inline-flex shrink-0",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, me = {
|
|
24
|
+
key: 2,
|
|
19
25
|
class: "inline-flex size-9 shrink-0 rounded-full bg-linear-to-r from-primary/70 to-primary/90 p-0.5",
|
|
20
26
|
"aria-hidden": "true"
|
|
21
|
-
},
|
|
27
|
+
}, he = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, ge = ["src"], _e = {
|
|
22
28
|
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
29
|
"aria-hidden": "true"
|
|
24
|
-
},
|
|
30
|
+
}, ve = ["src"], ye = { class: "min-w-0 flex-1" }, be = { class: "block truncate text-base font-medium text-heading" }, xe = {
|
|
25
31
|
key: 0,
|
|
26
32
|
class: "block truncate text-xs text-muted"
|
|
27
|
-
},
|
|
33
|
+
}, Se = ["aria-labelledby"], Ce = ["id"], we = { class: "flex flex-col gap-1" }, Te = ["aria-checked", "onClick"], Ee = { class: "flex min-w-0 items-center gap-2" }, De = { class: "min-w-0" }, Oe = { class: "block truncate font-medium text-heading" }, ke = { class: "block truncate text-xs text-muted" }, Ae = ["aria-labelledby"], je = ["id"], Me = ["aria-labelledby"], Ne = ["id"], Pe = {
|
|
28
34
|
role: "group",
|
|
29
|
-
class: "mt-1 flex flex-col border-t border-border py-1"
|
|
30
|
-
},
|
|
35
|
+
class: "mt-1 flex flex-col border-t border-border py-1 first:mt-0 first:border-t-0"
|
|
36
|
+
}, Fe = { 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", Ie = "[role=\"menuitem\"]:not([aria-disabled=\"true\"]), [role=\"menuitemradio\"], [role=\"radio\"]", k = /*@__PURE__*/ m({
|
|
31
37
|
__name: "AcUserMenu",
|
|
32
38
|
props: /*@__PURE__*/ h({
|
|
33
39
|
name: {},
|
|
@@ -50,7 +56,15 @@ var le = {
|
|
|
50
56
|
logoutUrl: { default: "" },
|
|
51
57
|
logoutLabel: { default: "Sign out" },
|
|
52
58
|
workspaces: { default: () => [] },
|
|
53
|
-
workspacesLabel: { default: "Workspaces" }
|
|
59
|
+
workspacesLabel: { default: "Workspaces" },
|
|
60
|
+
showProfile: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !0
|
|
63
|
+
},
|
|
64
|
+
logoutIcon: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !0
|
|
67
|
+
}
|
|
54
68
|
}, {
|
|
55
69
|
open: {
|
|
56
70
|
type: Boolean,
|
|
@@ -66,18 +80,18 @@ var le = {
|
|
|
66
80
|
"set:theme",
|
|
67
81
|
"switch-workspace"
|
|
68
82
|
], ["update:open", "update:workspace"]),
|
|
69
|
-
setup(
|
|
70
|
-
let k =
|
|
83
|
+
setup(m, { emit: h }) {
|
|
84
|
+
let k = m, A = T(m, "open"), j = T(m, "workspace"), M = h, Le = ae(), N = `${O} text-heading [&>svg]:text-muted`, Re = `${O} text-danger-strong`, P = ee()?.appContext.components.RouterLink, F = ie(), I = `${F}-trigger`, L = `${F}-menu`, R = y(null), z = y(null), B = y(!1), V = y({
|
|
71
85
|
top: 0,
|
|
72
86
|
right: 0
|
|
73
|
-
}), H =
|
|
87
|
+
}), H = s(() => {
|
|
74
88
|
let e = k.name.trim().split(/[\s._-]+/).filter(Boolean);
|
|
75
89
|
return e.length ? (e[0].charAt(0) + (e.length > 1 ? e[e.length - 1].charAt(0) : "")).toUpperCase() : "?";
|
|
76
|
-
}), U =
|
|
90
|
+
}), U = s(() => !!k.avatarUrl && !B.value);
|
|
77
91
|
function W(e) {
|
|
78
92
|
return e.to && P && !e.disabled ? P : e.to || e.href ? "a" : "button";
|
|
79
93
|
}
|
|
80
|
-
function
|
|
94
|
+
function ze(e) {
|
|
81
95
|
let t = W(e);
|
|
82
96
|
return t === P ? { to: e.to } : t === "a" ? e.disabled ? { "aria-disabled": "true" } : { href: e.href ?? (typeof e.to == "string" ? e.to : void 0) } : {
|
|
83
97
|
type: "button",
|
|
@@ -85,22 +99,22 @@ var le = {
|
|
|
85
99
|
};
|
|
86
100
|
}
|
|
87
101
|
function G() {
|
|
88
|
-
return [...z.value?.querySelectorAll(
|
|
102
|
+
return [...z.value?.querySelectorAll(Ie) ?? []];
|
|
89
103
|
}
|
|
90
104
|
function K(e) {
|
|
91
105
|
let t = G();
|
|
92
106
|
t.length && t[(e + t.length) % t.length].focus();
|
|
93
107
|
}
|
|
94
108
|
function q() {
|
|
95
|
-
let
|
|
96
|
-
if (!
|
|
97
|
-
let
|
|
98
|
-
V.value =
|
|
99
|
-
bottom:
|
|
100
|
-
right:
|
|
109
|
+
let t = R.value;
|
|
110
|
+
if (!t) return;
|
|
111
|
+
let n = t.getBoundingClientRect(), r = e(), i = z.value?.offsetHeight ?? 320, a = z.value?.offsetWidth ?? 256, o = Math.max(8, Math.min(r.right - n.right, r.width - a - 8)), s = r.bottom - n.bottom - 6 - 8;
|
|
112
|
+
V.value = s < i && n.top - r.top > s ? {
|
|
113
|
+
bottom: r.bottom - n.top + 6,
|
|
114
|
+
right: o
|
|
101
115
|
} : {
|
|
102
|
-
top:
|
|
103
|
-
right:
|
|
116
|
+
top: n.bottom + 6 - r.top,
|
|
117
|
+
right: o
|
|
104
118
|
};
|
|
105
119
|
}
|
|
106
120
|
async function J(e = "first") {
|
|
@@ -109,7 +123,7 @@ var le = {
|
|
|
109
123
|
function Y(e = !0) {
|
|
110
124
|
A.value && (A.value = !1, e && R.value?.focus());
|
|
111
125
|
}
|
|
112
|
-
function
|
|
126
|
+
function Be(e) {
|
|
113
127
|
[
|
|
114
128
|
"Enter",
|
|
115
129
|
" ",
|
|
@@ -120,13 +134,13 @@ var le = {
|
|
|
120
134
|
let t = G().indexOf(document.activeElement);
|
|
121
135
|
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();
|
|
122
136
|
}
|
|
123
|
-
function
|
|
137
|
+
function Ve(e) {
|
|
124
138
|
e.disabled || (M("select", e), Y());
|
|
125
139
|
}
|
|
126
|
-
function
|
|
140
|
+
function He(e) {
|
|
127
141
|
e.name !== j.value && (j.value = e.name, M("switch-workspace", e)), Y();
|
|
128
142
|
}
|
|
129
|
-
function
|
|
143
|
+
function Ue() {
|
|
130
144
|
M("logout"), Y(!1);
|
|
131
145
|
}
|
|
132
146
|
function Z(e) {
|
|
@@ -139,10 +153,10 @@ var le = {
|
|
|
139
153
|
function $() {
|
|
140
154
|
document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
141
155
|
}
|
|
142
|
-
return
|
|
156
|
+
return E(A, (e) => {
|
|
143
157
|
if (!e) return $();
|
|
144
158
|
document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(q);
|
|
145
|
-
}),
|
|
159
|
+
}), E(() => k.avatarUrl, () => B.value = !1), re($), (e, s) => (v(), u("div", ue, [d("button", {
|
|
146
160
|
id: I,
|
|
147
161
|
ref_key: "trigger",
|
|
148
162
|
ref: R,
|
|
@@ -150,33 +164,33 @@ var le = {
|
|
|
150
164
|
"aria-haspopup": "menu",
|
|
151
165
|
"aria-expanded": A.value,
|
|
152
166
|
"aria-controls": A.value ? L : void 0,
|
|
153
|
-
"aria-label": `${
|
|
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", [
|
|
167
|
+
"aria-label": `${m.name}, account menu`,
|
|
168
|
+
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", A.value && "border-border bg-surface-sunken/50"]]),
|
|
155
169
|
"data-ac-ds": "",
|
|
156
170
|
"data-testid": "ac-user-menu-trigger",
|
|
157
|
-
onClick:
|
|
158
|
-
onKeydown:
|
|
171
|
+
onClick: s[1] ||= (e) => A.value ? Y() : J(),
|
|
172
|
+
onKeydown: Be
|
|
159
173
|
}, [
|
|
160
|
-
|
|
161
|
-
u("span",
|
|
174
|
+
m.showName ? (v(), u("span", fe, C(m.name), 1)) : l("", !0),
|
|
175
|
+
Le.avatar ? (v(), u("span", pe, [x(e.$slots, "avatar")])) : (v(), u("span", me, [d("span", he, [U.value ? (v(), u("img", {
|
|
162
176
|
key: 0,
|
|
163
|
-
src:
|
|
177
|
+
src: m.avatarUrl,
|
|
164
178
|
alt: "",
|
|
165
179
|
class: "size-full object-cover",
|
|
166
|
-
onError:
|
|
167
|
-
}, null, 40,
|
|
168
|
-
|
|
169
|
-
key:
|
|
180
|
+
onError: s[0] ||= (e) => B.value = !0
|
|
181
|
+
}, null, 40, ge)) : (v(), u(i, { key: 1 }, [f(C(H.value), 1)], 64))])])),
|
|
182
|
+
m.showName ? (v(), c(w(ce), {
|
|
183
|
+
key: 3,
|
|
170
184
|
class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", A.value && "rotate-180"]),
|
|
171
185
|
"aria-hidden": "true"
|
|
172
|
-
}, null, 8, ["class"])) :
|
|
173
|
-
], 42,
|
|
186
|
+
}, null, 8, ["class"])) : l("", !0)
|
|
187
|
+
], 42, de), (v(), c(a, { to: "body" }, [p(o, {
|
|
174
188
|
"enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
|
|
175
189
|
"enter-from-class": "opacity-0 scale-95",
|
|
176
190
|
"leave-active-class": "transition duration-100 ease-in",
|
|
177
191
|
"leave-to-class": "opacity-0"
|
|
178
192
|
}, {
|
|
179
|
-
default:
|
|
193
|
+
default: D(() => [A.value ? (v(), u("div", {
|
|
180
194
|
key: 0,
|
|
181
195
|
id: L,
|
|
182
196
|
ref_key: "panel",
|
|
@@ -184,7 +198,7 @@ var le = {
|
|
|
184
198
|
role: "menu",
|
|
185
199
|
"aria-labelledby": I,
|
|
186
200
|
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:
|
|
201
|
+
style: ne({
|
|
188
202
|
top: V.value.top === void 0 ? void 0 : `${V.value.top}px`,
|
|
189
203
|
bottom: V.value.bottom === void 0 ? void 0 : `${V.value.bottom}px`,
|
|
190
204
|
right: `${V.value.right}px`
|
|
@@ -193,114 +207,118 @@ var le = {
|
|
|
193
207
|
"data-testid": "ac-user-menu-panel",
|
|
194
208
|
onKeydown: X
|
|
195
209
|
}, [
|
|
196
|
-
(v(),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
m.showProfile ? (v(), c(S(m.profileUrl ? "a" : "div"), {
|
|
211
|
+
key: 0,
|
|
212
|
+
href: m.profileUrl || void 0,
|
|
213
|
+
role: m.profileUrl ? "menuitem" : "presentation",
|
|
214
|
+
tabindex: m.profileUrl ? -1 : void 0,
|
|
215
|
+
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
216
|
}, {
|
|
202
|
-
default:
|
|
217
|
+
default: D(() => [d("span", _e, [U.value ? (v(), u("img", {
|
|
203
218
|
key: 0,
|
|
204
|
-
src:
|
|
219
|
+
src: m.avatarUrl,
|
|
205
220
|
alt: "",
|
|
206
221
|
class: "size-full object-cover",
|
|
207
|
-
onError:
|
|
208
|
-
}, null, 40,
|
|
222
|
+
onError: s[2] ||= (e) => B.value = !0
|
|
223
|
+
}, null, 40, ve)) : (v(), u(i, { key: 1 }, [f(C(H.value), 1)], 64))]), d("span", ye, [d("span", be, C(m.name), 1), m.email ? (v(), u("span", xe, C(m.email), 1)) : l("", !0)])]),
|
|
209
224
|
_: 1
|
|
210
225
|
}, 8, [
|
|
211
226
|
"href",
|
|
212
227
|
"role",
|
|
213
228
|
"tabindex",
|
|
214
229
|
"class"
|
|
215
|
-
])),
|
|
216
|
-
|
|
217
|
-
key:
|
|
230
|
+
])) : l("", !0),
|
|
231
|
+
m.workspaces.length ? (v(), u("div", {
|
|
232
|
+
key: 1,
|
|
218
233
|
role: "group",
|
|
219
|
-
"aria-labelledby": `${
|
|
220
|
-
class: "mt-1 border-t border-border px-3 py-2"
|
|
221
|
-
}, [
|
|
222
|
-
id: `${
|
|
234
|
+
"aria-labelledby": `${w(F)}-workspaces`,
|
|
235
|
+
class: "mt-1 border-t border-border px-3 py-2 first:mt-0 first:border-t-0"
|
|
236
|
+
}, [d("p", {
|
|
237
|
+
id: `${w(F)}-workspaces`,
|
|
223
238
|
class: "mb-2 flex items-center gap-2 text-xs font-semibold tracking-wide text-muted uppercase"
|
|
224
|
-
}, [
|
|
239
|
+
}, [p(w(oe), {
|
|
225
240
|
class: "size-4",
|
|
226
241
|
"aria-hidden": "true"
|
|
227
|
-
}),
|
|
228
|
-
key:
|
|
242
|
+
}), f(" " + C(m.workspacesLabel), 1)], 8, Ce), d("div", we, [(v(!0), u(i, null, b(m.workspaces, (e) => (v(), u("button", {
|
|
243
|
+
key: e.name,
|
|
229
244
|
type: "button",
|
|
230
245
|
role: "menuitemradio",
|
|
231
246
|
tabindex: "-1",
|
|
232
|
-
"aria-checked":
|
|
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",
|
|
247
|
+
"aria-checked": e.name === j.value,
|
|
248
|
+
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 === j.value && "bg-surface-sunken/50"]),
|
|
234
249
|
"data-ac-ds": "",
|
|
235
250
|
"data-testid": "ac-user-menu-workspace",
|
|
236
|
-
onClick: (
|
|
237
|
-
}, [
|
|
238
|
-
name:
|
|
239
|
-
"img-url":
|
|
240
|
-
kind:
|
|
251
|
+
onClick: (t) => He(e)
|
|
252
|
+
}, [d("span", Ee, [p(t, {
|
|
253
|
+
name: e.displayName || e.name,
|
|
254
|
+
"img-url": e.avatarUrl,
|
|
255
|
+
kind: e.type === "user" ? "person" : "organization",
|
|
241
256
|
alt: ""
|
|
242
257
|
}, null, 8, [
|
|
243
258
|
"name",
|
|
244
259
|
"img-url",
|
|
245
260
|
"kind"
|
|
246
|
-
]),
|
|
261
|
+
]), d("span", De, [d("span", Oe, C(e.displayName || e.name), 1), d("span", ke, [f(C(e.name), 1), e.type === "user" ? (v(), u(i, { key: 0 }, [f(" (Personal)")], 64)) : l("", !0)])])]), e.name === j.value ? (v(), c(w(se), {
|
|
247
262
|
key: 0,
|
|
248
263
|
class: "size-4 shrink-0 text-primary",
|
|
249
264
|
"aria-hidden": "true"
|
|
250
|
-
})) :
|
|
251
|
-
|
|
252
|
-
key:
|
|
265
|
+
})) : l("", !0)], 10, Te))), 128))])], 8, Se)) : l("", !0),
|
|
266
|
+
m.showThemeMode ? (v(), u("div", {
|
|
267
|
+
key: 2,
|
|
253
268
|
role: "group",
|
|
254
|
-
"aria-labelledby": `${
|
|
255
|
-
class: "mt-1 border-t border-border px-1 pt-2 pb-1"
|
|
256
|
-
}, [
|
|
257
|
-
id: `${
|
|
269
|
+
"aria-labelledby": `${w(F)}-theme`,
|
|
270
|
+
class: "mt-1 border-t border-border px-1 pt-2 pb-1 first:mt-0 first:border-t-0"
|
|
271
|
+
}, [d("p", {
|
|
272
|
+
id: `${w(F)}-theme`,
|
|
258
273
|
class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
259
|
-
}, "Theme", 8,
|
|
274
|
+
}, "Theme", 8, je), p(r, {
|
|
260
275
|
display: "labels",
|
|
261
|
-
"onSet:theme":
|
|
262
|
-
})], 8,
|
|
263
|
-
|
|
264
|
-
key:
|
|
276
|
+
"onSet:theme": s[3] ||= (e) => M("set:theme", e)
|
|
277
|
+
})], 8, Ae)) : l("", !0),
|
|
278
|
+
m.showFontScale ? (v(), u("div", {
|
|
279
|
+
key: 3,
|
|
265
280
|
role: "group",
|
|
266
|
-
"aria-labelledby": `${
|
|
267
|
-
class: "mt-1 border-t border-border px-1 pt-2 pb-1"
|
|
268
|
-
}, [
|
|
269
|
-
id: `${
|
|
281
|
+
"aria-labelledby": `${w(F)}-scale`,
|
|
282
|
+
class: "mt-1 border-t border-border px-1 pt-2 pb-1 first:mt-0 first:border-t-0"
|
|
283
|
+
}, [d("p", {
|
|
284
|
+
id: `${w(F)}-scale`,
|
|
270
285
|
class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
271
|
-
}, "Text size", 8,
|
|
272
|
-
|
|
273
|
-
(v(!0),
|
|
286
|
+
}, "Text size", 8, Ne), p(n, { display: "labels" })], 8, Me)) : l("", !0),
|
|
287
|
+
d("div", Pe, [
|
|
288
|
+
(v(!0), u(i, null, b(m.items, (e) => (v(), c(S(W(e)), te({ key: e.label }, { ref_for: !0 }, ze(e), {
|
|
274
289
|
role: "menuitem",
|
|
275
290
|
tabindex: "-1",
|
|
276
291
|
class: N,
|
|
277
|
-
onClick: (t) =>
|
|
292
|
+
onClick: (t) => Ve(e)
|
|
278
293
|
}), {
|
|
279
|
-
default:
|
|
294
|
+
default: D(() => [e.icon ? (v(), c(S(e.icon), {
|
|
280
295
|
key: 0,
|
|
281
296
|
"aria-hidden": "true"
|
|
282
|
-
})) :
|
|
297
|
+
})) : l("", !0), d("span", Fe, C(e.label), 1)]),
|
|
283
298
|
_: 2
|
|
284
299
|
}, 1040, ["onClick"]))), 128)),
|
|
285
|
-
|
|
300
|
+
x(e.$slots, "default", {
|
|
286
301
|
close: Y,
|
|
287
302
|
itemClass: N
|
|
288
303
|
}),
|
|
289
|
-
(v(),
|
|
290
|
-
href:
|
|
291
|
-
type:
|
|
304
|
+
(v(), c(S(m.logoutUrl ? "a" : "button"), {
|
|
305
|
+
href: m.logoutUrl || void 0,
|
|
306
|
+
type: m.logoutUrl ? void 0 : "button",
|
|
292
307
|
role: "menuitem",
|
|
293
308
|
tabindex: "-1",
|
|
294
|
-
class: _(
|
|
309
|
+
class: _(Re),
|
|
295
310
|
"data-ac-ds": "",
|
|
296
311
|
"data-testid": "ac-user-menu-logout",
|
|
297
|
-
onClick:
|
|
312
|
+
onClick: Ue
|
|
298
313
|
}, {
|
|
299
|
-
default:
|
|
314
|
+
default: D(() => [m.logoutIcon ? (v(), c(w(le), {
|
|
315
|
+
key: 0,
|
|
316
|
+
"aria-hidden": "true"
|
|
317
|
+
})) : l("", !0), d("span", null, C(m.logoutLabel), 1)]),
|
|
300
318
|
_: 1
|
|
301
319
|
}, 8, ["href", "type"]))
|
|
302
320
|
])
|
|
303
|
-
], 36)) :
|
|
321
|
+
], 36)) : l("", !0)]),
|
|
304
322
|
_: 3
|
|
305
323
|
})]))]));
|
|
306
324
|
}
|
|
@@ -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 };
|
|
@@ -61,6 +61,7 @@ export { default as AcPagination } from "./AcPagination.vue";
|
|
|
61
61
|
export { default as AcPreloader } from "./AcPreloader.vue";
|
|
62
62
|
export { default as AcProgress } from "./AcProgress.vue";
|
|
63
63
|
export { default as AcProductHero } from "./AcProductHero.vue";
|
|
64
|
+
export { default as AcRadioCard } from "./AcRadioCard.vue";
|
|
64
65
|
export { default as AcResourceCard } from "./AcResourceCard.vue";
|
|
65
66
|
export { default as AcSearchBar } from "./AcSearchBar.vue";
|
|
66
67
|
export { default as AcSectionContent } from "./AcSectionContent.vue";
|
|
@@ -13,4 +13,6 @@ export interface SelectOption<V = string | number> {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
/** Options with the same group are listed under that heading. */
|
|
15
15
|
group?: string;
|
|
16
|
+
/** Extra data for the `option` and `selected` slots, e.g. an icon, a price or a role. */
|
|
17
|
+
custom?: Record<string, unknown>;
|
|
16
18
|
}
|
package/dist/lib/index.js
CHANGED
|
@@ -67,36 +67,37 @@ import me from "./components/AcPagination.js";
|
|
|
67
67
|
import he from "./components/AcPreloader.js";
|
|
68
68
|
import ge from "./components/AcProgress.js";
|
|
69
69
|
import _e from "./components/AcProductHero.js";
|
|
70
|
-
import ve from "./components/
|
|
71
|
-
import ye from "./components/
|
|
72
|
-
import be from "./components/
|
|
73
|
-
import xe from "./components/
|
|
74
|
-
import Se from "./components/
|
|
75
|
-
import Ce from "./components/
|
|
76
|
-
import we from "./components/
|
|
77
|
-
import Te from "./components/
|
|
78
|
-
import Ee from "./components/
|
|
79
|
-
import De from "./components/
|
|
80
|
-
import Oe from "./components/
|
|
81
|
-
import ke from "./components/
|
|
82
|
-
import Ae from "./components/
|
|
83
|
-
import je from "./components/
|
|
84
|
-
import Me from "./components/
|
|
85
|
-
import Ne from "./components/
|
|
86
|
-
import Pe from "./components/
|
|
87
|
-
import Fe from "./components/
|
|
88
|
-
import Ie from "./components/
|
|
89
|
-
import Le from "./components/
|
|
90
|
-
import
|
|
91
|
-
import ze from "./
|
|
92
|
-
import Be from "./components/
|
|
93
|
-
import
|
|
94
|
-
import Ue from "./
|
|
95
|
-
import We from "./components/
|
|
96
|
-
import Ge from "./components/
|
|
97
|
-
import
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
|
|
70
|
+
import ve from "./components/AcRadioCard.js";
|
|
71
|
+
import ye from "./components/AcTag.js";
|
|
72
|
+
import be from "./components/AcResourceCard.js";
|
|
73
|
+
import xe from "./components/AcSectionContent.js";
|
|
74
|
+
import Se from "./components/AcSegmentedControl.js";
|
|
75
|
+
import Ce from "./components/AcSettingsRow.js";
|
|
76
|
+
import we from "./components/AcSidebar.js";
|
|
77
|
+
import Te from "./components/AcSidebarItem.js";
|
|
78
|
+
import Ee from "./components/AcSidebarSection.js";
|
|
79
|
+
import De from "./components/AcSidePanel.js";
|
|
80
|
+
import Oe from "./components/AcSideTabs.js";
|
|
81
|
+
import ke from "./components/AcSlider.js";
|
|
82
|
+
import Ae from "./components/AcStatCard.js";
|
|
83
|
+
import je from "./components/AcStatusBar.js";
|
|
84
|
+
import Me from "./components/AcSteps.js";
|
|
85
|
+
import Ne from "./components/AcSwitch.js";
|
|
86
|
+
import Pe from "./components/AcSwitchCard.js";
|
|
87
|
+
import Fe from "./components/AcTable.js";
|
|
88
|
+
import Ie from "./components/AcTabs.js";
|
|
89
|
+
import Le from "./components/AcTagInput.js";
|
|
90
|
+
import Re from "./components/AcTextarea.js";
|
|
91
|
+
import { useColorMode as ze } from "./composables/useColorMode.js";
|
|
92
|
+
import Be from "./components/AcThemeMode.js";
|
|
93
|
+
import Ve from "./components/AcTimePicker.js";
|
|
94
|
+
import { showToast as He, useToast as Ue } from "./composables/useToast.js";
|
|
95
|
+
import We from "./components/AcToaster.js";
|
|
96
|
+
import Ge from "./components/AcUsageCard.js";
|
|
97
|
+
import Ke from "./components/AcUserMenu.js";
|
|
98
|
+
import { useTablePagination as qe } from "./composables/useTablePagination.js";
|
|
99
|
+
import { useApiPagination as Je } from "./composables/useApiPagination.js";
|
|
100
|
+
import { useBulkSelection as Ye } from "./composables/useBulkSelection.js";
|
|
101
|
+
import { useFormValidation as Xe } from "./composables/useFormValidation.js";
|
|
102
|
+
import { HSLToHex as Ze, HexToHSL as Qe, MIN_CONTRAST as $e, contrastOnWhite as et, getThemeHSL as tt, hexToHsl as nt, hslToHex as rt, readableLightness as it, setThemeHSL as at, useBrandColor as ot } from "./composables/useBrandColor.js";
|
|
103
|
+
export { ee as AcAccordion, te as AcAccordionItem, n as AcAlert, a as AcAppSwitcher, o as AcAvatar, u as AcBadge, d as AcBanner, f as AcBreadcrumb, p as AcBulkActionBar, t as AcButton, m as AcButtons, h as AcCard, y as AcCellValue, b as AcCheckBox, x as AcCheckList, S as AcCheckRadio, C as AcCircularProgress, w as AcClusterSwitcher, T as AcColorInput, E as AcCommandBlock, D as AcConfirmModal, O as AcContentHeader, k as AcContentLayout, j as AcContentTable, M as AcCopyButton, N as AcCostSummary, P as AcDatePicker, I as AcDeleteConfirmationModal, I as AcDeleteModal, L as AcDivider, R as AcDropdown, z as AcDropdownDivider, B as AcDropdownItem, V as AcEmptyState, H as AcErrorState, U as AcFeatureCard, W as AcFileUpload, q as AcFontScale, J as AcFooter, Y as AcForm, X as AcFormArray, Z as AcFormFooter, Q as AcFormSection, ne as AcHeader, re as AcHeaderItem, ie as AcHeaderItems, ae as AcInfoTable, F as AcInput, oe as AcKbd, se as AcKeyValueInput, ce as AcLoader, le as AcLocaleSwitcher, r as AcLogo, g as AcModal, ue as AcNavbar, i as AcNavbarItem, de as AcNotificationMenu, fe as AcNumberInput, pe as AcPage, me as AcPagination, he as AcPreloader, _e as AcProductHero, ge as AcProgress, ve as AcRadioCard, be as AcResourceCard, A as AcSearchBar, xe as AcSectionContent, Se as AcSegmentedControl, $ as AcSelect, Ce as AcSettingsRow, De as AcSidePanel, Oe as AcSideTabs, we as AcSidebar, Te as AcSidebarItem, Ee as AcSidebarSection, _ as AcSkeleton, ke as AcSlider, e as AcSpinner, Ae as AcStatCard, je as AcStatusBar, Me as AcSteps, Ne as AcSwitch, Pe as AcSwitchCard, Fe as AcTable, Ie as AcTabs, ye as AcTag, Le as AcTagInput, Re as AcTextarea, Be as AcThemeMode, Ve as AcTimePicker, We as AcToaster, v as AcTooltip, Ge as AcUsageCard, Ke as AcUserMenu, G as FONT_SCALES, Ze as HSLToHex, Qe as HexToHSL, $e as MIN_CONTRAST, et as contrastOnWhite, tt as getThemeHSL, nt as hexToHsl, rt as hslToHex, s as humanizeState, c as normalizeState, it as readableLightness, at as setThemeHSL, He as showToast, l as statusMeta, Je as useApiPagination, ot as useBrandColor, Ye as useBulkSelection, ze as useColorMode, K as useFontScale, Xe as useFormValidation, qe as useTablePagination, Ue as useToast };
|