@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,221 @@
|
|
|
1
|
+
import { Fragment as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, nextTick as ee, normalizeClass as d, onBeforeUnmount as f, onMounted as p, openBlock as m, provide as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useModel as x, watch as S, withCtx as C } from "vue";
|
|
2
|
+
import { PanelLeftClose as w, PanelLeftOpen as T, X as E } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var te = [
|
|
5
|
+
"role",
|
|
6
|
+
"aria-modal",
|
|
7
|
+
"aria-label"
|
|
8
|
+
], ne = ["aria-label"], re = {
|
|
9
|
+
role: "list",
|
|
10
|
+
class: "flex flex-col gap-0.5"
|
|
11
|
+
}, ie = {
|
|
12
|
+
key: 0,
|
|
13
|
+
role: "list",
|
|
14
|
+
class: "flex flex-col gap-0.5"
|
|
15
|
+
}, ae = ["aria-label", "title"], D = { key: 0 }, O = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", k = 120, A = 180, j = /*@__PURE__*/ c({
|
|
16
|
+
inheritAttrs: !1,
|
|
17
|
+
__name: "AcSidebar",
|
|
18
|
+
props: /*@__PURE__*/ l({
|
|
19
|
+
label: { default: "Main" },
|
|
20
|
+
dark: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
collapsible: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !0
|
|
27
|
+
},
|
|
28
|
+
contained: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
breakpoint: { default: 768 },
|
|
33
|
+
hoverExpand: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
top: { default: "0px" }
|
|
38
|
+
}, {
|
|
39
|
+
collapsed: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
collapsedModifiers: {},
|
|
44
|
+
mobileOpen: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
mobileOpenModifiers: {}
|
|
49
|
+
}),
|
|
50
|
+
emits: ["update:collapsed", "update:mobileOpen"],
|
|
51
|
+
setup(c, { expose: l }) {
|
|
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(X()).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 ? k : A)));
|
|
55
|
+
}
|
|
56
|
+
function q() {
|
|
57
|
+
W = !0, clearTimeout(G), B.value = !1, M.value = !M.value;
|
|
58
|
+
}
|
|
59
|
+
function oe() {
|
|
60
|
+
W = !1, K(!1);
|
|
61
|
+
}
|
|
62
|
+
function se(e) {
|
|
63
|
+
P.value?.contains(e.relatedTarget) || K(!1);
|
|
64
|
+
}
|
|
65
|
+
let J = n(() => I.value && N.value), Y = n(() => j.dark), ce = n(() => I.value || j.contained ? void 0 : {
|
|
66
|
+
top: j.top,
|
|
67
|
+
height: `calc(100dvh - ${j.top})`
|
|
68
|
+
}), le = n(() => {
|
|
69
|
+
let e = j.dark ? "dark border-r border-border-light bg-sidebar text-body" : "border-r border-border-light bg-surface-muted text-body";
|
|
70
|
+
return I.value ? [
|
|
71
|
+
e,
|
|
72
|
+
j.contained ? "absolute" : "fixed",
|
|
73
|
+
"inset-y-0 left-0 z-[80] w-60 max-w-[85%] shadow-xl duration-200 ease-out-soft motion-reduce:transition-none",
|
|
74
|
+
N.value ? "visible translate-x-0 transition-[translate]" : "invisible -translate-x-full transition-[translate,visibility]"
|
|
75
|
+
] : [
|
|
76
|
+
e,
|
|
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
|
+
"transition-[width] duration-200 ease-out-soft motion-reduce:transition-none",
|
|
79
|
+
H.value ? "w-14" : "w-60"
|
|
80
|
+
];
|
|
81
|
+
});
|
|
82
|
+
function X() {
|
|
83
|
+
return `(max-width: ${j.breakpoint - .02}px)`;
|
|
84
|
+
}
|
|
85
|
+
function ue() {
|
|
86
|
+
I.value ? N.value = !N.value : M.value = !M.value;
|
|
87
|
+
}
|
|
88
|
+
function de() {
|
|
89
|
+
M.value = !1;
|
|
90
|
+
}
|
|
91
|
+
function fe() {
|
|
92
|
+
I.value && (N.value = !1);
|
|
93
|
+
}
|
|
94
|
+
function Z() {
|
|
95
|
+
N.value = !1;
|
|
96
|
+
}
|
|
97
|
+
function pe(e) {
|
|
98
|
+
if (J.value && P.value) {
|
|
99
|
+
if (e.key === "Escape") e.stopPropagation(), Z();
|
|
100
|
+
else if (e.key === "Tab") {
|
|
101
|
+
let t = [...P.value.querySelectorAll(O)].filter((e) => e.offsetParent !== null);
|
|
102
|
+
if (!t.length) return;
|
|
103
|
+
let n = t[0], r = t[t.length - 1];
|
|
104
|
+
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function Q(e) {
|
|
109
|
+
I.value = e.matches;
|
|
110
|
+
}
|
|
111
|
+
function $(e) {
|
|
112
|
+
let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
|
|
113
|
+
t.dataset.acModals = String(Math.max(n, 0)), e && n === 1 ? t.style.overflow = "hidden" : !e && n <= 0 && (t.style.overflow = "");
|
|
114
|
+
}
|
|
115
|
+
function me() {
|
|
116
|
+
let e = F.value, t = e?.querySelector("[aria-current=\"page\"]");
|
|
117
|
+
if (!e || !t) return;
|
|
118
|
+
let n = t.getBoundingClientRect().top - e.getBoundingClientRect().top;
|
|
119
|
+
(n < 0 || n > e.clientHeight - t.offsetHeight) && (e.scrollTop += n - e.clientHeight / 2);
|
|
120
|
+
}
|
|
121
|
+
return h("ac-sidebar", {
|
|
122
|
+
rail: H,
|
|
123
|
+
isMobile: I,
|
|
124
|
+
dark: Y,
|
|
125
|
+
expand: de,
|
|
126
|
+
navigate: fe
|
|
127
|
+
}), S(J, async (e, t) => {
|
|
128
|
+
e ? (L = document.activeElement, j.contained || $(!0), await ee(), (P.value?.querySelector("[aria-current=\"page\"]") ?? P.value?.querySelector(O))?.focus()) : t && (j.contained || $(!1), L?.focus?.());
|
|
129
|
+
}), S(I, (e) => {
|
|
130
|
+
e || (N.value = !1);
|
|
131
|
+
}), p(() => {
|
|
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(X()), I.value = R.matches, R.addEventListener("change", Q);
|
|
136
|
+
me();
|
|
137
|
+
}), f(() => {
|
|
138
|
+
clearTimeout(G), R?.removeEventListener("change", Q), z?.disconnect(), J.value && !j.contained && $(!1);
|
|
139
|
+
}), l({ toggle: ue }), (n, l) => (m(), a(e, null, [
|
|
140
|
+
s(t, {
|
|
141
|
+
"enter-active-class": "transition-opacity duration-200",
|
|
142
|
+
"enter-from-class": "opacity-0",
|
|
143
|
+
"leave-active-class": "transition-opacity duration-150",
|
|
144
|
+
"leave-to-class": "opacity-0"
|
|
145
|
+
}, {
|
|
146
|
+
default: C(() => [J.value ? (m(), a("div", {
|
|
147
|
+
key: 0,
|
|
148
|
+
class: d(["inset-0 z-[79] bg-overlay", c.contained ? "absolute" : "fixed"]),
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
"data-ac-ds": "",
|
|
151
|
+
"data-testid": "ac-sidebar-backdrop",
|
|
152
|
+
onClick: Z
|
|
153
|
+
}, null, 2)) : i("", !0)]),
|
|
154
|
+
_: 1
|
|
155
|
+
}),
|
|
156
|
+
V.value ? (m(), a("div", {
|
|
157
|
+
key: 0,
|
|
158
|
+
class: d(["w-14 shrink-0", c.contained && "h-full"]),
|
|
159
|
+
"aria-hidden": "true",
|
|
160
|
+
"data-ac-ds": ""
|
|
161
|
+
}, null, 2)) : i("", !0),
|
|
162
|
+
o("aside", u({
|
|
163
|
+
ref_key: "root",
|
|
164
|
+
ref: P
|
|
165
|
+
}, n.$attrs, {
|
|
166
|
+
class: ["flex shrink-0 flex-col overflow-hidden", le.value],
|
|
167
|
+
style: ce.value,
|
|
168
|
+
role: J.value ? "dialog" : void 0,
|
|
169
|
+
"aria-modal": J.value || void 0,
|
|
170
|
+
"aria-label": J.value ? c.label : void 0,
|
|
171
|
+
"data-ac-ds": "",
|
|
172
|
+
"data-testid": "ac-sidebar",
|
|
173
|
+
onKeydown: pe,
|
|
174
|
+
onMouseenter: l[0] ||= (e) => K(!0),
|
|
175
|
+
onMouseleave: oe,
|
|
176
|
+
onFocusin: l[1] ||= (e) => K(!0),
|
|
177
|
+
onFocusout: se
|
|
178
|
+
}), [
|
|
179
|
+
n.$slots.header || I.value ? (m(), a("div", {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: d(["flex h-14 shrink-0 items-center gap-2 overflow-hidden border-b border-border-light", H.value ? "justify-center px-2" : "px-4"])
|
|
182
|
+
}, [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
|
+
key: 0,
|
|
184
|
+
type: "button",
|
|
185
|
+
class: d(["-mr-1.5 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", Y.value ? "hover:bg-white/8" : "hover:bg-slate-90"]),
|
|
186
|
+
"aria-label": "Close navigation",
|
|
187
|
+
"data-ac-ds": "",
|
|
188
|
+
"data-testid": "ac-sidebar-close",
|
|
189
|
+
onClick: Z
|
|
190
|
+
}, [s(b(E), {
|
|
191
|
+
class: "size-4",
|
|
192
|
+
"aria-hidden": "true"
|
|
193
|
+
})], 2)) : i("", !0)], 2)) : i("", !0),
|
|
194
|
+
o("nav", {
|
|
195
|
+
ref_key: "nav",
|
|
196
|
+
ref: F,
|
|
197
|
+
"aria-label": c.label,
|
|
198
|
+
class: d(["ac-scrollbar min-h-0 flex-1 overflow-x-hidden py-3", H.value ? "px-2" : "px-3"])
|
|
199
|
+
}, [o("ul", re, [_(n.$slots, "default")])], 10, ne),
|
|
200
|
+
n.$slots.footer || c.collapsible && !I.value ? (m(), a("div", {
|
|
201
|
+
key: 1,
|
|
202
|
+
class: d(["flex shrink-0 flex-col gap-0.5 border-t border-border-light py-2", H.value ? "px-2" : "px-3"])
|
|
203
|
+
}, [n.$slots.footer ? (m(), a("ul", ie, [_(n.$slots, "footer", { collapsed: H.value })])) : i("", !0), c.collapsible && !I.value ? (m(), a("button", {
|
|
204
|
+
key: 1,
|
|
205
|
+
type: "button",
|
|
206
|
+
class: d(["flex h-8 w-full cursor-pointer items-center gap-2.5 rounded-6 text-base text-label transition-colors hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", [H.value ? "justify-center" : "px-2.5", Y.value ? "hover:bg-white/8" : "hover:bg-slate-90"]]),
|
|
207
|
+
"aria-label": U.value ? "Expand sidebar" : "Collapse sidebar",
|
|
208
|
+
title: H.value ? "Expand sidebar" : void 0,
|
|
209
|
+
"data-ac-ds": "",
|
|
210
|
+
"data-testid": "ac-sidebar-collapse",
|
|
211
|
+
onClick: q
|
|
212
|
+
}, [(m(), r(v(U.value ? b(T) : b(w)), {
|
|
213
|
+
class: "size-4 shrink-0 text-muted",
|
|
214
|
+
"aria-hidden": "true"
|
|
215
|
+
})), H.value ? i("", !0) : (m(), a("span", D, y(U.value ? "Expand" : "Collapse"), 1))], 10, ae)) : i("", !0)], 2)) : i("", !0)
|
|
216
|
+
], 16, te)
|
|
217
|
+
], 64));
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
//#endregion
|
|
221
|
+
export { j as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { Tone } from "./types";
|
|
3
|
+
export interface Props {
|
|
4
|
+
/** Text of the item. In the collapsed rail it becomes the tooltip and the accessible name. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** A Lucide icon component, e.g. `:icon="Database"`. The collapsed rail shows only the icon. */
|
|
7
|
+
icon?: Component;
|
|
8
|
+
/** Route to link to. Renders `RouterLink` when vue-router is installed in the app, otherwise a plain link (string routes only). */
|
|
9
|
+
to?: string | object;
|
|
10
|
+
/** Plain URL, for pages outside the app. Takes over from `to` when vue-router isn't installed. */
|
|
11
|
+
href?: string;
|
|
12
|
+
/** Marks the current page: highlighted and `aria-current="page"`. With `to` and vue-router, an exact route match does this for you. */
|
|
13
|
+
active?: boolean;
|
|
14
|
+
/** A count or short word after the label, e.g. `3` or `"New"`. Shown as a dot in the collapsed rail. */
|
|
15
|
+
badge?: string | number;
|
|
16
|
+
/** Colour of the badge. */
|
|
17
|
+
badgeColor?: Tone | "neutral";
|
|
18
|
+
/** Greys the item out and blocks clicks. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
type __VLS_Props = Props;
|
|
22
|
+
type __VLS_Slots = {
|
|
23
|
+
/** Nested `AcSidebarItem`s. Turns this item into a group that expands and collapses. */
|
|
24
|
+
default?: () => unknown;
|
|
25
|
+
/** A custom 16px icon, e.g. an `<img>` from the AppsCode CDN. Replaces `icon`. */
|
|
26
|
+
icon?: () => unknown;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_ModelProps = {
|
|
29
|
+
/** Whether the nested items are shown. Opens by itself when a nested item is the current page. Bind with `v-model:open`. */
|
|
30
|
+
"open"?: boolean;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
33
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
34
|
+
"update:open": (value: boolean) => any;
|
|
35
|
+
click: (e: MouseEvent) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
onClick?: ((e: MouseEvent) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
icon: Component;
|
|
42
|
+
href: string;
|
|
43
|
+
to: string | object;
|
|
44
|
+
active: boolean;
|
|
45
|
+
badge: string | number;
|
|
46
|
+
badgeColor: Tone | "neutral";
|
|
47
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
52
|
+
new (): {
|
|
53
|
+
$slots: S;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, getCurrentInstance as s, inject as c, mergeModels as l, mergeProps as u, normalizeClass as d, onBeforeUnmount as f, onMounted as p, openBlock as m, provide as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useId as x, useModel as S, useSlots as C, watch as w, withCtx as T } from "vue";
|
|
2
|
+
import { ChevronRight as E } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcSidebarItem.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var D = {
|
|
5
|
+
class: "m-0 list-none",
|
|
6
|
+
"data-ac-ds": "",
|
|
7
|
+
"data-testid": "ac-sidebar-item"
|
|
8
|
+
}, O = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "inline-flex size-4 shrink-0 items-center justify-center text-muted transition-colors group-hover:text-heading group-aria-[current=page]:text-primary-30! [&>img]:size-4",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
}, k = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "text-xs font-semibold"
|
|
15
|
+
}, A = [
|
|
16
|
+
"disabled",
|
|
17
|
+
"aria-expanded",
|
|
18
|
+
"aria-controls",
|
|
19
|
+
"title"
|
|
20
|
+
], j = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "text-xs font-semibold"
|
|
23
|
+
}, M = ["id"], N = /*@__PURE__*/ o({
|
|
24
|
+
__name: "AcSidebarItem",
|
|
25
|
+
props: /*@__PURE__*/ l({
|
|
26
|
+
label: {},
|
|
27
|
+
icon: { default: void 0 },
|
|
28
|
+
to: { default: void 0 },
|
|
29
|
+
href: { default: void 0 },
|
|
30
|
+
active: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
badge: { default: void 0 },
|
|
35
|
+
badgeColor: { default: "neutral" },
|
|
36
|
+
disabled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
open: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
openModifiers: {}
|
|
46
|
+
}),
|
|
47
|
+
emits: /*@__PURE__*/ l(["click"], ["update:open"]),
|
|
48
|
+
setup(o, { emit: l }) {
|
|
49
|
+
let N = o, P = S(o, "open"), F = l, I = C(), L = {
|
|
50
|
+
neutral: "bg-slate-90 text-label ring-1 ring-border ring-inset",
|
|
51
|
+
primary: "bg-primary-95 text-primary-20",
|
|
52
|
+
info: "bg-blue-95 text-blue-20",
|
|
53
|
+
success: "bg-green-95 text-green-20",
|
|
54
|
+
warning: "bg-yellow-95 text-yellow-20",
|
|
55
|
+
danger: "bg-red-95 text-red-30"
|
|
56
|
+
}, R = {
|
|
57
|
+
neutral: "bg-slate-60",
|
|
58
|
+
primary: "bg-primary",
|
|
59
|
+
info: "bg-info",
|
|
60
|
+
success: "bg-success",
|
|
61
|
+
warning: "bg-warning",
|
|
62
|
+
danger: "bg-danger"
|
|
63
|
+
}, z = c("ac-sidebar", null), B = c("ac-sidebar-depth", 0), V = s()?.appContext.components.RouterLink, H = x(), U = g(null), W = g(!1), G = null, K = t(() => !!I.default), q = t(() => (z?.rail.value ?? !1) && B === 0), J = t(() => z?.dark.value ? "not-aria-[current=page]:hover:bg-white/8 not-aria-[current=page]:hover:text-heading" : "not-aria-[current=page]:hover:bg-slate-90 not-aria-[current=page]:hover:text-heading"), Y = t(() => N.to && V && !N.disabled ? V : N.to || N.href ? "a" : "button"), X = t(() => {
|
|
64
|
+
let e = {};
|
|
65
|
+
return Y.value === V ? e.to = N.to : Y.value === "a" ? N.disabled ? (e.role = "link", e["aria-disabled"] = "true") : e.href = N.href ?? (typeof N.to == "string" ? N.to : void 0) : (e.type = "button", e.disabled = N.disabled || void 0), N.active && (e["aria-current"] = "page"), e;
|
|
66
|
+
}), Z = t(() => N.badge === void 0 || N.badge === "" ? "" : String(N.badge));
|
|
67
|
+
function Q(e) {
|
|
68
|
+
if (N.disabled) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
F("click", e), z?.navigate();
|
|
73
|
+
}
|
|
74
|
+
function ee() {
|
|
75
|
+
q.value ? (z?.expand(), P.value = !0) : P.value = !P.value;
|
|
76
|
+
}
|
|
77
|
+
function $() {
|
|
78
|
+
W.value = !!U.value?.querySelector("[aria-current=\"page\"]");
|
|
79
|
+
}
|
|
80
|
+
return h("ac-sidebar-depth", B + 1), w(W, (e) => {
|
|
81
|
+
e && (P.value = !0);
|
|
82
|
+
}), p(() => {
|
|
83
|
+
U.value && ($(), G = new MutationObserver($), G.observe(U.value, {
|
|
84
|
+
subtree: !0,
|
|
85
|
+
childList: !0,
|
|
86
|
+
attributes: !0,
|
|
87
|
+
attributeFilter: ["aria-current"]
|
|
88
|
+
}));
|
|
89
|
+
}), f(() => G?.disconnect()), (t, s) => (m(), i("li", D, [K.value ? (m(), i(e, { key: 1 }, [a("button", {
|
|
90
|
+
type: "button",
|
|
91
|
+
class: d(["group relative flex w-full items-center gap-2.5 rounded-6 text-left text-base transition-colors duration-100 select-none focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring", [
|
|
92
|
+
q.value ? "h-9 justify-center" : "h-8 px-2.5",
|
|
93
|
+
q.value && W.value ? "bg-primary-95 text-primary-20" : W.value ? "font-medium text-heading" : "text-body",
|
|
94
|
+
o.disabled ? "cursor-not-allowed opacity-50" : ["cursor-pointer", J.value]
|
|
95
|
+
]]),
|
|
96
|
+
disabled: o.disabled || void 0,
|
|
97
|
+
"aria-expanded": q.value ? void 0 : P.value,
|
|
98
|
+
"aria-controls": `${b(H)}-list`,
|
|
99
|
+
title: q.value ? o.label : void 0,
|
|
100
|
+
"data-ac-ds": "",
|
|
101
|
+
"data-testid": "ac-sidebar-group",
|
|
102
|
+
onClick: ee
|
|
103
|
+
}, [
|
|
104
|
+
t.$slots.icon || o.icon || q.value ? (m(), i("span", {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: d(["inline-flex size-4 shrink-0 items-center justify-center transition-colors group-hover:text-heading [&>img]:size-4", W.value ? "text-primary-30" : "text-muted"]),
|
|
107
|
+
"aria-hidden": "true"
|
|
108
|
+
}, [_(t.$slots, "icon", {}, () => [o.icon ? (m(), n(v(o.icon), {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: "size-4"
|
|
111
|
+
})) : (m(), i("span", j, y(o.label.charAt(0)), 1))])], 2)) : r("", !0),
|
|
112
|
+
a("span", { class: d(q.value ? "sr-only" : "min-w-0 flex-1 truncate") }, y(o.label), 3),
|
|
113
|
+
Z.value && !q.value ? (m(), i("span", {
|
|
114
|
+
key: 1,
|
|
115
|
+
class: d(["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", L[o.badgeColor]])
|
|
116
|
+
}, y(Z.value), 3)) : r("", !0),
|
|
117
|
+
q.value ? r("", !0) : (m(), n(b(E), {
|
|
118
|
+
key: 2,
|
|
119
|
+
class: d(["size-3.5 shrink-0 text-muted transition-transform duration-150 motion-reduce:transition-none", P.value && "rotate-90"]),
|
|
120
|
+
"aria-hidden": "true"
|
|
121
|
+
}, null, 8, ["class"]))
|
|
122
|
+
], 10, A), a("ul", {
|
|
123
|
+
id: `${b(H)}-list`,
|
|
124
|
+
ref_key: "list",
|
|
125
|
+
ref: U,
|
|
126
|
+
role: "list",
|
|
127
|
+
class: d(["mt-0.5 ml-4.5 flex-col gap-0.5 border-l border-border pl-2", P.value && !q.value ? "flex" : "hidden"])
|
|
128
|
+
}, [_(t.$slots, "default")], 10, M)], 64)) : (m(), n(v(Y.value), u({ key: 0 }, X.value, {
|
|
129
|
+
class: ["group relative flex w-full items-center gap-2.5 rounded-6 text-left text-base font-normal text-body no-underline transition-colors duration-100 select-none focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring aria-[current=page]:bg-primary-95 aria-[current=page]:font-medium aria-[current=page]:text-primary-20", [q.value ? "h-9 justify-center" : "h-8 px-2.5", o.disabled ? "pointer-events-none cursor-not-allowed opacity-50" : ["cursor-pointer", J.value]]],
|
|
130
|
+
title: q.value ? Z.value ? `${o.label} (${Z.value})` : o.label : void 0,
|
|
131
|
+
"data-ac-ds": "",
|
|
132
|
+
"data-testid": "ac-sidebar-link",
|
|
133
|
+
onClick: Q
|
|
134
|
+
}), {
|
|
135
|
+
default: T(() => [
|
|
136
|
+
t.$slots.icon || o.icon || q.value ? (m(), i("span", O, [_(t.$slots, "icon", {}, () => [o.icon ? (m(), n(v(o.icon), {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "size-4"
|
|
139
|
+
})) : (m(), i("span", k, y(o.label.charAt(0)), 1))])])) : r("", !0),
|
|
140
|
+
a("span", { class: d(q.value ? "sr-only" : "min-w-0 flex-1 truncate") }, y(o.label), 3),
|
|
141
|
+
Z.value ? (m(), i(e, { key: 1 }, [q.value ? (m(), i("span", {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: d(["absolute top-1 right-1 size-1.5 rounded-full", R[o.badgeColor]]),
|
|
144
|
+
"aria-hidden": "true"
|
|
145
|
+
}, null, 2)) : (m(), i("span", {
|
|
146
|
+
key: 1,
|
|
147
|
+
class: d(["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", L[o.badgeColor]])
|
|
148
|
+
}, y(Z.value), 3))], 64)) : r("", !0)
|
|
149
|
+
]),
|
|
150
|
+
_: 3
|
|
151
|
+
}, 16, ["class", "title"]))]));
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
//#endregion
|
|
155
|
+
export { N as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Small uppercase heading above the items. Hidden in the collapsed rail, where a divider takes its place. */
|
|
3
|
+
label?: string;
|
|
4
|
+
/** Turns the heading into a button that shows and hides the items. */
|
|
5
|
+
collapsible?: boolean;
|
|
6
|
+
}
|
|
7
|
+
type __VLS_Props = Props;
|
|
8
|
+
type __VLS_Slots = {
|
|
9
|
+
/** The section's `AcSidebarItem`s. */
|
|
10
|
+
default?: () => unknown;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_ModelProps = {
|
|
13
|
+
/** Whether the items are shown when `collapsible`. Bind with `v-model:open`. */
|
|
14
|
+
"open"?: boolean;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
"update:open": (value: boolean) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
label: string;
|
|
23
|
+
collapsible: boolean;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u, renderSlot as d, toDisplayString as f, unref as p, useId as m, useModel as h } from "vue";
|
|
2
|
+
import { ChevronDown as g } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcSidebarSection.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var _ = ["aria-expanded", "aria-controls"], v = { class: "truncate" }, y = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "h-7 truncate px-2.5 text-sm leading-7 font-medium tracking-wider text-muted uppercase"
|
|
7
|
+
}, b = ["id", "aria-label"], x = /*@__PURE__*/ o({
|
|
8
|
+
__name: "AcSidebarSection",
|
|
9
|
+
props: /*@__PURE__*/ c({
|
|
10
|
+
label: { default: "" },
|
|
11
|
+
collapsible: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
}
|
|
15
|
+
}, {
|
|
16
|
+
open: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !0
|
|
19
|
+
},
|
|
20
|
+
openModifiers: {}
|
|
21
|
+
}),
|
|
22
|
+
emits: ["update:open"],
|
|
23
|
+
setup(o) {
|
|
24
|
+
let c = h(o, "open"), x = s("ac-sidebar", null), S = m(), C = t(() => x?.rail.value ?? !1);
|
|
25
|
+
return (t, s) => (u(), r("li", {
|
|
26
|
+
class: l(["list-none", C.value ? "mt-2 border-t border-border-light pt-2 first:mt-0 first:border-0 first:pt-0" : "mt-4 first:mt-0"]),
|
|
27
|
+
"data-ac-ds": "",
|
|
28
|
+
"data-testid": "ac-sidebar-section"
|
|
29
|
+
}, [o.label && !C.value ? (u(), r(e, { key: 0 }, [o.collapsible ? (u(), r("button", {
|
|
30
|
+
key: 0,
|
|
31
|
+
type: "button",
|
|
32
|
+
class: "group flex h-7 w-full cursor-pointer items-center justify-between gap-2 rounded-6 px-2.5 text-sm font-medium tracking-wider text-muted uppercase transition-colors hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
33
|
+
"aria-expanded": c.value,
|
|
34
|
+
"aria-controls": `${p(S)}-items`,
|
|
35
|
+
onClick: s[0] ||= (e) => c.value = !c.value
|
|
36
|
+
}, [i("span", v, f(o.label), 1), a(p(g), {
|
|
37
|
+
class: l(["size-3.5 shrink-0 transition-transform duration-150 motion-reduce:transition-none", !c.value && "-rotate-90"]),
|
|
38
|
+
"aria-hidden": "true"
|
|
39
|
+
}, null, 8, ["class"])], 8, _)) : (u(), r("p", y, f(o.label), 1))], 64)) : n("", !0), i("ul", {
|
|
40
|
+
id: `${p(S)}-items`,
|
|
41
|
+
role: "list",
|
|
42
|
+
"aria-label": o.label || void 0,
|
|
43
|
+
class: l(["flex-col gap-0.5", c.value || C.value || !o.collapsible ? "flex" : "hidden"])
|
|
44
|
+
}, [d(t.$slots, "default")], 10, b)], 2));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { x as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** `text` lines, a `circle` or `rect`, or a preset: `table`, `card`, `info-card`, `editor`. */
|
|
3
|
+
shape?: "text" | "circle" | "rect" | "table" | "card" | "info-card" | "editor";
|
|
4
|
+
/** Number of text lines. The last one is shorter so the block reads as a paragraph. */
|
|
5
|
+
lines?: number;
|
|
6
|
+
/** Rows of the `table` preset, not counting the header. */
|
|
7
|
+
rows?: number;
|
|
8
|
+
/** Columns of the `table` preset. */
|
|
9
|
+
cols?: number;
|
|
10
|
+
/** CSS width, e.g. `"80%"` or `"240px"`. Defaults to full width, or to `height` for a circle. */
|
|
11
|
+
width?: string;
|
|
12
|
+
/** CSS height of a `rect` or `editor` (default `320px`, like AcCodeEditor), the diameter of a `circle`, or the height of each `text` line. */
|
|
13
|
+
height?: string;
|
|
14
|
+
/** Hidden text for screen readers. Pass an empty string to hide the skeleton from them, e.g. when several are composed inside one `aria-busy` region. */
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
label: string;
|
|
19
|
+
height: string;
|
|
20
|
+
width: string;
|
|
21
|
+
shape: "text" | "circle" | "rect" | "table" | "card" | "info-card" | "editor";
|
|
22
|
+
lines: number;
|
|
23
|
+
rows: number;
|
|
24
|
+
cols: number;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|