@ac-design/design-system 2.8.0 → 2.9.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 +21 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +9 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +64 -52
- package/dist/lib/components/AcSectionContent.vue.d.ts +1 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +1 -1
- package/dist/lib/theme.css +25 -0
- package/package.json +1 -1
package/dist/lib/compat.css
CHANGED
|
@@ -361,6 +361,9 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
361
361
|
.relative:where([data-ac-ds], [data-ac-ds] *) {
|
|
362
362
|
position: relative !important;
|
|
363
363
|
}
|
|
364
|
+
.static:where([data-ac-ds], [data-ac-ds] *) {
|
|
365
|
+
position: static !important;
|
|
366
|
+
}
|
|
364
367
|
.sticky:where([data-ac-ds], [data-ac-ds] *) {
|
|
365
368
|
position: sticky !important;
|
|
366
369
|
}
|
|
@@ -3685,6 +3688,14 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
3685
3688
|
--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)) !important;
|
|
3686
3689
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
|
|
3687
3690
|
}
|
|
3691
|
+
.ac-focus-inset:focus-visible:where([data-ac-ds], [data-ac-ds] *) {
|
|
3692
|
+
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;
|
|
3693
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
|
|
3694
|
+
--tw-ring-color: var(--color-ring) !important;
|
|
3695
|
+
--tw-outline-style: none !important;
|
|
3696
|
+
outline-style: none !important;
|
|
3697
|
+
--tw-ring-inset: inset !important;
|
|
3698
|
+
}
|
|
3688
3699
|
.ring:where([data-ac-ds], [data-ac-ds] *) {
|
|
3689
3700
|
--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;
|
|
3690
3701
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
|
|
@@ -3920,6 +3931,16 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
|
|
|
3920
3931
|
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,) !important;
|
|
3921
3932
|
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,) !important;
|
|
3922
3933
|
}
|
|
3934
|
+
.ac-transition-colors:where([data-ac-ds], [data-ac-ds] *) {
|
|
3935
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to !important;
|
|
3936
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;
|
|
3937
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;
|
|
3938
|
+
--tw-duration: 200ms !important;
|
|
3939
|
+
transition-duration: 200ms !important;
|
|
3940
|
+
@media (prefers-reduced-motion: reduce) {
|
|
3941
|
+
transition-property: none !important;
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3923
3944
|
.transition:where([data-ac-ds], [data-ac-ds] *) {
|
|
3924
3945
|
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events !important;
|
|
3925
3946
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;
|
|
@@ -9,6 +9,12 @@ export interface Props {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
/** Heading level of the title. Defaults to the parent AcAccordion's, or 3. */
|
|
11
11
|
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
12
|
+
/** Turn off for a section that always shows its content: the header is plain text, with no chevron, and `open` is ignored. */
|
|
13
|
+
collapsible?: boolean;
|
|
14
|
+
/** Frame of an item on its own (inside an AcAccordion the parent's applies): `separated` its own card, `bordered` no frame with card padding, for a container that draws the border, `flush` no frame or side padding. */
|
|
15
|
+
variant?: "bordered" | "separated" | "flush";
|
|
16
|
+
/** Attributes for the header button (the header row when not `collapsible`), e.g. `{ 'data-testid': 'section-heading' }` for tests. */
|
|
17
|
+
headerAttrs?: Record<string, unknown>;
|
|
12
18
|
}
|
|
13
19
|
type __VLS_Props = Props;
|
|
14
20
|
type __VLS_Slots = {
|
|
@@ -35,11 +41,14 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
35
41
|
onToggle?: ((open: boolean) => any) | undefined;
|
|
36
42
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
37
43
|
}>, {
|
|
44
|
+
variant: "bordered" | "separated" | "flush";
|
|
38
45
|
headingLevel: 2 | 3 | 4 | 5 | 6;
|
|
39
46
|
title: string;
|
|
40
47
|
value: string;
|
|
41
48
|
description: string;
|
|
42
49
|
disabled: boolean;
|
|
50
|
+
collapsible: boolean;
|
|
51
|
+
headerAttrs: Record<string, unknown>;
|
|
43
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
53
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
54
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, inject as s, mergeModels as c,
|
|
2
|
-
import { ChevronDown as
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, inject as s, mergeModels as c, mergeProps as l, normalizeClass as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useId as g, useModel as _, watch as v, withCtx as y } from "vue";
|
|
2
|
+
import { ChevronDown as b, ChevronRight as x } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcAccordionItem.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
-
"id",
|
|
6
|
-
"aria-expanded",
|
|
7
|
-
"aria-controls",
|
|
8
|
-
"disabled"
|
|
9
|
-
], S = {
|
|
4
|
+
var S = {
|
|
10
5
|
key: 1,
|
|
11
6
|
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary-strong [&_svg]:size-4",
|
|
12
7
|
"aria-hidden": "true"
|
|
@@ -17,7 +12,7 @@ var x = [
|
|
|
17
12
|
"id",
|
|
18
13
|
"aria-labelledby",
|
|
19
14
|
"inert"
|
|
20
|
-
], D = /*@__PURE__*/ o({
|
|
15
|
+
], D = "cursor-pointer ac-transition-colors ac-focus-inset disabled:cursor-not-allowed disabled:opacity-50", O = /*@__PURE__*/ o({
|
|
21
16
|
__name: "AcAccordionItem",
|
|
22
17
|
props: /*@__PURE__*/ c({
|
|
23
18
|
value: { default: void 0 },
|
|
@@ -27,7 +22,13 @@ var x = [
|
|
|
27
22
|
type: Boolean,
|
|
28
23
|
default: !1
|
|
29
24
|
},
|
|
30
|
-
headingLevel: { default: void 0 }
|
|
25
|
+
headingLevel: { default: void 0 },
|
|
26
|
+
collapsible: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
variant: { default: void 0 },
|
|
31
|
+
headerAttrs: { default: void 0 }
|
|
31
32
|
}, {
|
|
32
33
|
open: {
|
|
33
34
|
type: Boolean,
|
|
@@ -37,54 +38,65 @@ var x = [
|
|
|
37
38
|
}),
|
|
38
39
|
emits: /*@__PURE__*/ c(["toggle"], ["update:open"]),
|
|
39
40
|
setup(o, { emit: c }) {
|
|
40
|
-
let
|
|
41
|
-
function
|
|
42
|
-
if (
|
|
43
|
-
let e = !
|
|
44
|
-
|
|
41
|
+
let O = o, k = _(o, "open"), A = c, j = s("ac-accordion", null), M = g(), N = e(() => O.value ?? M), P = e(() => !O.collapsible || (j ? j.isOpen(N.value) : k.value)), F = e(() => O.headingLevel ?? j?.headingLevel.value ?? 3), I = e(() => j?.variant.value ?? O.variant ?? "separated");
|
|
42
|
+
function L() {
|
|
43
|
+
if (O.disabled || !O.collapsible) return;
|
|
44
|
+
let e = !P.value;
|
|
45
|
+
j ? j.toggle(N.value) : k.value = e, A("toggle", e);
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
let R = e(() => O.collapsible ? {
|
|
48
|
+
type: "button",
|
|
49
|
+
"data-accordion-trigger": "",
|
|
50
|
+
"aria-expanded": P.value,
|
|
51
|
+
"aria-controls": `${M}-panel`,
|
|
52
|
+
disabled: O.disabled
|
|
53
|
+
} : {});
|
|
54
|
+
return v(P, (e) => {
|
|
55
|
+
j && (k.value = e);
|
|
56
|
+
}), (e, s) => (d(), r("div", {
|
|
57
|
+
class: u([I.value === "separated" && "overflow-clip rounded-14 border border-border bg-surface", e.$slots.actions && "@container"]),
|
|
50
58
|
"data-ac-ds": "",
|
|
51
59
|
"data-testid": "ac-accordion-item"
|
|
52
|
-
}, [i("div", { class:
|
|
53
|
-
default:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
60
|
+
}, [i("div", { class: u(["flex items-center", e.$slots.actions && "transition-colors duration-200 @max-md:flex-wrap has-[[data-accordion-trigger]:enabled:hover]:bg-accent-hover/60"]) }, [(d(), t(p(`h${F.value}`), { class: "m-0 min-w-0 flex-1 text-base leading-5 font-normal tracking-normal @max-md:basis-full" }, {
|
|
61
|
+
default: y(() => [(d(), t(p(o.collapsible ? "button" : "span"), l({ id: `${h(M)}-trigger` }, {
|
|
62
|
+
...R.value,
|
|
63
|
+
...o.headerAttrs
|
|
64
|
+
}, {
|
|
65
|
+
class: ["flex w-full items-center gap-3 text-left", [
|
|
66
|
+
I.value === "flush" ? "px-1 py-3" : "px-5 py-4",
|
|
67
|
+
o.collapsible && D,
|
|
68
|
+
o.collapsible && !o.disabled && !e.$slots.actions && "hover:bg-accent-hover/60"
|
|
69
|
+
]],
|
|
70
|
+
onClick: L
|
|
71
|
+
}), {
|
|
72
|
+
default: y(() => [
|
|
73
|
+
o.collapsible && e.$slots.actions ? (d(), t(h(x), {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: u(["size-4 shrink-0 text-muted transition-transform duration-200 ease-out-soft motion-reduce:transition-none", P.value && "rotate-90 text-heading"]),
|
|
76
|
+
"aria-hidden": "true"
|
|
77
|
+
}, null, 8, ["class"])) : n("", !0),
|
|
78
|
+
e.$slots.icon ? (d(), r("span", S, [f(e.$slots, "icon")])) : n("", !0),
|
|
79
|
+
i("span", C, [i("span", w, [f(e.$slots, "title", {}, () => [a(m(o.title), 1)])]), o.description || e.$slots.description ? (d(), r("span", T, [f(e.$slots, "description", {}, () => [a(m(o.description), 1)])])) : n("", !0)]),
|
|
80
|
+
o.collapsible && !e.$slots.actions ? (d(), t(h(b), {
|
|
81
|
+
key: 2,
|
|
82
|
+
class: u(["size-4 shrink-0 text-muted transition-transform duration-200 ease-out-soft motion-reduce:transition-none", P.value && "rotate-180 text-heading"]),
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
}, null, 8, ["class"])) : n("", !0)
|
|
85
|
+
]),
|
|
86
|
+
_: 3
|
|
87
|
+
}, 16, ["id", "class"]))]),
|
|
76
88
|
_: 3
|
|
77
|
-
})), e.$slots.actions ? (
|
|
89
|
+
})), e.$slots.actions ? (d(), r("div", {
|
|
78
90
|
key: 0,
|
|
79
|
-
class:
|
|
80
|
-
}, [
|
|
81
|
-
id: `${
|
|
91
|
+
class: u(["flex shrink-0 flex-wrap items-center gap-1.5 @max-md:w-full", I.value === "flush" ? "pr-1 @max-md:-mt-1 @max-md:pb-3 @max-md:pl-8" : "pr-5 @max-md:-mt-2 @max-md:pb-4 @max-md:pl-12"])
|
|
92
|
+
}, [f(e.$slots, "actions")], 2)) : n("", !0)], 2), i("div", { class: u(["grid transition-[grid-template-rows] duration-200 ease-out-soft motion-reduce:transition-none", P.value ? "grid-rows-[1fr]" : "grid-rows-[0fr]"]) }, [i("div", {
|
|
93
|
+
id: `${h(M)}-panel`,
|
|
82
94
|
role: "region",
|
|
83
|
-
"aria-labelledby": `${
|
|
84
|
-
inert: !
|
|
85
|
-
class: "min-h-0 overflow-
|
|
86
|
-
}, [i("div", { class:
|
|
95
|
+
"aria-labelledby": `${h(M)}-trigger`,
|
|
96
|
+
inert: !P.value || void 0,
|
|
97
|
+
class: "min-h-0 overflow-clip"
|
|
98
|
+
}, [i("div", { class: u(["pt-0.5 text-base text-body", I.value === "flush" ? "px-1 pb-4" : "px-5 pb-5"]) }, [f(e.$slots, "default")], 2)], 8, E)], 2)], 2));
|
|
87
99
|
}
|
|
88
100
|
});
|
|
89
101
|
//#endregion
|
|
90
|
-
export {
|
|
102
|
+
export { O as default };
|
|
@@ -38,11 +38,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
38
38
|
onBack?: (() => any) | undefined;
|
|
39
39
|
}>, {
|
|
40
40
|
title: string;
|
|
41
|
+
collapsible: boolean;
|
|
41
42
|
tone: "default" | "danger";
|
|
42
43
|
subtitle: string;
|
|
43
44
|
padded: boolean;
|
|
44
45
|
plain: boolean;
|
|
45
|
-
collapsible: boolean;
|
|
46
46
|
backButton: boolean;
|
|
47
47
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
48
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -75,12 +75,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
75
75
|
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
77
|
label: string;
|
|
78
|
+
collapsible: boolean;
|
|
78
79
|
width: string;
|
|
79
80
|
top: string;
|
|
80
81
|
bottom: string;
|
|
81
82
|
mobile: "select" | "scroll";
|
|
82
83
|
sticky: boolean;
|
|
83
|
-
collapsible: boolean;
|
|
84
84
|
breakpoint: number;
|
|
85
85
|
offsetSelectors: string[];
|
|
86
86
|
hideTabs: boolean;
|
|
@@ -56,10 +56,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
56
56
|
}>, {
|
|
57
57
|
fixed: boolean;
|
|
58
58
|
label: string;
|
|
59
|
+
collapsible: boolean;
|
|
59
60
|
spacing: "normal" | "compact";
|
|
60
61
|
top: string;
|
|
61
62
|
dark: boolean;
|
|
62
|
-
collapsible: boolean;
|
|
63
63
|
contained: boolean;
|
|
64
64
|
breakpoint: number;
|
|
65
65
|
hoverExpand: boolean;
|
package/dist/lib/theme.css
CHANGED
|
@@ -314,6 +314,8 @@
|
|
|
314
314
|
--radius-14: calc(14px * var(--ac-scale));
|
|
315
315
|
--radius-16: calc(16px * var(--ac-scale));
|
|
316
316
|
--radius-50: calc(50px * var(--ac-scale));
|
|
317
|
+
/* a band inside a 14px card (a header, footer or steps strip): the card's corner less its 1px border */
|
|
318
|
+
--radius-14-inner: calc(var(--radius-14) - 1px);
|
|
317
319
|
|
|
318
320
|
/* elevation: cloud-ui's neutral scale. Cards rest on a border, not a shadow. */
|
|
319
321
|
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
@@ -644,6 +646,29 @@
|
|
|
644
646
|
&.ac-scrollbar::-webkit-scrollbar-thumb { background-color: #b0b0b0; }
|
|
645
647
|
}
|
|
646
648
|
|
|
649
|
+
/* Composite classes: one name for a set of utilities the components and apps keep repeating. They work with
|
|
650
|
+
variants like any utility (`hover:ac-transition-colors`, `max-sm:…`). */
|
|
651
|
+
|
|
652
|
+
/* A small uppercase label over a group: menu sections, panel headings, sidebar groups (11px, 600, 0.08em). */
|
|
653
|
+
@utility ac-overline {
|
|
654
|
+
@apply text-sm font-semibold tracking-[0.08em] text-muted uppercase;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/* Hover and selection colour changes at the standard 200ms, and none when the user asks for less motion. */
|
|
658
|
+
@utility ac-transition-colors {
|
|
659
|
+
@apply transition-colors duration-200 motion-reduce:transition-none;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/* Turning and sliding (a chevron opening, an arrow nudging) at 200ms, and none with reduced motion. */
|
|
663
|
+
@utility ac-transition-transform {
|
|
664
|
+
@apply transition-transform duration-200 motion-reduce:transition-none;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/* Keyboard focus drawn inside the element: full-width rows and headers, where an outer ring would be clipped. */
|
|
668
|
+
@utility ac-focus-inset {
|
|
669
|
+
@apply focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none;
|
|
670
|
+
}
|
|
671
|
+
|
|
647
672
|
/* Keyframes for AcSkeleton's shimmer and AcProgress's indeterminate bar; kept here so the library ships no extra CSS file. */
|
|
648
673
|
@keyframes ac-skeleton-shimmer {
|
|
649
674
|
from { background-position: 150% 0; }
|