@ac-design/design-system 2.10.2 → 2.10.3
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 +22 -22
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +17 -15
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +32 -30
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/lib/components/AcList.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcListItem.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +2 -2
- package/package.json +1 -1
package/dist/lib/compat.css
CHANGED
|
@@ -6064,6 +6064,28 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
6064
6064
|
.\[\&\>svg\]\:text-muted > svg:where([data-ac-ds], [data-ac-ds] *) {
|
|
6065
6065
|
color: var(--color-muted) !important;
|
|
6066
6066
|
}
|
|
6067
|
+
.peer + .\[\.peer\+\&\]\:mt-2\.5:where([data-ac-ds], [data-ac-ds] *) {
|
|
6068
|
+
margin-top: calc(var(--spacing) * 2.5) !important;
|
|
6069
|
+
}
|
|
6070
|
+
.peer + .\[\.peer\+\&\]\:mt-5:where([data-ac-ds], [data-ac-ds] *) {
|
|
6071
|
+
margin-top: calc(var(--spacing) * 5) !important;
|
|
6072
|
+
}
|
|
6073
|
+
.peer + .\[\.peer\+\&\]\:border-t:where([data-ac-ds], [data-ac-ds] *) {
|
|
6074
|
+
border-top-style: var(--tw-border-style) !important;
|
|
6075
|
+
border-top-width: 1px !important;
|
|
6076
|
+
}
|
|
6077
|
+
.peer + .\[\.peer\+\&\]\:border-muted\/20:where([data-ac-ds], [data-ac-ds] *) {
|
|
6078
|
+
border-color: color-mix(in srgb, #5c5c5c 20%, transparent) !important;
|
|
6079
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
6080
|
+
border-color: color-mix(in oklab, var(--color-muted) 20%, transparent) !important;
|
|
6081
|
+
}
|
|
6082
|
+
}
|
|
6083
|
+
.peer + .\[\.peer\+\&\]\:pt-4:where([data-ac-ds], [data-ac-ds] *) {
|
|
6084
|
+
padding-top: calc(var(--spacing) * 4) !important;
|
|
6085
|
+
}
|
|
6086
|
+
.peer[data-closed] + .\[\.peer\[data-closed\]\+\&\]\:mt-0:where([data-ac-ds], [data-ac-ds] *) {
|
|
6087
|
+
margin-top: 0px !important;
|
|
6088
|
+
}
|
|
6067
6089
|
:where(.\[\:where\(\&\)\]\:w-full):where([data-ac-ds], [data-ac-ds] *) {
|
|
6068
6090
|
width: 100% !important;
|
|
6069
6091
|
}
|
|
@@ -6093,28 +6115,6 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
6093
6115
|
width: calc(var(--spacing) * 4) !important;
|
|
6094
6116
|
height: calc(var(--spacing) * 4) !important;
|
|
6095
6117
|
}
|
|
6096
|
-
[data-testid=ac-sidebar-section] + .\[\[data-testid\=ac-sidebar-section\]\+\&\]\:mt-2\.5:where([data-ac-ds], [data-ac-ds] *) {
|
|
6097
|
-
margin-top: calc(var(--spacing) * 2.5) !important;
|
|
6098
|
-
}
|
|
6099
|
-
[data-testid=ac-sidebar-section] + .\[\[data-testid\=ac-sidebar-section\]\+\&\]\:mt-5:where([data-ac-ds], [data-ac-ds] *) {
|
|
6100
|
-
margin-top: calc(var(--spacing) * 5) !important;
|
|
6101
|
-
}
|
|
6102
|
-
[data-testid=ac-sidebar-section] + .\[\[data-testid\=ac-sidebar-section\]\+\&\]\:border-t:where([data-ac-ds], [data-ac-ds] *) {
|
|
6103
|
-
border-top-style: var(--tw-border-style) !important;
|
|
6104
|
-
border-top-width: 1px !important;
|
|
6105
|
-
}
|
|
6106
|
-
[data-testid=ac-sidebar-section] + .\[\[data-testid\=ac-sidebar-section\]\+\&\]\:border-muted\/20:where([data-ac-ds], [data-ac-ds] *) {
|
|
6107
|
-
border-color: color-mix(in srgb, #5c5c5c 20%, transparent) !important;
|
|
6108
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
6109
|
-
border-color: color-mix(in oklab, var(--color-muted) 20%, transparent) !important;
|
|
6110
|
-
}
|
|
6111
|
-
}
|
|
6112
|
-
[data-testid=ac-sidebar-section] + .\[\[data-testid\=ac-sidebar-section\]\+\&\]\:pt-4:where([data-ac-ds], [data-ac-ds] *) {
|
|
6113
|
-
padding-top: calc(var(--spacing) * 4) !important;
|
|
6114
|
-
}
|
|
6115
|
-
[data-testid=ac-sidebar-section][data-closed] + .\[\[data-testid\=ac-sidebar-section\]\[data-closed\]\+\&\]\:mt-0:where([data-ac-ds], [data-ac-ds] *) {
|
|
6116
|
-
margin-top: 0px !important;
|
|
6117
|
-
}
|
|
6118
6118
|
tbody .\[tbody_\&\]\:h-\[51px\]:where([data-ac-ds], [data-ac-ds] *) {
|
|
6119
6119
|
height: 51px !important;
|
|
6120
6120
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { computed as e, createElementBlock as t, defineComponent as n, mergeModels as r, normalizeClass as i, openBlock as a, provide as o, ref as s, renderSlot as c,
|
|
1
|
+
import { computed as e, createElementBlock as t, defineComponent as n, mergeModels as r, normalizeClass as i, openBlock as a, provide as o, ref as s, renderSlot as c, useId as l, useModel as u } from "vue";
|
|
2
2
|
//#region src/lib/components/AcAccordion.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
3
|
+
var d = /*@__PURE__*/ n({
|
|
4
4
|
__name: "AcAccordion",
|
|
5
5
|
props: /*@__PURE__*/ r({
|
|
6
6
|
multiple: {
|
|
@@ -15,18 +15,19 @@ var u = /*@__PURE__*/ n({
|
|
|
15
15
|
}),
|
|
16
16
|
emits: ["update:modelValue"],
|
|
17
17
|
setup(n) {
|
|
18
|
-
let r = n,
|
|
19
|
-
let e =
|
|
18
|
+
let r = n, d = u(n, "modelValue"), f = s(null), p = e(() => {
|
|
19
|
+
let e = d.value;
|
|
20
20
|
return e == null || e === "" ? [] : Array.isArray(e) ? e : [e];
|
|
21
21
|
});
|
|
22
|
-
function p(e) {
|
|
23
|
-
return f.value.includes(e);
|
|
24
|
-
}
|
|
25
22
|
function m(e) {
|
|
26
|
-
|
|
27
|
-
r.multiple ? u.value = t ? f.value.filter((t) => t !== e) : [...f.value, e] : u.value = t ? null : e;
|
|
23
|
+
return p.value.includes(e);
|
|
28
24
|
}
|
|
29
25
|
function h(e) {
|
|
26
|
+
let t = m(e);
|
|
27
|
+
r.multiple ? d.value = t ? p.value.filter((t) => t !== e) : [...p.value, e] : d.value = t ? null : e;
|
|
28
|
+
}
|
|
29
|
+
let g = l();
|
|
30
|
+
function _(e) {
|
|
30
31
|
if (![
|
|
31
32
|
"ArrowDown",
|
|
32
33
|
"ArrowUp",
|
|
@@ -35,17 +36,18 @@ var u = /*@__PURE__*/ n({
|
|
|
35
36
|
].includes(e.key)) return;
|
|
36
37
|
let t = e.target;
|
|
37
38
|
if (!t.matches("[data-accordion-trigger]")) return;
|
|
38
|
-
let n = [...
|
|
39
|
+
let n = [...f.value?.querySelectorAll("[data-accordion-trigger]") ?? []].filter((e) => e.dataset.accordionTrigger === g && !e.disabled), r = n.indexOf(t);
|
|
39
40
|
r < 0 || (e.preventDefault(), n[e.key === "Home" ? 0 : e.key === "End" ? n.length - 1 : (r + (e.key === "ArrowDown" ? 1 : -1) + n.length) % n.length]?.focus());
|
|
40
41
|
}
|
|
41
42
|
return o("ac-accordion", {
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
uid: g,
|
|
44
|
+
isOpen: m,
|
|
45
|
+
toggle: h,
|
|
44
46
|
variant: e(() => r.variant),
|
|
45
47
|
headingLevel: e(() => r.headingLevel)
|
|
46
48
|
}), (e, r) => (a(), t("div", {
|
|
47
49
|
ref_key: "root",
|
|
48
|
-
ref:
|
|
50
|
+
ref: f,
|
|
49
51
|
class: i(["w-full", {
|
|
50
52
|
"divide-y divide-border overflow-hidden rounded-14 border border-border bg-surface": n.variant === "bordered",
|
|
51
53
|
"flex flex-col gap-3": n.variant === "separated",
|
|
@@ -53,9 +55,9 @@ var u = /*@__PURE__*/ n({
|
|
|
53
55
|
}]),
|
|
54
56
|
"data-ac-ds": "",
|
|
55
57
|
"data-testid": "ac-accordion",
|
|
56
|
-
onKeydown:
|
|
58
|
+
onKeydown: _
|
|
57
59
|
}, [c(e.$slots, "default")], 34));
|
|
58
60
|
}
|
|
59
61
|
});
|
|
60
62
|
//#endregion
|
|
61
|
-
export {
|
|
63
|
+
export { d as default };
|
|
@@ -26,67 +26,69 @@ var T = ["aria-label"], E = { class: "sr-only" }, D = { class: "block font-mono
|
|
|
26
26
|
},
|
|
27
27
|
emits: ["copy"],
|
|
28
28
|
setup(u, { expose: M, emit: N }) {
|
|
29
|
-
let P = u, F = N, I = b(), L = g(null), R = g(null), z = g("idle"),
|
|
29
|
+
let P = u, F = N, I = b(), L = g(null), R = g(null), z = g(null), B = g("idle"), V = g(!1), H, U = r(() => ({
|
|
30
30
|
class: I.class,
|
|
31
31
|
style: I.style
|
|
32
|
-
})),
|
|
32
|
+
})), W = r(() => {
|
|
33
33
|
let { class: e, style: t, ...n } = I;
|
|
34
34
|
return n;
|
|
35
|
-
}),
|
|
36
|
-
function
|
|
37
|
-
let e =
|
|
38
|
-
|
|
35
|
+
}), G = r(() => P.display || P.value), K = r(() => P.label ? ` ${P.label}` : ""), q = r(() => P.label || "value"), J = r(() => !P.iconOnly && (V.value || !!P.display && P.display !== P.value)), Y = r(() => P.iconOnly ? P.size === "small" ? "size-6 justify-center rounded-6" : "size-7 justify-center rounded-8" : P.variant === "chip" ? P.size === "small" ? "gap-1.5 rounded-8 px-2 py-0.5 text-xs" : "gap-1.5 rounded-8 px-2.5 py-1 text-base" : P.size === "small" ? "gap-1 rounded-4 text-xs" : P.size === "normal" ? "gap-1.5 rounded-6 text-base" : "gap-1 rounded-4"), X = r(() => P.iconOnly ? "text-muted hover:bg-surface-sunken hover:text-heading" : P.variant === "chip" ? "border border-border bg-surface-sunken/50 text-muted hover:border-border-dark hover:text-heading" : P.size ? "text-heading" : ""), Z = r(() => P.iconOnly && P.size !== "small" ? "size-4" : "size-3.5"), Q = r(() => P.iconOnly ? "" : P.variant === "chip" ? "text-muted opacity-60 group-hover:opacity-100 group-focus-visible:opacity-100" : "text-muted opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 pointer-coarse:opacity-100");
|
|
36
|
+
function $() {
|
|
37
|
+
let e = z.value;
|
|
38
|
+
V.value = !!e && e.scrollWidth > e.clientWidth + 1;
|
|
39
39
|
}
|
|
40
|
-
async function
|
|
41
|
-
clearTimeout(
|
|
40
|
+
async function ee() {
|
|
41
|
+
clearTimeout(H);
|
|
42
42
|
try {
|
|
43
|
-
await t(P.value),
|
|
43
|
+
await t(P.value), B.value = "copied", F("copy", P.value);
|
|
44
44
|
} catch {
|
|
45
|
-
|
|
45
|
+
B.value = "failed";
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
H = setTimeout(() => B.value = "idle", A), await f(), te();
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let e =
|
|
49
|
+
function te() {
|
|
50
|
+
let e = R.value?.$el;
|
|
51
51
|
e && L.value?.matches(":hover") && e.dispatchEvent(new PointerEvent("pointerenter", { pointerType: "mouse" }));
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ne() {
|
|
54
54
|
L.value?.focus();
|
|
55
55
|
}
|
|
56
|
-
return m(() => clearTimeout(
|
|
56
|
+
return m(() => clearTimeout(H)), M({ focus: ne }), (t, r) => (h(), o("span", d({ class: "inline-flex max-w-full min-w-0 align-middle" }, U.value, {
|
|
57
57
|
"data-ac-ds": "",
|
|
58
58
|
"data-testid": "ac-copy-button"
|
|
59
59
|
}), [l(e, {
|
|
60
|
+
ref_key: "tooltip",
|
|
61
|
+
ref: R,
|
|
60
62
|
class: "min-w-0 flex-auto",
|
|
61
|
-
delay:
|
|
62
|
-
"max-width":
|
|
63
|
+
delay: B.value === "idle" ? 300 : 0,
|
|
64
|
+
"max-width": B.value === "idle" && J.value ? j : void 0
|
|
63
65
|
}, {
|
|
64
|
-
content: x(() => [
|
|
66
|
+
content: x(() => [B.value === "copied" ? (h(), o(n, { key: 0 }, [c("Copied" + v(K.value), 1)], 64)) : B.value === "failed" ? (h(), o(n, { key: 1 }, [c("Couldn't copy" + v(K.value) + ". The browser blocked the clipboard.", 1)], 64)) : J.value ? (h(), o(n, { key: 2 }, [s("span", D, v(u.value), 1), s("span", O, "Click to copy" + v(K.value), 1)], 64)) : (h(), o(n, { key: 3 }, [c("Copy" + v(K.value), 1)], 64))]),
|
|
65
67
|
default: x(() => [s("button", d({
|
|
66
68
|
ref_key: "button",
|
|
67
69
|
ref: L,
|
|
68
70
|
type: "button",
|
|
69
|
-
class: ["group inline-flex max-w-full min-w-0 flex-auto cursor-pointer items-center text-left transition-[color,background-color,border-color] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", [
|
|
70
|
-
"aria-label": u.iconOnly ? `Copy ${
|
|
71
|
-
},
|
|
72
|
-
onClick: S(
|
|
73
|
-
onPointerenter:
|
|
74
|
-
onFocus:
|
|
75
|
-
}), [u.iconOnly ? a("", !0) : (h(), o(n, { key: 0 }, [s("span", E, v(`Copy ${
|
|
71
|
+
class: ["group inline-flex max-w-full min-w-0 flex-auto cursor-pointer items-center text-left transition-[color,background-color,border-color] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", [Y.value, X.value]],
|
|
72
|
+
"aria-label": u.iconOnly ? `Copy ${q.value}` : void 0
|
|
73
|
+
}, W.value, {
|
|
74
|
+
onClick: S(ee, ["stop"]),
|
|
75
|
+
onPointerenter: $,
|
|
76
|
+
onFocus: $
|
|
77
|
+
}), [u.iconOnly ? a("", !0) : (h(), o(n, { key: 0 }, [s("span", E, v(`Copy ${q.value}: `), 1), s("span", {
|
|
76
78
|
ref_key: "text",
|
|
77
|
-
ref:
|
|
79
|
+
ref: z,
|
|
78
80
|
class: p(["min-w-0 truncate", u.mono && "font-mono"])
|
|
79
|
-
}, [_(t.$slots, "default", {}, () => [c(v(
|
|
81
|
+
}, [_(t.$slots, "default", {}, () => [c(v(G.value), 1)])], 2)], 64)), B.value === "copied" ? (h(), i(y(C), {
|
|
80
82
|
key: 1,
|
|
81
|
-
class: p(["shrink-0 text-primary",
|
|
83
|
+
class: p(["shrink-0 text-primary", Z.value]),
|
|
82
84
|
"aria-hidden": "true"
|
|
83
85
|
}, null, 8, ["class"])) : (h(), i(y(w), {
|
|
84
86
|
key: 2,
|
|
85
|
-
class: p(["shrink-0 transition-opacity duration-200", [
|
|
87
|
+
class: p(["shrink-0 transition-opacity duration-200", [Z.value, Q.value]]),
|
|
86
88
|
"aria-hidden": "true"
|
|
87
89
|
}, null, 8, ["class"]))], 16, T)]),
|
|
88
90
|
_: 3
|
|
89
|
-
}, 8, ["delay", "max-width"]), s("span", k, v(
|
|
91
|
+
}, 8, ["delay", "max-width"]), s("span", k, v(B.value === "copied" ? `Copied ${q.value}` : B.value === "failed" ? `Couldn't copy ${q.value}` : ""), 1)], 16));
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
94
|
//#endregion
|
|
@@ -165,8 +165,14 @@ var oe = [
|
|
|
165
165
|
e.isComposing || (e.preventDefault(), t < R.value.length - 1 ? Y(t + 1, "key") : V.value || $());
|
|
166
166
|
}
|
|
167
167
|
function Ce(e, t) {
|
|
168
|
+
return [...e.querySelectorAll("[aria-controls]")].some((n) => {
|
|
169
|
+
let r = document.getElementById(n.getAttribute("aria-controls") ?? "")?.closest("[data-ac-ds]");
|
|
170
|
+
return !!r && !r.contains(e) && r.contains(t);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
function we(e, t) {
|
|
168
174
|
let n = e.currentTarget, r = e.relatedTarget;
|
|
169
|
-
r && (n.contains(r) ||
|
|
175
|
+
r && (n.contains(r) || Ce(n, r)) || N.value === t && (N.value = null);
|
|
170
176
|
}
|
|
171
177
|
return y(w, (e) => {
|
|
172
178
|
!e || Array.isArray(e) || ye(e, I) || (F.value = Object.entries(e).map(([e, t]) => ({
|
|
@@ -227,7 +233,7 @@ var oe = [
|
|
|
227
233
|
"data-row": r,
|
|
228
234
|
class: m(["grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-4", !d.plain && "max-sm:rounded-10 max-sm:border max-sm:border-border max-sm:bg-surface max-sm:p-3"]),
|
|
229
235
|
onFocusin: (e) => N.value = M.value[r] ?? null,
|
|
230
|
-
onFocusout: (e) =>
|
|
236
|
+
onFocusout: (e) => we(e, M.value[r] ?? -1)
|
|
231
237
|
}, [l("div", { class: m(["grid items-start gap-x-4 gap-y-3 [&_div:has(>input)]:rounded-8 [&_input]:rounded-8 [&_input]:font-medium", [H.value, d.plain && "[&_input]:pr-3 [&_input]:pl-3"]]) }, [
|
|
232
238
|
u(t, {
|
|
233
239
|
"data-cell": "key",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./AcListItem.js";
|
|
2
|
-
import { Fragment as t, computed as n, createBlock as r, createElementBlock as i, defineComponent as a, getCurrentInstance as o, mergeProps as s, normalizeClass as c, openBlock as l, provide as u, reactive as d, ref as f, renderList as p, renderSlot as m, toHandlers as h, toRef as g } from "vue";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createElementBlock as i, defineComponent as a, getCurrentInstance as o, mergeProps as s, normalizeClass as c, openBlock as l, provide as u, reactive as d, ref as f, renderList as p, renderSlot as m, toHandlers as h, toRef as g, useId as _ } from "vue";
|
|
3
3
|
//#region src/lib/components/AcList.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var v = ["aria-label"], y = "[data-ac-list-row]:not([aria-disabled='true']):not(:disabled)", b = /*@__PURE__*/ a({
|
|
5
5
|
__name: "AcList",
|
|
6
6
|
props: {
|
|
7
7
|
items: { default: () => [] },
|
|
@@ -14,16 +14,17 @@ var _ = ["aria-label"], v = "[data-ac-list-row]:not([aria-disabled='true']):not(
|
|
|
14
14
|
label: { default: void 0 }
|
|
15
15
|
},
|
|
16
16
|
emits: ["select"],
|
|
17
|
-
setup(a, { emit:
|
|
18
|
-
let
|
|
17
|
+
setup(a, { emit: b }) {
|
|
18
|
+
let x = a, S = b, C = !!o()?.vnode.props?.onSelect, w = f(null), T = n(() => x.variant === "plain" && !x.divided), E = n(() => x.items.some((e) => e.selected !== void 0)), D = _();
|
|
19
19
|
u("ac-list", d({
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
uid: D,
|
|
21
|
+
size: g(x, "size"),
|
|
22
|
+
rounded: T
|
|
22
23
|
}));
|
|
23
|
-
function
|
|
24
|
-
return
|
|
24
|
+
function O(e, t) {
|
|
25
|
+
return C ? { click: () => S("select", e, t) } : {};
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function k(e) {
|
|
27
28
|
if (![
|
|
28
29
|
"ArrowDown",
|
|
29
30
|
"ArrowUp",
|
|
@@ -32,22 +33,22 @@ var _ = ["aria-label"], v = "[data-ac-list-row]:not([aria-disabled='true']):not(
|
|
|
32
33
|
].includes(e.key)) return;
|
|
33
34
|
let t = e.target;
|
|
34
35
|
if (!t.matches("[data-ac-list-row]")) return;
|
|
35
|
-
let n = [...
|
|
36
|
+
let n = [...w.value?.querySelectorAll(y) ?? []].filter((e) => e.dataset.acListRow === D), r = n.indexOf(t);
|
|
36
37
|
r < 0 || (e.preventDefault(), n[e.key === "Home" ? 0 : e.key === "End" ? n.length - 1 : Math.min(Math.max(r + (e.key === "ArrowDown" ? 1 : -1), 0), n.length - 1)]?.focus());
|
|
37
38
|
}
|
|
38
39
|
return (n, o) => (l(), i("ul", {
|
|
39
40
|
ref_key: "root",
|
|
40
|
-
ref:
|
|
41
|
+
ref: w,
|
|
41
42
|
role: "list",
|
|
42
43
|
class: c(["@container m-0 flex list-none flex-col p-0", [
|
|
43
44
|
a.variant === "card" && "overflow-hidden rounded-14 border border-border bg-surface",
|
|
44
45
|
a.divided && "divide-y divide-border",
|
|
45
|
-
|
|
46
|
+
T.value && "gap-0.5"
|
|
46
47
|
]]),
|
|
47
48
|
"aria-label": a.label,
|
|
48
49
|
"data-ac-ds": "",
|
|
49
50
|
"data-testid": "ac-list",
|
|
50
|
-
onKeydown:
|
|
51
|
+
onKeydown: k
|
|
51
52
|
}, [m(n.$slots, "default", {}, () => [(l(!0), i(t, null, p(a.items, (t, n) => (l(), r(e, s({
|
|
52
53
|
key: t.key ?? t.title,
|
|
53
54
|
title: t.title,
|
|
@@ -55,10 +56,10 @@ var _ = ["aria-label"], v = "[data-ac-list-row]:not([aria-disabled='true']):not(
|
|
|
55
56
|
icon: t.icon,
|
|
56
57
|
to: t.to,
|
|
57
58
|
href: t.href,
|
|
58
|
-
selected:
|
|
59
|
+
selected: E.value ? !!t.selected : void 0,
|
|
59
60
|
disabled: t.disabled,
|
|
60
61
|
chevron: t.chevron
|
|
61
|
-
}, h(
|
|
62
|
+
}, h(O(t, n))), null, 16, [
|
|
62
63
|
"title",
|
|
63
64
|
"description",
|
|
64
65
|
"icon",
|
|
@@ -67,8 +68,8 @@ var _ = ["aria-label"], v = "[data-ac-list-row]:not([aria-disabled='true']):not(
|
|
|
67
68
|
"selected",
|
|
68
69
|
"disabled",
|
|
69
70
|
"chevron"
|
|
70
|
-
]))), 128))])], 42,
|
|
71
|
+
]))), 128))])], 42, v));
|
|
71
72
|
}
|
|
72
73
|
});
|
|
73
74
|
//#endregion
|
|
74
|
-
export {
|
|
75
|
+
export { b as default };
|
|
@@ -46,7 +46,7 @@ var v = {
|
|
|
46
46
|
}
|
|
47
47
|
}, O = c("ac-list", null), k = s()?.appContext.components.RouterLink, A = !!s()?.vnode.props?.onClick, j = e(() => D[O?.size ?? "normal"]), M = e(() => T.to && k && !T.disabled ? k : T.to || T.href ? "a" : A ? "button" : "div"), N = e(() => M.value !== "div"), P = e(() => {
|
|
48
48
|
let e = {};
|
|
49
|
-
return M.value === k ? e.to = T.to : M.value === "a" ? T.disabled ? (e.role = "link", e["aria-disabled"] = "true") : e.href = T.href ?? (typeof T.to == "string" ? T.to : void 0) : M.value === "button" && (e.type = "button", e.disabled = T.disabled || void 0, e["aria-pressed"] = T.selected), N.value && (e["data-ac-list-row"] = ""), T.selected && M.value !== "button" && (e["aria-current"] = N.value ? "page" : "true"), e;
|
|
49
|
+
return M.value === k ? e.to = T.to : M.value === "a" ? T.disabled ? (e.role = "link", e["aria-disabled"] = "true") : e.href = T.href ?? (typeof T.to == "string" ? T.to : void 0) : M.value === "button" && (e.type = "button", e.disabled = T.disabled || void 0, e["aria-pressed"] = T.selected), N.value && (e["data-ac-list-row"] = O?.uid ?? ""), T.selected && M.value !== "button" && (e["aria-current"] = N.value ? "page" : "true"), e;
|
|
50
50
|
});
|
|
51
51
|
function F(e) {
|
|
52
52
|
if (T.disabled) {
|
|
@@ -20,9 +20,9 @@ var v = ["data-closed"], y = ["aria-expanded", "aria-controls"], b = { class: "t
|
|
|
20
20
|
setup(o) {
|
|
21
21
|
let c = g(o, "open"), C = s("ac-sidebar", null), w = s("ac-sidebar-section", !1);
|
|
22
22
|
d("ac-sidebar-section", !0), d("ac-sidebar-subgroup", w);
|
|
23
|
-
let T = h(), E = t(() => C?.rail.value ?? !1), D = t(() => c.value || E.value), O = t(() => C?.compact?.value ?? !1), k = t(() => w ? O.value ? "mb-1 py-[5px] text-xm text-muted/80" : "mb-1 py-0.5 text-xm text-muted/80" : O.value ? D.value ? "mb-2 py-1 text-sm text-muted" : "mb-1 py-1 text-sm text-muted" : "mb-2 py-0.5 text-sm text-muted"), A = t(() => w ? O.value ? "mt-0.5 first:mt-0" : "mt-2 first:mt-0" : E.value ? "mt-2 border-t border-muted/20 pt-2 first:mt-0 first:border-0 first:pt-0" : O.value ? "mt-3 first:mt-0 [[data-
|
|
23
|
+
let T = h(), E = t(() => C?.rail.value ?? !1), D = t(() => c.value || E.value), O = t(() => C?.compact?.value ?? !1), k = t(() => w ? O.value ? "mb-1 py-[5px] text-xm text-muted/80" : "mb-1 py-0.5 text-xm text-muted/80" : O.value ? D.value ? "mb-2 py-1 text-sm text-muted" : "mb-1 py-1 text-sm text-muted" : "mb-2 py-0.5 text-sm text-muted"), A = t(() => w ? O.value ? "mt-0.5 first:mt-0" : "mt-2 first:mt-0" : E.value ? "mt-2 border-t border-muted/20 pt-2 first:mt-0 first:border-0 first:pt-0" : O.value ? "mt-3 first:mt-0 [.peer[data-closed]+&]:mt-0 [.peer+&]:mt-2.5 [.peer+&]:border-t [.peer+&]:border-muted/20 [.peer+&]:pt-4" : "mt-4 first:mt-0 [.peer+&]:mt-5 [.peer+&]:border-t [.peer+&]:border-muted/20 [.peer+&]:pt-4");
|
|
24
24
|
return (t, s) => (u(), r("li", {
|
|
25
|
-
class: l(["list-none", A.value]),
|
|
25
|
+
class: l(["peer list-none", A.value]),
|
|
26
26
|
"data-closed": !D.value || void 0,
|
|
27
27
|
"data-ac-ds": "",
|
|
28
28
|
"data-testid": "ac-sidebar-section"
|