@ac-design/design-system 0.0.0-stage → 1.0.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/README.md +160 -2
- package/dist/lib/compat.css +4441 -0
- package/dist/lib/components/AcAccordion.js +5 -0
- package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/lib/components/AcAccordionItem.js +5 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcAlert.js +5 -0
- package/dist/lib/components/AcAlert.vue.d.ts +52 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcAppSwitcher.js +5 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/lib/components/AcAvatar.js +5 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/lib/components/AcBadge.js +5 -0
- package/dist/lib/components/AcBadge.vue.d.ts +32 -0
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcBanner.js +5 -0
- package/dist/lib/components/AcBanner.vue.d.ts +57 -0
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcBreadcrumb.js +5 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcButton.js +5 -0
- package/dist/lib/components/AcButton.vue.d.ts +49 -0
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcButtons.js +5 -0
- package/dist/lib/components/AcButtons.vue.d.ts +31 -0
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/lib/components/AcCard.js +5 -0
- package/dist/lib/components/AcCard.vue.d.ts +27 -0
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/lib/components/AcCellValue.js +5 -0
- package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
- package/dist/lib/components/AcCheckBox.js +5 -0
- package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/lib/components/AcCheckRadio.js +5 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/lib/components/AcClusterSwitcher.js +5 -0
- package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
- package/dist/lib/components/AcCodeEditor.js +5 -0
- package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +381 -0
- package/dist/lib/components/AcContentHeader.js +5 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/lib/components/AcContentLayout.js +5 -0
- package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/lib/components/AcContentTable.js +5 -0
- package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
- package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcDatePicker.js +5 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
- package/dist/lib/components/AcDeleteModal.js +5 -0
- package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/lib/components/AcDivider.js +5 -0
- package/dist/lib/components/AcDivider.vue.d.ts +25 -0
- package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcDropdown.js +5 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
- package/dist/lib/components/AcDropdownDivider.js +5 -0
- package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/lib/components/AcDropdownItem.js +5 -0
- package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcEmptyState.js +5 -0
- package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcFeatureCard.js +5 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/lib/components/AcFileEditor.js +5 -0
- package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
- package/dist/lib/components/AcFileUpload.js +5 -0
- package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
- package/dist/lib/components/AcFontScale.js +5 -0
- package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcForm.js +5 -0
- package/dist/lib/components/AcForm.vue.d.ts +31 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcFormArray.js +5 -0
- package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
- package/dist/lib/components/AcFormFooter.js +5 -0
- package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcFormSection.js +5 -0
- package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcHeader.js +5 -0
- package/dist/lib/components/AcHeader.vue.d.ts +46 -0
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcHeaderItem.js +5 -0
- package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcHeaderItems.js +5 -0
- package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcInfoTable.js +5 -0
- package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/lib/components/AcInput.js +5 -0
- package/dist/lib/components/AcInput.vue.d.ts +68 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
- package/dist/lib/components/AcKbd.js +5 -0
- package/dist/lib/components/AcKbd.vue.d.ts +25 -0
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/lib/components/AcLogo.js +5 -0
- package/dist/lib/components/AcLogo.vue.d.ts +18 -0
- package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcModal.js +5 -0
- package/dist/lib/components/AcModal.vue.d.ts +54 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcNavbar.js +5 -0
- package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcNavbarItem.js +5 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcNotificationMenu.js +5 -0
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/lib/components/AcPage.js +5 -0
- package/dist/lib/components/AcPage.vue.d.ts +25 -0
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/lib/components/AcPagination.js +5 -0
- package/dist/lib/components/AcPagination.vue.d.ts +51 -0
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/lib/components/AcPreloader.js +5 -0
- package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcProgress.js +5 -0
- package/dist/lib/components/AcProgress.vue.d.ts +31 -0
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcResourceCard.js +5 -0
- package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
- package/dist/lib/components/AcSearchBar.js +5 -0
- package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcSectionContent.js +5 -0
- package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcSegmentedControl.js +5 -0
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/lib/components/AcSelect.js +5 -0
- package/dist/lib/components/AcSelect.vue.d.ts +78 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
- package/dist/lib/components/AcSidePanel.js +5 -0
- package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/lib/components/AcSideTabs.js +5 -0
- package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
- package/dist/lib/components/AcSidebar.js +5 -0
- package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/lib/components/AcSidebarItem.js +5 -0
- package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
- package/dist/lib/components/AcSidebarSection.js +5 -0
- package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/lib/components/AcSkeleton.js +5 -0
- package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/lib/components/AcSlider.js +5 -0
- package/dist/lib/components/AcSlider.vue.d.ts +72 -0
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/lib/components/AcSpinner.js +5 -0
- package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
- package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/lib/components/AcStatCard.js +5 -0
- package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/lib/components/AcStatusBar.js +5 -0
- package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/lib/components/AcSteps.js +5 -0
- package/dist/lib/components/AcSteps.vue.d.ts +28 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/lib/components/AcSwitch.js +5 -0
- package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcTable.js +5 -0
- package/dist/lib/components/AcTable.vue.d.ts +98 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
- package/dist/lib/components/AcTabs.js +5 -0
- package/dist/lib/components/AcTabs.vue.d.ts +40 -0
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/lib/components/AcTag.js +5 -0
- package/dist/lib/components/AcTag.vue.d.ts +41 -0
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/lib/components/AcTextarea.js +5 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/lib/components/AcThemeMode.js +5 -0
- package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcToaster.js +5 -0
- package/dist/lib/components/AcToaster.vue.d.ts +15 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/lib/components/AcTooltip.js +5 -0
- package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/lib/components/AcUsageCard.js +5 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/lib/components/AcUserMenu.js +5 -0
- package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/lib/components/index.d.ts +76 -0
- package/dist/lib/components/types.d.ts +16 -0
- package/dist/lib/composables/copyText.d.ts +6 -0
- package/dist/lib/composables/copyText.js +16 -0
- package/dist/lib/composables/useBrandColor.d.ts +53 -0
- package/dist/lib/composables/useBrandColor.js +148 -0
- package/dist/lib/composables/useColorMode.d.ts +12 -0
- package/dist/lib/composables/useColorMode.js +40 -0
- package/dist/lib/composables/useFontScale.d.ts +16 -0
- package/dist/lib/composables/useFontScale.js +43 -0
- package/dist/lib/composables/useToast.d.ts +68 -0
- package/dist/lib/composables/useToast.js +36 -0
- package/dist/lib/editor/index.d.ts +4 -0
- package/dist/lib/editor/index.js +3 -0
- package/dist/lib/editor/theme.d.ts +3 -0
- package/dist/lib/editor/theme.js +309 -0
- package/dist/lib/editor/validate.d.ts +19 -0
- package/dist/lib/editor/validate.js +127 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +78 -0
- package/dist/lib/theme.css +556 -0
- package/package.json +82 -4
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { Tone } from "./types";
|
|
3
|
+
export interface SideTabItem {
|
|
4
|
+
/** Unique key. `v-model` holds the active item's key. */
|
|
5
|
+
key: string;
|
|
6
|
+
/** Text of the item. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** A Lucide icon component, e.g. `:icon="Database"`. The collapsed rail shows only the icon. */
|
|
9
|
+
icon?: Component;
|
|
10
|
+
/** Route for `RouterLink` (needs vue-router in the app). The item for the current route becomes active by itself. */
|
|
11
|
+
to?: string | Record<string, unknown>;
|
|
12
|
+
/** Plain link, when there's no router. */
|
|
13
|
+
href?: string;
|
|
14
|
+
/** A count or short word after the label, e.g. `3` or `"New"`. */
|
|
15
|
+
badge?: string | number;
|
|
16
|
+
/** Colour of the badge. */
|
|
17
|
+
badgeColor?: Tone | "neutral";
|
|
18
|
+
/** Colours the item, e.g. `danger` for a "Danger zone" section. */
|
|
19
|
+
tone?: "danger" | "warning" | "success";
|
|
20
|
+
/** Greys the item out and blocks clicks. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Items with the same group are listed under that heading. */
|
|
23
|
+
group?: string;
|
|
24
|
+
/** Nested items. Turns this item into a group that expands and collapses (one level deep). */
|
|
25
|
+
children?: SideTabItem[];
|
|
26
|
+
}
|
|
27
|
+
export interface Props {
|
|
28
|
+
/** The sections: `{ key, label, icon?, to?, href?, badge?, tone?, disabled?, group?, children? }`. */
|
|
29
|
+
items: SideTabItem[];
|
|
30
|
+
/** Accessible name of the navigation, and the label of the select on phones. */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** Sticks the list to the top while the page scrolls. */
|
|
33
|
+
sticky?: boolean;
|
|
34
|
+
/** Sticky offset from the top of the scroll area, e.g. `"56px"` under a navbar. */
|
|
35
|
+
top?: string;
|
|
36
|
+
/** Space kept free at the bottom while sticky, e.g. `"28px"` above a status bar. */
|
|
37
|
+
bottom?: string;
|
|
38
|
+
/** CSS selectors of fixed bars (navbar, page header) whose measured heights are added to `top`. For bars whose height changes. */
|
|
39
|
+
offsetSelectors?: string[];
|
|
40
|
+
/** Width of the list. */
|
|
41
|
+
width?: string;
|
|
42
|
+
/** Hides the list so the content takes the full width, e.g. on an edit page that needs the room. */
|
|
43
|
+
hideTabs?: boolean;
|
|
44
|
+
/** Shows a Collapse button that toggles `v-model:collapsed` (an icon-only rail). */
|
|
45
|
+
collapsible?: boolean;
|
|
46
|
+
/** Width in px (at scale 1) below which the list turns into the phone layout: the component's own width with content beside it, otherwise its parent's. It grows with the interface scale. `0` keeps it vertical. */
|
|
47
|
+
breakpoint?: number;
|
|
48
|
+
/** Phone layout: a `select`, or a horizontal row of tabs that `scroll`s. */
|
|
49
|
+
mobile?: "select" | "scroll";
|
|
50
|
+
}
|
|
51
|
+
type __VLS_Props = Props;
|
|
52
|
+
type __VLS_Slots = {
|
|
53
|
+
/** Page content, placed beside the list (below it on phones). Receives the active key and whether the phone layout is on. */
|
|
54
|
+
default?: (props: {
|
|
55
|
+
active: string;
|
|
56
|
+
compact: boolean;
|
|
57
|
+
}) => unknown;
|
|
58
|
+
};
|
|
59
|
+
type __VLS_ModelProps = {
|
|
60
|
+
/** The active item's `key`. With router links it follows the current route. */
|
|
61
|
+
modelValue?: string;
|
|
62
|
+
/** Icon-only rail. Bind with `v-model:collapsed`. */
|
|
63
|
+
"collapsed"?: boolean;
|
|
64
|
+
};
|
|
65
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
66
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
67
|
+
select: (item: SideTabItem) => any;
|
|
68
|
+
"update:modelValue": (value: string) => any;
|
|
69
|
+
"update:collapsed": (value: boolean) => any;
|
|
70
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
71
|
+
onSelect?: ((item: SideTabItem) => any) | undefined;
|
|
72
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
73
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
74
|
+
}>, {
|
|
75
|
+
label: string;
|
|
76
|
+
width: string;
|
|
77
|
+
bottom: string;
|
|
78
|
+
top: string;
|
|
79
|
+
mobile: "select" | "scroll";
|
|
80
|
+
collapsible: boolean;
|
|
81
|
+
sticky: boolean;
|
|
82
|
+
breakpoint: number;
|
|
83
|
+
offsetSelectors: string[];
|
|
84
|
+
hideTabs: boolean;
|
|
85
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
86
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
87
|
+
declare const _default: typeof __VLS_export;
|
|
88
|
+
export default _default;
|
|
89
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
90
|
+
new (): {
|
|
91
|
+
$slots: S;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import e from "./AcSelect.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as ee, createVNode as te, defineComponent as s, getCurrentInstance as c, mergeModels as l, mergeProps as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as ne, onMounted as re, openBlock as m, ref as h, renderList as g, renderSlot as ie, resolveDynamicComponent as _, toDisplayString as v, unref as y, useId as ae, useModel as b, useSlots as oe, watch as x, withCtx as S } from "vue";
|
|
3
|
+
import { ChevronRight as se, PanelLeftClose as ce, PanelLeftOpen as le } from "@lucide/vue";
|
|
4
|
+
//#region src/lib/components/AcSideTabs.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var ue = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "border-b border-border-light bg-surface px-4 py-3"
|
|
8
|
+
}, de = ["aria-label"], fe = ["aria-label"], pe = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "mb-1 truncate px-2.5 pt-1 text-sm font-semibold tracking-[0.06em] text-muted uppercase"
|
|
11
|
+
}, me = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "mx-2 mb-2 h-px bg-border-light",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}, he = {
|
|
16
|
+
class: "flex flex-col gap-0.5",
|
|
17
|
+
role: "list"
|
|
18
|
+
}, ge = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "text-xs font-semibold"
|
|
21
|
+
}, _e = [
|
|
22
|
+
"disabled",
|
|
23
|
+
"aria-expanded",
|
|
24
|
+
"aria-controls",
|
|
25
|
+
"title",
|
|
26
|
+
"onClick"
|
|
27
|
+
], ve = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "text-xs font-semibold"
|
|
30
|
+
}, ye = ["id"], be = { class: "min-w-0 flex-1 truncate" }, xe = [
|
|
31
|
+
"aria-label",
|
|
32
|
+
"aria-expanded",
|
|
33
|
+
"title"
|
|
34
|
+
], Se = { key: 2 }, Ce = {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "min-w-0 flex-1"
|
|
37
|
+
}, C = /*@__PURE__*/ s({
|
|
38
|
+
__name: "AcSideTabs",
|
|
39
|
+
props: /*@__PURE__*/ l({
|
|
40
|
+
items: {},
|
|
41
|
+
label: { default: "Sections" },
|
|
42
|
+
sticky: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
top: { default: "0px" },
|
|
47
|
+
bottom: { default: "0px" },
|
|
48
|
+
offsetSelectors: { default: () => [] },
|
|
49
|
+
width: { default: "calc(220px * var(--ac-scale))" },
|
|
50
|
+
hideTabs: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
collapsible: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
breakpoint: { default: 640 },
|
|
59
|
+
mobile: { default: "select" }
|
|
60
|
+
}, {
|
|
61
|
+
modelValue: { default: "" },
|
|
62
|
+
modelModifiers: {},
|
|
63
|
+
collapsed: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
},
|
|
67
|
+
collapsedModifiers: {}
|
|
68
|
+
}),
|
|
69
|
+
emits: /*@__PURE__*/ l(["select"], ["update:modelValue", "update:collapsed"]),
|
|
70
|
+
setup(s, { emit: l }) {
|
|
71
|
+
let C = s, w = b(s, "modelValue"), T = b(s, "collapsed"), E = l, D = {
|
|
72
|
+
neutral: "bg-surface-sunken text-label ring-1 ring-border ring-inset",
|
|
73
|
+
primary: "bg-primary-95 text-primary-20",
|
|
74
|
+
info: "bg-blue-95 text-blue-20",
|
|
75
|
+
success: "bg-green-95 text-green-20",
|
|
76
|
+
warning: "bg-yellow-95 text-yellow-20",
|
|
77
|
+
danger: "bg-red-95 text-red-30"
|
|
78
|
+
}, we = {
|
|
79
|
+
neutral: "bg-slate-60",
|
|
80
|
+
primary: "bg-primary",
|
|
81
|
+
info: "bg-info",
|
|
82
|
+
success: "bg-success",
|
|
83
|
+
warning: "bg-warning",
|
|
84
|
+
danger: "bg-danger"
|
|
85
|
+
}, Te = {
|
|
86
|
+
none: ["text-body hover:bg-surface-sunken hover:text-heading", "bg-primary-95 font-medium text-primary-20"],
|
|
87
|
+
danger: ["text-red-30 hover:bg-red-97", "bg-red-95 font-medium text-red-20"],
|
|
88
|
+
warning: ["text-yellow-30 hover:bg-yellow-97", "bg-yellow-95 font-medium text-yellow-20"],
|
|
89
|
+
success: ["text-green-30 hover:bg-green-97", "bg-green-95 font-medium text-green-20"]
|
|
90
|
+
}, O = ae(), Ee = 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(() => !!Ee.default), B = n(() => T.value && !P.value), V = n(() => C.items.flatMap((e) => e.children?.length ? e.children : [e])), De = n(() => {
|
|
91
|
+
let e = [];
|
|
92
|
+
for (let t of C.items) {
|
|
93
|
+
let n = t.group ?? "", r = e[e.length - 1];
|
|
94
|
+
r && r.name === n ? r.items.push(t) : e.push({
|
|
95
|
+
name: n,
|
|
96
|
+
items: [t]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return e;
|
|
100
|
+
}), Oe = n(() => C.items.flatMap((e) => e.children?.length ? e.children.map((t) => ({
|
|
101
|
+
value: t.key,
|
|
102
|
+
label: t.label,
|
|
103
|
+
group: e.label,
|
|
104
|
+
disabled: t.disabled
|
|
105
|
+
})) : [{
|
|
106
|
+
value: e.key,
|
|
107
|
+
label: e.label,
|
|
108
|
+
group: e.group,
|
|
109
|
+
disabled: e.disabled
|
|
110
|
+
}])), ke = n(() => {
|
|
111
|
+
if (!j) return "";
|
|
112
|
+
let e = j.currentRoute.value.path, t = "", n = -1;
|
|
113
|
+
for (let r of V.value) {
|
|
114
|
+
if (r.to === void 0) continue;
|
|
115
|
+
let i;
|
|
116
|
+
try {
|
|
117
|
+
i = j.resolve(r.to).path;
|
|
118
|
+
} catch {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (i === e) return r.key;
|
|
122
|
+
let a = i.endsWith("/") ? i : `${i}/`;
|
|
123
|
+
e.startsWith(a) && i.length > n && (t = r.key, n = i.length);
|
|
124
|
+
}
|
|
125
|
+
return t;
|
|
126
|
+
}), H = n(() => F.value ? `calc(${C.top} + ${F.value}px)` : C.top), Ae = n(() => C.sticky ? {
|
|
127
|
+
top: H.value,
|
|
128
|
+
maxHeight: `calc(100dvh - ${H.value} - ${C.bottom})`
|
|
129
|
+
} : void 0), je = n(() => ({
|
|
130
|
+
width: B.value ? "calc(56px * var(--ac-scale))" : C.width,
|
|
131
|
+
minHeight: C.sticky && z.value ? `calc(100dvh - ${H.value} - ${C.bottom})` : void 0
|
|
132
|
+
}));
|
|
133
|
+
function U(e) {
|
|
134
|
+
return e.key === w.value;
|
|
135
|
+
}
|
|
136
|
+
function W(e) {
|
|
137
|
+
return !!e.children?.some(U);
|
|
138
|
+
}
|
|
139
|
+
function G(e) {
|
|
140
|
+
return !I.value[e.key];
|
|
141
|
+
}
|
|
142
|
+
function Me(e) {
|
|
143
|
+
if (B.value) {
|
|
144
|
+
T.value = !1, I.value[e.key] = !1;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
I.value[e.key] = G(e);
|
|
148
|
+
}
|
|
149
|
+
function K(e) {
|
|
150
|
+
return e.to !== void 0 && A && !e.disabled ? A : e.href || typeof e.to == "string" ? "a" : "button";
|
|
151
|
+
}
|
|
152
|
+
function q(e) {
|
|
153
|
+
let t = K(e), n = { "aria-current": U(e) ? e.to || e.href ? "page" : "true" : void 0 };
|
|
154
|
+
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
|
+
}
|
|
156
|
+
function J(e) {
|
|
157
|
+
let [t, n] = Te[e.tone ?? "none"];
|
|
158
|
+
return [U(e) ? n : t, e.disabled ? "pointer-events-none cursor-not-allowed opacity-50" : "cursor-pointer"];
|
|
159
|
+
}
|
|
160
|
+
function Y(e, t) {
|
|
161
|
+
if (e.disabled) {
|
|
162
|
+
t.preventDefault();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
w.value = e.key, E("select", e);
|
|
166
|
+
}
|
|
167
|
+
function Ne(e) {
|
|
168
|
+
let t = V.value.find((t) => t.key === e);
|
|
169
|
+
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
|
+
}
|
|
171
|
+
function X(e) {
|
|
172
|
+
if (![
|
|
173
|
+
"ArrowDown",
|
|
174
|
+
"ArrowUp",
|
|
175
|
+
"ArrowLeft",
|
|
176
|
+
"ArrowRight",
|
|
177
|
+
"Home",
|
|
178
|
+
"End"
|
|
179
|
+
].includes(e.key)) return;
|
|
180
|
+
let t = [...e.currentTarget.querySelectorAll("[data-side-tab]")].filter((e) => e.offsetParent !== null && !e.hasAttribute("disabled") && e.getAttribute("aria-disabled") !== "true"), n = P.value, r = n ? "ArrowRight" : "ArrowDown", i = n ? "ArrowLeft" : "ArrowUp", a = t.indexOf(document.activeElement), o;
|
|
181
|
+
e.key === r ? o = t[(a + 1) % t.length] : e.key === i ? o = t[(a - 1 + t.length) % t.length] : e.key === "Home" ? o = t[0] : e.key === "End" && (o = t[t.length - 1]), o && (e.preventDefault(), o.focus());
|
|
182
|
+
}
|
|
183
|
+
function Z() {
|
|
184
|
+
let e = N.value, t = e?.querySelector("[aria-current]");
|
|
185
|
+
if (!e || !t) return;
|
|
186
|
+
let n = t.getBoundingClientRect().left - e.getBoundingClientRect().left;
|
|
187
|
+
e.scrollLeft += n - (e.clientWidth - t.offsetWidth) / 2;
|
|
188
|
+
}
|
|
189
|
+
function Q() {
|
|
190
|
+
let e = z.value ? M.value : M.value?.parentElement;
|
|
191
|
+
if (!e) return;
|
|
192
|
+
let t = Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--ac-scale")) || 1;
|
|
193
|
+
P.value = C.breakpoint > 0 && e.clientWidth < C.breakpoint * t;
|
|
194
|
+
}
|
|
195
|
+
function $() {
|
|
196
|
+
if (R?.disconnect(), F.value = 0, !C.offsetSelectors.length || typeof ResizeObserver > "u") return;
|
|
197
|
+
let e = C.offsetSelectors.map((e) => document.querySelector(e)).filter((e) => !!e), t = () => F.value = e.reduce((e, t) => e + t.offsetHeight, 0);
|
|
198
|
+
R = new ResizeObserver(t), e.forEach((e) => R.observe(e)), t();
|
|
199
|
+
}
|
|
200
|
+
return x(ke, (e) => {
|
|
201
|
+
e && (w.value = e);
|
|
202
|
+
}, { immediate: !0 }), x(w, (e) => {
|
|
203
|
+
let t = C.items.find((t) => t.children?.some((t) => t.key === e));
|
|
204
|
+
t && (I.value[t.key] = !1), P.value && C.mobile === "scroll" && d(Z);
|
|
205
|
+
}), x(P, (e) => {
|
|
206
|
+
e && C.mobile === "scroll" && d(Z);
|
|
207
|
+
}), x(() => C.offsetSelectors.join(","), $), re(() => {
|
|
208
|
+
Q(), window.addEventListener("ac-scale", Q), $();
|
|
209
|
+
let e = z.value ? M.value : M.value?.parentElement;
|
|
210
|
+
e && typeof ResizeObserver < "u" && (L = new ResizeObserver(Q), L.observe(e));
|
|
211
|
+
}), ne(() => {
|
|
212
|
+
window.removeEventListener("ac-scale", Q), L?.disconnect(), R?.disconnect();
|
|
213
|
+
}), (n, c) => (m(), a("div", {
|
|
214
|
+
ref_key: "root",
|
|
215
|
+
ref: M,
|
|
216
|
+
class: f(z.value ? ["flex w-full min-w-0", P.value ? "flex-col" : "flex-row"] : P.value ? "w-full" : "flex shrink-0 self-stretch"),
|
|
217
|
+
"data-ac-ds": "",
|
|
218
|
+
"data-testid": "ac-side-tabs"
|
|
219
|
+
}, [s.hideTabs ? i("", !0) : (m(), a(t, { key: 0 }, [P.value && s.mobile === "select" ? (m(), a("div", ue, [te(e, {
|
|
220
|
+
"model-value": w.value || null,
|
|
221
|
+
options: Oe.value,
|
|
222
|
+
label: s.label,
|
|
223
|
+
"onUpdate:modelValue": Ne
|
|
224
|
+
}, null, 8, [
|
|
225
|
+
"model-value",
|
|
226
|
+
"options",
|
|
227
|
+
"label"
|
|
228
|
+
])])) : P.value ? (m(), a("nav", {
|
|
229
|
+
key: 1,
|
|
230
|
+
"aria-label": s.label,
|
|
231
|
+
class: "border-b border-border-light bg-surface"
|
|
232
|
+
}, [o("ul", {
|
|
233
|
+
ref_key: "scroller",
|
|
234
|
+
ref: N,
|
|
235
|
+
class: "flex gap-1 overflow-x-auto px-2 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
236
|
+
onKeydown: X
|
|
237
|
+
}, [(m(!0), a(t, null, g(V.value, (e) => (m(), a("li", {
|
|
238
|
+
key: e.key,
|
|
239
|
+
class: "shrink-0"
|
|
240
|
+
}, [(m(), r(_(K(e)), u({ ref_for: !0 }, q(e), {
|
|
241
|
+
"data-side-tab": "",
|
|
242
|
+
class: ["inline-flex h-8 items-center gap-2 rounded-6 px-3 text-base whitespace-nowrap no-underline transition-colors duration-100 select-none focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", J(e)],
|
|
243
|
+
onClick: (t) => Y(e, t)
|
|
244
|
+
}), {
|
|
245
|
+
default: S(() => [
|
|
246
|
+
e.icon ? (m(), r(_(e.icon), {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: "size-4 shrink-0 opacity-80",
|
|
249
|
+
"aria-hidden": "true"
|
|
250
|
+
})) : i("", !0),
|
|
251
|
+
ee(" " + v(e.label) + " ", 1),
|
|
252
|
+
e.badge !== void 0 && e.badge !== "" ? (m(), a("span", {
|
|
253
|
+
key: 1,
|
|
254
|
+
class: f(["inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-50 px-1.5 text-sm font-medium tabular-nums", D[e.badgeColor ?? "neutral"]])
|
|
255
|
+
}, v(e.badge), 3)) : i("", !0)
|
|
256
|
+
]),
|
|
257
|
+
_: 2
|
|
258
|
+
}, 1040, ["class", "onClick"]))]))), 128))], 544)], 8, de)) : (m(), a("div", {
|
|
259
|
+
key: 2,
|
|
260
|
+
class: "shrink-0 border-r border-border-light bg-surface transition-[width] duration-200 ease-out-soft motion-reduce:transition-none",
|
|
261
|
+
style: p(je.value)
|
|
262
|
+
}, [o("nav", {
|
|
263
|
+
"aria-label": s.label,
|
|
264
|
+
class: f(["ac-scrollbar flex flex-col gap-3 p-2", s.sticky && "sticky"]),
|
|
265
|
+
style: p(Ae.value),
|
|
266
|
+
onKeydown: X
|
|
267
|
+
}, [(m(!0), a(t, null, g(De.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
|
+
type: "button",
|
|
269
|
+
"data-side-tab": "",
|
|
270
|
+
class: f(["group flex h-8 w-full cursor-pointer items-center gap-2.5 rounded-6 text-left text-base transition-colors duration-100 select-none hover:bg-surface-sunken focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", [B.value ? "justify-center" : "px-2.5", B.value && W(e) ? "bg-primary-95 text-primary-20" : W(e) ? "font-medium text-heading" : "text-body hover:text-heading"]]),
|
|
271
|
+
disabled: e.disabled || void 0,
|
|
272
|
+
"aria-expanded": B.value ? void 0 : G(e),
|
|
273
|
+
"aria-controls": `${y(O)}-${e.key}`,
|
|
274
|
+
title: B.value ? e.label : void 0,
|
|
275
|
+
onClick: (t) => Me(e)
|
|
276
|
+
}, [
|
|
277
|
+
e.icon || B.value ? (m(), a("span", {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: f(["inline-flex size-4 shrink-0 items-center justify-center", W(e) ? "text-primary-30" : "text-muted group-hover:text-heading"]),
|
|
280
|
+
"aria-hidden": "true"
|
|
281
|
+
}, [e.icon ? (m(), r(_(e.icon), {
|
|
282
|
+
key: 0,
|
|
283
|
+
class: "size-4"
|
|
284
|
+
})) : (m(), a("span", ve, v(e.label.charAt(0)), 1))], 2)) : i("", !0),
|
|
285
|
+
o("span", { class: f(B.value ? "sr-only" : "min-w-0 flex-1 truncate") }, v(e.label), 3),
|
|
286
|
+
!B.value && e.badge !== void 0 && e.badge !== "" ? (m(), a("span", {
|
|
287
|
+
key: 1,
|
|
288
|
+
class: f(["inline-flex h-4.5 min-w-4.5 shrink-0 items-center justify-center rounded-50 px-1.5 text-sm font-medium tabular-nums", D[e.badgeColor ?? "neutral"]])
|
|
289
|
+
}, v(e.badge), 3)) : i("", !0),
|
|
290
|
+
B.value ? i("", !0) : (m(), r(y(se), {
|
|
291
|
+
key: 2,
|
|
292
|
+
class: f(["size-3.5 shrink-0 text-muted transition-transform duration-150 motion-reduce:transition-none", G(e) && "rotate-90"]),
|
|
293
|
+
"aria-hidden": "true"
|
|
294
|
+
}, null, 8, ["class"]))
|
|
295
|
+
], 10, _e), o("ul", {
|
|
296
|
+
id: `${y(O)}-${e.key}`,
|
|
297
|
+
role: "list",
|
|
298
|
+
class: f(["mt-0.5 ml-4.5 flex-col gap-0.5 border-l border-border-light pl-2", G(e) && !B.value ? "flex" : "hidden"])
|
|
299
|
+
}, [(m(!0), a(t, null, g(e.children, (e) => (m(), a("li", { key: e.key }, [(m(), r(_(K(e)), u({ ref_for: !0 }, q(e), {
|
|
300
|
+
"data-side-tab": "",
|
|
301
|
+
class: ["group flex h-8 w-full items-center gap-2.5 rounded-6 px-2.5 text-left text-base no-underline transition-colors duration-100 select-none focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", J(e)],
|
|
302
|
+
onClick: (t) => Y(e, t)
|
|
303
|
+
}), {
|
|
304
|
+
default: S(() => [
|
|
305
|
+
e.icon ? (m(), r(_(e.icon), {
|
|
306
|
+
key: 0,
|
|
307
|
+
class: f(["size-4 shrink-0", !e.tone && !U(e) && "text-muted group-hover:text-heading"]),
|
|
308
|
+
"aria-hidden": "true"
|
|
309
|
+
}, null, 8, ["class"])) : i("", !0),
|
|
310
|
+
o("span", be, v(e.label), 1),
|
|
311
|
+
e.badge !== void 0 && e.badge !== "" ? (m(), a("span", {
|
|
312
|
+
key: 1,
|
|
313
|
+
class: f(["inline-flex h-4.5 min-w-4.5 shrink-0 items-center justify-center rounded-50 px-1.5 text-sm font-medium tabular-nums", D[e.badgeColor ?? "neutral"]])
|
|
314
|
+
}, v(e.badge), 3)) : i("", !0)
|
|
315
|
+
]),
|
|
316
|
+
_: 2
|
|
317
|
+
}, 1040, ["class", "onClick"]))]))), 128))], 10, ye)], 64)) : (m(), r(_(K(e)), u({
|
|
318
|
+
key: 0,
|
|
319
|
+
ref_for: !0
|
|
320
|
+
}, q(e), {
|
|
321
|
+
"data-side-tab": "",
|
|
322
|
+
class: ["group relative flex h-8 w-full items-center gap-2.5 rounded-6 text-left text-base no-underline transition-colors duration-100 select-none focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", [J(e), B.value ? "justify-center" : "px-2.5"]],
|
|
323
|
+
title: B.value ? e.label : void 0,
|
|
324
|
+
onClick: (t) => Y(e, t)
|
|
325
|
+
}), {
|
|
326
|
+
default: S(() => [
|
|
327
|
+
e.icon || B.value ? (m(), a("span", {
|
|
328
|
+
key: 0,
|
|
329
|
+
class: f(["inline-flex size-4 shrink-0 items-center justify-center", !e.tone && !U(e) && "text-muted group-hover:text-heading"]),
|
|
330
|
+
"aria-hidden": "true"
|
|
331
|
+
}, [e.icon ? (m(), r(_(e.icon), {
|
|
332
|
+
key: 0,
|
|
333
|
+
class: "size-4"
|
|
334
|
+
})) : (m(), a("span", ge, v(e.label.charAt(0)), 1))], 2)) : i("", !0),
|
|
335
|
+
o("span", { class: f(B.value ? "sr-only" : "min-w-0 flex-1 truncate") }, v(e.label), 3),
|
|
336
|
+
e.badge !== void 0 && e.badge !== "" ? (m(), a(t, { key: 1 }, [B.value ? (m(), a("span", {
|
|
337
|
+
key: 0,
|
|
338
|
+
class: f(["absolute top-1 right-1 size-1.5 rounded-full", we[e.badgeColor ?? "neutral"]]),
|
|
339
|
+
"aria-hidden": "true"
|
|
340
|
+
}, null, 2)) : (m(), a("span", {
|
|
341
|
+
key: 1,
|
|
342
|
+
class: f(["inline-flex h-4.5 min-w-4.5 shrink-0 items-center justify-center rounded-50 px-1.5 text-sm font-medium tabular-nums", D[e.badgeColor ?? "neutral"]])
|
|
343
|
+
}, v(e.badge), 3))], 64)) : i("", !0)
|
|
344
|
+
]),
|
|
345
|
+
_: 2
|
|
346
|
+
}, 1040, [
|
|
347
|
+
"class",
|
|
348
|
+
"title",
|
|
349
|
+
"onClick"
|
|
350
|
+
]))]))), 128))])]))), 128)), s.collapsible ? (m(), a("button", {
|
|
351
|
+
key: 0,
|
|
352
|
+
type: "button",
|
|
353
|
+
class: f(["mt-auto flex h-8 w-full cursor-pointer items-center gap-2.5 rounded-6 text-base text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", B.value ? "justify-center" : "px-2.5"]),
|
|
354
|
+
"aria-label": B.value ? `Expand ${s.label}` : `Collapse ${s.label}`,
|
|
355
|
+
"aria-expanded": !T.value,
|
|
356
|
+
title: B.value ? "Expand" : void 0,
|
|
357
|
+
onClick: c[0] ||= (e) => T.value = !T.value
|
|
358
|
+
}, [B.value ? (m(), r(y(le), {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "size-4 shrink-0",
|
|
361
|
+
"aria-hidden": "true"
|
|
362
|
+
})) : (m(), r(y(ce), {
|
|
363
|
+
key: 1,
|
|
364
|
+
class: "size-4 shrink-0",
|
|
365
|
+
"aria-hidden": "true"
|
|
366
|
+
})), B.value ? i("", !0) : (m(), a("span", Se, "Collapse"))], 10, xe)) : i("", !0)], 46, fe)], 4))], 64)), z.value ? (m(), a("div", Ce, [ie(n.$slots, "default", {
|
|
367
|
+
active: w.value,
|
|
368
|
+
compact: P.value
|
|
369
|
+
})])) : i("", !0)], 2));
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
//#endregion
|
|
373
|
+
export { C as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Accessible name of the navigation landmark. */
|
|
3
|
+
label?: string;
|
|
4
|
+
/** Dark sidebar on `bg-sidebar` in both themes, like the old library's default look. Everything inside uses the dark tokens. */
|
|
5
|
+
dark?: boolean;
|
|
6
|
+
/** Shows a Collapse button at the bottom that toggles `v-model:collapsed`. It's hidden in the mobile drawer. */
|
|
7
|
+
collapsible?: boolean;
|
|
8
|
+
/** Keeps the sidebar inside its parent instead of the viewport: the mobile drawer and backdrop use `absolute`, and the mobile layout follows the parent's width. Give the parent `relative`, `overflow-hidden` and a height. For previews and embedded shells. */
|
|
9
|
+
contained?: boolean;
|
|
10
|
+
/** Width in px below which the sidebar becomes an off-canvas drawer: the window's width, or the parent's with `contained`. `0` keeps it docked. */
|
|
11
|
+
breakpoint?: number;
|
|
12
|
+
/** With the sidebar collapsed to the rail, opens it to full width over the page while the pointer or keyboard focus is inside, then folds it back. The page doesn't shift. */
|
|
13
|
+
hoverExpand?: boolean;
|
|
14
|
+
/** Offset from the top of the viewport on desktop, e.g. `"56px"` under a full-width navbar. The height shrinks to match. */
|
|
15
|
+
top?: string;
|
|
16
|
+
}
|
|
17
|
+
type __VLS_Props = Props;
|
|
18
|
+
type __VLS_Slots = {
|
|
19
|
+
/** The 56px top bar: logo or cluster switcher. Receives `collapsed` so you can show a small logo in the rail. */
|
|
20
|
+
header?: (props: {
|
|
21
|
+
collapsed: boolean;
|
|
22
|
+
}) => unknown;
|
|
23
|
+
/** Sections (`AcSidebarSection`) and items (`AcSidebarItem`). Rendered inside a list. */
|
|
24
|
+
default?: () => unknown;
|
|
25
|
+
/** Items pinned to the bottom, such as Help. Rendered inside a list, above the Collapse button. */
|
|
26
|
+
footer?: (props: {
|
|
27
|
+
collapsed: boolean;
|
|
28
|
+
}) => unknown;
|
|
29
|
+
};
|
|
30
|
+
/** Collapses or expands on desktop, and opens or closes the drawer on mobile. Wire it to a navbar menu button. */
|
|
31
|
+
declare function toggle(): void;
|
|
32
|
+
type __VLS_ModelProps = {
|
|
33
|
+
/** Icon-only 56px rail on desktop. Bind with `v-model:collapsed`. */
|
|
34
|
+
"collapsed"?: boolean;
|
|
35
|
+
/** Whether the off-canvas drawer is open (below `breakpoint`). Bind with `v-model:mobile-open`. */
|
|
36
|
+
"mobileOpen"?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
40
|
+
toggle: typeof toggle;
|
|
41
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
42
|
+
"update:collapsed": (value: boolean) => any;
|
|
43
|
+
"update:mobileOpen": (value: boolean) => any;
|
|
44
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
45
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
46
|
+
"onUpdate:mobileOpen"?: ((value: boolean) => any) | undefined;
|
|
47
|
+
}>, {
|
|
48
|
+
label: string;
|
|
49
|
+
top: string;
|
|
50
|
+
dark: boolean;
|
|
51
|
+
collapsible: boolean;
|
|
52
|
+
contained: boolean;
|
|
53
|
+
breakpoint: number;
|
|
54
|
+
hoverExpand: boolean;
|
|
55
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
|
+
declare const _default: typeof __VLS_export;
|
|
58
|
+
export default _default;
|
|
59
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
60
|
+
new (): {
|
|
61
|
+
$slots: S;
|
|
62
|
+
};
|
|
63
|
+
};
|