@ac-design/design-system 1.0.3 → 2.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 +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +69 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/lib/charts/index.d.ts +7 -0
- package/dist/lib/charts/index.js +5 -0
- package/dist/lib/charts/shared.d.ts +60 -0
- package/dist/lib/charts/shared.js +114 -0
- package/dist/lib/charts/xy.d.ts +65 -0
- package/dist/lib/charts/xy.js +92 -0
- package/dist/lib/compat.css +1707 -1042
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +19 -25
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +44 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +215 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcBadge.vue.d.ts +16 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +59 -43
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +43 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +43 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +3 -3
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +42 -34
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +10 -2
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +37 -11
- package/dist/lib/components/AcCellValue.vue.d.ts +4 -1
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +214 -179
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +126 -29
- package/dist/lib/components/AcCheckRadio.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +33 -21
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +54 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +5 -5
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +204 -213
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +37 -46
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +73 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +210 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +14 -13
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +2 -2
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +7 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcHeader.vue.d.ts +3 -3
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +3 -3
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +98 -87
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +38 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +46 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +26 -26
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +20 -3
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +81 -53
- package/dist/lib/components/AcPreloader.vue.d.ts +1 -1
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcProgress.vue.d.ts +2 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcResourceCard.vue.d.ts +2 -2
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +4 -4
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +230 -227
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +31 -31
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +3 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +75 -75
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +87 -87
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +291 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +3 -3
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +89 -64
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +463 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +65 -71
- package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +77 -67
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +111 -103
- package/dist/lib/components/index.d.ts +14 -2
- package/dist/lib/components/status.d.ts +26 -0
- package/dist/lib/components/status.js +110 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/index.js +95 -78
- package/dist/lib/theme.css +391 -272
- package/package.json +11 -4
|
@@ -1,26 +1,22 @@
|
|
|
1
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
2
|
import { ArrowDownRight as v, ArrowUpRight as y, Minus as b } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcStatCard.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var x = ["aria-busy"],
|
|
4
|
+
var x = ["aria-busy"], S = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "-mt-0.5 flex shrink-0 items-center gap-2"
|
|
7
|
-
},
|
|
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 = {
|
|
7
|
+
}, C = ["id"], w = {
|
|
12
8
|
key: 1,
|
|
13
9
|
class: "min-w-0"
|
|
14
|
-
},
|
|
10
|
+
}, T = { class: "flex flex-wrap items-baseline gap-x-1.5 gap-y-0.5" }, E = {
|
|
15
11
|
key: 0,
|
|
16
|
-
class: "text-
|
|
17
|
-
},
|
|
12
|
+
class: "text-xs font-medium text-muted"
|
|
13
|
+
}, D = ["viewBox", "aria-label"], O = ["d"], ee = ["d"], te = ["cx", "cy"], ne = ["aria-labelledby", "aria-valuenow"], k = {
|
|
18
14
|
key: 1,
|
|
19
|
-
class: "flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1 text-
|
|
20
|
-
},
|
|
15
|
+
class: "flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1 text-sm text-muted"
|
|
16
|
+
}, A = {
|
|
21
17
|
key: 0,
|
|
22
|
-
class: "inline-flex items-center gap-1"
|
|
23
|
-
},
|
|
18
|
+
class: "inline-flex items-center gap-1.5"
|
|
19
|
+
}, j = { class: "sr-only" }, M = { key: 0 }, N = 88, P = 28, F = /*@__PURE__*/ o({
|
|
24
20
|
__name: "AcStatCard",
|
|
25
21
|
props: {
|
|
26
22
|
label: {},
|
|
@@ -56,80 +52,85 @@ var x = ["aria-busy"], ee = {
|
|
|
56
52
|
target: { default: void 0 }
|
|
57
53
|
},
|
|
58
54
|
emits: ["click"],
|
|
59
|
-
setup(o, { emit:
|
|
60
|
-
let
|
|
55
|
+
setup(o, { emit: F }) {
|
|
56
|
+
let I = o, L = F, R = {
|
|
61
57
|
default: {
|
|
62
58
|
card: "border-border bg-surface",
|
|
63
59
|
value: "text-heading",
|
|
64
|
-
label: "text-muted"
|
|
60
|
+
label: "text-muted",
|
|
61
|
+
tile: "bg-primary/10 text-primary-strong ring-primary/20"
|
|
65
62
|
},
|
|
66
63
|
success: {
|
|
67
64
|
card: "border-border bg-surface",
|
|
68
|
-
value: "text-
|
|
69
|
-
label: "text-muted"
|
|
65
|
+
value: "text-success-strong",
|
|
66
|
+
label: "text-muted",
|
|
67
|
+
tile: "bg-success/10 text-success-strong ring-success/20"
|
|
70
68
|
},
|
|
71
69
|
info: {
|
|
72
70
|
card: "border-border bg-surface",
|
|
73
|
-
value: "text-
|
|
74
|
-
label: "text-muted"
|
|
71
|
+
value: "text-info-strong",
|
|
72
|
+
label: "text-muted",
|
|
73
|
+
tile: "bg-info/10 text-info-strong ring-info/20"
|
|
75
74
|
},
|
|
76
75
|
warning: {
|
|
77
|
-
card: "border-
|
|
78
|
-
value: "text-
|
|
79
|
-
label: "text-
|
|
76
|
+
card: "border-warning/30 bg-warning/5",
|
|
77
|
+
value: "text-warning-strong",
|
|
78
|
+
label: "text-warning-strong",
|
|
79
|
+
tile: "bg-warning/10 text-warning-strong ring-warning/25"
|
|
80
80
|
},
|
|
81
81
|
danger: {
|
|
82
|
-
card: "border-
|
|
83
|
-
value: "text-
|
|
84
|
-
label: "text-
|
|
82
|
+
card: "border-danger/25 bg-danger/5",
|
|
83
|
+
value: "text-danger-strong",
|
|
84
|
+
label: "text-danger-strong",
|
|
85
|
+
tile: "bg-danger/10 text-danger-strong ring-danger/20"
|
|
85
86
|
}
|
|
86
|
-
},
|
|
87
|
+
}, z = {
|
|
87
88
|
primary: "bg-primary",
|
|
88
89
|
info: "bg-info",
|
|
89
90
|
success: "bg-success",
|
|
90
91
|
warning: "bg-warning",
|
|
91
92
|
danger: "bg-danger"
|
|
92
|
-
},
|
|
93
|
-
if (
|
|
94
|
-
if (
|
|
95
|
-
if (typeof
|
|
96
|
-
let e =
|
|
93
|
+
}, B = s(), V = B?.appContext.components.RouterLink, H = g(), U = e(() => R[I.status]), W = e(() => {
|
|
94
|
+
if (I.trend) return I.trend;
|
|
95
|
+
if (I.delta === void 0 || I.delta === "") return;
|
|
96
|
+
if (typeof I.delta == "number") return I.delta > 0 ? "up" : I.delta < 0 ? "down" : "flat";
|
|
97
|
+
let e = I.delta.trim()[0];
|
|
97
98
|
return e === "+" ? "up" : e === "-" || e === "−" ? "down" : "flat";
|
|
98
|
-
}),
|
|
99
|
-
let e =
|
|
99
|
+
}), G = e(() => typeof I.delta == "number" ? `${I.delta > 0 ? "+" : I.delta < 0 ? "−" : ""}${Math.abs(I.delta).toLocaleString(void 0, { maximumFractionDigits: 1 })}%` : I.delta ?? ""), K = e(() => W.value === "flat" || !W.value ? "bg-surface-sunken text-muted" : W.value === "up" === I.invertTrend ? "bg-danger/10 text-danger-strong" : "bg-success/10 text-success-strong"), q = e(() => !!W.value && G.value !== ""), J = e(() => Math.min(100, Math.max(0, I.progress ?? 0))), Y = e(() => I.progressColor === "auto" ? J.value >= 95 ? z.danger : J.value >= 80 ? z.warning : z.primary : z[I.progressColor]), X = e(() => W.value === "up" ? y : W.value === "down" ? v : b), Z = e(() => {
|
|
100
|
+
let e = I.sparkline.filter((e) => Number.isFinite(e));
|
|
100
101
|
if (e.length < 2) return null;
|
|
101
102
|
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
103
|
return {
|
|
103
104
|
line: a,
|
|
104
|
-
area: `${a} L${o[0].toFixed(1)} ${
|
|
105
|
+
area: `${a} L${o[0].toFixed(1)} ${P} L3 ${P} Z`,
|
|
105
106
|
last: o,
|
|
106
107
|
summary: c
|
|
107
108
|
};
|
|
108
|
-
}),
|
|
109
|
-
if (
|
|
110
|
-
is:
|
|
111
|
-
to:
|
|
109
|
+
}), re = e(() => I.inline || I.size === "small" ? "text-lg font-semibold tabular-nums" : "text-3xl font-bold tracking-tight tabular-nums"), Q = e(() => {
|
|
110
|
+
if (I.to !== void 0 && V) return {
|
|
111
|
+
is: V,
|
|
112
|
+
to: I.to
|
|
112
113
|
};
|
|
113
|
-
let e =
|
|
114
|
+
let e = I.href ?? (typeof I.to == "string" ? I.to : void 0);
|
|
114
115
|
return e ? {
|
|
115
116
|
is: "a",
|
|
116
117
|
href: e,
|
|
117
|
-
target:
|
|
118
|
-
rel:
|
|
118
|
+
target: I.target,
|
|
119
|
+
rel: I.target === "_blank" ? "noopener noreferrer" : void 0
|
|
119
120
|
} : null;
|
|
120
121
|
});
|
|
121
122
|
function $() {
|
|
122
|
-
return !Q.value && !!
|
|
123
|
+
return !Q.value && !!B?.vnode.props?.onClick;
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
125
|
+
function ie(e) {
|
|
126
|
+
L("click", e);
|
|
126
127
|
}
|
|
127
128
|
return (e, s) => (d(), r("div", {
|
|
128
|
-
class: l(["relative flex min-w-0 rounded-
|
|
129
|
-
|
|
130
|
-
o.inline ? "items-center justify-between gap-3 px-4 py-
|
|
131
|
-
!o.inline && (o.size === "small" ? "px-
|
|
132
|
-
(Q.value || $()) && "hover:border-
|
|
129
|
+
class: l(["relative flex min-w-0 rounded-14 border transition-[background-color,border-color,box-shadow,translate] duration-200 has-[[data-ac-card-link]:focus-visible]:ring-2 has-[[data-ac-card-link]:focus-visible]:ring-ring has-[[data-ac-card-link]:focus-visible]:ring-offset-2 has-[[data-ac-card-link]:focus-visible]:ring-offset-surface motion-reduce:transition-none", [
|
|
130
|
+
U.value.card,
|
|
131
|
+
o.inline ? "items-center justify-between gap-3 px-4 py-3" : "flex-col gap-2",
|
|
132
|
+
!o.inline && (o.size === "small" ? "px-4 py-3.5" : "p-5"),
|
|
133
|
+
(Q.value || $()) && "hover:-translate-y-0.5 hover:border-primary/30 hover:bg-accent-hover/60 hover:shadow-card motion-reduce:hover:translate-y-0"
|
|
133
134
|
]]),
|
|
134
135
|
"aria-busy": o.loading || void 0,
|
|
135
136
|
"data-ac-ds": "",
|
|
@@ -139,16 +140,16 @@ var x = ["aria-busy"], ee = {
|
|
|
139
140
|
...Q.value,
|
|
140
141
|
is: void 0
|
|
141
142
|
} : {}, {
|
|
142
|
-
id: `${h(
|
|
143
|
+
id: `${h(H)}-label`,
|
|
143
144
|
type: $() ? "button" : void 0,
|
|
144
|
-
"aria-describedby": Q.value || $() ? `${h(
|
|
145
|
+
"aria-describedby": Q.value || $() ? `${h(H)}-value` : void 0,
|
|
145
146
|
"data-ac-card-link": Q.value || $() ? "" : void 0,
|
|
146
|
-
class: ["min-w-0 truncate text-left
|
|
147
|
-
o.inline ? "text-base text-body" : o.size === "small" ? "text-sm
|
|
148
|
-
!o.inline &&
|
|
147
|
+
class: ["min-w-0 truncate text-left outline-none after:absolute after:inset-0 after:rounded-14", [
|
|
148
|
+
o.inline ? "text-base font-medium text-body" : ["font-semibold tracking-wide uppercase", o.size === "small" ? "text-sm" : "text-xs"],
|
|
149
|
+
!o.inline && U.value.label,
|
|
149
150
|
(Q.value || $()) && "cursor-pointer"
|
|
150
151
|
]],
|
|
151
|
-
onClick: s[0] ||= (e) => Q.value || $() ?
|
|
152
|
+
onClick: s[0] ||= (e) => Q.value || $() ? ie(e) : void 0
|
|
152
153
|
}), {
|
|
153
154
|
default: _(() => [a(m(o.label), 1)]),
|
|
154
155
|
_: 1
|
|
@@ -158,68 +159,72 @@ var x = ["aria-busy"], ee = {
|
|
|
158
159
|
"aria-describedby",
|
|
159
160
|
"data-ac-card-link",
|
|
160
161
|
"class"
|
|
161
|
-
])), !o.inline && (e.$slots.badge || e.$slots.icon || o.icon) ? (d(), r("div",
|
|
162
|
+
])), !o.inline && (e.$slots.badge || e.$slots.icon || o.icon) ? (d(), r("div", S, [f(e.$slots, "badge"), e.$slots.icon || o.icon ? (d(), r("span", {
|
|
163
|
+
key: 0,
|
|
164
|
+
class: l(["inline-flex items-center justify-center rounded-full ring-1 ring-inset [&_svg]:size-4", [U.value.tile, o.size === "small" ? "size-8" : "size-9"]]),
|
|
165
|
+
"aria-hidden": "true"
|
|
166
|
+
}, [f(e.$slots, "icon", {}, () => [(d(), t(p(o.icon)))])], 2)) : n("", !0)])) : n("", !0)], 2),
|
|
162
167
|
i("div", {
|
|
163
|
-
id: `${h(
|
|
168
|
+
id: `${h(H)}-value`,
|
|
164
169
|
class: l(["flex min-w-0 items-end justify-between gap-3", o.inline ? "shrink-0" : "flex-1"])
|
|
165
170
|
}, [o.loading ? (d(), r("span", {
|
|
166
171
|
key: 0,
|
|
167
|
-
class: l(["ac-skeleton-bone block rounded-
|
|
168
|
-
}, null, 2)) : (d(), r("div",
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
class: l(["ac-skeleton-bone block rounded-6", o.inline ? "h-4 w-12" : o.size === "small" ? "h-4 w-2/5" : "mt-1 h-7 w-1/2"])
|
|
173
|
+
}, null, 2)) : (d(), r("div", w, [f(e.$slots, "default", {}, () => [i("p", T, [i("span", { class: l(["min-w-0 break-words", [
|
|
174
|
+
re.value,
|
|
175
|
+
U.value.value,
|
|
171
176
|
o.mono && "font-mono tracking-tight"
|
|
172
|
-
]]) }, m(o.value), 3), o.suffix ? (d(), r("span",
|
|
177
|
+
]]) }, m(o.value), 3), o.suffix ? (d(), r("span", E, m(o.suffix), 1)) : n("", !0)])])])), Z.value && !o.inline && !o.loading ? (d(), r("svg", {
|
|
173
178
|
key: 2,
|
|
174
|
-
width:
|
|
175
|
-
height:
|
|
176
|
-
viewBox: `0 0 ${
|
|
179
|
+
width: N,
|
|
180
|
+
height: P,
|
|
181
|
+
viewBox: `0 0 ${N} ${P}`,
|
|
177
182
|
class: "mb-1 shrink-0 overflow-visible",
|
|
178
183
|
role: "img",
|
|
179
184
|
"aria-label": Z.value.summary
|
|
180
185
|
}, [
|
|
181
186
|
i("path", {
|
|
182
187
|
d: Z.value.area,
|
|
183
|
-
class: "fill-primary
|
|
184
|
-
}, null, 8,
|
|
188
|
+
class: "fill-primary/10"
|
|
189
|
+
}, null, 8, O),
|
|
185
190
|
i("path", {
|
|
186
191
|
d: Z.value.line,
|
|
187
192
|
fill: "none",
|
|
188
|
-
class: "stroke-
|
|
193
|
+
class: "stroke-primary",
|
|
189
194
|
"stroke-width": "1.5",
|
|
190
195
|
"stroke-linecap": "round",
|
|
191
196
|
"stroke-linejoin": "round"
|
|
192
|
-
}, null, 8,
|
|
197
|
+
}, null, 8, ee),
|
|
193
198
|
i("circle", {
|
|
194
199
|
cx: Z.value.last[0],
|
|
195
200
|
cy: Z.value.last[1],
|
|
196
201
|
r: "3",
|
|
197
202
|
class: "fill-primary stroke-surface",
|
|
198
203
|
"stroke-width": "1.5"
|
|
199
|
-
}, null, 8,
|
|
200
|
-
], 8,
|
|
204
|
+
}, null, 8, te)
|
|
205
|
+
], 8, D)) : n("", !0)], 10, C),
|
|
201
206
|
o.progress !== void 0 && !o.inline ? (d(), r("div", {
|
|
202
207
|
key: 0,
|
|
203
208
|
role: "progressbar",
|
|
204
|
-
"aria-labelledby": `${h(
|
|
209
|
+
"aria-labelledby": `${h(H)}-label`,
|
|
205
210
|
"aria-valuemin": "0",
|
|
206
211
|
"aria-valuemax": "100",
|
|
207
|
-
"aria-valuenow": Math.round(
|
|
208
|
-
class: "h-1 w-full overflow-hidden rounded-full bg-
|
|
212
|
+
"aria-valuenow": Math.round(J.value),
|
|
213
|
+
class: "h-1 w-full overflow-hidden rounded-full bg-surface-sunken"
|
|
209
214
|
}, [i("div", {
|
|
210
|
-
class: l(["h-full rounded-full transition-[width] duration-
|
|
211
|
-
style: u({ width: `${
|
|
212
|
-
}, null, 6)], 8,
|
|
213
|
-
!o.inline && (
|
|
214
|
-
(d(), t(p(
|
|
215
|
-
class: "size-3
|
|
215
|
+
class: l(["h-full rounded-full transition-[width] duration-700 ease-out motion-reduce:transition-none", Y.value]),
|
|
216
|
+
style: u({ width: `${J.value}%` })
|
|
217
|
+
}, null, 6)], 8, ne)) : n("", !0),
|
|
218
|
+
!o.inline && (q.value || e.$slots.footer) ? (d(), r("div", k, [q.value ? (d(), r("span", A, [i("span", { class: l(["inline-flex items-center gap-0.5 rounded-full px-2 py-0.5 text-sm font-semibold tabular-nums", K.value]) }, [
|
|
219
|
+
(d(), t(p(X.value), {
|
|
220
|
+
class: "size-3",
|
|
216
221
|
"aria-hidden": "true"
|
|
217
222
|
})),
|
|
218
|
-
i("span",
|
|
219
|
-
a(" " + m(
|
|
220
|
-
], 2), o.deltaLabel ? (d(), r("span",
|
|
223
|
+
i("span", j, m(W.value === "up" ? "Up" : W.value === "down" ? "Down" : "No change"), 1),
|
|
224
|
+
a(" " + m(G.value), 1)
|
|
225
|
+
], 2), o.deltaLabel ? (d(), r("span", M, m(o.deltaLabel), 1)) : n("", !0)])) : n("", !0), f(e.$slots, "footer")])) : n("", !0)
|
|
221
226
|
], 10, x));
|
|
222
227
|
}
|
|
223
228
|
});
|
|
224
229
|
//#endregion
|
|
225
|
-
export {
|
|
230
|
+
export { F as default };
|
|
@@ -39,7 +39,7 @@ export interface Props {
|
|
|
39
39
|
items?: StatusBarItem[];
|
|
40
40
|
/** Accessible name of the bar. */
|
|
41
41
|
label?: string;
|
|
42
|
-
/** Dark bar on `bg-sidebar` in both themes,
|
|
42
|
+
/** Dark bar on `bg-sidebar` (#171717) in both themes, to sit under a `dark` sidebar. Everything inside uses the dark tokens. */
|
|
43
43
|
dark?: boolean;
|
|
44
44
|
/** Sticks the bar to the bottom of its scroll area. */
|
|
45
45
|
sticky?: boolean;
|
|
@@ -44,14 +44,14 @@ var C = ["aria-label"], w = { class: "flex h-7 items-center justify-between gap-
|
|
|
44
44
|
danger: "bg-danger",
|
|
45
45
|
info: "bg-info",
|
|
46
46
|
pending: "bg-warning",
|
|
47
|
-
neutral: "bg-
|
|
47
|
+
neutral: "bg-muted/60"
|
|
48
48
|
}, M = {
|
|
49
49
|
success: "bg-success",
|
|
50
50
|
warning: "bg-warning",
|
|
51
51
|
danger: "bg-danger",
|
|
52
52
|
info: "bg-info",
|
|
53
|
-
pending: "bg-
|
|
54
|
-
neutral: "bg-
|
|
53
|
+
pending: "bg-muted/60",
|
|
54
|
+
neutral: "bg-muted/60"
|
|
55
55
|
}, N = {
|
|
56
56
|
high: "",
|
|
57
57
|
normal: "@max-lg:hidden",
|
|
@@ -90,7 +90,7 @@ var C = ["aria-label"], w = { class: "flex h-7 items-center justify-between gap-
|
|
|
90
90
|
}
|
|
91
91
|
return (n, c) => (f(), a("footer", {
|
|
92
92
|
"aria-label": s.label,
|
|
93
|
-
class: u(["@container z-10 w-full border-t", [s.dark ? "dark border-border
|
|
93
|
+
class: u(["@container z-10 w-full border-t", [s.dark ? "dark border-border bg-sidebar text-body" : "border-border bg-surface-muted text-body", s.sticky && "sticky bottom-0"]]),
|
|
94
94
|
"data-ac-ds": "",
|
|
95
95
|
"data-testid": "ac-status-bar"
|
|
96
96
|
}, [o("div", w, [(f(), a(t, null, p(["left", "right"], (s) => o("div", {
|
|
@@ -100,7 +100,7 @@ var C = ["aria-label"], w = { class: "flex h-7 items-center justify-between gap-
|
|
|
100
100
|
key: L(n, s),
|
|
101
101
|
class: u(["flex min-w-0 shrink-0 items-center", N[n.priority ?? "normal"]])
|
|
102
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-
|
|
103
|
+
class: ["inline-flex h-6 min-w-0 items-center gap-1.5 rounded-6 px-1.5 text-xs whitespace-nowrap no-underline", z(n) && (n.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset")],
|
|
104
104
|
onClick: (e) => z(n) && V(n, e)
|
|
105
105
|
}), {
|
|
106
106
|
default: _(() => [
|
|
@@ -131,7 +131,7 @@ var C = ["aria-label"], w = { class: "flex h-7 items-center justify-between gap-
|
|
|
131
131
|
"aria-valuemin": "0",
|
|
132
132
|
"aria-valuemax": "100",
|
|
133
133
|
"aria-label": n.label ? `${n.label} usage` : "Usage",
|
|
134
|
-
class: "h-1.5 w-8 shrink-0 overflow-hidden rounded-full bg-
|
|
134
|
+
class: "h-1.5 w-8 shrink-0 overflow-hidden rounded-full bg-border-dark"
|
|
135
135
|
}, [o("span", {
|
|
136
136
|
class: u(["block h-full rounded-full", H(n)]),
|
|
137
137
|
style: d({ width: `${U(n.meter)}%` })
|
|
@@ -7,18 +7,24 @@ var f = {
|
|
|
7
7
|
"data-ac-ds": "",
|
|
8
8
|
"data-testid": "ac-steps"
|
|
9
9
|
}, p = ["aria-current"], m = { key: 1 }, h = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "mt-0.5 text-xs text-muted"
|
|
12
|
+
}, g = {
|
|
10
13
|
key: 1,
|
|
11
14
|
class: "flex w-full flex-col",
|
|
12
15
|
"data-ac-ds": "",
|
|
13
16
|
"data-testid": "ac-steps"
|
|
14
|
-
},
|
|
17
|
+
}, _ = ["aria-current"], v = { key: 1 }, y = { class: "min-w-0 flex-1 pt-1.5" }, b = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "mt-0.5 text-xs text-muted"
|
|
20
|
+
}, x = {
|
|
15
21
|
key: 1,
|
|
16
22
|
class: "mt-2 space-y-0.5 border-l border-dashed border-border-dark pl-3",
|
|
17
23
|
"data-testid": "ac-steps-substeps"
|
|
18
|
-
},
|
|
24
|
+
}, S = ["aria-current"], C = {
|
|
19
25
|
key: 1,
|
|
20
26
|
class: "size-1.5 rounded-full bg-primary"
|
|
21
|
-
},
|
|
27
|
+
}, w = /*@__PURE__*/ a({
|
|
22
28
|
__name: "AcSteps",
|
|
23
29
|
props: {
|
|
24
30
|
options: {},
|
|
@@ -27,65 +33,59 @@ var f = {
|
|
|
27
33
|
activeSubstep: { default: void 0 }
|
|
28
34
|
},
|
|
29
35
|
setup(a) {
|
|
30
|
-
let
|
|
31
|
-
return (
|
|
36
|
+
let w = a, T = (e) => w.activeSubstep === void 0 ? -1 : (e.substeps ?? []).findIndex((e) => e.id === w.activeSubstep);
|
|
37
|
+
return (w, E) => a.orientation === "horizontal" ? (s(), r("ol", f, [(s(!0), r(e, null, c(a.options, (e, c) => (s(), r("li", {
|
|
32
38
|
key: e.id,
|
|
33
39
|
class: "relative flex flex-1 flex-col items-center px-2 text-center",
|
|
34
40
|
"aria-current": a.active === e.id ? "step" : void 0
|
|
35
41
|
}, [
|
|
36
42
|
c < a.options.length - 1 ? (s(), r("span", {
|
|
37
43
|
key: 0,
|
|
38
|
-
class: o(["absolute top-
|
|
44
|
+
class: o(["absolute top-4 left-[calc(50%+26px)] h-0.5 w-[calc(100%-52px)] -translate-y-1/2 rounded-full transition-colors duration-300 motion-reduce:transition-none", a.active > e.id ? "bg-primary" : "bg-border"]),
|
|
39
45
|
"aria-hidden": "true"
|
|
40
46
|
}, null, 2)) : n("", !0),
|
|
41
|
-
i("span", { class: o(["relative inline-flex size-
|
|
47
|
+
i("span", { class: o(["relative inline-flex size-8 items-center justify-center rounded-full text-base font-semibold tabular-nums transition-[background-color,color,box-shadow] duration-200 motion-reduce:transition-none", a.active > e.id ? "bg-primary text-white shadow-button" : a.active === e.id ? "bg-surface text-primary-strong ring-2 ring-primary shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_15%,transparent)]" : "bg-surface text-muted ring-1 ring-border-dark"]) }, [a.active > e.id ? (s(), t(u(d), {
|
|
42
48
|
key: 0,
|
|
43
|
-
class: "size-
|
|
49
|
+
class: "size-4",
|
|
44
50
|
"stroke-width": 2.5,
|
|
45
51
|
"aria-hidden": "true"
|
|
46
52
|
})) : (s(), r("span", m, l(e.id), 1))], 2),
|
|
47
53
|
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
|
-
|
|
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", {
|
|
54
|
+
e.description ? (s(), r("p", h, l(e.description), 1)) : n("", !0)
|
|
55
|
+
], 8, p))), 128))])) : (s(), r("ol", g, [(s(!0), r(e, null, c(a.options, (f, p) => (s(), r("li", {
|
|
53
56
|
key: f.id,
|
|
54
57
|
class: "relative flex gap-3 pb-6 last:pb-0",
|
|
55
58
|
"aria-current": a.active === f.id ? "step" : void 0
|
|
56
59
|
}, [
|
|
57
60
|
p < a.options.length - 1 ? (s(), r("span", {
|
|
58
61
|
key: 0,
|
|
59
|
-
class: o(["absolute top-
|
|
62
|
+
class: o(["absolute top-10 bottom-2 left-4 w-0.5 -translate-x-1/2 rounded-full transition-colors duration-300 motion-reduce:transition-none", a.active > f.id ? "bg-primary" : "bg-border"]),
|
|
60
63
|
"aria-hidden": "true"
|
|
61
64
|
}, null, 2)) : n("", !0),
|
|
62
|
-
i("span", { class: o(["relative inline-flex size-
|
|
65
|
+
i("span", { class: o(["relative inline-flex size-8 shrink-0 items-center justify-center rounded-full text-base font-semibold tabular-nums transition-[background-color,color,box-shadow] duration-200 motion-reduce:transition-none", a.active > f.id ? "bg-primary text-white shadow-button" : a.active === f.id ? "bg-surface text-primary-strong ring-2 ring-primary shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_15%,transparent)]" : "bg-surface text-muted ring-1 ring-border-dark"]) }, [a.active > f.id ? (s(), t(u(d), {
|
|
63
66
|
key: 0,
|
|
64
|
-
class: "size-
|
|
67
|
+
class: "size-4",
|
|
65
68
|
"stroke-width": 2.5,
|
|
66
69
|
"aria-hidden": "true"
|
|
67
|
-
})) : (s(), r("span",
|
|
68
|
-
i("div",
|
|
70
|
+
})) : (s(), r("span", v, l(f.id), 1))], 2),
|
|
71
|
+
i("div", y, [
|
|
69
72
|
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
|
-
|
|
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", {
|
|
73
|
+
f.description ? (s(), r("p", b, l(f.description), 1)) : n("", !0),
|
|
74
|
+
f.substeps?.length && a.active === f.id ? (s(), r("ul", x, [(s(!0), r(e, null, c(f.substeps, (e, c) => (s(), r("li", {
|
|
75
75
|
key: e.id,
|
|
76
76
|
class: "flex items-center gap-2 py-1",
|
|
77
77
|
"aria-current": e.id === a.activeSubstep ? "step" : void 0
|
|
78
78
|
}, [i("span", {
|
|
79
|
-
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c <
|
|
79
|
+
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < T(f) ? "bg-primary text-white" : c === T(f) ? "bg-surface text-primary ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
|
|
80
80
|
"aria-hidden": "true"
|
|
81
|
-
}, [c <
|
|
81
|
+
}, [c < T(f) ? (s(), t(u(d), {
|
|
82
82
|
key: 0,
|
|
83
83
|
class: "size-3",
|
|
84
84
|
"stroke-width": 3
|
|
85
|
-
})) : c ===
|
|
85
|
+
})) : c === T(f) ? (s(), r("span", C)) : n("", !0)], 2), i("span", { class: o(["min-w-0 truncate text-base", c < T(f) ? "text-heading/80" : c === T(f) ? "font-medium text-heading" : "text-muted"]) }, l(e.title), 3)], 8, S))), 128))])) : n("", !0)
|
|
86
86
|
])
|
|
87
|
-
], 8,
|
|
87
|
+
], 8, _))), 128))]));
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
//#endregion
|
|
91
|
-
export {
|
|
91
|
+
export { w as default };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r,
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, normalizeClass as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _ } from "vue";
|
|
2
|
+
import { CircleAlert as v } from "@lucide/vue";
|
|
2
3
|
//#region src/lib/components/AcSwitch.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
4
|
+
var y = { class: "flex items-center gap-2" }, b = ["for"], x = [
|
|
4
5
|
"id",
|
|
5
6
|
"name",
|
|
6
7
|
"aria-checked",
|
|
7
8
|
"disabled"
|
|
8
|
-
],
|
|
9
|
+
], S = {
|
|
9
10
|
key: 0,
|
|
10
|
-
class: "mt-1.5 text-
|
|
11
|
-
|
|
11
|
+
class: "mt-1.5 flex items-center gap-1.5 text-base text-danger-strong",
|
|
12
|
+
role: "alert"
|
|
13
|
+
}, C = /*@__PURE__*/ o({
|
|
12
14
|
inheritAttrs: !1,
|
|
13
15
|
__name: "AcSwitch",
|
|
14
|
-
props: /*@__PURE__*/
|
|
16
|
+
props: /*@__PURE__*/ s({
|
|
15
17
|
label: { default: "" },
|
|
16
18
|
name: { default: "" },
|
|
17
19
|
disabled: {
|
|
@@ -27,41 +29,44 @@ var g = { class: "flex items-center gap-2" }, _ = ["for"], v = [
|
|
|
27
29
|
modelModifiers: {}
|
|
28
30
|
}),
|
|
29
31
|
emits: ["update:modelValue"],
|
|
30
|
-
setup(
|
|
31
|
-
let
|
|
32
|
-
class:
|
|
33
|
-
style:
|
|
34
|
-
})),
|
|
35
|
-
let { class: e, style: t, ...n } =
|
|
32
|
+
setup(o, { expose: s }) {
|
|
33
|
+
let C = _(o, "modelValue"), w = g(), T = h(), E = e(() => ({
|
|
34
|
+
class: T.class,
|
|
35
|
+
style: T.style
|
|
36
|
+
})), D = e(() => {
|
|
37
|
+
let { class: e, style: t, ...n } = T;
|
|
36
38
|
return n;
|
|
37
|
-
}),
|
|
38
|
-
return
|
|
39
|
+
}), O = d(null);
|
|
40
|
+
return s({ focus: () => O.value?.focus() }), (e, s) => (u(), n("div", c(E.value, {
|
|
39
41
|
"data-ac-ds": "",
|
|
40
42
|
"data-testid": "ac-switch"
|
|
41
|
-
}), [r("div",
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
}), [r("div", y, [
|
|
44
|
+
f(e.$slots, "left"),
|
|
45
|
+
o.label ? (u(), n("label", {
|
|
44
46
|
key: 0,
|
|
45
|
-
for:
|
|
46
|
-
class: "cursor-pointer text-base text-heading"
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
r("button",
|
|
50
|
-
id:
|
|
47
|
+
for: m(w),
|
|
48
|
+
class: l(["cursor-pointer text-base font-medium text-heading", o.disabled && "cursor-not-allowed opacity-50"])
|
|
49
|
+
}, p(o.label), 11, b)) : t("", !0),
|
|
50
|
+
f(e.$slots, "middle"),
|
|
51
|
+
r("button", c({
|
|
52
|
+
id: m(w),
|
|
51
53
|
ref_key: "button",
|
|
52
|
-
ref:
|
|
53
|
-
},
|
|
54
|
+
ref: O
|
|
55
|
+
}, D.value, {
|
|
54
56
|
type: "button",
|
|
55
57
|
role: "switch",
|
|
56
|
-
name:
|
|
57
|
-
"aria-checked":
|
|
58
|
-
disabled:
|
|
59
|
-
class: ["relative
|
|
60
|
-
onClick:
|
|
61
|
-
}), [r("span", { class:
|
|
62
|
-
|
|
63
|
-
]),
|
|
58
|
+
name: o.name,
|
|
59
|
+
"aria-checked": C.value,
|
|
60
|
+
disabled: o.disabled,
|
|
61
|
+
class: ["relative h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", C.value ? "bg-primary" : "bg-muted/45"],
|
|
62
|
+
onClick: s[0] ||= (e) => C.value = !C.value
|
|
63
|
+
}), [r("span", { class: l(["pointer-events-none absolute top-0.5 left-0.5 size-5 rounded-full bg-white shadow-sm transition-transform duration-200 ease-out motion-reduce:transition-none", C.value ? "translate-x-5" : "translate-x-0"]) }, null, 2)], 16, x),
|
|
64
|
+
f(e.$slots, "right")
|
|
65
|
+
]), o.errorMsg ? (u(), n("p", S, [a(m(v), {
|
|
66
|
+
class: "size-4 shrink-0",
|
|
67
|
+
"aria-hidden": "true"
|
|
68
|
+
}), i(" " + p(o.errorMsg), 1)])) : t("", !0)], 16));
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
//#endregion
|
|
67
|
-
export {
|
|
72
|
+
export { C as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Name of the feature the switch turns on, e.g. "Automated backups". Also the switch's accessible name. */
|
|
4
|
+
title: string;
|
|
5
|
+
/** One line on what the current position does, e.g. "Runs a Stash backup every 6 hours." */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Bold text beside the switch, e.g. the cost or result of the choice: "Free", "+$15.00", "3 nodes". */
|
|
8
|
+
status?: string;
|
|
9
|
+
/** A small line under `status`, e.g. "per month" or "if enabled". */
|
|
10
|
+
statusDetail?: string;
|
|
11
|
+
/** A Lucide icon shown in a 32px tile before the title. */
|
|
12
|
+
icon?: Component;
|
|
13
|
+
/** Adds a "Recommended" pill after the title. */
|
|
14
|
+
recommended?: boolean;
|
|
15
|
+
/** The switch is on but won't take effect yet: tints the card amber instead of primary. Explain why in the default slot. */
|
|
16
|
+
warning?: boolean;
|
|
17
|
+
/** Turns the switch and the card click off. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Shows a spinner beside the switch and blocks changes, e.g. while the change is saved. */
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
}
|
|
22
|
+
type __VLS_Props = Props;
|
|
23
|
+
type __VLS_Slots = {
|
|
24
|
+
/** Pills after the title, beside the built-in Recommended one, e.g. "Coming soon". */
|
|
25
|
+
badges?: () => unknown;
|
|
26
|
+
/** Replaces the `status` text, e.g. a price with a muted unit. */
|
|
27
|
+
status?: () => unknown;
|
|
28
|
+
/** Content under the row, shown only while the switch is on: settings revealed after enabling, or a warning about the choice. */
|
|
29
|
+
default?: () => unknown;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_ModelProps = {
|
|
32
|
+
modelValue?: boolean;
|
|
33
|
+
};
|
|
34
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
35
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
36
|
+
/** Moves focus to the switch. */
|
|
37
|
+
focus: () => void | undefined;
|
|
38
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
"update:modelValue": (value: boolean) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
description: string;
|
|
44
|
+
disabled: boolean;
|
|
45
|
+
icon: Component;
|
|
46
|
+
status: string;
|
|
47
|
+
warning: boolean;
|
|
48
|
+
loading: boolean;
|
|
49
|
+
recommended: boolean;
|
|
50
|
+
statusDetail: string;
|
|
51
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
52
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
53
|
+
declare const _default: typeof __VLS_export;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|