@ac-design/design-system 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +375 -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 +125 -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/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,65 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, defineComponent as o, getCurrentInstance as s, mergeProps as c, openBlock as l, renderSlot as u, resolveDynamicComponent as d, toDisplayString as f, withCtx as p } from "vue";
|
|
2
|
+
//#region src/lib/components/AcNavbarItem.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var m = { key: 1 }, h = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "absolute -top-0.5 left-4 inline-flex h-4 min-w-4 items-center justify-center rounded-50 bg-danger px-1 text-xm font-semibold text-white tabular-nums ring-2 ring-surface",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, g = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-50 bg-slate-90 px-1.5 text-sm font-medium text-label tabular-nums ring-1 ring-border ring-inset"
|
|
10
|
+
}, _ = /*@__PURE__*/ o({
|
|
11
|
+
__name: "AcNavbarItem",
|
|
12
|
+
props: {
|
|
13
|
+
label: {},
|
|
14
|
+
icon: { default: void 0 },
|
|
15
|
+
iconOnly: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
to: { default: void 0 },
|
|
20
|
+
href: { default: void 0 },
|
|
21
|
+
active: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
badge: { default: void 0 },
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
emits: ["click"],
|
|
32
|
+
setup(o, { emit: _ }) {
|
|
33
|
+
let v = o, y = _, b = s()?.appContext.components.RouterLink, x = t(() => v.to && b && !v.disabled ? b : v.to || v.href ? "a" : "button"), S = t(() => v.badge === void 0 || v.badge === "" || v.badge === 0 ? "" : typeof v.badge == "number" && v.badge > 999 ? "999+" : String(v.badge)), C = t(() => {
|
|
34
|
+
let e = {};
|
|
35
|
+
return x.value === b ? e.to = v.to : x.value === "a" ? v.disabled ? (e.role = "link", e["aria-disabled"] = "true") : e.href = v.href ?? (typeof v.to == "string" ? v.to : void 0) : (e.type = "button", e.disabled = v.disabled || void 0), v.active && (e["aria-current"] = "page"), v.iconOnly && (e["aria-label"] = S.value ? `${v.label} (${S.value})` : v.label), e;
|
|
36
|
+
});
|
|
37
|
+
function w(e) {
|
|
38
|
+
if (v.disabled) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
y("click", e);
|
|
43
|
+
}
|
|
44
|
+
return (t, s) => (l(), n(d(x.value), c(C.value, {
|
|
45
|
+
class: ["relative inline-flex h-8 shrink-0 items-center justify-center gap-2 rounded-6 text-base font-medium whitespace-nowrap text-label no-underline transition-colors duration-100 select-none focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring aria-[current=page]:bg-surface-sunken aria-[current=page]:text-heading", [o.iconOnly ? "w-8" : "px-3", o.disabled ? "pointer-events-none cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-surface-sunken hover:text-heading"]],
|
|
46
|
+
title: o.iconOnly ? o.label : void 0,
|
|
47
|
+
"data-ac-ds": "",
|
|
48
|
+
"data-testid": "ac-navbar-item",
|
|
49
|
+
onClick: w
|
|
50
|
+
}), {
|
|
51
|
+
default: p(() => [
|
|
52
|
+
o.icon ? (l(), n(d(o.icon), {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "size-4 shrink-0",
|
|
55
|
+
"aria-hidden": "true"
|
|
56
|
+
})) : r("", !0),
|
|
57
|
+
o.iconOnly ? r("", !0) : (l(), i("span", m, [u(t.$slots, "default", {}, () => [a(f(o.label), 1)])])),
|
|
58
|
+
S.value ? (l(), i(e, { key: 2 }, [o.iconOnly ? (l(), i("span", h, f(S.value), 1)) : (l(), i("span", g, f(S.value), 1))], 64)) : r("", !0)
|
|
59
|
+
]),
|
|
60
|
+
_: 3
|
|
61
|
+
}, 16, ["class", "title"]));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { _ as default };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface NotificationItem {
|
|
3
|
+
/** Unique id. */
|
|
4
|
+
id: string | number;
|
|
5
|
+
/** When it happened: a `Date`, an ISO string, or epoch milliseconds (epoch seconds also work). */
|
|
6
|
+
time: number | string | Date;
|
|
7
|
+
/** Bold first line. Without it, `msg` is the first line. */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** The message. Old `msg`. */
|
|
10
|
+
msg?: string;
|
|
11
|
+
/** Event status, e.g. `Success`, `Failed`, `Running`, `Pending`. Shown next to the time and picks the icon. */
|
|
12
|
+
status?: string;
|
|
13
|
+
/** Overrides the tone that `status` picks. */
|
|
14
|
+
type?: "success" | "danger" | "warning" | "info" | "neutral";
|
|
15
|
+
/** Read items lose the unread dot and the bold title. */
|
|
16
|
+
read?: boolean;
|
|
17
|
+
/** Plain URL to open. */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Route to open; rendered as `RouterLink` when vue-router is installed. */
|
|
20
|
+
to?: string | object;
|
|
21
|
+
/** A Lucide icon to replace the status icon. */
|
|
22
|
+
icon?: Component;
|
|
23
|
+
}
|
|
24
|
+
export interface Props {
|
|
25
|
+
/** Recent events, newest first. */
|
|
26
|
+
notifications?: NotificationItem[];
|
|
27
|
+
/** Number on the bell. Defaults to the items without `read: true`. Old `unreadNotification`. */
|
|
28
|
+
unreadCount?: number;
|
|
29
|
+
/** Shows skeleton rows in the panel. */
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
/** Accessible name of the bell, and the panel heading. */
|
|
32
|
+
label?: string;
|
|
33
|
+
/** Heading of the empty state. */
|
|
34
|
+
emptyText?: string;
|
|
35
|
+
/** Text of the footer link. */
|
|
36
|
+
viewAllLabel?: string;
|
|
37
|
+
/** Plain URL of the full notifications page. Shows the footer link. */
|
|
38
|
+
viewAllHref?: string;
|
|
39
|
+
/** Route of the full notifications page; rendered as `RouterLink` when vue-router is installed. Shows the footer link. */
|
|
40
|
+
viewAllTo?: string | object;
|
|
41
|
+
/** Which edge of the bell the panel lines up with. */
|
|
42
|
+
align?: "start" | "end";
|
|
43
|
+
}
|
|
44
|
+
type __VLS_Props = Props;
|
|
45
|
+
type __VLS_Slots = {
|
|
46
|
+
/** Custom row content. */
|
|
47
|
+
item?: (props: {
|
|
48
|
+
item: NotificationItem;
|
|
49
|
+
}) => unknown;
|
|
50
|
+
/** Replaces the empty state. */
|
|
51
|
+
empty?: () => unknown;
|
|
52
|
+
/** Replaces the footer link. Receives `close`. */
|
|
53
|
+
footer?: (props: {
|
|
54
|
+
close: () => void;
|
|
55
|
+
}) => unknown;
|
|
56
|
+
};
|
|
57
|
+
type __VLS_ModelProps = {
|
|
58
|
+
/** Whether the panel is open. Bind with `v-model:open`; watch it to mark items read when the panel opens. Old `isActive` event. */
|
|
59
|
+
"open"?: boolean;
|
|
60
|
+
};
|
|
61
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
62
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
63
|
+
select: (item: NotificationItem) => any;
|
|
64
|
+
"update:open": (value: boolean) => any;
|
|
65
|
+
markAllRead: () => any;
|
|
66
|
+
viewAll: () => any;
|
|
67
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
68
|
+
onSelect?: ((item: NotificationItem) => any) | undefined;
|
|
69
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
70
|
+
onMarkAllRead?: (() => any) | undefined;
|
|
71
|
+
onViewAll?: (() => any) | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
label: string;
|
|
74
|
+
loading: boolean;
|
|
75
|
+
align: "start" | "end";
|
|
76
|
+
emptyText: string;
|
|
77
|
+
notifications: NotificationItem[];
|
|
78
|
+
unreadCount: number;
|
|
79
|
+
viewAllLabel: string;
|
|
80
|
+
viewAllHref: string;
|
|
81
|
+
viewAllTo: string | object;
|
|
82
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
83
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
84
|
+
declare const _default: typeof __VLS_export;
|
|
85
|
+
export default _default;
|
|
86
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
87
|
+
new (): {
|
|
88
|
+
$slots: S;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import e from "./AcNavbarItem.js";
|
|
2
|
+
import t from "./AcSkeleton.js";
|
|
3
|
+
import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, getCurrentInstance as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as ee, onBeforeUnmount as te, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useId as ne, useModel as re, watch as T, withCtx as E } from "vue";
|
|
4
|
+
import { ArrowRight as ie, Bell as ae, BellOff as oe, CheckCheck as se, CircleCheck as ce, CircleX as le, Info as ue, LoaderCircle as de, TriangleAlert as fe } from "@lucide/vue";
|
|
5
|
+
//#region src/lib/components/AcNotificationMenu.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var pe = {
|
|
7
|
+
class: "inline-flex",
|
|
8
|
+
"data-ac-ds": "",
|
|
9
|
+
"data-testid": "ac-notification-menu"
|
|
10
|
+
}, me = { class: "flex h-12 shrink-0 items-center gap-2 border-b border-border-light pr-2 pl-4" }, he = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-50 bg-primary-95 px-1.5 text-sm font-semibold text-primary-20 tabular-nums"
|
|
13
|
+
}, ge = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "flex flex-col gap-4 px-4 py-4",
|
|
16
|
+
"aria-busy": "true",
|
|
17
|
+
role: "status",
|
|
18
|
+
"aria-label": "Loading notifications"
|
|
19
|
+
}, _e = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "flex flex-col items-center gap-3 px-6 py-10 text-center"
|
|
22
|
+
}, ve = {
|
|
23
|
+
class: "inline-flex size-10 items-center justify-center rounded-10 border border-border bg-surface-muted text-muted",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
}, ye = { class: "text-lg font-medium text-heading" }, be = {
|
|
26
|
+
key: 2,
|
|
27
|
+
role: "list",
|
|
28
|
+
class: "ac-scrollbar min-h-0 flex-1 divide-y divide-border-light",
|
|
29
|
+
"data-ac-ds": "",
|
|
30
|
+
"data-testid": "ac-notification-menu-list"
|
|
31
|
+
}, xe = { class: "min-w-0 flex-1" }, Se = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "mt-0.5 line-clamp-2 text-xs text-body"
|
|
34
|
+
}, Ce = { class: "mt-1 flex items-center gap-1.5 text-xs text-muted" }, we = {
|
|
35
|
+
key: 1,
|
|
36
|
+
"aria-hidden": "true"
|
|
37
|
+
}, Te = ["datetime", "title"], Ee = {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "mt-2 size-2 shrink-0 rounded-full bg-primary",
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
}, De = {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "sr-only"
|
|
44
|
+
}, Oe = {
|
|
45
|
+
key: 3,
|
|
46
|
+
class: "shrink-0 border-t border-border-light p-1"
|
|
47
|
+
}, ke = "[data-notification-item]", Ae = 6048e5, D = /*@__PURE__*/ f({
|
|
48
|
+
__name: "AcNotificationMenu",
|
|
49
|
+
props: /*@__PURE__*/ m({
|
|
50
|
+
notifications: { default: () => [] },
|
|
51
|
+
unreadCount: { default: void 0 },
|
|
52
|
+
loading: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
},
|
|
56
|
+
label: { default: "Notifications" },
|
|
57
|
+
emptyText: { default: "You're all caught up" },
|
|
58
|
+
viewAllLabel: { default: "View all" },
|
|
59
|
+
viewAllHref: { default: "" },
|
|
60
|
+
viewAllTo: { default: void 0 },
|
|
61
|
+
align: { default: "end" }
|
|
62
|
+
}, {
|
|
63
|
+
open: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
},
|
|
67
|
+
openModifiers: {}
|
|
68
|
+
}),
|
|
69
|
+
emits: /*@__PURE__*/ m([
|
|
70
|
+
"select",
|
|
71
|
+
"markAllRead",
|
|
72
|
+
"viewAll"
|
|
73
|
+
], ["update:open"]),
|
|
74
|
+
setup(f, { emit: m }) {
|
|
75
|
+
let D = f, O = re(f, "open"), k = m, je = {
|
|
76
|
+
success: "success",
|
|
77
|
+
succeeded: "success",
|
|
78
|
+
completed: "success",
|
|
79
|
+
complete: "success",
|
|
80
|
+
ready: "success",
|
|
81
|
+
active: "success",
|
|
82
|
+
failed: "danger",
|
|
83
|
+
failure: "danger",
|
|
84
|
+
error: "danger",
|
|
85
|
+
critical: "danger",
|
|
86
|
+
warning: "warning",
|
|
87
|
+
pending: "warning",
|
|
88
|
+
waiting: "warning",
|
|
89
|
+
running: "info",
|
|
90
|
+
started: "info",
|
|
91
|
+
inprogress: "info",
|
|
92
|
+
progressing: "info",
|
|
93
|
+
info: "info"
|
|
94
|
+
}, A = {
|
|
95
|
+
success: {
|
|
96
|
+
icon: ce,
|
|
97
|
+
tile: "bg-green-95 text-green-40",
|
|
98
|
+
text: "text-green-30"
|
|
99
|
+
},
|
|
100
|
+
danger: {
|
|
101
|
+
icon: le,
|
|
102
|
+
tile: "bg-red-95 text-red-40",
|
|
103
|
+
text: "text-red-30"
|
|
104
|
+
},
|
|
105
|
+
warning: {
|
|
106
|
+
icon: fe,
|
|
107
|
+
tile: "bg-yellow-95 text-yellow-40",
|
|
108
|
+
text: "text-yellow-30"
|
|
109
|
+
},
|
|
110
|
+
info: {
|
|
111
|
+
icon: de,
|
|
112
|
+
tile: "bg-blue-95 text-blue-40",
|
|
113
|
+
text: "text-blue-30"
|
|
114
|
+
},
|
|
115
|
+
neutral: {
|
|
116
|
+
icon: ue,
|
|
117
|
+
tile: "bg-slate-90 text-label",
|
|
118
|
+
text: "text-muted"
|
|
119
|
+
}
|
|
120
|
+
}, j = new Intl.RelativeTimeFormat(void 0, {
|
|
121
|
+
numeric: "auto",
|
|
122
|
+
style: "narrow"
|
|
123
|
+
}), Me = new Intl.DateTimeFormat(void 0, {
|
|
124
|
+
dateStyle: "medium",
|
|
125
|
+
timeStyle: "short"
|
|
126
|
+
}), Ne = new Intl.DateTimeFormat(void 0, {
|
|
127
|
+
month: "short",
|
|
128
|
+
day: "numeric"
|
|
129
|
+
}), M = p()?.appContext.components.RouterLink, N = ne(), P = `${N}-panel`, F = `${N}-heading`, I = y(null), L = y(null), R = y({}), z = y(!0), B = y(Date.now()), V, H = a(() => D.unreadCount ?? D.notifications.filter((e) => !e.read).length), Pe = a(() => D.notifications.some((e) => !e.read)), Fe = a(() => !!(D.viewAllHref || D.viewAllTo));
|
|
130
|
+
function U(e) {
|
|
131
|
+
return e.type ? e.type : je[(e.status ?? "").toLowerCase().replace(/[^a-z]/g, "")] ?? "neutral";
|
|
132
|
+
}
|
|
133
|
+
function W(e) {
|
|
134
|
+
return e instanceof Date ? e.getTime() : typeof e == "number" ? e < 1e11 ? e * 1e3 : e : new Date(e).getTime();
|
|
135
|
+
}
|
|
136
|
+
function Ie(e) {
|
|
137
|
+
let t = W(e);
|
|
138
|
+
if (Number.isNaN(t)) return "";
|
|
139
|
+
let n = t - B.value, r = Math.abs(n);
|
|
140
|
+
return r < 45e3 ? "Just now" : r >= Ae ? Ne.format(t) : r < 36e5 ? j.format(Math.round(n / 6e4), "minute") : r < 864e5 ? j.format(Math.round(n / 36e5), "hour") : j.format(Math.round(n / 864e5), "day");
|
|
141
|
+
}
|
|
142
|
+
function Le(e) {
|
|
143
|
+
let t = W(e);
|
|
144
|
+
return Number.isNaN(t) ? "" : Me.format(t);
|
|
145
|
+
}
|
|
146
|
+
function Re(e) {
|
|
147
|
+
let t = W(e);
|
|
148
|
+
return Number.isNaN(t) ? void 0 : new Date(t).toISOString();
|
|
149
|
+
}
|
|
150
|
+
function G(e, t) {
|
|
151
|
+
return e && M ? M : e || t ? "a" : "button";
|
|
152
|
+
}
|
|
153
|
+
function K(e, t) {
|
|
154
|
+
let n = G(e, t);
|
|
155
|
+
return n === M ? { to: e } : n === "a" ? { href: t || (typeof e == "string" ? e : void 0) } : { type: "button" };
|
|
156
|
+
}
|
|
157
|
+
function q() {
|
|
158
|
+
return I.value?.$el ?? null;
|
|
159
|
+
}
|
|
160
|
+
function J() {
|
|
161
|
+
return [...L.value?.querySelectorAll(ke) ?? []];
|
|
162
|
+
}
|
|
163
|
+
function Y(e) {
|
|
164
|
+
let t = J();
|
|
165
|
+
t.length && t[(e + t.length) % t.length].focus();
|
|
166
|
+
}
|
|
167
|
+
function X() {
|
|
168
|
+
let e = q();
|
|
169
|
+
if (!e || !L.value) return;
|
|
170
|
+
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = L.value, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = D.align === "end" ? t.right - n : t.left;
|
|
171
|
+
z.value = !o, R.value = {
|
|
172
|
+
[o ? "bottom" : "top"]: `${o ? window.innerHeight - t.top + 6 : t.bottom + 6}px`,
|
|
173
|
+
left: `${Math.max(8, Math.min(s, window.innerWidth - n - 8))}px`,
|
|
174
|
+
maxHeight: `${Math.max(o ? a : i, 200)}px`
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function Z(e = !0) {
|
|
178
|
+
O.value && (O.value = !1, e && q()?.focus());
|
|
179
|
+
}
|
|
180
|
+
function ze() {
|
|
181
|
+
O.value ? Z() : O.value = !0;
|
|
182
|
+
}
|
|
183
|
+
function Be(e) {
|
|
184
|
+
k("select", e), Z(!1);
|
|
185
|
+
}
|
|
186
|
+
function Ve() {
|
|
187
|
+
k("viewAll"), Z(!1);
|
|
188
|
+
}
|
|
189
|
+
function He(e) {
|
|
190
|
+
e.key !== "ArrowDown" || O.value || (e.preventDefault(), O.value = !0);
|
|
191
|
+
}
|
|
192
|
+
function Ue(e) {
|
|
193
|
+
let t = J(), n = t.indexOf(document.activeElement);
|
|
194
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp") && t.length ? (e.preventDefault(), Y(n < 0 ? e.key === "ArrowDown" ? 0 : -1 : n + (e.key === "ArrowDown" ? 1 : -1))) : (e.key === "Home" || e.key === "End") && n >= 0 ? (e.preventDefault(), Y(e.key === "Home" ? 0 : -1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && We(e);
|
|
195
|
+
}
|
|
196
|
+
function We(e) {
|
|
197
|
+
let t = [...L.value?.querySelectorAll("a[href], button:not([disabled])") ?? []], n = t[0], r = t[t.length - 1];
|
|
198
|
+
e.shiftKey && (document.activeElement === n || document.activeElement === L.value) ? (e.preventDefault(), Z()) : !e.shiftKey && (document.activeElement === r || !t.length) && Z();
|
|
199
|
+
}
|
|
200
|
+
function Ge(e) {
|
|
201
|
+
let t = e.target;
|
|
202
|
+
q()?.contains(t) || L.value?.contains(t) || Z(!1);
|
|
203
|
+
}
|
|
204
|
+
function Q(e) {
|
|
205
|
+
e && L.value?.contains(e.target) || X();
|
|
206
|
+
}
|
|
207
|
+
function $(e) {
|
|
208
|
+
let t = e ? "addEventListener" : "removeEventListener";
|
|
209
|
+
document[t]("pointerdown", Ge, !0), window[t]("scroll", Q, !0), window[t]("resize", Q), clearInterval(V), e && (V = setInterval(() => B.value = Date.now(), 3e4));
|
|
210
|
+
}
|
|
211
|
+
return T(O, async (e) => {
|
|
212
|
+
if ($(e), !e) return;
|
|
213
|
+
B.value = Date.now(), await g(), X();
|
|
214
|
+
let t = J()[0];
|
|
215
|
+
t ? t.focus() : L.value?.focus();
|
|
216
|
+
}), T(() => [D.notifications.length, D.loading], () => O.value && g(X)), te(() => $(!1)), (a, p) => (v(), c("div", pe, [d(e, {
|
|
217
|
+
ref_key: "trigger",
|
|
218
|
+
ref: I,
|
|
219
|
+
label: f.label,
|
|
220
|
+
icon: w(ae),
|
|
221
|
+
"icon-only": "",
|
|
222
|
+
badge: H.value,
|
|
223
|
+
"aria-haspopup": "dialog",
|
|
224
|
+
"aria-expanded": O.value,
|
|
225
|
+
"aria-controls": O.value ? P : void 0,
|
|
226
|
+
class: _(O.value && "bg-surface-sunken text-heading"),
|
|
227
|
+
"data-ac-ds": "",
|
|
228
|
+
"data-testid": "ac-notification-menu-trigger",
|
|
229
|
+
onClick: ze,
|
|
230
|
+
onKeydown: He
|
|
231
|
+
}, null, 8, [
|
|
232
|
+
"label",
|
|
233
|
+
"icon",
|
|
234
|
+
"badge",
|
|
235
|
+
"aria-expanded",
|
|
236
|
+
"aria-controls",
|
|
237
|
+
"class"
|
|
238
|
+
]), (v(), o(r, { to: "body" }, [d(i, {
|
|
239
|
+
"enter-active-class": "transition duration-150 ease-out",
|
|
240
|
+
"enter-from-class": `opacity-0 motion-safe:scale-[0.98] ${z.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
|
|
241
|
+
"leave-active-class": "transition duration-100 ease-in",
|
|
242
|
+
"leave-to-class": "opacity-0"
|
|
243
|
+
}, {
|
|
244
|
+
default: E(() => [O.value ? (v(), c("div", {
|
|
245
|
+
key: 0,
|
|
246
|
+
id: P,
|
|
247
|
+
ref_key: "panel",
|
|
248
|
+
ref: L,
|
|
249
|
+
role: "dialog",
|
|
250
|
+
tabindex: "-1",
|
|
251
|
+
"aria-labelledby": F,
|
|
252
|
+
class: _(["fixed z-[90] flex w-[calc(380px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-10 border border-border bg-surface shadow-lg outline-none", z.value ? "origin-top-right" : "origin-bottom-right"]),
|
|
253
|
+
style: ee(R.value),
|
|
254
|
+
"data-ac-ds": "",
|
|
255
|
+
"data-testid": "ac-notification-menu-panel",
|
|
256
|
+
onKeydown: Ue
|
|
257
|
+
}, [
|
|
258
|
+
l("div", me, [
|
|
259
|
+
l("h2", {
|
|
260
|
+
id: F,
|
|
261
|
+
class: "text-lg font-semibold tracking-normal text-heading"
|
|
262
|
+
}, C(f.label), 1),
|
|
263
|
+
H.value ? (v(), c("span", he, [u(C(H.value > 999 ? "999+" : H.value), 1), p[1] ||= l("span", { class: "sr-only" }, "\xA0unread", -1)])) : s("", !0),
|
|
264
|
+
Pe.value || H.value ? (v(), c("button", {
|
|
265
|
+
key: 1,
|
|
266
|
+
type: "button",
|
|
267
|
+
class: "ml-auto inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-6 px-2 text-xs font-medium text-label transition-colors hover:bg-surface-muted hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
268
|
+
"data-ac-ds": "",
|
|
269
|
+
"data-testid": "ac-notification-menu-mark-all",
|
|
270
|
+
onClick: p[0] ||= (e) => k("markAllRead")
|
|
271
|
+
}, [d(w(se), {
|
|
272
|
+
class: "size-3.5",
|
|
273
|
+
"aria-hidden": "true"
|
|
274
|
+
}), p[2] ||= u(" Mark all as read ", -1)])) : s("", !0)
|
|
275
|
+
]),
|
|
276
|
+
f.loading ? (v(), c("div", ge, [(v(), c(n, null, b(3, (e) => l("div", {
|
|
277
|
+
key: e,
|
|
278
|
+
class: "flex gap-3"
|
|
279
|
+
}, [d(t, {
|
|
280
|
+
shape: "rect",
|
|
281
|
+
width: "28px",
|
|
282
|
+
height: "28px",
|
|
283
|
+
label: "",
|
|
284
|
+
class: "shrink-0"
|
|
285
|
+
}), d(t, {
|
|
286
|
+
shape: "text",
|
|
287
|
+
lines: 2,
|
|
288
|
+
height: "10px",
|
|
289
|
+
label: "",
|
|
290
|
+
class: "flex-1"
|
|
291
|
+
})])), 64))])) : f.notifications.length ? (v(), c("ul", be, [(v(!0), c(n, null, b(f.notifications, (e) => (v(), c("li", { key: e.id }, [(v(), o(S(G(e.to, e.href)), h({ ref_for: !0 }, K(e.to, e.href), {
|
|
292
|
+
"data-notification-item": "",
|
|
293
|
+
class: ["relative flex w-full cursor-pointer gap-3 px-4 py-3 text-left no-underline outline-none transition-colors hover:bg-surface-muted focus-visible:bg-surface-muted focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:ring-inset", !e.read && "bg-primary-97"],
|
|
294
|
+
"data-ac-ds": "",
|
|
295
|
+
"data-testid": "ac-notification-menu-item",
|
|
296
|
+
onClick: (t) => Be(e)
|
|
297
|
+
}), {
|
|
298
|
+
default: E(() => [x(a.$slots, "item", { item: e }, () => [
|
|
299
|
+
l("span", {
|
|
300
|
+
class: _(["mt-0.5 inline-flex size-7 shrink-0 items-center justify-center rounded-8", A[U(e)].tile]),
|
|
301
|
+
"aria-hidden": "true"
|
|
302
|
+
}, [(v(), o(S(e.icon ?? A[U(e)].icon), { class: "size-4" }))], 2),
|
|
303
|
+
l("span", xe, [
|
|
304
|
+
l("span", { class: _(["line-clamp-2 text-base text-heading", !e.read && "font-medium"]) }, C(e.title || e.msg), 3),
|
|
305
|
+
e.title && e.msg ? (v(), c("span", Se, C(e.msg), 1)) : s("", !0),
|
|
306
|
+
l("span", Ce, [
|
|
307
|
+
e.status ? (v(), c("span", {
|
|
308
|
+
key: 0,
|
|
309
|
+
class: _(["font-medium", A[U(e)].text])
|
|
310
|
+
}, C(e.status), 3)) : s("", !0),
|
|
311
|
+
e.status ? (v(), c("span", we, "·")) : s("", !0),
|
|
312
|
+
l("time", {
|
|
313
|
+
datetime: Re(e.time),
|
|
314
|
+
title: Le(e.time)
|
|
315
|
+
}, C(Ie(e.time)), 9, Te)
|
|
316
|
+
])
|
|
317
|
+
]),
|
|
318
|
+
e.read ? s("", !0) : (v(), c("span", Ee)),
|
|
319
|
+
e.read ? s("", !0) : (v(), c("span", De, "(unread)"))
|
|
320
|
+
])]),
|
|
321
|
+
_: 2
|
|
322
|
+
}, 1040, ["class", "onClick"]))]))), 128))])) : (v(), c("div", _e, [x(a.$slots, "empty", {}, () => [
|
|
323
|
+
l("span", ve, [d(w(oe), { class: "size-4.5" })]),
|
|
324
|
+
l("p", ye, C(f.emptyText), 1),
|
|
325
|
+
p[3] ||= l("p", { class: "max-w-64 text-base text-muted" }, "Backups, upgrades and alerts from your clusters show up here.", -1)
|
|
326
|
+
])])),
|
|
327
|
+
a.$slots.footer || Fe.value ? (v(), c("div", Oe, [x(a.$slots, "footer", { close: Z }, () => [(v(), o(S(G(f.viewAllTo, f.viewAllHref)), h(K(f.viewAllTo, f.viewAllHref), {
|
|
328
|
+
class: "flex h-8 w-full cursor-pointer items-center justify-center gap-1.5 rounded-6 text-base font-medium text-heading no-underline outline-none transition-colors hover:bg-surface-muted focus-visible:bg-surface-muted focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
329
|
+
"data-ac-ds": "",
|
|
330
|
+
"data-testid": "ac-notification-menu-view-all",
|
|
331
|
+
onClick: Ve
|
|
332
|
+
}), {
|
|
333
|
+
default: E(() => [u(C(f.viewAllLabel) + " ", 1), d(w(ie), {
|
|
334
|
+
class: "size-3.5",
|
|
335
|
+
"aria-hidden": "true"
|
|
336
|
+
})]),
|
|
337
|
+
_: 1
|
|
338
|
+
}, 16))])])) : s("", !0)
|
|
339
|
+
], 38)) : s("", !0)]),
|
|
340
|
+
_: 3
|
|
341
|
+
}, 8, ["enter-from-class"])]))]));
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
//#endregion
|
|
345
|
+
export { D as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Pads the page on all sides (20px). Turn off when a parent already pads it. */
|
|
3
|
+
padded?: boolean;
|
|
4
|
+
/** Space between the page's direct children: `small` 12px, `normal` 20px, `large` 32px. */
|
|
5
|
+
gap?: "small" | "normal" | "large";
|
|
6
|
+
/** Caps the content width and centres it: `narrow` 768px, `normal` 1024px, `wide` 1280px, `full` fills the area. */
|
|
7
|
+
width?: "full" | "wide" | "normal" | "narrow";
|
|
8
|
+
}
|
|
9
|
+
type __VLS_Slots = {
|
|
10
|
+
/** The page's sections: `AcCard`, `AcSectionContent`, `AcTable`, a form. Each direct child is spaced by `gap`. */
|
|
11
|
+
default?: () => unknown;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
14
|
+
width: "full" | "wide" | "normal" | "narrow";
|
|
15
|
+
gap: "small" | "normal" | "large";
|
|
16
|
+
padded: boolean;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createElementBlock as e, defineComponent as t, normalizeClass as n, openBlock as r, renderSlot as i } from "vue";
|
|
2
|
+
//#region src/lib/components/AcPage.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var a = /*@__PURE__*/ t({
|
|
4
|
+
__name: "AcPage",
|
|
5
|
+
props: {
|
|
6
|
+
padded: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: !0
|
|
9
|
+
},
|
|
10
|
+
gap: { default: "normal" },
|
|
11
|
+
width: { default: "full" }
|
|
12
|
+
},
|
|
13
|
+
setup(t) {
|
|
14
|
+
let a = {
|
|
15
|
+
small: "gap-3",
|
|
16
|
+
normal: "gap-5",
|
|
17
|
+
large: "gap-8"
|
|
18
|
+
}, o = {
|
|
19
|
+
full: "",
|
|
20
|
+
wide: "mx-auto max-w-7xl",
|
|
21
|
+
normal: "mx-auto max-w-5xl",
|
|
22
|
+
narrow: "mx-auto max-w-3xl"
|
|
23
|
+
};
|
|
24
|
+
return (s, c) => (r(), e("div", {
|
|
25
|
+
class: n(["flex w-full min-w-0 flex-col", [
|
|
26
|
+
a[t.gap],
|
|
27
|
+
o[t.width],
|
|
28
|
+
t.padded && "p-5"
|
|
29
|
+
]]),
|
|
30
|
+
"data-ac-ds": "",
|
|
31
|
+
"data-testid": "ac-page"
|
|
32
|
+
}, [i(s.$slots, "default")], 2));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { a as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** Total number of items across all pages. */
|
|
3
|
+
total: number;
|
|
4
|
+
/** Choices in the page-size select. */
|
|
5
|
+
pageSizes?: number[];
|
|
6
|
+
/** Hides the "Rows per page" select. */
|
|
7
|
+
hidePageSize?: boolean;
|
|
8
|
+
/** How many page numbers to show on each side of the current one before an ellipsis. */
|
|
9
|
+
siblings?: number;
|
|
10
|
+
/** Always use the compact "‹ 3 / 6 ›" control. It's used automatically below 640px. */
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
/** Noun after the count: "Showing 1–10 of 57 databases". */
|
|
13
|
+
itemLabel?: string;
|
|
14
|
+
/** Disables every control, e.g. while a page loads. */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** `small` makes the page buttons 28px (default `normal` is 32px). Use it inside cards and dense tables. */
|
|
17
|
+
size?: "normal" | "small";
|
|
18
|
+
}
|
|
19
|
+
type __VLS_Props = Props;
|
|
20
|
+
type __VLS_ModelProps = {
|
|
21
|
+
/** The current page, starting at 1. Bind with `v-model:page`. */
|
|
22
|
+
"page"?: number;
|
|
23
|
+
/** Items per page. Bind with `v-model:page-size`. */
|
|
24
|
+
"pageSize"?: number;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
27
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
range: (range: {
|
|
29
|
+
start: number;
|
|
30
|
+
end: number;
|
|
31
|
+
}) => any;
|
|
32
|
+
"update:page": (value: number) => any;
|
|
33
|
+
"update:pageSize": (value: number) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
35
|
+
onRange?: ((range: {
|
|
36
|
+
start: number;
|
|
37
|
+
end: number;
|
|
38
|
+
}) => any) | undefined;
|
|
39
|
+
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
40
|
+
"onUpdate:pageSize"?: ((value: number) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
size: "normal" | "small";
|
|
44
|
+
compact: boolean;
|
|
45
|
+
pageSizes: number[];
|
|
46
|
+
hidePageSize: boolean;
|
|
47
|
+
siblings: number;
|
|
48
|
+
itemLabel: string;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|