@ac-design/design-system 2.0.0 → 2.1.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/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +17 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +79 -25
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
import { computed as e,
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, ref as c, toDisplayString as l, unref as u, watch as d } from "vue";
|
|
2
|
+
import { Building as f } from "@lucide/vue";
|
|
2
3
|
//#region src/lib/components/AcAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
4
|
+
var p = [
|
|
4
5
|
"role",
|
|
5
6
|
"aria-label",
|
|
6
7
|
"aria-hidden"
|
|
7
|
-
],
|
|
8
|
+
], m = ["src"], h = {
|
|
8
9
|
key: 1,
|
|
9
10
|
class: "tabular-nums",
|
|
10
11
|
"aria-hidden": "true"
|
|
11
|
-
},
|
|
12
|
-
key:
|
|
12
|
+
}, g = {
|
|
13
|
+
key: 3,
|
|
13
14
|
"aria-hidden": "true"
|
|
14
|
-
},
|
|
15
|
+
}, _ = /*@__PURE__*/ a({
|
|
15
16
|
__name: "AcAvatar",
|
|
16
17
|
props: {
|
|
17
18
|
name: { default: "" },
|
|
18
19
|
imgUrl: { default: "" },
|
|
19
20
|
alt: { default: void 0 },
|
|
20
21
|
size: { default: "normal" },
|
|
21
|
-
shape: { default:
|
|
22
|
+
shape: { default: void 0 },
|
|
23
|
+
kind: { default: "person" },
|
|
22
24
|
status: { default: void 0 },
|
|
23
25
|
overflowCount: { default: 0 }
|
|
24
26
|
},
|
|
25
|
-
setup(
|
|
26
|
-
let
|
|
27
|
+
setup(a) {
|
|
28
|
+
let _ = a, v = {
|
|
27
29
|
xs: {
|
|
28
30
|
box: "size-5 text-xm",
|
|
29
31
|
dot: "size-1.5",
|
|
30
|
-
|
|
32
|
+
icon: "size-2.5"
|
|
31
33
|
},
|
|
32
34
|
small: {
|
|
33
35
|
box: "size-6 text-sm",
|
|
34
36
|
dot: "size-2",
|
|
35
|
-
|
|
37
|
+
icon: "size-3"
|
|
36
38
|
},
|
|
37
39
|
normal: {
|
|
38
40
|
box: "size-8 text-xs",
|
|
39
41
|
dot: "size-2.5",
|
|
40
|
-
|
|
42
|
+
icon: "size-4"
|
|
43
|
+
},
|
|
44
|
+
medium: {
|
|
45
|
+
box: "size-10 text-base",
|
|
46
|
+
dot: "size-2.5",
|
|
47
|
+
icon: "size-5"
|
|
41
48
|
},
|
|
42
49
|
large: {
|
|
43
50
|
box: "size-12 text-xl",
|
|
44
51
|
dot: "size-3",
|
|
45
|
-
|
|
52
|
+
icon: "size-6"
|
|
46
53
|
}
|
|
47
|
-
},
|
|
54
|
+
}, y = [
|
|
48
55
|
"bg-primary/15 text-primary-strong",
|
|
49
56
|
"bg-info/15 text-info-strong",
|
|
50
57
|
"bg-pending/15 text-pending-strong",
|
|
51
58
|
"bg-warning/20 text-warning-strong",
|
|
52
59
|
"bg-danger/15 text-danger-strong",
|
|
53
60
|
"bg-success/15 text-success-strong"
|
|
54
|
-
],
|
|
61
|
+
], b = {
|
|
55
62
|
online: {
|
|
56
63
|
dot: "bg-success",
|
|
57
64
|
label: "Online"
|
|
@@ -68,49 +75,47 @@ var u = [
|
|
|
68
75
|
dot: "bg-muted",
|
|
69
76
|
label: "Offline"
|
|
70
77
|
}
|
|
71
|
-
},
|
|
72
|
-
let e =
|
|
78
|
+
}, x = c(!1), S = e(() => !!_.imgUrl && !x.value && !_.overflowCount), C = e(() => _.kind === "organization" && !_.overflowCount), w = e(() => {
|
|
79
|
+
let e = _.name.split("@")[0].split(/[\s._-]+/).filter(Boolean);
|
|
73
80
|
return e.length ? (e.length > 1 ? e[0][0] + e[1][0] : e[0].slice(0, 1)).toUpperCase() : "";
|
|
74
|
-
}),
|
|
75
|
-
if (
|
|
81
|
+
}), T = e(() => {
|
|
82
|
+
if (C.value) return "bg-linear-to-br from-primary/80 to-primary text-white";
|
|
83
|
+
if (_.overflowCount || !_.name) return "bg-surface-sunken text-muted";
|
|
76
84
|
let e = 0;
|
|
77
|
-
for (let t of
|
|
78
|
-
return
|
|
79
|
-
}),
|
|
80
|
-
if (
|
|
81
|
-
let e =
|
|
82
|
-
return e ?
|
|
83
|
-
}),
|
|
84
|
-
return
|
|
85
|
-
class:
|
|
86
|
-
role:
|
|
87
|
-
"aria-label":
|
|
88
|
-
"aria-hidden": !
|
|
85
|
+
for (let t of _.name) e = e * 31 + t.charCodeAt(0) >>> 0;
|
|
86
|
+
return y[e % y.length];
|
|
87
|
+
}), E = e(() => {
|
|
88
|
+
if (_.overflowCount) return _.alt ?? `${_.overflowCount} more`;
|
|
89
|
+
let e = _.alt ?? _.name;
|
|
90
|
+
return e ? _.status ? `${e} (${b[_.status].label})` : e : "";
|
|
91
|
+
}), D = e(() => (_.shape ?? (_.kind === "organization" ? "square" : "circle")) === "square"), O = e(() => D.value ? "rounded-4" : "rounded-full");
|
|
92
|
+
return d(() => _.imgUrl, () => x.value = !1), (e, c) => (s(), r("span", {
|
|
93
|
+
class: o(["relative inline-flex shrink-0 bg-surface align-middle", [v[a.size].box, O.value]]),
|
|
94
|
+
role: E.value ? "img" : void 0,
|
|
95
|
+
"aria-label": E.value || void 0,
|
|
96
|
+
"aria-hidden": !E.value || void 0,
|
|
89
97
|
"data-ac-ds": "",
|
|
90
98
|
"data-testid": "ac-avatar"
|
|
91
|
-
}, [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"aria-hidden": "true"
|
|
111
|
-
}, null, 2)) : t("", !0)
|
|
112
|
-
], 10, u));
|
|
99
|
+
}, [i("span", { class: o(["inline-flex size-full items-center justify-center overflow-hidden font-semibold tracking-[-0.01em] select-none", [O.value, S.value ? "bg-surface-sunken" : T.value]]) }, [S.value ? (s(), r("img", {
|
|
100
|
+
key: 0,
|
|
101
|
+
src: a.imgUrl,
|
|
102
|
+
alt: "",
|
|
103
|
+
class: "size-full object-cover",
|
|
104
|
+
onError: c[0] ||= (e) => x.value = !0
|
|
105
|
+
}, null, 40, m)) : a.overflowCount ? (s(), r("span", h, "+" + l(a.overflowCount), 1)) : C.value ? (s(), t(u(f), {
|
|
106
|
+
key: 2,
|
|
107
|
+
class: o(v[a.size].icon),
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}, null, 8, ["class"])) : (s(), r("span", g, l(w.value), 1))], 2), a.status && !a.overflowCount ? (s(), r("span", {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: o(["absolute right-0 bottom-0 rounded-full ring-2 ring-surface", [
|
|
112
|
+
v[a.size].dot,
|
|
113
|
+
b[a.status].dot,
|
|
114
|
+
D.value && "translate-x-1/4 translate-y-1/4"
|
|
115
|
+
]]),
|
|
116
|
+
"aria-hidden": "true"
|
|
117
|
+
}, null, 2)) : n("", !0)], 10, p));
|
|
113
118
|
}
|
|
114
119
|
});
|
|
115
120
|
//#endregion
|
|
116
|
-
export {
|
|
121
|
+
export { _ as default };
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
import type { Tone, Variant } from "./types";
|
|
2
3
|
export interface Props {
|
|
3
4
|
/** Text of the badge. The default slot overrides it. Defaults to "Default", or the humanized `status`. */
|
|
4
5
|
label?: string;
|
|
5
6
|
/** Status or brand colour. Always pair a status colour with a word. Defaults to `default`, or the colour of `status`. */
|
|
6
7
|
color?: Tone | "pending" | "default" | "secondary" | "dark";
|
|
7
|
-
/** `solid` fill, `light` tint (10% fill
|
|
8
|
+
/** `solid` fill, `light` tint (10% fill in the colour's own text, amber text on warning) or `outlined`. Defaults to `solid`, or `light` with `status`. */
|
|
8
9
|
variant?: Variant;
|
|
9
10
|
/** Pill shape, the default. Set `false` for 6px corners. */
|
|
10
11
|
rounded?: boolean;
|
|
11
12
|
/** Shows a 6px status dot before the label. On by default with `status`. */
|
|
12
13
|
dot?: boolean;
|
|
13
|
-
/** Raw state from the API, e.g. `RUNNING`, `pending_provisioning` or `NotReady`. Sets the colour, a sentence-case label, the dot and the `light` variant; any of those props you pass wins. cloud-ui's StatusBadge `state`. */
|
|
14
|
+
/** Raw state from the API, e.g. `RUNNING`, `pending_provisioning` or `NotReady`. Sets the colour, a sentence-case label, the dot and the `light` variant; any of those props you pass wins. Stopped and paused states get a hollow grey dot; in-progress ones a spinner on a primary tint. cloud-ui's StatusBadge `state`. */
|
|
14
15
|
status?: string | null;
|
|
15
16
|
/** Enum prefix stripped from `status` before matching, e.g. `VPC_STATE` shows `VPC_STATE_AVAILABLE` as "Available". */
|
|
16
17
|
prefix?: string;
|
|
17
|
-
/**
|
|
18
|
+
/** Shows a 12px spinner instead of the dot to show work in progress; with `status` the badge also turns primary. On by default for transient states such as Provisioning or Deleting. cloud-ui's `transient`. */
|
|
18
19
|
pulse?: boolean;
|
|
20
|
+
/** A Lucide icon shown at 12px before the label, in the text colour, e.g. `ShieldCheck` on "4 Active Policies". Takes the place of the dot; the in-progress spinner still wins. */
|
|
21
|
+
icon?: Component;
|
|
19
22
|
}
|
|
20
23
|
type __VLS_Slots = {
|
|
21
24
|
/** Badge content. Replaces `label`. */
|
|
@@ -24,6 +27,7 @@ type __VLS_Slots = {
|
|
|
24
27
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
25
28
|
variant: Variant;
|
|
26
29
|
label: string;
|
|
30
|
+
icon: Component;
|
|
27
31
|
color: Tone | "pending" | "default" | "secondary" | "dark";
|
|
28
32
|
status: string | null;
|
|
29
33
|
rounded: boolean;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { statusMeta as e } from "./status.js";
|
|
2
|
-
import { computed as t,
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, resolveDynamicComponent as u, toDisplayString as d, unref as f } from "vue";
|
|
3
|
+
import { LoaderCircle as p } from "@lucide/vue";
|
|
3
4
|
//#region src/lib/components/AcBadge.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "relative flex size-1.5 shrink-0",
|
|
7
|
-
"aria-hidden": "true"
|
|
8
|
-
}, f = /*@__PURE__*/ o({
|
|
5
|
+
var m = /*@__PURE__*/ o({
|
|
9
6
|
__name: "AcBadge",
|
|
10
7
|
props: {
|
|
11
8
|
label: { default: void 0 },
|
|
@@ -24,81 +21,91 @@ var d = {
|
|
|
24
21
|
pulse: {
|
|
25
22
|
type: Boolean,
|
|
26
23
|
default: void 0
|
|
27
|
-
}
|
|
24
|
+
},
|
|
25
|
+
icon: { default: void 0 }
|
|
28
26
|
},
|
|
29
27
|
setup(o) {
|
|
30
|
-
let
|
|
28
|
+
let m = o, h = {
|
|
31
29
|
primary: [
|
|
32
30
|
"bg-primary text-white",
|
|
33
|
-
"bg-primary/10 text-primary-strong
|
|
31
|
+
"bg-primary/10 text-primary-strong",
|
|
34
32
|
"ring-primary/40 text-primary-strong",
|
|
35
33
|
"bg-primary"
|
|
36
34
|
],
|
|
37
35
|
secondary: [
|
|
38
36
|
"bg-secondary text-white",
|
|
39
|
-
"bg-secondary-95 text-secondary-20
|
|
37
|
+
"bg-secondary-95 text-secondary-20",
|
|
40
38
|
"ring-secondary-70 text-secondary",
|
|
41
39
|
"bg-secondary-40"
|
|
42
40
|
],
|
|
43
41
|
info: [
|
|
44
42
|
"bg-info text-white",
|
|
45
|
-
"bg-info/10 text-info-strong
|
|
43
|
+
"bg-info/10 text-info-strong",
|
|
46
44
|
"ring-info/40 text-info-strong",
|
|
47
45
|
"bg-info"
|
|
48
46
|
],
|
|
49
47
|
success: [
|
|
50
48
|
"bg-success text-white",
|
|
51
|
-
"bg-success/10 text-success-strong
|
|
49
|
+
"bg-success/10 text-success-strong",
|
|
52
50
|
"ring-success/40 text-success-strong",
|
|
53
51
|
"bg-success"
|
|
54
52
|
],
|
|
55
53
|
warning: [
|
|
56
54
|
"bg-warning text-on-warning",
|
|
57
|
-
"bg-warning/10 text-warning-strong
|
|
55
|
+
"bg-warning/10 text-warning-strong",
|
|
58
56
|
"ring-warning/45 text-warning-strong",
|
|
59
57
|
"bg-warning"
|
|
60
58
|
],
|
|
61
59
|
danger: [
|
|
62
60
|
"bg-danger text-white",
|
|
63
|
-
"bg-danger/10 text-danger-strong
|
|
61
|
+
"bg-danger/10 text-danger-strong",
|
|
64
62
|
"ring-danger/40 text-danger-strong",
|
|
65
63
|
"bg-danger"
|
|
66
64
|
],
|
|
67
65
|
pending: [
|
|
68
66
|
"bg-pending text-white",
|
|
69
|
-
"bg-pending/10 text-pending-strong
|
|
67
|
+
"bg-pending/10 text-pending-strong",
|
|
70
68
|
"ring-pending/40 text-pending-strong",
|
|
71
69
|
"bg-pending"
|
|
72
70
|
],
|
|
73
71
|
dark: [
|
|
74
72
|
"bg-slate-20 text-surface",
|
|
75
|
-
"bg-slate-20/10 text-heading
|
|
73
|
+
"bg-slate-20/10 text-heading",
|
|
76
74
|
"ring-slate-20/40 text-heading",
|
|
77
75
|
"bg-slate-20"
|
|
78
76
|
],
|
|
79
77
|
default: [
|
|
80
78
|
"bg-surface-sunken text-heading",
|
|
81
|
-
"bg-surface-sunken text-muted
|
|
79
|
+
"bg-surface-sunken/40 text-muted",
|
|
82
80
|
"ring-border text-muted",
|
|
83
81
|
"bg-muted"
|
|
84
82
|
]
|
|
85
|
-
},
|
|
86
|
-
let [e, t, n] =
|
|
83
|
+
}, g = t(() => m.status === void 0 ? null : e(m.status, { prefix: m.prefix })), _ = t(() => m.pulse ?? g.value?.transient ?? !1), v = t(() => m.color ?? (g.value && _.value ? "primary" : g.value?.tone ?? "default")), y = t(() => m.variant ?? (g.value ? "light" : "solid")), b = t(() => m.label || g.value?.label || "Default"), x = t(() => m.dot ?? (!!g.value || _.value)), S = t(() => !!g.value?.hollow && !m.color), C = t(() => {
|
|
84
|
+
let [e, t, n] = h[v.value];
|
|
87
85
|
return {
|
|
88
86
|
solid: e,
|
|
89
|
-
light:
|
|
87
|
+
light: t,
|
|
90
88
|
outlined: `bg-surface ring-1 ring-inset ${n}`
|
|
91
|
-
}[
|
|
92
|
-
}),
|
|
93
|
-
return (e, t) => (c(),
|
|
94
|
-
class: s(["inline-flex h-5
|
|
89
|
+
}[y.value];
|
|
90
|
+
}), w = t(() => S.value ? "border border-muted bg-transparent" : y.value === "solid" && v.value !== "default" ? "bg-surface" : h[v.value][3]);
|
|
91
|
+
return (e, t) => (c(), i("span", {
|
|
92
|
+
class: s(["inline-flex h-5 items-center gap-1.5 px-2.5 text-xs leading-none font-medium whitespace-nowrap tabular-nums", [C.value, o.rounded ? "rounded-full" : "rounded-6"]]),
|
|
95
93
|
"data-ac-ds": "",
|
|
96
94
|
"data-testid": "ac-badge"
|
|
97
|
-
}, [
|
|
95
|
+
}, [_.value && x.value ? (c(), n(f(p), {
|
|
98
96
|
key: 0,
|
|
99
|
-
class:
|
|
100
|
-
|
|
97
|
+
class: "size-3 shrink-0 motion-safe:animate-spin",
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
})) : o.icon ? (c(), n(u(o.icon), {
|
|
100
|
+
key: 1,
|
|
101
|
+
class: "size-3 shrink-0",
|
|
102
|
+
"aria-hidden": "true"
|
|
103
|
+
})) : x.value ? (c(), i("span", {
|
|
104
|
+
key: 2,
|
|
105
|
+
class: s(["size-1.5 shrink-0 rounded-full", w.value]),
|
|
106
|
+
"aria-hidden": "true"
|
|
107
|
+
}, null, 2)) : r("", !0), l(e.$slots, "default", {}, () => [a(d(b.value), 1)])], 2));
|
|
101
108
|
}
|
|
102
109
|
});
|
|
103
110
|
//#endregion
|
|
104
|
-
export {
|
|
111
|
+
export { m as default };
|
|
@@ -22,10 +22,13 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
22
22
|
orientation: "vertical" | "horizontal";
|
|
23
23
|
radius: number;
|
|
24
24
|
loading: boolean;
|
|
25
|
+
animation: boolean;
|
|
25
26
|
tooltip: boolean;
|
|
26
27
|
emptyText: string;
|
|
27
28
|
stacked: boolean;
|
|
29
|
+
renderer: "canvas" | "svg";
|
|
28
30
|
gridLines: boolean;
|
|
31
|
+
zoom: boolean;
|
|
29
32
|
xFormatter: (value: Date | number | string) => string;
|
|
30
33
|
yFormatter: (value: number) => string;
|
|
31
34
|
xLabel: string;
|