@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,84 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { Tone } from "./types";
|
|
3
|
+
export interface Props {
|
|
4
|
+
/** What the number measures, in sentence case: "Databases", "Data RPO". Also the card's accessible name when it's a link. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The number or short text to show. Format it yourself, e.g. `"1,284"` or `"41s"`. */
|
|
7
|
+
value?: string | number;
|
|
8
|
+
/** Unit or context after the value, e.g. `GiB` or `/ 1m target`. Old `suffix`. */
|
|
9
|
+
suffix?: string;
|
|
10
|
+
/** Change since a previous period. A number is shown as a signed percentage (`12` → `+12%`); pass a string for other units, e.g. `"+19s"`. */
|
|
11
|
+
delta?: string | number;
|
|
12
|
+
/** The period `delta` compares with, e.g. "vs last week". */
|
|
13
|
+
deltaLabel?: string;
|
|
14
|
+
/** Direction of `delta`. Worked out from its sign when not set; set it for text such as "2m margin". */
|
|
15
|
+
trend?: "up" | "down" | "flat";
|
|
16
|
+
/** A rise is bad, e.g. error rate, latency or cost, so up is shown in red and down in green. */
|
|
17
|
+
invertTrend?: boolean;
|
|
18
|
+
/** Colours the value, and tints the whole card for `warning` and `danger`. Old SummaryCard item `type`. */
|
|
19
|
+
status?: "default" | "success" | "info" | "warning" | "danger";
|
|
20
|
+
/** Recent values, oldest first, drawn as a small line next to the value. About 7 to 30 points. */
|
|
21
|
+
sparkline?: number[];
|
|
22
|
+
/** Adds a bar under the value, from 0 to 100. */
|
|
23
|
+
progress?: number;
|
|
24
|
+
/** Colour of the `progress` bar. `auto` turns it warning from 80 and danger from 95. */
|
|
25
|
+
progressColor?: Tone | "auto";
|
|
26
|
+
/** A Lucide icon shown in a tinted tile at the top right. Or use the `icon` slot. */
|
|
27
|
+
icon?: Component;
|
|
28
|
+
/** `small` for dense grids and summaries (14px value); `normal` for overview rows (24px value). */
|
|
29
|
+
size?: "small" | "normal";
|
|
30
|
+
/** Label on the left and value on the right, in one compact row. Replaces the old OverviewCard. */
|
|
31
|
+
inline?: boolean;
|
|
32
|
+
/** Sets the value in Geist Mono, for IDs, timestamps and durations. */
|
|
33
|
+
mono?: boolean;
|
|
34
|
+
/** Shows a placeholder bar instead of the value while it loads. */
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/** Makes the card a `RouterLink` to this route. Needs vue-router in the app; without it a string is used as `href`. */
|
|
37
|
+
to?: string | Record<string, unknown>;
|
|
38
|
+
/** Makes the card a plain link. */
|
|
39
|
+
href?: string;
|
|
40
|
+
/** Link target for `href`, e.g. `_blank`. */
|
|
41
|
+
target?: string;
|
|
42
|
+
}
|
|
43
|
+
type __VLS_Slots = {
|
|
44
|
+
/** Replaces the value, e.g. a status badge or two lines of text. */
|
|
45
|
+
default?: () => unknown;
|
|
46
|
+
/** A badge or tag at the top right, e.g. "Optimal". */
|
|
47
|
+
badge?: () => unknown;
|
|
48
|
+
/** Replaces the `icon` tile. */
|
|
49
|
+
icon?: () => unknown;
|
|
50
|
+
/** A row of small text under the value, after the delta. Old StatCard `footer`. */
|
|
51
|
+
footer?: () => unknown;
|
|
52
|
+
};
|
|
53
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
54
|
+
click: (e: MouseEvent) => any;
|
|
55
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
56
|
+
onClick?: ((e: MouseEvent) => any) | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
progress: number;
|
|
59
|
+
value: string | number;
|
|
60
|
+
icon: Component;
|
|
61
|
+
target: string;
|
|
62
|
+
href: string;
|
|
63
|
+
to: string | Record<string, unknown>;
|
|
64
|
+
size: "small" | "normal";
|
|
65
|
+
status: "default" | "success" | "info" | "warning" | "danger";
|
|
66
|
+
loading: boolean;
|
|
67
|
+
inline: boolean;
|
|
68
|
+
mono: boolean;
|
|
69
|
+
suffix: string;
|
|
70
|
+
delta: string | number;
|
|
71
|
+
deltaLabel: string;
|
|
72
|
+
trend: "up" | "down" | "flat";
|
|
73
|
+
invertTrend: boolean;
|
|
74
|
+
sparkline: number[];
|
|
75
|
+
progressColor: Tone | "auto";
|
|
76
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
77
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
78
|
+
declare const _default: typeof __VLS_export;
|
|
79
|
+
export default _default;
|
|
80
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
81
|
+
new (): {
|
|
82
|
+
$slots: S;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, getCurrentInstance as s, mergeProps as c, normalizeClass as l, normalizeStyle as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useId as g, withCtx as _ } from "vue";
|
|
2
|
+
import { ArrowDownRight as v, ArrowUpRight as y, Minus as b } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcStatCard.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var x = ["aria-busy"], ee = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "-mt-0.5 flex shrink-0 items-center gap-2"
|
|
7
|
+
}, te = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "inline-flex size-8 items-center justify-center rounded-8 bg-primary-95 text-primary-30 [&_svg]:size-4",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, ne = ["id"], S = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "min-w-0"
|
|
14
|
+
}, C = { class: "flex flex-wrap items-baseline gap-x-1.5 gap-y-0.5" }, w = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "text-base text-muted"
|
|
17
|
+
}, T = ["viewBox", "aria-label"], E = ["d"], D = ["d"], O = ["cx", "cy"], k = ["aria-labelledby", "aria-valuenow"], A = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1 text-xs text-muted"
|
|
20
|
+
}, j = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "inline-flex items-center gap-1"
|
|
23
|
+
}, M = { class: "sr-only" }, N = { key: 0 }, P = 88, F = 28, I = /*@__PURE__*/ o({
|
|
24
|
+
__name: "AcStatCard",
|
|
25
|
+
props: {
|
|
26
|
+
label: {},
|
|
27
|
+
value: { default: "" },
|
|
28
|
+
suffix: { default: "" },
|
|
29
|
+
delta: { default: void 0 },
|
|
30
|
+
deltaLabel: { default: "" },
|
|
31
|
+
trend: { default: void 0 },
|
|
32
|
+
invertTrend: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
status: { default: "default" },
|
|
37
|
+
sparkline: { default: () => [] },
|
|
38
|
+
progress: { default: void 0 },
|
|
39
|
+
progressColor: { default: "primary" },
|
|
40
|
+
icon: { default: void 0 },
|
|
41
|
+
size: { default: "normal" },
|
|
42
|
+
inline: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
mono: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
loading: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
to: { default: void 0 },
|
|
55
|
+
href: { default: void 0 },
|
|
56
|
+
target: { default: void 0 }
|
|
57
|
+
},
|
|
58
|
+
emits: ["click"],
|
|
59
|
+
setup(o, { emit: I }) {
|
|
60
|
+
let L = o, R = I, z = {
|
|
61
|
+
default: {
|
|
62
|
+
card: "border-border bg-surface",
|
|
63
|
+
value: "text-heading",
|
|
64
|
+
label: "text-muted"
|
|
65
|
+
},
|
|
66
|
+
success: {
|
|
67
|
+
card: "border-border bg-surface",
|
|
68
|
+
value: "text-green-30",
|
|
69
|
+
label: "text-muted"
|
|
70
|
+
},
|
|
71
|
+
info: {
|
|
72
|
+
card: "border-border bg-surface",
|
|
73
|
+
value: "text-blue-30",
|
|
74
|
+
label: "text-muted"
|
|
75
|
+
},
|
|
76
|
+
warning: {
|
|
77
|
+
card: "border-yellow-80 bg-yellow-97",
|
|
78
|
+
value: "text-yellow-20",
|
|
79
|
+
label: "text-yellow-20"
|
|
80
|
+
},
|
|
81
|
+
danger: {
|
|
82
|
+
card: "border-red-80 bg-red-97",
|
|
83
|
+
value: "text-red-30",
|
|
84
|
+
label: "text-red-30"
|
|
85
|
+
}
|
|
86
|
+
}, B = {
|
|
87
|
+
primary: "bg-primary",
|
|
88
|
+
info: "bg-info",
|
|
89
|
+
success: "bg-success",
|
|
90
|
+
warning: "bg-warning",
|
|
91
|
+
danger: "bg-danger"
|
|
92
|
+
}, V = s(), H = V?.appContext.components.RouterLink, U = g(), W = e(() => z[L.status]), G = e(() => {
|
|
93
|
+
if (L.trend) return L.trend;
|
|
94
|
+
if (L.delta === void 0 || L.delta === "") return;
|
|
95
|
+
if (typeof L.delta == "number") return L.delta > 0 ? "up" : L.delta < 0 ? "down" : "flat";
|
|
96
|
+
let e = L.delta.trim()[0];
|
|
97
|
+
return e === "+" ? "up" : e === "-" || e === "−" ? "down" : "flat";
|
|
98
|
+
}), K = e(() => typeof L.delta == "number" ? `${L.delta > 0 ? "+" : L.delta < 0 ? "−" : ""}${Math.abs(L.delta).toLocaleString(void 0, { maximumFractionDigits: 1 })}%` : L.delta ?? ""), q = e(() => G.value === "flat" || !G.value ? "text-muted" : G.value === "up" === L.invertTrend ? "text-red-30" : "text-green-30"), J = e(() => !!G.value && K.value !== ""), Y = e(() => Math.min(100, Math.max(0, L.progress ?? 0))), X = e(() => L.progressColor === "auto" ? Y.value >= 95 ? B.danger : Y.value >= 80 ? B.warning : B.primary : B[L.progressColor]), re = e(() => G.value === "up" ? y : G.value === "down" ? v : b), Z = e(() => {
|
|
99
|
+
let e = L.sparkline.filter((e) => Number.isFinite(e));
|
|
100
|
+
if (e.length < 2) return null;
|
|
101
|
+
let t = Math.min(...e), n = Math.max(...e), r = n - t || 1, i = e.map((n, i) => [i / (e.length - 1) * 82 + 3, 25 - (n - t) / r * 22]), a = i.map(([e, t], n) => `${n ? "L" : "M"}${e.toFixed(1)} ${t.toFixed(1)}`).join(" "), o = i[i.length - 1], s = (e) => e.toLocaleString(), c = `Trend over ${e.length} points: from ${s(e[0])} to ${s(e[e.length - 1])}, low ${s(t)}, high ${s(n)}`;
|
|
102
|
+
return {
|
|
103
|
+
line: a,
|
|
104
|
+
area: `${a} L${o[0].toFixed(1)} ${F} L3 ${F} Z`,
|
|
105
|
+
last: o,
|
|
106
|
+
summary: c
|
|
107
|
+
};
|
|
108
|
+
}), ie = e(() => L.inline || L.size === "small" ? "text-lg font-semibold" : "text-3xl font-semibold"), Q = e(() => {
|
|
109
|
+
if (L.to !== void 0 && H) return {
|
|
110
|
+
is: H,
|
|
111
|
+
to: L.to
|
|
112
|
+
};
|
|
113
|
+
let e = L.href ?? (typeof L.to == "string" ? L.to : void 0);
|
|
114
|
+
return e ? {
|
|
115
|
+
is: "a",
|
|
116
|
+
href: e,
|
|
117
|
+
target: L.target,
|
|
118
|
+
rel: L.target === "_blank" ? "noopener noreferrer" : void 0
|
|
119
|
+
} : null;
|
|
120
|
+
});
|
|
121
|
+
function $() {
|
|
122
|
+
return !Q.value && !!V?.vnode.props?.onClick;
|
|
123
|
+
}
|
|
124
|
+
function ae(e) {
|
|
125
|
+
R("click", e);
|
|
126
|
+
}
|
|
127
|
+
return (e, s) => (d(), r("div", {
|
|
128
|
+
class: l(["relative flex min-w-0 rounded-10 border shadow-xs transition-[border-color,box-shadow] duration-150 has-[[data-ac-card-link]:focus-visible]:ring-[3px] has-[[data-ac-card-link]:focus-visible]:ring-ring", [
|
|
129
|
+
W.value.card,
|
|
130
|
+
o.inline ? "items-center justify-between gap-3 px-4 py-2.5" : "flex-col gap-2",
|
|
131
|
+
!o.inline && (o.size === "small" ? "px-3.5 py-3" : "p-4"),
|
|
132
|
+
(Q.value || $()) && "hover:border-border-dark hover:shadow-sm"
|
|
133
|
+
]]),
|
|
134
|
+
"aria-busy": o.loading || void 0,
|
|
135
|
+
"data-ac-ds": "",
|
|
136
|
+
"data-testid": "ac-stat-card"
|
|
137
|
+
}, [
|
|
138
|
+
i("div", { class: l(["flex min-w-0 items-start justify-between gap-2", o.inline && "flex-1"]) }, [(d(), t(p(Q.value ? Q.value.is : $() ? "button" : "p"), c(Q.value ? {
|
|
139
|
+
...Q.value,
|
|
140
|
+
is: void 0
|
|
141
|
+
} : {}, {
|
|
142
|
+
id: `${h(U)}-label`,
|
|
143
|
+
type: $() ? "button" : void 0,
|
|
144
|
+
"aria-describedby": Q.value || $() ? `${h(U)}-value` : void 0,
|
|
145
|
+
"data-ac-card-link": Q.value || $() ? "" : void 0,
|
|
146
|
+
class: ["min-w-0 truncate text-left font-medium outline-none after:absolute after:inset-0 after:rounded-10", [
|
|
147
|
+
o.inline ? "text-base text-body" : o.size === "small" ? "text-sm tracking-wide uppercase" : "text-xs",
|
|
148
|
+
!o.inline && W.value.label,
|
|
149
|
+
(Q.value || $()) && "cursor-pointer"
|
|
150
|
+
]],
|
|
151
|
+
onClick: s[0] ||= (e) => Q.value || $() ? ae(e) : void 0
|
|
152
|
+
}), {
|
|
153
|
+
default: _(() => [a(m(o.label), 1)]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 16, [
|
|
156
|
+
"id",
|
|
157
|
+
"type",
|
|
158
|
+
"aria-describedby",
|
|
159
|
+
"data-ac-card-link",
|
|
160
|
+
"class"
|
|
161
|
+
])), !o.inline && (e.$slots.badge || e.$slots.icon || o.icon) ? (d(), r("div", ee, [f(e.$slots, "badge"), e.$slots.icon || o.icon ? (d(), r("span", te, [f(e.$slots, "icon", {}, () => [(d(), t(p(o.icon)))])])) : n("", !0)])) : n("", !0)], 2),
|
|
162
|
+
i("div", {
|
|
163
|
+
id: `${h(U)}-value`,
|
|
164
|
+
class: l(["flex min-w-0 items-end justify-between gap-3", o.inline ? "shrink-0" : "flex-1"])
|
|
165
|
+
}, [o.loading ? (d(), r("span", {
|
|
166
|
+
key: 0,
|
|
167
|
+
class: l(["ac-skeleton-bone block rounded-4", o.inline ? "h-4 w-12" : o.size === "small" ? "h-4 w-2/5" : "mt-1 h-6 w-1/2"])
|
|
168
|
+
}, null, 2)) : (d(), r("div", S, [f(e.$slots, "default", {}, () => [i("p", C, [i("span", { class: l(["min-w-0 break-words", [
|
|
169
|
+
ie.value,
|
|
170
|
+
W.value.value,
|
|
171
|
+
o.mono && "font-mono tracking-tight"
|
|
172
|
+
]]) }, m(o.value), 3), o.suffix ? (d(), r("span", w, m(o.suffix), 1)) : n("", !0)])])])), Z.value && !o.inline && !o.loading ? (d(), r("svg", {
|
|
173
|
+
key: 2,
|
|
174
|
+
width: P,
|
|
175
|
+
height: F,
|
|
176
|
+
viewBox: `0 0 ${P} ${F}`,
|
|
177
|
+
class: "mb-1 shrink-0 overflow-visible",
|
|
178
|
+
role: "img",
|
|
179
|
+
"aria-label": Z.value.summary
|
|
180
|
+
}, [
|
|
181
|
+
i("path", {
|
|
182
|
+
d: Z.value.area,
|
|
183
|
+
class: "fill-primary-97"
|
|
184
|
+
}, null, 8, E),
|
|
185
|
+
i("path", {
|
|
186
|
+
d: Z.value.line,
|
|
187
|
+
fill: "none",
|
|
188
|
+
class: "stroke-slate-60",
|
|
189
|
+
"stroke-width": "1.5",
|
|
190
|
+
"stroke-linecap": "round",
|
|
191
|
+
"stroke-linejoin": "round"
|
|
192
|
+
}, null, 8, D),
|
|
193
|
+
i("circle", {
|
|
194
|
+
cx: Z.value.last[0],
|
|
195
|
+
cy: Z.value.last[1],
|
|
196
|
+
r: "3",
|
|
197
|
+
class: "fill-primary stroke-surface",
|
|
198
|
+
"stroke-width": "1.5"
|
|
199
|
+
}, null, 8, O)
|
|
200
|
+
], 8, T)) : n("", !0)], 10, ne),
|
|
201
|
+
o.progress !== void 0 && !o.inline ? (d(), r("div", {
|
|
202
|
+
key: 0,
|
|
203
|
+
role: "progressbar",
|
|
204
|
+
"aria-labelledby": `${h(U)}-label`,
|
|
205
|
+
"aria-valuemin": "0",
|
|
206
|
+
"aria-valuemax": "100",
|
|
207
|
+
"aria-valuenow": Math.round(Y.value),
|
|
208
|
+
class: "h-1 w-full overflow-hidden rounded-full bg-slate-90"
|
|
209
|
+
}, [i("div", {
|
|
210
|
+
class: l(["h-full rounded-full transition-[width] duration-300 ease-out motion-reduce:transition-none", X.value]),
|
|
211
|
+
style: u({ width: `${Y.value}%` })
|
|
212
|
+
}, null, 6)], 8, k)) : n("", !0),
|
|
213
|
+
!o.inline && (J.value || e.$slots.footer) ? (d(), r("div", A, [J.value ? (d(), r("span", j, [i("span", { class: l(["inline-flex items-center gap-0.5 font-medium", q.value]) }, [
|
|
214
|
+
(d(), t(p(re.value), {
|
|
215
|
+
class: "size-3.5",
|
|
216
|
+
"aria-hidden": "true"
|
|
217
|
+
})),
|
|
218
|
+
i("span", M, m(G.value === "up" ? "Up" : G.value === "down" ? "Down" : "No change"), 1),
|
|
219
|
+
a(" " + m(K.value), 1)
|
|
220
|
+
], 2), o.deltaLabel ? (d(), r("span", N, m(o.deltaLabel), 1)) : n("", !0)])) : n("", !0), f(e.$slots, "footer")])) : n("", !0)
|
|
221
|
+
], 10, x));
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
//#endregion
|
|
225
|
+
export { I as default };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export type StatusBarStatus = "success" | "warning" | "danger" | "info" | "pending" | "neutral";
|
|
3
|
+
export interface StatusBarItem {
|
|
4
|
+
/** Unique key; falls back to the label. */
|
|
5
|
+
key?: string;
|
|
6
|
+
/** The name, e.g. `"Version"`. Shown muted before `value`, or on its own for a status such as `"TLS"`. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** The value, e.g. `"6.0.12"`. */
|
|
9
|
+
value?: string | number;
|
|
10
|
+
/** A Lucide icon component before the text. */
|
|
11
|
+
icon?: Component;
|
|
12
|
+
/** Colours the icon and picks a default one: check, warning, cross, info, spinner (`pending`) or minus. */
|
|
13
|
+
status?: StatusBarStatus;
|
|
14
|
+
/** Shows a status dot instead of an icon, e.g. for the connection. `pending` pulses. */
|
|
15
|
+
dot?: boolean;
|
|
16
|
+
/** A 0–100 usage meter after the text. It turns yellow at 75 and red at 90 unless `status` is set. */
|
|
17
|
+
meter?: number;
|
|
18
|
+
/** Which end of the bar the item sits at. */
|
|
19
|
+
align?: "left" | "right";
|
|
20
|
+
/** On narrow bars, `low` items hide first (under 768px), then `normal` ones (under 512px). `high` items always show. */
|
|
21
|
+
priority?: "high" | "normal" | "low";
|
|
22
|
+
/** Sets the value in the monospace font, for versions, names and IDs. */
|
|
23
|
+
mono?: boolean;
|
|
24
|
+
/** Shows only the icon; the label becomes the accessible name and hover title. */
|
|
25
|
+
iconOnly?: boolean;
|
|
26
|
+
/** Hover text. */
|
|
27
|
+
title?: string;
|
|
28
|
+
/** Route for `RouterLink` (needs vue-router in the app). */
|
|
29
|
+
to?: string | Record<string, unknown>;
|
|
30
|
+
/** Plain link. */
|
|
31
|
+
href?: string;
|
|
32
|
+
/** Makes the item a button. */
|
|
33
|
+
onClick?: (e: MouseEvent) => void;
|
|
34
|
+
/** Greys out an item that's a link or button. */
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface Props {
|
|
38
|
+
/** The items: `{ label?, value?, icon?, status?, dot?, meter?, align?, priority?, mono?, iconOnly?, to?, href?, onClick? }`. */
|
|
39
|
+
items?: StatusBarItem[];
|
|
40
|
+
/** Accessible name of the bar. */
|
|
41
|
+
label?: string;
|
|
42
|
+
/** Dark bar on `bg-sidebar` in both themes, like the old footer. Everything inside uses the dark tokens. */
|
|
43
|
+
dark?: boolean;
|
|
44
|
+
/** Sticks the bar to the bottom of its scroll area. */
|
|
45
|
+
sticky?: boolean;
|
|
46
|
+
}
|
|
47
|
+
type __VLS_Slots = {
|
|
48
|
+
/** Extra content at the left end, after the left items. */
|
|
49
|
+
left?: () => unknown;
|
|
50
|
+
/** Extra content at the right end, after the right items: a badge or small buttons. */
|
|
51
|
+
right?: () => unknown;
|
|
52
|
+
};
|
|
53
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
54
|
+
label: string;
|
|
55
|
+
dark: boolean;
|
|
56
|
+
items: StatusBarItem[];
|
|
57
|
+
sticky: boolean;
|
|
58
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
|
+
declare const _default: typeof __VLS_export;
|
|
61
|
+
export default _default;
|
|
62
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
63
|
+
new (): {
|
|
64
|
+
$slots: S;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import e from "./AcSpinner.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, getCurrentInstance as c, mergeProps as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, withCtx as _ } from "vue";
|
|
3
|
+
import { CircleCheck as v, CircleMinus as y, CircleX as b, Info as x, TriangleAlert as S } from "@lucide/vue";
|
|
4
|
+
//#region src/lib/components/AcStatusBar.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var C = ["aria-label"], w = { class: "flex h-7 items-center justify-between gap-4 px-2 @lg:px-3" }, T = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex h-6 min-w-0 flex-wrap items-center gap-x-1 overflow-hidden @lg:gap-x-2",
|
|
8
|
+
role: "list"
|
|
9
|
+
}, E = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "relative inline-flex size-2 shrink-0",
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}, D = ["aria-valuenow", "aria-label"], O = /*@__PURE__*/ s({
|
|
14
|
+
__name: "AcStatusBar",
|
|
15
|
+
props: {
|
|
16
|
+
items: { default: () => [] },
|
|
17
|
+
label: { default: "Status bar" },
|
|
18
|
+
dark: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
sticky: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(s) {
|
|
28
|
+
let O = s, k = {
|
|
29
|
+
success: v,
|
|
30
|
+
warning: S,
|
|
31
|
+
danger: b,
|
|
32
|
+
info: x,
|
|
33
|
+
neutral: y
|
|
34
|
+
}, A = {
|
|
35
|
+
success: "text-success",
|
|
36
|
+
warning: "text-warning",
|
|
37
|
+
danger: "text-danger",
|
|
38
|
+
info: "text-info",
|
|
39
|
+
pending: "text-muted",
|
|
40
|
+
neutral: "text-muted"
|
|
41
|
+
}, j = {
|
|
42
|
+
success: "bg-success",
|
|
43
|
+
warning: "bg-warning",
|
|
44
|
+
danger: "bg-danger",
|
|
45
|
+
info: "bg-info",
|
|
46
|
+
pending: "bg-warning",
|
|
47
|
+
neutral: "bg-slate-60"
|
|
48
|
+
}, M = {
|
|
49
|
+
success: "bg-success",
|
|
50
|
+
warning: "bg-warning",
|
|
51
|
+
danger: "bg-danger",
|
|
52
|
+
info: "bg-info",
|
|
53
|
+
pending: "bg-slate-60",
|
|
54
|
+
neutral: "bg-slate-60"
|
|
55
|
+
}, N = {
|
|
56
|
+
high: "",
|
|
57
|
+
normal: "@max-lg:hidden",
|
|
58
|
+
low: "@max-3xl:hidden"
|
|
59
|
+
}, P = c()?.appContext.components.RouterLink, F = n(() => O.items.filter((e) => e.align !== "right")), I = n(() => O.items.filter((e) => e.align === "right"));
|
|
60
|
+
function L(e, t) {
|
|
61
|
+
return e.key ?? `${e.label ?? ""}-${t}`;
|
|
62
|
+
}
|
|
63
|
+
function R(e) {
|
|
64
|
+
return e.to !== void 0 && P && !e.disabled ? P : e.href || typeof e.to == "string" ? "a" : e.onClick ? "button" : "span";
|
|
65
|
+
}
|
|
66
|
+
function z(e) {
|
|
67
|
+
return R(e) !== "span";
|
|
68
|
+
}
|
|
69
|
+
function B(e) {
|
|
70
|
+
let t = R(e), n = {
|
|
71
|
+
title: e.title ?? (e.iconOnly ? e.label : void 0),
|
|
72
|
+
"aria-label": e.iconOnly ? e.label : void 0
|
|
73
|
+
};
|
|
74
|
+
return t === P ? n.to = e.to : t === "a" ? e.disabled ? (n.role = "link", n["aria-disabled"] = "true") : n.href = e.href ?? e.to : t === "button" && (n.type = "button", n.disabled = e.disabled || void 0), n;
|
|
75
|
+
}
|
|
76
|
+
function V(e, t) {
|
|
77
|
+
if (e.disabled) {
|
|
78
|
+
t.preventDefault();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
e.onClick?.(t);
|
|
82
|
+
}
|
|
83
|
+
function H(e) {
|
|
84
|
+
if (e.status) return M[e.status];
|
|
85
|
+
let t = e.meter ?? 0;
|
|
86
|
+
return t >= 90 ? "bg-danger" : t >= 75 ? "bg-warning" : "bg-primary";
|
|
87
|
+
}
|
|
88
|
+
function U(e) {
|
|
89
|
+
return Math.min(100, Math.max(0, e));
|
|
90
|
+
}
|
|
91
|
+
return (n, c) => (f(), a("footer", {
|
|
92
|
+
"aria-label": s.label,
|
|
93
|
+
class: u(["@container z-10 w-full border-t", [s.dark ? "dark border-border-light bg-sidebar text-body" : "border-border-light bg-surface-muted text-body", s.sticky && "sticky bottom-0"]]),
|
|
94
|
+
"data-ac-ds": "",
|
|
95
|
+
"data-testid": "ac-status-bar"
|
|
96
|
+
}, [o("div", w, [(f(), a(t, null, p(["left", "right"], (s) => o("div", {
|
|
97
|
+
key: s,
|
|
98
|
+
class: u(["flex min-w-0 items-center gap-1", s === "left" ? "flex-1" : "shrink-0"])
|
|
99
|
+
}, [(s === "left" ? F.value : I.value).length ? (f(), a("ul", T, [(f(!0), a(t, null, p(s === "left" ? F.value : I.value, (n, s) => (f(), a("li", {
|
|
100
|
+
key: L(n, s),
|
|
101
|
+
class: u(["flex min-w-0 shrink-0 items-center", N[n.priority ?? "normal"]])
|
|
102
|
+
}, [(f(), r(h(R(n)), l({ ref_for: !0 }, B(n), {
|
|
103
|
+
class: ["inline-flex h-6 min-w-0 items-center gap-1.5 rounded-4 px-1.5 text-xs whitespace-nowrap no-underline", z(n) && (n.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring")],
|
|
104
|
+
onClick: (e) => z(n) && V(n, e)
|
|
105
|
+
}), {
|
|
106
|
+
default: _(() => [
|
|
107
|
+
n.dot ? (f(), a("span", E, [n.status === "pending" ? (f(), a("span", {
|
|
108
|
+
key: 0,
|
|
109
|
+
class: u(["absolute inset-0 rounded-full opacity-60 motion-safe:animate-ping", j.pending])
|
|
110
|
+
}, null, 2)) : i("", !0), o("span", { class: u(["relative size-2 rounded-full", j[n.status ?? "neutral"]]) }, null, 2)])) : n.status === "pending" && !n.icon ? (f(), r(e, {
|
|
111
|
+
key: 1,
|
|
112
|
+
size: "xs",
|
|
113
|
+
label: "",
|
|
114
|
+
class: "text-muted"
|
|
115
|
+
})) : n.icon || n.status ? (f(), r(h(n.icon ?? k[n.status]), {
|
|
116
|
+
key: 2,
|
|
117
|
+
class: u(["size-3.5 shrink-0", n.status ? A[n.status] : "text-muted"]),
|
|
118
|
+
"aria-hidden": "true"
|
|
119
|
+
}, null, 8, ["class"])) : i("", !0),
|
|
120
|
+
n.iconOnly ? i("", !0) : (f(), a(t, { key: 3 }, [n.label ? (f(), a("span", {
|
|
121
|
+
key: 0,
|
|
122
|
+
class: u(["shrink-0", n.value === void 0 ? "font-medium text-body" : "text-muted"])
|
|
123
|
+
}, g(n.label), 3)) : i("", !0), n.value === void 0 ? i("", !0) : (f(), a("span", {
|
|
124
|
+
key: 1,
|
|
125
|
+
class: u(["max-w-48 truncate font-medium text-heading", n.mono && "font-mono text-[length:calc(11.5px*var(--ac-scale))]"])
|
|
126
|
+
}, g(n.value), 3))], 64)),
|
|
127
|
+
n.meter === void 0 ? i("", !0) : (f(), a("span", {
|
|
128
|
+
key: 4,
|
|
129
|
+
role: "meter",
|
|
130
|
+
"aria-valuenow": U(n.meter),
|
|
131
|
+
"aria-valuemin": "0",
|
|
132
|
+
"aria-valuemax": "100",
|
|
133
|
+
"aria-label": n.label ? `${n.label} usage` : "Usage",
|
|
134
|
+
class: "h-1.5 w-8 shrink-0 overflow-hidden rounded-full bg-slate-80"
|
|
135
|
+
}, [o("span", {
|
|
136
|
+
class: u(["block h-full rounded-full", H(n)]),
|
|
137
|
+
style: d({ width: `${U(n.meter)}%` })
|
|
138
|
+
}, null, 6)], 8, D))
|
|
139
|
+
]),
|
|
140
|
+
_: 2
|
|
141
|
+
}, 1040, ["class", "onClick"]))], 2))), 128))])) : i("", !0), m(n.$slots, s)], 2)), 64))])], 10, C));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
//#endregion
|
|
145
|
+
export { O as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface SubStep {
|
|
2
|
+
/** Unique across all steps, e.g. `"credentials"` or `3`. */
|
|
3
|
+
id: number | string;
|
|
4
|
+
title: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Step {
|
|
7
|
+
id: number;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Smaller steps inside this one. Only the current step lists them, and only with `orientation="vertical"`. */
|
|
11
|
+
substeps?: SubStep[];
|
|
12
|
+
}
|
|
13
|
+
export interface Props {
|
|
14
|
+
/** The steps: `{ id, title, description? }`, with ids 1…n in order. */
|
|
15
|
+
options: Step[];
|
|
16
|
+
/** Id of the current step. Lower ids show a check mark. */
|
|
17
|
+
active: number;
|
|
18
|
+
/** `horizontal` fits a wizard's header. `vertical` fits a side panel and can list `substeps`. */
|
|
19
|
+
orientation?: "horizontal" | "vertical";
|
|
20
|
+
/** With `orientation="vertical"`, the id of the current sub-step of the current step. Earlier sub-steps show a check mark. */
|
|
21
|
+
activeSubstep?: number | string;
|
|
22
|
+
}
|
|
23
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
24
|
+
orientation: "horizontal" | "vertical";
|
|
25
|
+
activeSubstep: number | string;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, toDisplayString as l, unref as u } from "vue";
|
|
2
|
+
import { Check as d } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcSteps.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var f = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex w-full",
|
|
7
|
+
"data-ac-ds": "",
|
|
8
|
+
"data-testid": "ac-steps"
|
|
9
|
+
}, p = ["aria-current"], m = { key: 1 }, h = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "flex w-full flex-col",
|
|
12
|
+
"data-ac-ds": "",
|
|
13
|
+
"data-testid": "ac-steps"
|
|
14
|
+
}, g = ["aria-current"], _ = { key: 1 }, v = { class: "min-w-0 flex-1 pt-1" }, y = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "mt-2 space-y-0.5 border-l border-dashed border-border-dark pl-3",
|
|
17
|
+
"data-testid": "ac-steps-substeps"
|
|
18
|
+
}, b = ["aria-current"], x = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "size-1.5 rounded-full bg-primary"
|
|
21
|
+
}, S = /*@__PURE__*/ a({
|
|
22
|
+
__name: "AcSteps",
|
|
23
|
+
props: {
|
|
24
|
+
options: {},
|
|
25
|
+
active: {},
|
|
26
|
+
orientation: { default: "horizontal" },
|
|
27
|
+
activeSubstep: { default: void 0 }
|
|
28
|
+
},
|
|
29
|
+
setup(a) {
|
|
30
|
+
let S = a, C = (e) => S.activeSubstep === void 0 ? -1 : (e.substeps ?? []).findIndex((e) => e.id === S.activeSubstep);
|
|
31
|
+
return (S, w) => a.orientation === "horizontal" ? (s(), r("ol", f, [(s(!0), r(e, null, c(a.options, (e, c) => (s(), r("li", {
|
|
32
|
+
key: e.id,
|
|
33
|
+
class: "relative flex flex-1 flex-col items-center px-2 text-center",
|
|
34
|
+
"aria-current": a.active === e.id ? "step" : void 0
|
|
35
|
+
}, [
|
|
36
|
+
c < a.options.length - 1 ? (s(), r("span", {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: o(["absolute top-3.5 left-[calc(50%+22px)] h-0.5 w-[calc(100%-44px)] -translate-y-1/2 rounded-full transition-colors duration-300", a.active > e.id ? "bg-primary" : "bg-border"]),
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, null, 2)) : n("", !0),
|
|
41
|
+
i("span", { class: o(["relative inline-flex size-7 items-center justify-center rounded-full text-xs font-semibold tabular-nums transition-all duration-200", a.active > e.id ? "bg-primary text-white shadow-button" : a.active === e.id ? "bg-surface text-primary-20 ring-2 ring-primary shadow-[0_0_0_5px_var(--color-ring)]" : "bg-surface text-muted ring-1 ring-border-dark"]) }, [a.active > e.id ? (s(), t(u(d), {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "size-3.5",
|
|
44
|
+
"stroke-width": 2.5,
|
|
45
|
+
"aria-hidden": "true"
|
|
46
|
+
})) : (s(), r("span", m, l(e.id), 1))], 2),
|
|
47
|
+
i("p", { class: o(["mt-3 text-base font-medium", a.active >= e.id ? "text-heading" : "text-muted"]) }, l(e.title), 3),
|
|
48
|
+
e.description ? (s(), r("p", {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: o(["mt-0.5 text-xs", a.active >= e.id ? "text-label" : "text-muted"])
|
|
51
|
+
}, l(e.description), 3)) : n("", !0)
|
|
52
|
+
], 8, p))), 128))])) : (s(), r("ol", h, [(s(!0), r(e, null, c(a.options, (f, p) => (s(), r("li", {
|
|
53
|
+
key: f.id,
|
|
54
|
+
class: "relative flex gap-3 pb-6 last:pb-0",
|
|
55
|
+
"aria-current": a.active === f.id ? "step" : void 0
|
|
56
|
+
}, [
|
|
57
|
+
p < a.options.length - 1 ? (s(), r("span", {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: o(["absolute top-9 bottom-1 left-3.5 w-0.5 -translate-x-1/2 rounded-full transition-colors duration-300", a.active > f.id ? "bg-primary" : "bg-border"]),
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
}, null, 2)) : n("", !0),
|
|
62
|
+
i("span", { class: o(["relative inline-flex size-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold tabular-nums transition-all duration-200", a.active > f.id ? "bg-primary text-white shadow-button" : a.active === f.id ? "bg-surface text-primary-20 ring-2 ring-primary shadow-[0_0_0_5px_var(--color-ring)]" : "bg-surface text-muted ring-1 ring-border-dark"]) }, [a.active > f.id ? (s(), t(u(d), {
|
|
63
|
+
key: 0,
|
|
64
|
+
class: "size-3.5",
|
|
65
|
+
"stroke-width": 2.5,
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
})) : (s(), r("span", _, l(f.id), 1))], 2),
|
|
68
|
+
i("div", v, [
|
|
69
|
+
i("p", { class: o(["text-base font-medium", a.active >= f.id ? "text-heading" : "text-muted"]) }, l(f.title), 3),
|
|
70
|
+
f.description ? (s(), r("p", {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: o(["mt-0.5 text-xs", a.active >= f.id ? "text-label" : "text-muted"])
|
|
73
|
+
}, l(f.description), 3)) : n("", !0),
|
|
74
|
+
f.substeps?.length && a.active === f.id ? (s(), r("ul", y, [(s(!0), r(e, null, c(f.substeps, (e, c) => (s(), r("li", {
|
|
75
|
+
key: e.id,
|
|
76
|
+
class: "flex items-center gap-2 py-1",
|
|
77
|
+
"aria-current": e.id === a.activeSubstep ? "step" : void 0
|
|
78
|
+
}, [i("span", {
|
|
79
|
+
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < C(f) ? "bg-primary text-white" : c === C(f) ? "bg-surface text-primary ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
}, [c < C(f) ? (s(), t(u(d), {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: "size-3",
|
|
84
|
+
"stroke-width": 3
|
|
85
|
+
})) : c === C(f) ? (s(), r("span", x)) : n("", !0)], 2), i("span", { class: o(["min-w-0 truncate text-base", c < C(f) ? "text-label" : c === C(f) ? "font-medium text-heading" : "text-muted"]) }, l(e.title), 3)], 8, b))), 128))])) : n("", !0)
|
|
86
|
+
])
|
|
87
|
+
], 8, g))), 128))]));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
//#endregion
|
|
91
|
+
export { S as default };
|