@ac-design/design-system 2.6.1 → 2.8.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 +2 -2
- package/dist/lib/charts/graph.d.ts +9 -15
- package/dist/lib/charts/graph.js +79 -75
- package/dist/lib/charts/index.d.ts +4 -2
- package/dist/lib/charts/index.js +2 -1
- package/dist/lib/charts/nodeSymbol.d.ts +15 -0
- package/dist/lib/charts/nodeSymbol.js +27 -0
- package/dist/lib/charts/tree.d.ts +15 -0
- package/dist/lib/charts/tree.js +89 -0
- package/dist/lib/compat.css +162 -10
- package/dist/lib/components/AcAccordionItem.vue.d.ts +3 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +35 -26
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcBadge.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +1 -1
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCellValue.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +46 -43
- package/dist/lib/components/AcCheckList.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcColorInput.vue.d.ts +4 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +12 -2
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +12 -2
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcFeatureCard.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.vue.d.ts +53 -3
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +401 -233
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +2 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +18 -8
- package/dist/lib/components/AcList.js +5 -0
- package/dist/lib/components/AcList.vue.d.ts +56 -0
- package/dist/lib/components/AcList.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcListItem.js +5 -0
- package/dist/lib/components/AcListItem.vue.d.ts +53 -0
- package/dist/lib/components/AcListItem.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +66 -3
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +403 -201
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/lib/components/AcMonthPicker.js +5 -0
- package/dist/lib/components/AcMonthPicker.vue.d.ts +105 -0
- package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +605 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcNumberInput.vue.d.ts +3 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +11 -1
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcSelect.vue.d.ts +3 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +241 -218
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/lib/components/AcSideTabs.vue.d.ts +3 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +53 -33
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcStatCard.vue.d.ts +1 -1
- package/dist/lib/components/AcSteps.vue.d.ts +3 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +33 -29
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +83 -72
- package/dist/lib/components/AcTextarea.vue.d.ts +3 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +11 -1
- package/dist/lib/components/AcTimePicker.vue.d.ts +3 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +12 -2
- package/dist/lib/components/AcToaster.vue.d.ts +3 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +71 -68
- package/dist/lib/components/AcTreeChart.js +5 -0
- package/dist/lib/components/AcTreeChart.vue.d.ts +135 -0
- package/dist/lib/components/AcTreeChart.vue_vue_type_script_setup_true_lang.js +809 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +1 -1
- package/dist/lib/components/index.d.ts +5 -2
- package/dist/lib/composables/copyText.d.ts +5 -1
- package/dist/lib/composables/copyText.js +15 -3
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +85 -81
- package/dist/lib/theme.css +11 -0
- package/package.json +1 -1
|
@@ -45,6 +45,10 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
45
45
|
P.closable && (F.value = !1, I("close"));
|
|
46
46
|
}
|
|
47
47
|
function U(e) {
|
|
48
|
+
let t = e.currentTarget;
|
|
49
|
+
e.clientX >= t.getBoundingClientRect().left + t.clientWidth || (e.preventDefault(), P.closeOnOutsideClick && H());
|
|
50
|
+
}
|
|
51
|
+
function W(e) {
|
|
48
52
|
if (e.key === "Escape") {
|
|
49
53
|
if (e.defaultPrevented) return;
|
|
50
54
|
e.stopPropagation(), H();
|
|
@@ -55,7 +59,7 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
55
59
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
|
-
function
|
|
62
|
+
function G(e) {
|
|
59
63
|
let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
|
|
60
64
|
if (t.dataset.acModals = String(Math.max(n, 0)), e && n === 1) {
|
|
61
65
|
let e = window.innerWidth - document.documentElement.clientWidth;
|
|
@@ -66,16 +70,16 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
66
70
|
}
|
|
67
71
|
return y(F, async (e, t) => {
|
|
68
72
|
if (e) {
|
|
69
|
-
V = document.activeElement,
|
|
73
|
+
V = document.activeElement, G(!0), await l();
|
|
70
74
|
let e = B.value?.querySelector("[autofocus]");
|
|
71
75
|
((e && (e.matches(N) ? e : e.querySelector(N))) ?? B.value?.querySelector(L) ?? B.value)?.focus();
|
|
72
|
-
} else t && (
|
|
76
|
+
} else t && (G(!1), V?.isConnected && V.focus());
|
|
73
77
|
}, { immediate: !0 }), d(() => {
|
|
74
|
-
F.value &&
|
|
78
|
+
F.value && (G(!1), V?.isConnected && V.focus());
|
|
75
79
|
}), (c, l) => (f(), n(e, { to: "body" }, [o(t, {
|
|
76
80
|
"enter-active-class": "transition-opacity duration-300 ease-out",
|
|
77
81
|
"enter-from-class": s.side === "right" ? "opacity-0 [&_[data-panel]]:translate-x-full" : "opacity-0 [&_[data-panel]]:-translate-x-full",
|
|
78
|
-
"leave-active-class": "transition-opacity duration-200 ease-in",
|
|
82
|
+
"leave-active-class": "pointer-events-none transition-opacity duration-200 ease-in",
|
|
79
83
|
"leave-to-class": s.side === "right" ? "opacity-0 [&_[data-panel]]:translate-x-full" : "opacity-0 [&_[data-panel]]:-translate-x-full"
|
|
80
84
|
}, {
|
|
81
85
|
default: b(() => [F.value ? (f(), i("div", {
|
|
@@ -83,8 +87,8 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
83
87
|
class: "fixed inset-0 z-[80] bg-black/50",
|
|
84
88
|
"data-ac-ds": "",
|
|
85
89
|
"data-testid": "ac-side-panel",
|
|
86
|
-
onKeydown:
|
|
87
|
-
onMousedown:
|
|
90
|
+
onKeydown: W,
|
|
91
|
+
onMousedown: x(U, ["self"])
|
|
88
92
|
}, [a("div", {
|
|
89
93
|
ref_key: "panel",
|
|
90
94
|
ref: B,
|
|
@@ -5,6 +5,8 @@ export interface SideTabItem {
|
|
|
5
5
|
key: string;
|
|
6
6
|
/** Text of the item. */
|
|
7
7
|
label: string;
|
|
8
|
+
/** A muted second line under the label, e.g. "Sort, search, select". Truncated to one line; hidden in the collapsed rail and the phone row of tabs. */
|
|
9
|
+
description?: string;
|
|
8
10
|
/** A Lucide icon component, e.g. `:icon="Database"`. The collapsed rail shows only the icon. */
|
|
9
11
|
icon?: Component;
|
|
10
12
|
/** Route for `RouterLink` (needs vue-router in the app). The item for the current route becomes active by itself. */
|
|
@@ -25,7 +27,7 @@ export interface SideTabItem {
|
|
|
25
27
|
children?: SideTabItem[];
|
|
26
28
|
}
|
|
27
29
|
export interface Props {
|
|
28
|
-
/** The sections: `{ key, label, icon?, to?, href?, badge?, tone?, disabled?, group?, children? }`. */
|
|
30
|
+
/** The sections: `{ key, label, description?, icon?, to?, href?, badge?, tone?, disabled?, group?, children? }`. */
|
|
29
31
|
items: SideTabItem[];
|
|
30
32
|
/** Accessible name of the navigation, and the label of the select on phones. */
|
|
31
33
|
label?: string;
|
|
@@ -18,20 +18,32 @@ var ue = {
|
|
|
18
18
|
}, ge = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "text-xs font-semibold"
|
|
21
|
-
}, _e =
|
|
21
|
+
}, _e = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "min-w-0 flex-1"
|
|
24
|
+
}, ve = { class: "block truncate" }, ye = { class: "block truncate text-xs font-normal text-muted" }, be = [
|
|
22
25
|
"disabled",
|
|
23
26
|
"aria-expanded",
|
|
24
27
|
"aria-controls",
|
|
25
28
|
"title",
|
|
26
29
|
"onClick"
|
|
27
|
-
],
|
|
30
|
+
], xe = {
|
|
28
31
|
key: 1,
|
|
29
32
|
class: "text-xs font-semibold"
|
|
30
|
-
},
|
|
33
|
+
}, Se = {
|
|
34
|
+
key: 1,
|
|
35
|
+
class: "min-w-0 flex-1"
|
|
36
|
+
}, Ce = { class: "block truncate" }, we = { class: "block truncate text-xs font-normal text-muted" }, Te = ["id"], Ee = {
|
|
37
|
+
key: 1,
|
|
38
|
+
class: "min-w-0 flex-1"
|
|
39
|
+
}, De = { class: "block truncate" }, Oe = { class: "block truncate text-xs font-normal text-muted" }, ke = {
|
|
40
|
+
key: 2,
|
|
41
|
+
class: "min-w-0 flex-1 truncate"
|
|
42
|
+
}, Ae = [
|
|
31
43
|
"aria-label",
|
|
32
44
|
"aria-expanded",
|
|
33
45
|
"title"
|
|
34
|
-
],
|
|
46
|
+
], je = { key: 2 }, Me = {
|
|
35
47
|
key: 1,
|
|
36
48
|
class: "min-w-0 flex-1"
|
|
37
49
|
}, C = /*@__PURE__*/ s({
|
|
@@ -75,19 +87,19 @@ var ue = {
|
|
|
75
87
|
success: "bg-success text-white",
|
|
76
88
|
warning: "bg-warning text-on-warning",
|
|
77
89
|
danger: "bg-danger text-white"
|
|
78
|
-
},
|
|
90
|
+
}, Ne = {
|
|
79
91
|
neutral: "bg-muted",
|
|
80
92
|
primary: "bg-primary",
|
|
81
93
|
info: "bg-info",
|
|
82
94
|
success: "bg-success",
|
|
83
95
|
warning: "bg-warning",
|
|
84
96
|
danger: "bg-danger"
|
|
85
|
-
},
|
|
97
|
+
}, Pe = {
|
|
86
98
|
none: ["border-transparent text-heading/80 hover:border-border hover:bg-accent-hover hover:text-heading", "border-primary/35 bg-primary/10 text-heading shadow-xs shadow-primary/10"],
|
|
87
99
|
danger: ["border-transparent text-danger-strong hover:border-danger/25 hover:bg-danger/10", "border-danger/25 bg-danger/10 text-danger-strong"],
|
|
88
100
|
warning: ["border-transparent text-warning-strong hover:border-warning/30 hover:bg-warning/10", "border-warning/30 bg-warning/10 text-warning-strong"],
|
|
89
101
|
success: ["border-transparent text-success-strong hover:border-success/25 hover:bg-success/10", "border-success/25 bg-success/10 text-success-strong"]
|
|
90
|
-
}, O = ae(),
|
|
102
|
+
}, O = ae(), Fe = oe(), k = c()?.appContext, A = k?.components.RouterLink, j = k?.config.globalProperties.$router, M = h(null), N = h(null), P = h(!1), F = h(0), I = h({}), L = null, R = null, z = n(() => !!Fe.default), B = n(() => T.value && !P.value), V = n(() => C.items.flatMap((e) => e.children?.length ? e.children : [e])), Ie = n(() => {
|
|
91
103
|
let e = [];
|
|
92
104
|
for (let t of C.items) {
|
|
93
105
|
let n = t.group ?? "", r = e[e.length - 1];
|
|
@@ -97,17 +109,19 @@ var ue = {
|
|
|
97
109
|
});
|
|
98
110
|
}
|
|
99
111
|
return e;
|
|
100
|
-
}),
|
|
112
|
+
}), Le = n(() => C.items.flatMap((e) => e.children?.length ? e.children.map((t) => ({
|
|
101
113
|
value: t.key,
|
|
102
114
|
label: t.label,
|
|
115
|
+
description: t.description,
|
|
103
116
|
group: e.label,
|
|
104
117
|
disabled: t.disabled
|
|
105
118
|
})) : [{
|
|
106
119
|
value: e.key,
|
|
107
120
|
label: e.label,
|
|
121
|
+
description: e.description,
|
|
108
122
|
group: e.group,
|
|
109
123
|
disabled: e.disabled
|
|
110
|
-
}])),
|
|
124
|
+
}])), Re = n(() => {
|
|
111
125
|
if (!j) return "";
|
|
112
126
|
let e = j.currentRoute.value.path, t = "", n = -1;
|
|
113
127
|
for (let r of V.value) {
|
|
@@ -123,10 +137,10 @@ var ue = {
|
|
|
123
137
|
e.startsWith(a) && i.length > n && (t = r.key, n = i.length);
|
|
124
138
|
}
|
|
125
139
|
return t;
|
|
126
|
-
}), H = n(() => F.value ? `calc(${C.top} + ${F.value}px)` : C.top),
|
|
140
|
+
}), H = n(() => F.value ? `calc(${C.top} + ${F.value}px)` : C.top), ze = n(() => C.sticky ? {
|
|
127
141
|
top: H.value,
|
|
128
142
|
maxHeight: `calc(100dvh - ${H.value} - ${C.bottom})`
|
|
129
|
-
} : void 0),
|
|
143
|
+
} : void 0), Be = n(() => ({
|
|
130
144
|
width: B.value ? "calc(56px * var(--ac-scale))" : C.width,
|
|
131
145
|
minHeight: C.sticky && z.value ? `calc(100dvh - ${H.value} - ${C.bottom})` : void 0
|
|
132
146
|
}));
|
|
@@ -139,7 +153,7 @@ var ue = {
|
|
|
139
153
|
function G(e) {
|
|
140
154
|
return !I.value[e.key];
|
|
141
155
|
}
|
|
142
|
-
function
|
|
156
|
+
function Ve(e) {
|
|
143
157
|
if (B.value) {
|
|
144
158
|
T.value = !1, I.value[e.key] = !1;
|
|
145
159
|
return;
|
|
@@ -154,7 +168,7 @@ var ue = {
|
|
|
154
168
|
return t === A ? n.to = e.to : t === "a" ? e.disabled ? (n.role = "link", n["aria-disabled"] = "true") : n.href = e.href ?? e.to : (n.type = "button", n.disabled = e.disabled || void 0), n;
|
|
155
169
|
}
|
|
156
170
|
function J(e) {
|
|
157
|
-
let [t, n] =
|
|
171
|
+
let [t, n] = Pe[e.tone ?? "none"];
|
|
158
172
|
return [U(e) ? n : t, e.disabled ? "pointer-events-none cursor-not-allowed opacity-50" : "cursor-pointer"];
|
|
159
173
|
}
|
|
160
174
|
function Y(e, t) {
|
|
@@ -164,7 +178,7 @@ var ue = {
|
|
|
164
178
|
}
|
|
165
179
|
w.value = e.key, E("select", e);
|
|
166
180
|
}
|
|
167
|
-
function
|
|
181
|
+
function He(e) {
|
|
168
182
|
let t = V.value.find((t) => t.key === e);
|
|
169
183
|
t && !t.disabled && (w.value = t.key, E("select", t), t.to !== void 0 && j ? j.push(t.to) : t.href && window.location.assign(t.href));
|
|
170
184
|
}
|
|
@@ -197,7 +211,7 @@ var ue = {
|
|
|
197
211
|
let e = C.offsetSelectors.map((e) => document.querySelector(e)).filter((e) => !!e), t = () => F.value = e.reduce((e, t) => e + t.offsetHeight, 0);
|
|
198
212
|
R = new ResizeObserver(t), e.forEach((e) => R.observe(e)), t();
|
|
199
213
|
}
|
|
200
|
-
return x(
|
|
214
|
+
return x(Re, (e) => {
|
|
201
215
|
e && (w.value = e);
|
|
202
216
|
}, { immediate: !0 }), x(w, (e) => {
|
|
203
217
|
let t = C.items.find((t) => t.children?.some((t) => t.key === e));
|
|
@@ -218,9 +232,9 @@ var ue = {
|
|
|
218
232
|
"data-testid": "ac-side-tabs"
|
|
219
233
|
}, [s.hideTabs ? i("", !0) : (m(), a(t, { key: 0 }, [P.value && s.mobile === "select" ? (m(), a("div", ue, [te(e, {
|
|
220
234
|
"model-value": w.value || null,
|
|
221
|
-
options:
|
|
235
|
+
options: Le.value,
|
|
222
236
|
label: s.label,
|
|
223
|
-
"onUpdate:modelValue":
|
|
237
|
+
"onUpdate:modelValue": He
|
|
224
238
|
}, null, 8, [
|
|
225
239
|
"model-value",
|
|
226
240
|
"options",
|
|
@@ -258,13 +272,13 @@ var ue = {
|
|
|
258
272
|
}, 1040, ["class", "onClick"]))]))), 128))], 544)], 8, de)) : (m(), a("div", {
|
|
259
273
|
key: 2,
|
|
260
274
|
class: "shrink-0 border-r border-border bg-surface transition-[width] duration-200 ease-out-soft motion-reduce:transition-none",
|
|
261
|
-
style: p(
|
|
275
|
+
style: p(Be.value)
|
|
262
276
|
}, [o("nav", {
|
|
263
277
|
"aria-label": s.label,
|
|
264
278
|
class: f(["ac-scrollbar flex flex-col gap-4", [s.sticky && "sticky", B.value ? "p-2" : "p-3"]]),
|
|
265
|
-
style: p(
|
|
279
|
+
style: p(ze.value),
|
|
266
280
|
onKeydown: X
|
|
267
|
-
}, [(m(!0), a(t, null, g(
|
|
281
|
+
}, [(m(!0), a(t, null, g(Ie.value, (e, n) => (m(), a("div", { key: e.name || `section-${n}` }, [e.name && !B.value ? (m(), a("p", pe, v(e.name), 1)) : e.name && n > 0 ? (m(), a("div", me)) : i("", !0), o("ul", he, [(m(!0), a(t, null, g(e.items, (e) => (m(), a("li", { key: e.key }, [e.children?.length ? (m(), a(t, { key: 1 }, [o("button", {
|
|
268
282
|
type: "button",
|
|
269
283
|
"data-side-tab": "",
|
|
270
284
|
class: f(["group flex w-full cursor-pointer items-center gap-3 rounded-10 border py-2 text-left text-base font-medium transition-all duration-200 select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", [B.value ? "h-9.5 justify-center" : "px-3", B.value && W(e) ? "border-primary/35 bg-primary/10 text-heading shadow-xs shadow-primary/10" : ["border-transparent hover:border-border hover:bg-accent-hover hover:text-heading", W(e) ? "text-heading" : "text-heading/80"]]]),
|
|
@@ -272,7 +286,7 @@ var ue = {
|
|
|
272
286
|
"aria-expanded": B.value ? void 0 : G(e),
|
|
273
287
|
"aria-controls": `${y(O)}-${e.key}`,
|
|
274
288
|
title: B.value ? e.label : void 0,
|
|
275
|
-
onClick: (t) =>
|
|
289
|
+
onClick: (t) => Ve(e)
|
|
276
290
|
}, [
|
|
277
291
|
e.icon || B.value ? (m(), a("span", {
|
|
278
292
|
key: 0,
|
|
@@ -281,18 +295,21 @@ var ue = {
|
|
|
281
295
|
}, [e.icon ? (m(), r(_(e.icon), {
|
|
282
296
|
key: 0,
|
|
283
297
|
class: "size-4"
|
|
284
|
-
})) : (m(), a("span",
|
|
285
|
-
|
|
298
|
+
})) : (m(), a("span", xe, v(e.label.charAt(0)), 1))], 2)) : i("", !0),
|
|
299
|
+
e.description && !B.value ? (m(), a("span", Se, [o("span", Ce, v(e.label), 1), o("span", we, v(e.description), 1)])) : (m(), a("span", {
|
|
300
|
+
key: 2,
|
|
301
|
+
class: f(B.value ? "sr-only" : "min-w-0 flex-1 truncate")
|
|
302
|
+
}, v(e.label), 3)),
|
|
286
303
|
!B.value && e.badge !== void 0 && e.badge !== "" ? (m(), a("span", {
|
|
287
|
-
key:
|
|
304
|
+
key: 3,
|
|
288
305
|
class: f(["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-6 px-2 text-xs leading-none font-medium tabular-nums", D[e.badgeColor ?? "neutral"]])
|
|
289
306
|
}, v(e.badge), 3)) : i("", !0),
|
|
290
307
|
B.value ? i("", !0) : (m(), r(y(se), {
|
|
291
|
-
key:
|
|
308
|
+
key: 4,
|
|
292
309
|
class: f(["size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none", G(e) && "rotate-90"]),
|
|
293
310
|
"aria-hidden": "true"
|
|
294
311
|
}, null, 8, ["class"]))
|
|
295
|
-
], 10,
|
|
312
|
+
], 10, be), o("ul", {
|
|
296
313
|
id: `${y(O)}-${e.key}`,
|
|
297
314
|
role: "list",
|
|
298
315
|
class: f(["mt-1 ml-5 flex-col gap-1 border-l border-border pl-2", G(e) && !B.value ? "flex" : "hidden"])
|
|
@@ -307,14 +324,14 @@ var ue = {
|
|
|
307
324
|
class: f(["size-4 shrink-0", !e.tone && (U(e) ? "text-primary" : "text-muted group-hover:text-heading")]),
|
|
308
325
|
"aria-hidden": "true"
|
|
309
326
|
}, null, 8, ["class"])) : i("", !0),
|
|
310
|
-
o("span",
|
|
327
|
+
e.description ? (m(), a("span", Ee, [o("span", De, v(e.label), 1), o("span", Oe, v(e.description), 1)])) : (m(), a("span", ke, v(e.label), 1)),
|
|
311
328
|
e.badge !== void 0 && e.badge !== "" ? (m(), a("span", {
|
|
312
|
-
key:
|
|
329
|
+
key: 3,
|
|
313
330
|
class: f(["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-6 px-2 text-xs leading-none font-medium tabular-nums", D[e.badgeColor ?? "neutral"]])
|
|
314
331
|
}, v(e.badge), 3)) : i("", !0)
|
|
315
332
|
]),
|
|
316
333
|
_: 2
|
|
317
|
-
}, 1040, ["class", "onClick"]))]))), 128))], 10,
|
|
334
|
+
}, 1040, ["class", "onClick"]))]))), 128))], 10, Te)], 64)) : (m(), r(_(K(e)), u({
|
|
318
335
|
key: 0,
|
|
319
336
|
ref_for: !0
|
|
320
337
|
}, q(e), {
|
|
@@ -332,10 +349,13 @@ var ue = {
|
|
|
332
349
|
key: 0,
|
|
333
350
|
class: "size-4"
|
|
334
351
|
})) : (m(), a("span", ge, v(e.label.charAt(0)), 1))], 2)) : i("", !0),
|
|
335
|
-
|
|
336
|
-
|
|
352
|
+
e.description && !B.value ? (m(), a("span", _e, [o("span", ve, v(e.label), 1), o("span", ye, v(e.description), 1)])) : (m(), a("span", {
|
|
353
|
+
key: 2,
|
|
354
|
+
class: f(B.value ? "sr-only" : "min-w-0 flex-1 truncate")
|
|
355
|
+
}, v(e.label), 3)),
|
|
356
|
+
e.badge !== void 0 && e.badge !== "" ? (m(), a(t, { key: 3 }, [B.value ? (m(), a("span", {
|
|
337
357
|
key: 0,
|
|
338
|
-
class: f(["absolute top-1 right-1 size-2 rounded-full",
|
|
358
|
+
class: f(["absolute top-1 right-1 size-2 rounded-full", Ne[e.badgeColor ?? "neutral"]]),
|
|
339
359
|
"aria-hidden": "true"
|
|
340
360
|
}, null, 2)) : (m(), a("span", {
|
|
341
361
|
key: 1,
|
|
@@ -363,7 +383,7 @@ var ue = {
|
|
|
363
383
|
key: 1,
|
|
364
384
|
class: "size-4 shrink-0 text-muted group-hover:text-heading",
|
|
365
385
|
"aria-hidden": "true"
|
|
366
|
-
})), B.value ? i("", !0) : (m(), a("span",
|
|
386
|
+
})), B.value ? i("", !0) : (m(), a("span", je, "Collapse"))], 10, Ae)) : i("", !0)], 46, fe)], 4))], 64)), z.value ? (m(), a("div", Me, [ie(n.$slots, "default", {
|
|
367
387
|
active: w.value,
|
|
368
388
|
compact: P.value
|
|
369
389
|
})])) : i("", !0)], 2));
|
|
@@ -159,7 +159,7 @@ var E = [
|
|
|
159
159
|
s(t, {
|
|
160
160
|
"enter-active-class": "transition-opacity duration-200",
|
|
161
161
|
"enter-from-class": "opacity-0",
|
|
162
|
-
"leave-active-class": "transition-opacity duration-150",
|
|
162
|
+
"leave-active-class": "pointer-events-none transition-opacity duration-150",
|
|
163
163
|
"leave-to-class": "opacity-0"
|
|
164
164
|
}, {
|
|
165
165
|
default: S(() => [q.value ? (p(), a("div", {
|
|
@@ -38,9 +38,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
38
38
|
onClick?: ((e: MouseEvent) => any) | undefined;
|
|
39
39
|
}>, {
|
|
40
40
|
disabled: boolean;
|
|
41
|
-
icon: Component;
|
|
42
41
|
href: string;
|
|
43
42
|
to: string | object;
|
|
43
|
+
icon: Component;
|
|
44
44
|
active: boolean;
|
|
45
45
|
badge: string | number;
|
|
46
46
|
badgeColor: Tone | "neutral";
|
|
@@ -57,10 +57,10 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
57
57
|
}>, {
|
|
58
58
|
progress: number;
|
|
59
59
|
value: string | number;
|
|
60
|
-
icon: Component;
|
|
61
60
|
target: string;
|
|
62
61
|
href: string;
|
|
63
62
|
to: string | Record<string, unknown>;
|
|
63
|
+
icon: Component;
|
|
64
64
|
size: "small" | "normal";
|
|
65
65
|
status: "default" | "success" | "info" | "warning" | "danger";
|
|
66
66
|
loading: boolean;
|
|
@@ -19,9 +19,12 @@ export interface Props {
|
|
|
19
19
|
orientation?: "horizontal" | "vertical";
|
|
20
20
|
/** With `orientation="vertical"`, the id of the current sub-step of the current step. Earlier sub-steps show a check mark. */
|
|
21
21
|
activeSubstep?: number | string;
|
|
22
|
+
/** With `orientation="horizontal"`, hides the titles and descriptions visually when the steps are narrower than 480px, leaving the numbered dots. Screen readers still read them. Use it when the current step's own heading names it. */
|
|
23
|
+
compact?: boolean;
|
|
22
24
|
}
|
|
23
25
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
24
26
|
orientation: "horizontal" | "vertical";
|
|
27
|
+
compact: boolean;
|
|
25
28
|
activeSubstep: number | string;
|
|
26
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, toDisplayString as l, unref as u } from "vue";
|
|
2
2
|
import { Check as d } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcSteps.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var f = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "flex w-full",
|
|
7
|
-
"data-ac-ds": "",
|
|
8
|
-
"data-testid": "ac-steps"
|
|
9
|
-
}, p = ["aria-current"], m = { key: 1 }, h = {
|
|
10
|
-
key: 1,
|
|
11
|
-
class: "mt-0.5 text-xs text-muted"
|
|
12
|
-
}, g = {
|
|
4
|
+
var f = ["aria-current"], p = { key: 1 }, m = {
|
|
13
5
|
key: 1,
|
|
14
6
|
class: "flex w-full flex-col",
|
|
15
7
|
"data-ac-ds": "",
|
|
16
8
|
"data-testid": "ac-steps"
|
|
17
|
-
},
|
|
9
|
+
}, h = ["aria-current"], g = { key: 1 }, _ = { class: "min-w-0 flex-1 pt-1.5" }, v = {
|
|
18
10
|
key: 0,
|
|
19
11
|
class: "mt-0.5 text-xs text-muted"
|
|
20
|
-
},
|
|
12
|
+
}, y = {
|
|
21
13
|
key: 1,
|
|
22
14
|
class: "mt-2 space-y-0.5 border-l border-dashed border-border-dark pl-3",
|
|
23
15
|
"data-testid": "ac-steps-substeps"
|
|
24
|
-
},
|
|
16
|
+
}, b = ["aria-current"], x = {
|
|
25
17
|
key: 1,
|
|
26
18
|
class: "size-1.5 rounded-full bg-primary"
|
|
27
|
-
},
|
|
19
|
+
}, S = /*@__PURE__*/ a({
|
|
28
20
|
__name: "AcSteps",
|
|
29
21
|
props: {
|
|
30
22
|
options: {},
|
|
31
23
|
active: {},
|
|
32
24
|
orientation: { default: "horizontal" },
|
|
33
|
-
activeSubstep: { default: void 0 }
|
|
25
|
+
activeSubstep: { default: void 0 },
|
|
26
|
+
compact: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
}
|
|
34
30
|
},
|
|
35
31
|
setup(a) {
|
|
36
|
-
let
|
|
37
|
-
return (
|
|
32
|
+
let S = a, C = (e) => S.activeSubstep === void 0 ? -1 : (e.substeps ?? []).findIndex((e) => e.id === S.activeSubstep);
|
|
33
|
+
return (S, w) => a.orientation === "horizontal" ? (s(), r("ol", {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: o(["flex w-full", a.compact && "@container/steps"]),
|
|
36
|
+
"data-ac-ds": "",
|
|
37
|
+
"data-testid": "ac-steps"
|
|
38
|
+
}, [(s(!0), r(e, null, c(a.options, (e, c) => (s(), r("li", {
|
|
38
39
|
key: e.id,
|
|
39
40
|
class: "relative flex flex-1 flex-col items-center px-2 text-center",
|
|
40
41
|
"aria-current": a.active === e.id ? "step" : void 0
|
|
@@ -49,10 +50,13 @@ var f = {
|
|
|
49
50
|
class: "size-4",
|
|
50
51
|
"stroke-width": 2.5,
|
|
51
52
|
"aria-hidden": "true"
|
|
52
|
-
})) : (s(), r("span",
|
|
53
|
-
i("p", { class: o(["mt-3 text-base font-medium", a.active >= e.id ? "text-heading" : "text-muted"]) }, l(e.title), 3),
|
|
54
|
-
e.description ? (s(), r("p",
|
|
55
|
-
|
|
53
|
+
})) : (s(), r("span", p, l(e.id), 1))], 2),
|
|
54
|
+
i("p", { class: o(["mt-3 text-base font-medium", [a.active >= e.id ? "text-heading" : "text-muted", a.compact && "@max-[480px]/steps:sr-only"]]) }, l(e.title), 3),
|
|
55
|
+
e.description ? (s(), r("p", {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: o(["mt-0.5 text-xs text-muted", a.compact && "@max-[480px]/steps:sr-only"])
|
|
58
|
+
}, l(e.description), 3)) : n("", !0)
|
|
59
|
+
], 8, f))), 128))], 2)) : (s(), r("ol", m, [(s(!0), r(e, null, c(a.options, (f, p) => (s(), r("li", {
|
|
56
60
|
key: f.id,
|
|
57
61
|
class: "relative flex gap-3 pb-6 last:pb-0",
|
|
58
62
|
"aria-current": a.active === f.id ? "step" : void 0
|
|
@@ -67,25 +71,25 @@ var f = {
|
|
|
67
71
|
class: "size-4",
|
|
68
72
|
"stroke-width": 2.5,
|
|
69
73
|
"aria-hidden": "true"
|
|
70
|
-
})) : (s(), r("span",
|
|
71
|
-
i("div",
|
|
74
|
+
})) : (s(), r("span", g, l(f.id), 1))], 2),
|
|
75
|
+
i("div", _, [
|
|
72
76
|
i("p", { class: o(["text-base font-medium", a.active >= f.id ? "text-heading" : "text-muted"]) }, l(f.title), 3),
|
|
73
|
-
f.description ? (s(), r("p",
|
|
74
|
-
f.substeps?.length && a.active === f.id ? (s(), r("ul",
|
|
77
|
+
f.description ? (s(), r("p", v, l(f.description), 1)) : n("", !0),
|
|
78
|
+
f.substeps?.length && a.active === f.id ? (s(), r("ul", y, [(s(!0), r(e, null, c(f.substeps, (e, c) => (s(), r("li", {
|
|
75
79
|
key: e.id,
|
|
76
80
|
class: "flex items-center gap-2 py-1",
|
|
77
81
|
"aria-current": e.id === a.activeSubstep ? "step" : void 0
|
|
78
82
|
}, [i("span", {
|
|
79
|
-
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c <
|
|
83
|
+
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < C(f) ? "bg-primary text-white" : c === C(f) ? "bg-surface text-primary-strong ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
|
|
80
84
|
"aria-hidden": "true"
|
|
81
|
-
}, [c <
|
|
85
|
+
}, [c < C(f) ? (s(), t(u(d), {
|
|
82
86
|
key: 0,
|
|
83
87
|
class: "size-3",
|
|
84
88
|
"stroke-width": 3
|
|
85
|
-
})) : c ===
|
|
89
|
+
})) : c === C(f) ? (s(), r("span", x)) : n("", !0)], 2), i("span", { class: o(["min-w-0 truncate text-base", c < C(f) ? "text-heading/80" : c === C(f) ? "font-medium text-heading" : "text-muted"]) }, l(e.title), 3)], 8, b))), 128))])) : n("", !0)
|
|
86
90
|
])
|
|
87
|
-
], 8,
|
|
91
|
+
], 8, h))), 128))]));
|
|
88
92
|
}
|
|
89
93
|
});
|
|
90
94
|
//#endregion
|
|
91
|
-
export {
|
|
95
|
+
export { S as default };
|
|
@@ -53,7 +53,7 @@ var h = { class: "flex items-center gap-2" }, g = ["for"], _ = [
|
|
|
53
53
|
i.label ? (c(), n("label", {
|
|
54
54
|
key: 0,
|
|
55
55
|
for: E.value,
|
|
56
|
-
class: s(["
|
|
56
|
+
class: s(["text-base font-medium", i.disabled ? "cursor-not-allowed text-muted" : "cursor-pointer text-heading"])
|
|
57
57
|
}, d(i.label), 11, g)) : t("", !0),
|
|
58
58
|
u(e.$slots, "middle"),
|
|
59
59
|
r("button", o({
|