@ac-design/design-system 2.0.0 → 2.1.1
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.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +20 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** What the setting is, in a few words: "Destroy", "Recovery console". */
|
|
3
|
+
title: string;
|
|
4
|
+
/** One or two sentences on what it does or what happens, e.g. "The VM is destroyed and its data can't be recovered." */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Dims the row and adds a "Coming soon" tag, for a setting that isn't wired up yet. Disable its action too. */
|
|
7
|
+
comingSoon?: boolean;
|
|
8
|
+
/** Text of the tag after the title. Defaults to "Coming soon" when `coming-soon` is set. */
|
|
9
|
+
tag?: string;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
/** Extra content under the description, e.g. a field or a list of details. */
|
|
13
|
+
default?: () => unknown;
|
|
14
|
+
/** The control on the right: a button, a switch or a select. It moves under the text below 640px. */
|
|
15
|
+
action?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
description: string;
|
|
19
|
+
tag: string;
|
|
20
|
+
comingSoon: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s } from "vue";
|
|
2
|
+
//#region src/lib/components/AcSettingsRow.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var c = { class: "min-w-0" }, l = { class: "flex flex-wrap items-center gap-2" }, u = { class: "text-base font-medium text-heading" }, d = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "rounded-full bg-surface-sunken px-1.5 py-0.5 text-xm leading-none font-medium text-muted"
|
|
6
|
+
}, f = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mt-0.5 text-xs leading-relaxed text-muted"
|
|
9
|
+
}, p = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "shrink-0"
|
|
12
|
+
}, m = /*@__PURE__*/ r({
|
|
13
|
+
__name: "AcSettingsRow",
|
|
14
|
+
props: {
|
|
15
|
+
title: {},
|
|
16
|
+
description: { default: "" },
|
|
17
|
+
comingSoon: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
tag: { default: "" }
|
|
22
|
+
},
|
|
23
|
+
setup(r) {
|
|
24
|
+
let m = r;
|
|
25
|
+
return (h, g) => (a(), t("div", {
|
|
26
|
+
class: i(["flex flex-col gap-3 border-t border-border/60 py-3.5 first:border-t-0 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between sm:gap-4", r.comingSoon && "opacity-60"]),
|
|
27
|
+
"data-ac-ds": "",
|
|
28
|
+
"data-testid": "ac-settings-row"
|
|
29
|
+
}, [n("div", c, [
|
|
30
|
+
n("div", l, [n("h4", u, s(r.title), 1), r.tag || r.comingSoon ? (a(), t("span", d, s(m.tag || "Coming soon"), 1)) : e("", !0)]),
|
|
31
|
+
r.description ? (a(), t("p", f, s(r.description), 1)) : e("", !0),
|
|
32
|
+
o(h.$slots, "default")
|
|
33
|
+
]), h.$slots.action ? (a(), t("div", p, [o(h.$slots, "action")])) : e("", !0)], 2));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { m as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Teleport as e, Transition as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeModels as c, nextTick as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderSlot as m, toDisplayString as h, unref as g, useId as _, useModel as v, watch as y, withCtx as b, withModifiers as x } from "vue";
|
|
2
2
|
import { X as S } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcSidePanel.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 items-start gap-4 border-b border-border
|
|
4
|
+
var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 items-start gap-4 border-b border-border p-6" }, T = { class: "min-w-0 flex-1" }, E = ["id"], D = ["id"], O = { class: "flex h-7 shrink-0 items-center gap-3" }, k = {
|
|
5
5
|
"data-panel-body": "",
|
|
6
6
|
class: "ac-scrollbar min-h-0 flex-1 p-6"
|
|
7
7
|
}, A = {
|
|
8
8
|
key: 0,
|
|
9
|
-
class: "flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-border
|
|
9
|
+
class: "flex shrink-0 flex-wrap items-center justify-between gap-3 border-t border-border p-6"
|
|
10
10
|
}, j = { class: "flex min-w-0 items-center gap-2" }, M = { class: "ml-auto flex items-center gap-3" }, N = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", P = /*@__PURE__*/ s({
|
|
11
11
|
__name: "AcSidePanel",
|
|
12
12
|
props: /*@__PURE__*/ c({
|
|
@@ -78,7 +78,7 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
78
78
|
}, {
|
|
79
79
|
default: b(() => [F.value ? (f(), i("div", {
|
|
80
80
|
key: 0,
|
|
81
|
-
class: "fixed inset-0 z-[80] bg-
|
|
81
|
+
class: "fixed inset-0 z-[80] bg-black/50",
|
|
82
82
|
"data-ac-ds": "",
|
|
83
83
|
"data-testid": "ac-side-panel",
|
|
84
84
|
onKeydown: U,
|
|
@@ -100,7 +100,7 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
100
100
|
}, [
|
|
101
101
|
a("header", w, [a("div", T, [m(c.$slots, "header", {}, () => [a("h2", {
|
|
102
102
|
id: `${g(z)}-title`,
|
|
103
|
-
class: "text-xl leading-7 font-semibold
|
|
103
|
+
class: "text-xl leading-7 font-semibold text-heading"
|
|
104
104
|
}, h(s.title), 9, E), s.description ? (f(), i("p", {
|
|
105
105
|
key: 0,
|
|
106
106
|
id: `${g(z)}-desc`,
|
|
@@ -108,7 +108,7 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
108
108
|
}, h(s.description), 9, D)) : r("", !0)])]), a("div", O, [m(c.$slots, "header-actions"), s.closable ? (f(), i("button", {
|
|
109
109
|
key: 0,
|
|
110
110
|
type: "button",
|
|
111
|
-
class: "inline-flex
|
|
111
|
+
class: "-m-0.5 inline-flex cursor-pointer items-center justify-center rounded-6 p-0.5 text-muted transition-colors hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
112
112
|
"aria-label": "Close",
|
|
113
113
|
"data-ac-ds": "",
|
|
114
114
|
"data-testid": "ac-side-panel-close",
|
|
@@ -77,8 +77,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
77
77
|
bottom: string;
|
|
78
78
|
top: string;
|
|
79
79
|
mobile: "select" | "scroll";
|
|
80
|
-
collapsible: boolean;
|
|
81
80
|
sticky: boolean;
|
|
81
|
+
collapsible: boolean;
|
|
82
82
|
breakpoint: number;
|
|
83
83
|
offsetSelectors: string[];
|
|
84
84
|
hideTabs: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Props {
|
|
2
2
|
/** Accessible name of the navigation landmark. */
|
|
3
3
|
label?: string;
|
|
4
|
-
/** Dark sidebar on `bg-sidebar` (#171717) in both themes, like cloud-ui's dark theme. Everything inside uses the dark tokens. */
|
|
4
|
+
/** Dark sidebar on `bg-sidebar` (#171717) in both themes, like cloud-ui's dark theme. Everything inside uses the dark tokens. In the app's dark theme the sidebar uses this colour anyway. */
|
|
5
5
|
dark?: boolean;
|
|
6
6
|
/** Shows a Collapse button at the bottom that toggles `v-model:collapsed`. It's hidden in the mobile drawer. */
|
|
7
7
|
collapsible?: boolean;
|
|
@@ -29,6 +29,7 @@ type __VLS_Slots = {
|
|
|
29
29
|
};
|
|
30
30
|
/** Collapses or expands on desktop, and opens or closes the drawer on mobile. Wire it to a navbar menu button. */
|
|
31
31
|
declare function toggle(): void;
|
|
32
|
+
declare function revealActive(): void;
|
|
32
33
|
type __VLS_ModelProps = {
|
|
33
34
|
/** Icon-only 56px rail on desktop. Bind with `v-model:collapsed`. */
|
|
34
35
|
"collapsed"?: boolean;
|
|
@@ -38,6 +39,8 @@ type __VLS_ModelProps = {
|
|
|
38
39
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
40
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
40
41
|
toggle: typeof toggle;
|
|
42
|
+
/** Scrolls the current page's item into view when it's outside the visible list. Call it after the route changes. */
|
|
43
|
+
revealActive: typeof revealActive;
|
|
41
44
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
45
|
"update:collapsed": (value: boolean) => any;
|
|
43
46
|
"update:mobileOpen": (value: boolean) => any;
|
|
@@ -11,8 +11,8 @@ var te = [
|
|
|
11
11
|
}, re = {
|
|
12
12
|
key: 0,
|
|
13
13
|
role: "list",
|
|
14
|
-
class: "flex flex-col
|
|
15
|
-
}, ie = ["aria-label", "title"], O = { key: 0 }, k = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])",
|
|
14
|
+
class: "flex flex-col"
|
|
15
|
+
}, ie = ["aria-label", "title"], O = { key: 0 }, k = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", ae = 120, A = 180, j = /*@__PURE__*/ c({
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "AcSidebar",
|
|
18
18
|
props: /*@__PURE__*/ l({
|
|
@@ -49,111 +49,114 @@ var te = [
|
|
|
49
49
|
}),
|
|
50
50
|
emits: ["update:collapsed", "update:mobileOpen"],
|
|
51
51
|
setup(c, { expose: l }) {
|
|
52
|
-
let
|
|
53
|
-
function
|
|
54
|
-
|
|
52
|
+
let j = c, M = x(c, "collapsed"), N = x(c, "mobileOpen"), P = g(null), F = g(null), I = g(!j.contained && typeof window < "u" && window.matchMedia(Y()).matches), L = null, R = null, z = null, B = g(!1), V = n(() => j.hoverExpand && M.value && !I.value && B.value), H = n(() => M.value && !I.value && !V.value), U = n(() => M.value && !I.value), W = !1, G;
|
|
53
|
+
function K(e) {
|
|
54
|
+
j.hoverExpand && (e && W || (clearTimeout(G), G = setTimeout(() => B.value = e, e ? ae : A)));
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
56
|
+
function q() {
|
|
57
|
+
W = !0, clearTimeout(G), B.value = !1, M.value = !M.value;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function oe() {
|
|
60
|
+
W = !1, K(!1);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
62
|
+
function se(e) {
|
|
63
|
+
P.value?.contains(e.relatedTarget) || K(!1);
|
|
64
64
|
}
|
|
65
|
-
let
|
|
66
|
-
top:
|
|
67
|
-
height: `calc(100dvh - ${
|
|
68
|
-
}),
|
|
69
|
-
let e =
|
|
70
|
-
return
|
|
65
|
+
let J = n(() => I.value && N.value), ce = n(() => j.dark), le = n(() => I.value || j.contained ? void 0 : {
|
|
66
|
+
top: j.top,
|
|
67
|
+
height: `calc(100dvh - ${j.top})`
|
|
68
|
+
}), ue = n(() => {
|
|
69
|
+
let e = j.dark ? "dark border-r border-border bg-sidebar text-body shadow-sm" : "border-r border-border bg-sidebar-panel/95 text-body shadow-sm backdrop-blur-sm";
|
|
70
|
+
return I.value ? [
|
|
71
71
|
e,
|
|
72
|
-
|
|
73
|
-
"inset-y-0 left-0 z-[80] w-64
|
|
74
|
-
|
|
72
|
+
j.contained ? "absolute" : "fixed",
|
|
73
|
+
"inset-y-0 left-0 z-[80] w-64 duration-300 ease-out-soft motion-reduce:transition-none",
|
|
74
|
+
N.value ? "visible translate-x-0 transition-[translate]" : "invisible -translate-x-full transition-[translate,visibility]"
|
|
75
75
|
] : [
|
|
76
76
|
e,
|
|
77
|
-
|
|
77
|
+
V.value ? [j.contained ? "absolute inset-y-0 left-0" : "fixed left-0", "z-30 shadow-xl"] : j.contained ? "relative h-full" : "sticky",
|
|
78
78
|
"transition-[width] duration-200 ease-out-soft motion-reduce:transition-none",
|
|
79
|
-
|
|
79
|
+
H.value ? "w-14" : j.contained ? "w-64" : "w-64 lg:w-52 xl:w-64"
|
|
80
80
|
];
|
|
81
81
|
});
|
|
82
|
-
function
|
|
83
|
-
return `(max-width: ${
|
|
84
|
-
}
|
|
85
|
-
function ue() {
|
|
86
|
-
L.value ? P.value = !P.value : N.value = !N.value;
|
|
82
|
+
function Y() {
|
|
83
|
+
return `(max-width: ${j.breakpoint - .02}px)`;
|
|
87
84
|
}
|
|
88
85
|
function de() {
|
|
89
|
-
N.value = !
|
|
86
|
+
I.value ? N.value = !N.value : M.value = !M.value;
|
|
90
87
|
}
|
|
91
88
|
function fe() {
|
|
92
|
-
|
|
89
|
+
M.value = !1;
|
|
93
90
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
91
|
+
function pe() {
|
|
92
|
+
I.value && (N.value = !1);
|
|
93
|
+
}
|
|
94
|
+
function X() {
|
|
95
|
+
N.value = !1;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
99
|
-
if (e.key === "Escape") e.stopPropagation(),
|
|
97
|
+
function me(e) {
|
|
98
|
+
if (J.value && P.value) {
|
|
99
|
+
if (e.key === "Escape") e.stopPropagation(), X();
|
|
100
100
|
else if (e.key === "Tab") {
|
|
101
|
-
let t = [...
|
|
101
|
+
let t = [...P.value.querySelectorAll(k)].filter((e) => e.offsetParent !== null);
|
|
102
102
|
if (!t.length) return;
|
|
103
103
|
let n = t[0], r = t[t.length - 1];
|
|
104
104
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
108
|
+
function Z(e) {
|
|
109
|
+
I.value = e.matches;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Q(e) {
|
|
112
112
|
let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
|
|
113
113
|
t.dataset.acModals = String(Math.max(n, 0)), e && n === 1 ? t.style.overflow = "hidden" : !e && n <= 0 && (t.style.overflow = "");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
let e =
|
|
115
|
+
function $() {
|
|
116
|
+
let e = F.value, t = e?.querySelector("[aria-current=\"page\"]");
|
|
117
117
|
if (!e || !t) return;
|
|
118
118
|
let n = t.getBoundingClientRect().top - e.getBoundingClientRect().top;
|
|
119
119
|
(n < 0 || n > e.clientHeight - t.offsetHeight) && (e.scrollTop += n - e.clientHeight / 2);
|
|
120
120
|
}
|
|
121
121
|
return h("ac-sidebar", {
|
|
122
|
-
rail:
|
|
123
|
-
isMobile:
|
|
124
|
-
dark:
|
|
125
|
-
expand:
|
|
126
|
-
navigate:
|
|
127
|
-
}), S(
|
|
128
|
-
e ? (
|
|
129
|
-
}), S(
|
|
130
|
-
e || (
|
|
122
|
+
rail: H,
|
|
123
|
+
isMobile: I,
|
|
124
|
+
dark: ce,
|
|
125
|
+
expand: fe,
|
|
126
|
+
navigate: pe
|
|
127
|
+
}), S(J, async (e, t) => {
|
|
128
|
+
e ? (L = document.activeElement, j.contained || Q(!0), await ee(), (P.value?.querySelector("[aria-current=\"page\"]") ?? P.value?.querySelector(k))?.focus()) : t && (j.contained || Q(!1), L?.focus?.());
|
|
129
|
+
}), S(I, (e) => {
|
|
130
|
+
e || (N.value = !1);
|
|
131
131
|
}), p(() => {
|
|
132
|
-
if (
|
|
133
|
-
let e =
|
|
134
|
-
e && (
|
|
135
|
-
} else
|
|
136
|
-
|
|
132
|
+
if (j.contained) {
|
|
133
|
+
let e = P.value?.parentElement;
|
|
134
|
+
e && (z = new ResizeObserver(([e]) => I.value = (e?.contentRect.width ?? 0) < j.breakpoint), z.observe(e));
|
|
135
|
+
} else R = window.matchMedia(Y()), I.value = R.matches, R.addEventListener("change", Z);
|
|
136
|
+
$();
|
|
137
137
|
}), f(() => {
|
|
138
|
-
clearTimeout(
|
|
139
|
-
}), l({
|
|
138
|
+
clearTimeout(G), R?.removeEventListener("change", Z), z?.disconnect(), J.value && !j.contained && Q(!1);
|
|
139
|
+
}), l({
|
|
140
|
+
toggle: de,
|
|
141
|
+
revealActive: $
|
|
142
|
+
}), (n, l) => (m(), a(e, null, [
|
|
140
143
|
s(t, {
|
|
141
144
|
"enter-active-class": "transition-opacity duration-200",
|
|
142
145
|
"enter-from-class": "opacity-0",
|
|
143
146
|
"leave-active-class": "transition-opacity duration-150",
|
|
144
147
|
"leave-to-class": "opacity-0"
|
|
145
148
|
}, {
|
|
146
|
-
default: C(() => [
|
|
149
|
+
default: C(() => [J.value ? (m(), a("div", {
|
|
147
150
|
key: 0,
|
|
148
|
-
class: d(["inset-0 z-[79] bg-overlay", c.contained ? "absolute" : "fixed"]),
|
|
151
|
+
class: d(["inset-0 z-[79] bg-overlay backdrop-blur-[2px]", c.contained ? "absolute" : "fixed"]),
|
|
149
152
|
"aria-hidden": "true",
|
|
150
153
|
"data-ac-ds": "",
|
|
151
154
|
"data-testid": "ac-sidebar-backdrop",
|
|
152
|
-
onClick:
|
|
155
|
+
onClick: X
|
|
153
156
|
}, null, 2)) : i("", !0)]),
|
|
154
157
|
_: 1
|
|
155
158
|
}),
|
|
156
|
-
|
|
159
|
+
V.value ? (m(), a("div", {
|
|
157
160
|
key: 0,
|
|
158
161
|
class: d(["w-14 shrink-0", c.contained && "h-full"]),
|
|
159
162
|
"aria-hidden": "true",
|
|
@@ -161,61 +164,68 @@ var te = [
|
|
|
161
164
|
}, null, 2)) : i("", !0),
|
|
162
165
|
o("aside", u({
|
|
163
166
|
ref_key: "root",
|
|
164
|
-
ref:
|
|
167
|
+
ref: P
|
|
165
168
|
}, n.$attrs, {
|
|
166
|
-
class: ["flex shrink-0 flex-col overflow-hidden",
|
|
167
|
-
style:
|
|
168
|
-
role:
|
|
169
|
-
"aria-modal":
|
|
170
|
-
"aria-label":
|
|
169
|
+
class: ["flex shrink-0 flex-col overflow-hidden", ue.value],
|
|
170
|
+
style: le.value,
|
|
171
|
+
role: J.value ? "dialog" : void 0,
|
|
172
|
+
"aria-modal": J.value || void 0,
|
|
173
|
+
"aria-label": J.value ? c.label : void 0,
|
|
171
174
|
"data-ac-ds": "",
|
|
172
175
|
"data-testid": "ac-sidebar",
|
|
173
|
-
onKeydown:
|
|
174
|
-
onMouseenter: l[0] ||= (e) =>
|
|
175
|
-
onMouseleave:
|
|
176
|
-
onFocusin: l[1] ||= (e) =>
|
|
177
|
-
onFocusout:
|
|
176
|
+
onKeydown: me,
|
|
177
|
+
onMouseenter: l[0] ||= (e) => K(!0),
|
|
178
|
+
onMouseleave: oe,
|
|
179
|
+
onFocusin: l[1] ||= (e) => K(!0),
|
|
180
|
+
onFocusout: se
|
|
178
181
|
}), [
|
|
179
|
-
n.$slots.header ||
|
|
182
|
+
n.$slots.header || I.value ? (m(), a("div", {
|
|
180
183
|
key: 0,
|
|
181
|
-
class: d(["flex h-
|
|
182
|
-
}, [o("div", { class: d(["flex min-w-0 flex-1 items-center",
|
|
184
|
+
class: d(["flex min-h-17 shrink-0 items-center gap-2 overflow-hidden border-b border-border/70 pt-5 pb-4", H.value ? "mx-2 justify-center" : "mx-4 px-1"])
|
|
185
|
+
}, [o("div", { class: d(["flex min-w-0 flex-1 items-center", H.value && "justify-center"]) }, [_(n.$slots, "header", { collapsed: H.value })], 2), I.value ? (m(), a("button", {
|
|
183
186
|
key: 0,
|
|
184
187
|
type: "button",
|
|
185
|
-
class: "-mr-1.5 inline-flex size-
|
|
188
|
+
class: "-mr-1.5 inline-flex size-8.5 shrink-0 cursor-pointer items-center justify-center rounded-10 border border-transparent text-muted transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
186
189
|
"aria-label": "Close navigation",
|
|
187
190
|
"data-ac-ds": "",
|
|
188
191
|
"data-testid": "ac-sidebar-close",
|
|
189
|
-
onClick:
|
|
192
|
+
onClick: X
|
|
190
193
|
}, [s(b(E), {
|
|
191
194
|
class: "size-5",
|
|
192
195
|
"aria-hidden": "true"
|
|
193
196
|
})])) : i("", !0)], 2)) : i("", !0),
|
|
194
197
|
o("nav", {
|
|
195
198
|
ref_key: "nav",
|
|
196
|
-
ref:
|
|
199
|
+
ref: F,
|
|
197
200
|
"aria-label": c.label,
|
|
198
|
-
class: d(["ac-scrollbar min-h-0 flex-1 overflow-x-hidden py-5",
|
|
201
|
+
class: d(["ac-scrollbar min-h-0 flex-1 overflow-x-hidden py-5", H.value ? "px-2" : "px-4"])
|
|
199
202
|
}, [o("ul", ne, [_(n.$slots, "default")])], 10, D),
|
|
200
|
-
n.$slots.footer || c.collapsible && !
|
|
201
|
-
key: 1,
|
|
202
|
-
class: d(["flex shrink-0 flex-col gap-1 border-t border-border py-3", U.value ? "px-2" : "px-4"])
|
|
203
|
-
}, [n.$slots.footer ? (m(), a("ul", re, [_(n.$slots, "footer", { collapsed: U.value })])) : i("", !0), c.collapsible && !L.value ? (m(), a("button", {
|
|
203
|
+
n.$slots.footer || c.collapsible && !I.value ? (m(), a("div", {
|
|
204
204
|
key: 1,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
205
|
+
class: d(["flex shrink-0 flex-col pb-4", H.value ? "px-2" : "px-4"])
|
|
206
|
+
}, [
|
|
207
|
+
o("div", {
|
|
208
|
+
class: d(["border-t border-muted/20", H.value ? "mb-3" : "mt-5 mb-6"]),
|
|
209
|
+
"aria-hidden": "true"
|
|
210
|
+
}, null, 2),
|
|
211
|
+
n.$slots.footer ? (m(), a("ul", re, [_(n.$slots, "footer", { collapsed: H.value })])) : i("", !0),
|
|
212
|
+
c.collapsible && !I.value ? (m(), a("button", {
|
|
213
|
+
key: 1,
|
|
214
|
+
type: "button",
|
|
215
|
+
class: d(["group flex w-full cursor-pointer items-center gap-3 rounded-10 border border-transparent py-2 text-base font-medium text-heading/80 transition-all duration-200 hover:border-border hover:bg-accent-hover hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset motion-reduce:transition-none", H.value ? "justify-center" : "px-3"]),
|
|
216
|
+
"aria-label": U.value ? "Expand sidebar" : "Collapse sidebar",
|
|
217
|
+
title: H.value ? "Expand sidebar" : void 0,
|
|
218
|
+
"data-ac-ds": "",
|
|
219
|
+
"data-testid": "ac-sidebar-collapse",
|
|
220
|
+
onClick: q
|
|
221
|
+
}, [(m(), r(v(U.value ? b(T) : b(w)), {
|
|
222
|
+
class: "size-4 shrink-0 text-muted group-hover:text-heading",
|
|
223
|
+
"aria-hidden": "true"
|
|
224
|
+
})), H.value ? i("", !0) : (m(), a("span", O, y(U.value ? "Expand" : "Collapse"), 1))], 10, ie)) : i("", !0)
|
|
225
|
+
], 2)) : i("", !0)
|
|
216
226
|
], 16, te)
|
|
217
227
|
], 64));
|
|
218
228
|
}
|
|
219
229
|
});
|
|
220
230
|
//#endregion
|
|
221
|
-
export {
|
|
231
|
+
export { j as default };
|
|
@@ -13,7 +13,7 @@ export interface Props {
|
|
|
13
13
|
active?: boolean;
|
|
14
14
|
/** A count or short word after the label, e.g. `3` or `"New"`. Shown as a dot in the collapsed rail. */
|
|
15
15
|
badge?: string | number;
|
|
16
|
-
/** Colour of the badge. */
|
|
16
|
+
/** Colour of the badge. Defaults to cloud-ui's solid primary chip. */
|
|
17
17
|
badgeColor?: Tone | "neutral";
|
|
18
18
|
/** Greys the item out and blocks clicks. */
|
|
19
19
|
disabled?: boolean;
|
|
@@ -6,21 +6,17 @@ var D = {
|
|
|
6
6
|
"data-ac-ds": "",
|
|
7
7
|
"data-testid": "ac-sidebar-item"
|
|
8
8
|
}, O = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "inline-flex size-4 shrink-0 items-center justify-center text-muted transition-colors duration-200 group-hover:text-heading group-aria-[current=page]:text-primary! [&>img]:size-4",
|
|
11
|
-
"aria-hidden": "true"
|
|
12
|
-
}, k = {
|
|
13
9
|
key: 1,
|
|
14
10
|
class: "text-xs font-semibold"
|
|
15
|
-
},
|
|
11
|
+
}, k = [
|
|
16
12
|
"disabled",
|
|
17
13
|
"aria-expanded",
|
|
18
14
|
"aria-controls",
|
|
19
15
|
"title"
|
|
20
|
-
],
|
|
16
|
+
], A = {
|
|
21
17
|
key: 1,
|
|
22
18
|
class: "text-xs font-semibold"
|
|
23
|
-
},
|
|
19
|
+
}, j = ["id"], M = /*@__PURE__*/ o({
|
|
24
20
|
__name: "AcSidebarItem",
|
|
25
21
|
props: /*@__PURE__*/ l({
|
|
26
22
|
label: {},
|
|
@@ -32,7 +28,7 @@ var D = {
|
|
|
32
28
|
default: !1
|
|
33
29
|
},
|
|
34
30
|
badge: { default: void 0 },
|
|
35
|
-
badgeColor: { default: "
|
|
31
|
+
badgeColor: { default: "primary" },
|
|
36
32
|
disabled: {
|
|
37
33
|
type: Boolean,
|
|
38
34
|
default: !1
|
|
@@ -46,39 +42,39 @@ var D = {
|
|
|
46
42
|
}),
|
|
47
43
|
emits: /*@__PURE__*/ l(["click"], ["update:open"]),
|
|
48
44
|
setup(o, { emit: l }) {
|
|
49
|
-
let
|
|
45
|
+
let M = o, N = S(o, "open"), P = l, F = C(), I = {
|
|
50
46
|
neutral: "border border-border bg-surface-sunken text-muted",
|
|
51
47
|
primary: "bg-primary text-white",
|
|
52
48
|
info: "bg-info text-white",
|
|
53
49
|
success: "bg-success text-white",
|
|
54
50
|
warning: "bg-warning text-on-warning",
|
|
55
51
|
danger: "bg-danger text-white"
|
|
56
|
-
},
|
|
52
|
+
}, L = {
|
|
57
53
|
neutral: "bg-muted",
|
|
58
54
|
primary: "bg-primary",
|
|
59
55
|
info: "bg-info",
|
|
60
56
|
success: "bg-success",
|
|
61
57
|
warning: "bg-warning",
|
|
62
58
|
danger: "bg-danger"
|
|
63
|
-
},
|
|
59
|
+
}, R = c("ac-sidebar", null), z = c("ac-sidebar-depth", 0), B = c("ac-sidebar-subgroup", !1), V = s()?.appContext.components.RouterLink, H = x(), U = g(null), W = g(!1), G = null, K = t(() => !!F.default), q = t(() => (R?.rail.value ?? !1) && z === 0), J = B || z > 0 ? "size-4 [&>img]:size-4" : "size-[17px] [&>img]:size-[17px]", Y = t(() => M.to && V && !M.disabled ? V : M.to || M.href ? "a" : "button"), X = t(() => {
|
|
64
60
|
let e = {};
|
|
65
|
-
return
|
|
66
|
-
}),
|
|
67
|
-
function
|
|
68
|
-
if (
|
|
61
|
+
return Y.value === V ? e.to = M.to : Y.value === "a" ? M.disabled ? (e.role = "link", e["aria-disabled"] = "true") : e.href = M.href ?? (typeof M.to == "string" ? M.to : void 0) : (e.type = "button", e.disabled = M.disabled || void 0), M.active && (e["aria-current"] = "page"), e;
|
|
62
|
+
}), Z = t(() => M.badge === void 0 || M.badge === "" ? "" : String(M.badge));
|
|
63
|
+
function Q(e) {
|
|
64
|
+
if (M.disabled) {
|
|
69
65
|
e.preventDefault();
|
|
70
66
|
return;
|
|
71
67
|
}
|
|
72
|
-
|
|
68
|
+
P("click", e), R?.navigate();
|
|
73
69
|
}
|
|
74
|
-
function
|
|
75
|
-
q.value ? (
|
|
70
|
+
function ee() {
|
|
71
|
+
q.value ? (R?.expand(), N.value = !0) : N.value = !N.value;
|
|
76
72
|
}
|
|
77
73
|
function $() {
|
|
78
74
|
W.value = !!U.value?.querySelector("[aria-current=\"page\"]");
|
|
79
75
|
}
|
|
80
|
-
return h("ac-sidebar-depth",
|
|
81
|
-
e && (
|
|
76
|
+
return h("ac-sidebar-depth", z + 1), w(W, (e) => {
|
|
77
|
+
e && (N.value = !0);
|
|
82
78
|
}), p(() => {
|
|
83
79
|
U.value && ($(), G = new MutationObserver($), G.observe(U.value, {
|
|
84
80
|
subtree: !0,
|
|
@@ -95,62 +91,66 @@ var D = {
|
|
|
95
91
|
!o.disabled && !(q.value && W.value) && "hover:border-border hover:bg-accent-hover hover:text-heading"
|
|
96
92
|
]]),
|
|
97
93
|
disabled: o.disabled || void 0,
|
|
98
|
-
"aria-expanded": q.value ? void 0 :
|
|
94
|
+
"aria-expanded": q.value ? void 0 : N.value,
|
|
99
95
|
"aria-controls": `${b(H)}-list`,
|
|
100
96
|
title: q.value ? o.label : void 0,
|
|
101
97
|
"data-ac-ds": "",
|
|
102
98
|
"data-testid": "ac-sidebar-group",
|
|
103
|
-
onClick:
|
|
99
|
+
onClick: ee
|
|
104
100
|
}, [
|
|
105
101
|
t.$slots.icon || o.icon || q.value ? (m(), i("span", {
|
|
106
102
|
key: 0,
|
|
107
|
-
class: d(["inline-flex
|
|
103
|
+
class: d(["inline-flex shrink-0 items-center justify-center transition-colors duration-200", [b(J), W.value ? "text-primary" : "text-muted group-hover:text-heading"]]),
|
|
108
104
|
"aria-hidden": "true"
|
|
109
105
|
}, [_(t.$slots, "icon", {}, () => [o.icon ? (m(), n(v(o.icon), {
|
|
110
106
|
key: 0,
|
|
111
|
-
class: "size-
|
|
112
|
-
})) : (m(), i("span",
|
|
107
|
+
class: "size-full"
|
|
108
|
+
})) : (m(), i("span", A, y(o.label.charAt(0)), 1))])], 2)) : r("", !0),
|
|
113
109
|
a("span", { class: d(q.value ? "sr-only" : "min-w-0 flex-1 truncate") }, y(o.label), 3),
|
|
114
|
-
|
|
110
|
+
Z.value && !q.value ? (m(), i("span", {
|
|
115
111
|
key: 1,
|
|
116
|
-
class: d(["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",
|
|
117
|
-
}, y(
|
|
112
|
+
class: d(["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", I[o.badgeColor]])
|
|
113
|
+
}, y(Z.value), 3)) : r("", !0),
|
|
118
114
|
q.value ? r("", !0) : (m(), n(b(E), {
|
|
119
115
|
key: 2,
|
|
120
|
-
class: d(["size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none",
|
|
116
|
+
class: d(["size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none", N.value && "rotate-90"]),
|
|
121
117
|
"aria-hidden": "true"
|
|
122
118
|
}, null, 8, ["class"]))
|
|
123
|
-
], 10,
|
|
119
|
+
], 10, k), a("ul", {
|
|
124
120
|
id: `${b(H)}-list`,
|
|
125
121
|
ref_key: "list",
|
|
126
122
|
ref: U,
|
|
127
123
|
role: "list",
|
|
128
|
-
class: d(["mt-1 ml-5 flex-col gap-1 border-l border-border pl-2",
|
|
129
|
-
}, [_(t.$slots, "default")], 10,
|
|
124
|
+
class: d(["mt-1 ml-5 flex-col gap-1 border-l border-border pl-2", N.value && !q.value ? "flex" : "hidden"])
|
|
125
|
+
}, [_(t.$slots, "default")], 10, j)], 64)) : (m(), n(v(Y.value), u({ key: 0 }, X.value, {
|
|
130
126
|
class: ["group relative flex w-full items-center gap-3 rounded-10 border border-transparent py-2 text-left text-base font-medium text-heading/80 no-underline transition-all duration-200 select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset motion-reduce:transition-none aria-[current=page]:border-primary/35 aria-[current=page]:bg-primary/10 aria-[current=page]:text-heading aria-[current=page]:shadow-xs aria-[current=page]:shadow-primary/10", [q.value ? "h-9.5 justify-center" : "px-3", o.disabled ? "pointer-events-none cursor-not-allowed opacity-50" : "cursor-pointer not-aria-[current=page]:hover:border-border not-aria-[current=page]:hover:bg-accent-hover not-aria-[current=page]:hover:text-heading"]],
|
|
131
|
-
title: q.value ?
|
|
127
|
+
title: q.value ? Z.value ? `${o.label} (${Z.value})` : o.label : void 0,
|
|
132
128
|
"data-ac-ds": "",
|
|
133
129
|
"data-testid": "ac-sidebar-link",
|
|
134
|
-
onClick:
|
|
130
|
+
onClick: Q
|
|
135
131
|
}), {
|
|
136
132
|
default: T(() => [
|
|
137
|
-
t.$slots.icon || o.icon || q.value ? (m(), i("span",
|
|
133
|
+
t.$slots.icon || o.icon || q.value ? (m(), i("span", {
|
|
134
|
+
key: 0,
|
|
135
|
+
class: d(["inline-flex shrink-0 items-center justify-center text-muted transition-colors duration-200 group-hover:text-heading group-aria-[current=page]:text-primary!", b(J)]),
|
|
136
|
+
"aria-hidden": "true"
|
|
137
|
+
}, [_(t.$slots, "icon", {}, () => [o.icon ? (m(), n(v(o.icon), {
|
|
138
138
|
key: 0,
|
|
139
|
-
class: "size-
|
|
140
|
-
})) : (m(), i("span",
|
|
139
|
+
class: "size-full"
|
|
140
|
+
})) : (m(), i("span", O, y(o.label.charAt(0)), 1))])], 2)) : r("", !0),
|
|
141
141
|
a("span", { class: d(q.value ? "sr-only" : "min-w-0 flex-1 truncate") }, y(o.label), 3),
|
|
142
|
-
|
|
142
|
+
Z.value ? (m(), i(e, { key: 1 }, [q.value ? (m(), i("span", {
|
|
143
143
|
key: 0,
|
|
144
|
-
class: d(["absolute top-1 right-1 size-2 rounded-full",
|
|
144
|
+
class: d(["absolute top-1 right-1 size-2 rounded-full", L[o.badgeColor]]),
|
|
145
145
|
"aria-hidden": "true"
|
|
146
146
|
}, null, 2)) : (m(), i("span", {
|
|
147
147
|
key: 1,
|
|
148
|
-
class: d(["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",
|
|
149
|
-
}, y(
|
|
148
|
+
class: d(["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", I[o.badgeColor]])
|
|
149
|
+
}, y(Z.value), 3))], 64)) : r("", !0)
|
|
150
150
|
]),
|
|
151
151
|
_: 3
|
|
152
152
|
}, 16, ["class", "title"]))]));
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
//#endregion
|
|
156
|
-
export {
|
|
156
|
+
export { M as default };
|