@ac-design/design-system 2.2.1 → 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/compat.css +210 -0
- 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/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 +432 -369
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- 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/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/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 +190 -174
- 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 +206 -174
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
- 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
|
@@ -2,7 +2,7 @@ import { fixedFrame as e } from "./fixedFrame.js";
|
|
|
2
2
|
import t from "./AcAvatar.js";
|
|
3
3
|
import n from "./AcFontScale.js";
|
|
4
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
|
|
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
6
|
import { Building2 as oe, Check as se, ChevronDown as ce, LogOut as le } from "@lucide/vue";
|
|
7
7
|
//#region src/lib/components/AcUserMenu.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var ue = {
|
|
@@ -17,18 +17,23 @@ var ue = {
|
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "hidden max-w-36 truncate text-base font-medium text-heading md:block"
|
|
19
19
|
}, pe = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "inline-flex shrink-0",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, me = {
|
|
24
|
+
key: 2,
|
|
20
25
|
class: "inline-flex size-9 shrink-0 rounded-full bg-linear-to-r from-primary/70 to-primary/90 p-0.5",
|
|
21
26
|
"aria-hidden": "true"
|
|
22
|
-
},
|
|
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 = {
|
|
23
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",
|
|
24
29
|
"aria-hidden": "true"
|
|
25
|
-
},
|
|
30
|
+
}, ve = ["src"], ye = { class: "min-w-0 flex-1" }, be = { class: "block truncate text-base font-medium text-heading" }, xe = {
|
|
26
31
|
key: 0,
|
|
27
32
|
class: "block truncate text-xs text-muted"
|
|
28
|
-
},
|
|
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 = {
|
|
29
34
|
role: "group",
|
|
30
|
-
class: "mt-1 flex flex-col border-t border-border py-1"
|
|
31
|
-
},
|
|
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({
|
|
32
37
|
__name: "AcUserMenu",
|
|
33
38
|
props: /*@__PURE__*/ h({
|
|
34
39
|
name: {},
|
|
@@ -51,7 +56,15 @@ var ue = {
|
|
|
51
56
|
logoutUrl: { default: "" },
|
|
52
57
|
logoutLabel: { default: "Sign out" },
|
|
53
58
|
workspaces: { default: () => [] },
|
|
54
|
-
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
|
+
}
|
|
55
68
|
}, {
|
|
56
69
|
open: {
|
|
57
70
|
type: Boolean,
|
|
@@ -68,35 +81,35 @@ var ue = {
|
|
|
68
81
|
"switch-workspace"
|
|
69
82
|
], ["update:open", "update:workspace"]),
|
|
70
83
|
setup(m, { emit: h }) {
|
|
71
|
-
let
|
|
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({
|
|
72
85
|
top: 0,
|
|
73
86
|
right: 0
|
|
74
|
-
}),
|
|
75
|
-
let e =
|
|
87
|
+
}), H = s(() => {
|
|
88
|
+
let e = k.name.trim().split(/[\s._-]+/).filter(Boolean);
|
|
76
89
|
return e.length ? (e[0].charAt(0) + (e.length > 1 ? e[e.length - 1].charAt(0) : "")).toUpperCase() : "?";
|
|
77
|
-
}),
|
|
78
|
-
function
|
|
79
|
-
return e.to &&
|
|
90
|
+
}), U = s(() => !!k.avatarUrl && !B.value);
|
|
91
|
+
function W(e) {
|
|
92
|
+
return e.to && P && !e.disabled ? P : e.to || e.href ? "a" : "button";
|
|
80
93
|
}
|
|
81
|
-
function
|
|
82
|
-
let t =
|
|
83
|
-
return t ===
|
|
94
|
+
function ze(e) {
|
|
95
|
+
let t = W(e);
|
|
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) } : {
|
|
84
97
|
type: "button",
|
|
85
98
|
"aria-disabled": e.disabled ? "true" : void 0
|
|
86
99
|
};
|
|
87
100
|
}
|
|
88
|
-
function
|
|
89
|
-
return [...
|
|
101
|
+
function G() {
|
|
102
|
+
return [...z.value?.querySelectorAll(Ie) ?? []];
|
|
90
103
|
}
|
|
91
|
-
function
|
|
92
|
-
let t =
|
|
104
|
+
function K(e) {
|
|
105
|
+
let t = G();
|
|
93
106
|
t.length && t[(e + t.length) % t.length].focus();
|
|
94
107
|
}
|
|
95
|
-
function
|
|
96
|
-
let t =
|
|
108
|
+
function q() {
|
|
109
|
+
let t = R.value;
|
|
97
110
|
if (!t) return;
|
|
98
|
-
let n = t.getBoundingClientRect(), r = e(), i =
|
|
99
|
-
|
|
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 ? {
|
|
100
113
|
bottom: r.bottom - n.top + 6,
|
|
101
114
|
right: o
|
|
102
115
|
} : {
|
|
@@ -104,71 +117,71 @@ var ue = {
|
|
|
104
117
|
right: o
|
|
105
118
|
};
|
|
106
119
|
}
|
|
107
|
-
async function
|
|
108
|
-
|
|
120
|
+
async function J(e = "first") {
|
|
121
|
+
A.value = !0, await g(), q(), K(e === "first" ? 0 : -1);
|
|
109
122
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
123
|
+
function Y(e = !0) {
|
|
124
|
+
A.value && (A.value = !1, e && R.value?.focus());
|
|
112
125
|
}
|
|
113
|
-
function
|
|
126
|
+
function Be(e) {
|
|
114
127
|
[
|
|
115
128
|
"Enter",
|
|
116
129
|
" ",
|
|
117
130
|
"ArrowDown"
|
|
118
|
-
].includes(e.key) ? (e.preventDefault(),
|
|
131
|
+
].includes(e.key) ? (e.preventDefault(), J("first")) : e.key === "ArrowUp" && (e.preventDefault(), J("last"));
|
|
119
132
|
}
|
|
120
|
-
function
|
|
121
|
-
let t =
|
|
122
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
133
|
+
function X(e) {
|
|
134
|
+
let t = G().indexOf(document.activeElement);
|
|
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();
|
|
123
136
|
}
|
|
124
|
-
function
|
|
125
|
-
e.disabled || (
|
|
137
|
+
function Ve(e) {
|
|
138
|
+
e.disabled || (M("select", e), Y());
|
|
126
139
|
}
|
|
127
|
-
function
|
|
128
|
-
e.name !==
|
|
140
|
+
function He(e) {
|
|
141
|
+
e.name !== j.value && (j.value = e.name, M("switch-workspace", e)), Y();
|
|
129
142
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
143
|
+
function Ue() {
|
|
144
|
+
M("logout"), Y(!1);
|
|
132
145
|
}
|
|
133
146
|
function Z(e) {
|
|
134
147
|
let t = e.target;
|
|
135
|
-
|
|
148
|
+
R.value?.contains(t) || z.value?.contains(t) || Y(!1);
|
|
136
149
|
}
|
|
137
150
|
function Q() {
|
|
138
|
-
|
|
151
|
+
q();
|
|
139
152
|
}
|
|
140
153
|
function $() {
|
|
141
154
|
document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
142
155
|
}
|
|
143
|
-
return
|
|
156
|
+
return E(A, (e) => {
|
|
144
157
|
if (!e) return $();
|
|
145
|
-
document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(
|
|
146
|
-
}),
|
|
147
|
-
id:
|
|
158
|
+
document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(q);
|
|
159
|
+
}), E(() => k.avatarUrl, () => B.value = !1), re($), (e, s) => (v(), u("div", ue, [d("button", {
|
|
160
|
+
id: I,
|
|
148
161
|
ref_key: "trigger",
|
|
149
|
-
ref:
|
|
162
|
+
ref: R,
|
|
150
163
|
type: "button",
|
|
151
164
|
"aria-haspopup": "menu",
|
|
152
|
-
"aria-expanded":
|
|
153
|
-
"aria-controls":
|
|
165
|
+
"aria-expanded": A.value,
|
|
166
|
+
"aria-controls": A.value ? L : void 0,
|
|
154
167
|
"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",
|
|
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"]]),
|
|
156
169
|
"data-ac-ds": "",
|
|
157
170
|
"data-testid": "ac-user-menu-trigger",
|
|
158
|
-
onClick: s[1] ||= (e) =>
|
|
159
|
-
onKeydown:
|
|
171
|
+
onClick: s[1] ||= (e) => A.value ? Y() : J(),
|
|
172
|
+
onKeydown: Be
|
|
160
173
|
}, [
|
|
161
|
-
m.showName ? (v(), u("span", fe,
|
|
162
|
-
|
|
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", {
|
|
163
176
|
key: 0,
|
|
164
177
|
src: m.avatarUrl,
|
|
165
178
|
alt: "",
|
|
166
179
|
class: "size-full object-cover",
|
|
167
|
-
onError: s[0] ||= (e) =>
|
|
168
|
-
}, null, 40,
|
|
169
|
-
m.showName ? (v(), c(
|
|
170
|
-
key:
|
|
171
|
-
class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block",
|
|
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,
|
|
184
|
+
class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", A.value && "rotate-180"]),
|
|
172
185
|
"aria-hidden": "true"
|
|
173
186
|
}, null, 8, ["class"])) : l("", !0)
|
|
174
187
|
], 42, de), (v(), c(a, { to: "body" }, [p(o, {
|
|
@@ -177,65 +190,66 @@ var ue = {
|
|
|
177
190
|
"leave-active-class": "transition duration-100 ease-in",
|
|
178
191
|
"leave-to-class": "opacity-0"
|
|
179
192
|
}, {
|
|
180
|
-
default:
|
|
193
|
+
default: D(() => [A.value ? (v(), u("div", {
|
|
181
194
|
key: 0,
|
|
182
|
-
id:
|
|
195
|
+
id: L,
|
|
183
196
|
ref_key: "panel",
|
|
184
|
-
ref:
|
|
197
|
+
ref: z,
|
|
185
198
|
role: "menu",
|
|
186
|
-
"aria-labelledby":
|
|
199
|
+
"aria-labelledby": I,
|
|
187
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",
|
|
188
201
|
style: ne({
|
|
189
|
-
top:
|
|
190
|
-
bottom:
|
|
191
|
-
right: `${
|
|
202
|
+
top: V.value.top === void 0 ? void 0 : `${V.value.top}px`,
|
|
203
|
+
bottom: V.value.bottom === void 0 ? void 0 : `${V.value.bottom}px`,
|
|
204
|
+
right: `${V.value.right}px`
|
|
192
205
|
}),
|
|
193
206
|
"data-ac-ds": "",
|
|
194
207
|
"data-testid": "ac-user-menu-panel",
|
|
195
|
-
onKeydown:
|
|
208
|
+
onKeydown: X
|
|
196
209
|
}, [
|
|
197
|
-
(v(), c(
|
|
210
|
+
m.showProfile ? (v(), c(S(m.profileUrl ? "a" : "div"), {
|
|
211
|
+
key: 0,
|
|
198
212
|
href: m.profileUrl || void 0,
|
|
199
213
|
role: m.profileUrl ? "menuitem" : "presentation",
|
|
200
214
|
tabindex: m.profileUrl ? -1 : void 0,
|
|
201
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"])
|
|
202
216
|
}, {
|
|
203
|
-
default:
|
|
217
|
+
default: D(() => [d("span", _e, [U.value ? (v(), u("img", {
|
|
204
218
|
key: 0,
|
|
205
219
|
src: m.avatarUrl,
|
|
206
220
|
alt: "",
|
|
207
221
|
class: "size-full object-cover",
|
|
208
|
-
onError: s[2] ||= (e) =>
|
|
209
|
-
}, 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)])]),
|
|
210
224
|
_: 1
|
|
211
225
|
}, 8, [
|
|
212
226
|
"href",
|
|
213
227
|
"role",
|
|
214
228
|
"tabindex",
|
|
215
229
|
"class"
|
|
216
|
-
])),
|
|
230
|
+
])) : l("", !0),
|
|
217
231
|
m.workspaces.length ? (v(), u("div", {
|
|
218
|
-
key:
|
|
232
|
+
key: 1,
|
|
219
233
|
role: "group",
|
|
220
|
-
"aria-labelledby": `${
|
|
221
|
-
class: "mt-1 border-t border-border px-3 py-2"
|
|
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"
|
|
222
236
|
}, [d("p", {
|
|
223
|
-
id: `${
|
|
237
|
+
id: `${w(F)}-workspaces`,
|
|
224
238
|
class: "mb-2 flex items-center gap-2 text-xs font-semibold tracking-wide text-muted uppercase"
|
|
225
|
-
}, [p(
|
|
239
|
+
}, [p(w(oe), {
|
|
226
240
|
class: "size-4",
|
|
227
241
|
"aria-hidden": "true"
|
|
228
|
-
}), f(" " +
|
|
242
|
+
}), f(" " + C(m.workspacesLabel), 1)], 8, Ce), d("div", we, [(v(!0), u(i, null, b(m.workspaces, (e) => (v(), u("button", {
|
|
229
243
|
key: e.name,
|
|
230
244
|
type: "button",
|
|
231
245
|
role: "menuitemradio",
|
|
232
246
|
tabindex: "-1",
|
|
233
|
-
"aria-checked": e.name ===
|
|
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 ===
|
|
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"]),
|
|
235
249
|
"data-ac-ds": "",
|
|
236
250
|
"data-testid": "ac-user-menu-workspace",
|
|
237
|
-
onClick: (t) =>
|
|
238
|
-
}, [d("span",
|
|
251
|
+
onClick: (t) => He(e)
|
|
252
|
+
}, [d("span", Ee, [p(t, {
|
|
239
253
|
name: e.displayName || e.name,
|
|
240
254
|
"img-url": e.avatarUrl,
|
|
241
255
|
kind: e.type === "user" ? "person" : "organization",
|
|
@@ -244,60 +258,63 @@ var ue = {
|
|
|
244
258
|
"name",
|
|
245
259
|
"img-url",
|
|
246
260
|
"kind"
|
|
247
|
-
]), d("span",
|
|
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), {
|
|
248
262
|
key: 0,
|
|
249
263
|
class: "size-4 shrink-0 text-primary",
|
|
250
264
|
"aria-hidden": "true"
|
|
251
|
-
})) : l("", !0)], 10,
|
|
265
|
+
})) : l("", !0)], 10, Te))), 128))])], 8, Se)) : l("", !0),
|
|
252
266
|
m.showThemeMode ? (v(), u("div", {
|
|
253
|
-
key:
|
|
267
|
+
key: 2,
|
|
254
268
|
role: "group",
|
|
255
|
-
"aria-labelledby": `${
|
|
256
|
-
class: "mt-1 border-t border-border px-1 pt-2 pb-1"
|
|
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"
|
|
257
271
|
}, [d("p", {
|
|
258
|
-
id: `${
|
|
272
|
+
id: `${w(F)}-theme`,
|
|
259
273
|
class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
260
|
-
}, "Theme", 8,
|
|
274
|
+
}, "Theme", 8, je), p(r, {
|
|
261
275
|
display: "labels",
|
|
262
|
-
"onSet:theme": s[3] ||= (e) =>
|
|
263
|
-
})], 8,
|
|
276
|
+
"onSet:theme": s[3] ||= (e) => M("set:theme", e)
|
|
277
|
+
})], 8, Ae)) : l("", !0),
|
|
264
278
|
m.showFontScale ? (v(), u("div", {
|
|
265
|
-
key:
|
|
279
|
+
key: 3,
|
|
266
280
|
role: "group",
|
|
267
|
-
"aria-labelledby": `${
|
|
268
|
-
class: "mt-1 border-t border-border px-1 pt-2 pb-1"
|
|
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"
|
|
269
283
|
}, [d("p", {
|
|
270
|
-
id: `${
|
|
284
|
+
id: `${w(F)}-scale`,
|
|
271
285
|
class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
272
|
-
}, "Text size", 8,
|
|
273
|
-
d("div",
|
|
274
|
-
(v(!0), u(i, null, b(m.items, (e) => (v(), c(
|
|
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), {
|
|
275
289
|
role: "menuitem",
|
|
276
290
|
tabindex: "-1",
|
|
277
|
-
class:
|
|
278
|
-
onClick: (t) =>
|
|
291
|
+
class: N,
|
|
292
|
+
onClick: (t) => Ve(e)
|
|
279
293
|
}), {
|
|
280
|
-
default:
|
|
294
|
+
default: D(() => [e.icon ? (v(), c(S(e.icon), {
|
|
281
295
|
key: 0,
|
|
282
296
|
"aria-hidden": "true"
|
|
283
|
-
})) : l("", !0), d("span",
|
|
297
|
+
})) : l("", !0), d("span", Fe, C(e.label), 1)]),
|
|
284
298
|
_: 2
|
|
285
299
|
}, 1040, ["onClick"]))), 128)),
|
|
286
|
-
|
|
287
|
-
close:
|
|
288
|
-
itemClass:
|
|
300
|
+
x(e.$slots, "default", {
|
|
301
|
+
close: Y,
|
|
302
|
+
itemClass: N
|
|
289
303
|
}),
|
|
290
|
-
(v(), c(
|
|
304
|
+
(v(), c(S(m.logoutUrl ? "a" : "button"), {
|
|
291
305
|
href: m.logoutUrl || void 0,
|
|
292
306
|
type: m.logoutUrl ? void 0 : "button",
|
|
293
307
|
role: "menuitem",
|
|
294
308
|
tabindex: "-1",
|
|
295
|
-
class: _(
|
|
309
|
+
class: _(Re),
|
|
296
310
|
"data-ac-ds": "",
|
|
297
311
|
"data-testid": "ac-user-menu-logout",
|
|
298
|
-
onClick:
|
|
312
|
+
onClick: Ue
|
|
299
313
|
}, {
|
|
300
|
-
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)]),
|
|
301
318
|
_: 1
|
|
302
319
|
}, 8, ["href", "type"]))
|
|
303
320
|
])
|
|
@@ -307,4 +324,4 @@ var ue = {
|
|
|
307
324
|
}
|
|
308
325
|
});
|
|
309
326
|
//#endregion
|
|
310
|
-
export {
|
|
327
|
+
export { k as default };
|
|
@@ -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 };
|