@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
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, normalizeClass as u, normalizeStyle as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, useAttrs as _, useId as v, useModel as y, watch as b, withKeys as x } from "vue";
|
|
2
|
+
import { CircleAlert as S } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcColorInput.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var C = ["for"], w = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "font-normal text-muted"
|
|
7
|
+
}, T = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "text-danger",
|
|
10
|
+
"aria-hidden": "true"
|
|
11
|
+
}, E = ["id"], D = [
|
|
12
|
+
"value",
|
|
13
|
+
"disabled",
|
|
14
|
+
"aria-label"
|
|
15
|
+
], O = [
|
|
16
|
+
"id",
|
|
17
|
+
"value",
|
|
18
|
+
"name",
|
|
19
|
+
"disabled",
|
|
20
|
+
"readonly",
|
|
21
|
+
"required",
|
|
22
|
+
"aria-invalid",
|
|
23
|
+
"aria-describedby"
|
|
24
|
+
], k = ["aria-label"], A = [
|
|
25
|
+
"disabled",
|
|
26
|
+
"aria-label",
|
|
27
|
+
"aria-pressed",
|
|
28
|
+
"title",
|
|
29
|
+
"onClick"
|
|
30
|
+
], j = ["id"], M = /*@__PURE__*/ s({
|
|
31
|
+
inheritAttrs: !1,
|
|
32
|
+
__name: "AcColorInput",
|
|
33
|
+
props: /*@__PURE__*/ c({
|
|
34
|
+
label: { default: "" },
|
|
35
|
+
name: { default: "" },
|
|
36
|
+
presets: { default: () => [] },
|
|
37
|
+
required: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !1
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
readonly: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
errorMsg: { default: "" },
|
|
50
|
+
hint: { default: "" },
|
|
51
|
+
size: { default: "normal" }
|
|
52
|
+
}, {
|
|
53
|
+
modelValue: { default: "" },
|
|
54
|
+
modelModifiers: {}
|
|
55
|
+
}),
|
|
56
|
+
emits: /*@__PURE__*/ c(["change"], ["update:modelValue"]),
|
|
57
|
+
setup(s, { expose: c, emit: M }) {
|
|
58
|
+
let N = s, P = y(s, "modelValue"), F = M, I = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i, L = v(), R = _(), z = t(() => ({
|
|
59
|
+
class: R.class,
|
|
60
|
+
style: R.style
|
|
61
|
+
})), B = t(() => {
|
|
62
|
+
let { class: e, style: t, ...n } = R;
|
|
63
|
+
return n;
|
|
64
|
+
}), V = p(null), H = p(P.value), U = p(""), W = t(() => Y(P.value)), G = t(() => N.disabled || N.readonly), K = t(() => N.errorMsg || U.value), q = t(() => [N.hint && `${L}-hint`, K.value && `${L}-msg`].filter(Boolean).join(" ") || void 0), J = t(() => N.presets.flatMap((e) => {
|
|
65
|
+
let t = typeof e == "string" ? { value: e } : e, n = Y(t.value);
|
|
66
|
+
return n ? [{
|
|
67
|
+
value: n,
|
|
68
|
+
label: t.label || n
|
|
69
|
+
}] : [];
|
|
70
|
+
}));
|
|
71
|
+
function Y(e) {
|
|
72
|
+
let t = e ? I.exec(e.trim()) : null;
|
|
73
|
+
if (!t) return null;
|
|
74
|
+
let n = t[1].toLowerCase();
|
|
75
|
+
return `#${n.length === 3 ? [...n].map((e) => e + e).join("") : n}`;
|
|
76
|
+
}
|
|
77
|
+
function X(e) {
|
|
78
|
+
U.value = "", H.value = e, e !== P.value && (P.value = e, F("change", e));
|
|
79
|
+
}
|
|
80
|
+
function Z(e) {
|
|
81
|
+
H.value = e.target.value, U.value = "";
|
|
82
|
+
let t = H.value.trim().replace(/^#?/, "").length === 6 ? Y(H.value) : null;
|
|
83
|
+
t && (P.value = t);
|
|
84
|
+
}
|
|
85
|
+
function Q() {
|
|
86
|
+
let e = H.value.trim();
|
|
87
|
+
if (!e) return X("");
|
|
88
|
+
let t = Y(e);
|
|
89
|
+
t ? X(t) : U.value = "Enter a hex colour such as #1c7c54 or #fff";
|
|
90
|
+
}
|
|
91
|
+
function $(e) {
|
|
92
|
+
U.value = "";
|
|
93
|
+
let t = e.target.value.toLowerCase();
|
|
94
|
+
H.value = t, P.value = t;
|
|
95
|
+
}
|
|
96
|
+
function ee(e) {
|
|
97
|
+
F("change", e.target.value.toLowerCase());
|
|
98
|
+
}
|
|
99
|
+
return b(P, (e) => {
|
|
100
|
+
Y(H.value) !== Y(e) && (H.value = e ?? "");
|
|
101
|
+
}), c({ focus: () => V.value?.focus() }), (t, c) => (f(), r("div", l(z.value, {
|
|
102
|
+
class: ["w-full", s.disabled && "opacity-50"],
|
|
103
|
+
"data-ac-ds": "",
|
|
104
|
+
"data-testid": "ac-color-input"
|
|
105
|
+
}), [
|
|
106
|
+
s.label ? (f(), r("label", {
|
|
107
|
+
key: 0,
|
|
108
|
+
for: g(L),
|
|
109
|
+
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
110
|
+
}, [
|
|
111
|
+
i("span", null, h(s.label), 1),
|
|
112
|
+
s.readonly ? (f(), r("span", w, "(read only)")) : n("", !0),
|
|
113
|
+
s.required ? (f(), r("span", T, "*")) : n("", !0)
|
|
114
|
+
], 8, C)) : n("", !0),
|
|
115
|
+
s.hint ? (f(), r("p", {
|
|
116
|
+
key: 1,
|
|
117
|
+
id: `${g(L)}-hint`,
|
|
118
|
+
class: "mb-2 text-base text-muted"
|
|
119
|
+
}, h(s.hint), 9, E)) : n("", !0),
|
|
120
|
+
i("div", { class: u(["relative flex min-w-0 items-center rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
|
|
121
|
+
s.size === "small" ? "h-9" : "h-10",
|
|
122
|
+
s.readonly ? "bg-surface-muted" : "bg-background",
|
|
123
|
+
K.value ? "border-danger/60 focus-within:border-danger focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus-within:focus-ring", !s.disabled && "hover:border-accent-active"]
|
|
124
|
+
]]) }, [i("span", {
|
|
125
|
+
class: u(["relative ml-1 shrink-0 overflow-hidden rounded-8 border border-border has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-ring has-[input:focus-visible]:ring-offset-1 has-[input:focus-visible]:ring-offset-surface", [s.size === "small" ? "size-7" : "size-8", !W.value && "bg-surface-sunken"]]),
|
|
126
|
+
style: d(W.value ? { backgroundColor: W.value } : void 0),
|
|
127
|
+
"data-testid": "ac-color-input-swatch"
|
|
128
|
+
}, [i("input", {
|
|
129
|
+
type: "color",
|
|
130
|
+
value: W.value ?? "#000000",
|
|
131
|
+
disabled: G.value,
|
|
132
|
+
"aria-label": s.label ? `${s.label}: open colour picker` : "Open colour picker",
|
|
133
|
+
class: "absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
134
|
+
onInput: $,
|
|
135
|
+
onChange: ee
|
|
136
|
+
}, null, 40, D)], 6), i("input", l({
|
|
137
|
+
id: g(L),
|
|
138
|
+
ref_key: "input",
|
|
139
|
+
ref: V
|
|
140
|
+
}, B.value, {
|
|
141
|
+
type: "text",
|
|
142
|
+
autocomplete: "off",
|
|
143
|
+
spellcheck: "false",
|
|
144
|
+
maxlength: "7",
|
|
145
|
+
value: H.value,
|
|
146
|
+
name: s.name,
|
|
147
|
+
disabled: s.disabled,
|
|
148
|
+
readonly: s.readonly,
|
|
149
|
+
required: s.required,
|
|
150
|
+
"aria-invalid": !!K.value || void 0,
|
|
151
|
+
"aria-describedby": q.value,
|
|
152
|
+
class: ["block h-full w-full min-w-0 flex-1 rounded-10 bg-transparent pl-2.5 font-mono text-base font-normal text-heading outline-none placeholder:font-sans placeholder:text-muted/80 disabled:cursor-not-allowed", s.size === "small" ? "pr-3" : "pr-4"],
|
|
153
|
+
onInput: Z,
|
|
154
|
+
onBlur: Q,
|
|
155
|
+
onKeydown: x(Q, ["enter"])
|
|
156
|
+
}), null, 16, O)], 2),
|
|
157
|
+
J.value.length ? (f(), r("div", {
|
|
158
|
+
key: 2,
|
|
159
|
+
class: "mt-2.5 flex flex-wrap gap-2",
|
|
160
|
+
role: "group",
|
|
161
|
+
"aria-label": s.label ? `${s.label} presets` : "Presets"
|
|
162
|
+
}, [(f(!0), r(e, null, m(J.value, (e) => (f(), r("button", {
|
|
163
|
+
key: e.value,
|
|
164
|
+
type: "button",
|
|
165
|
+
class: u(["size-6 shrink-0 rounded-full border border-border transition-[box-shadow,transform] duration-200 hover:scale-110 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:hover:scale-100 motion-reduce:transition-none motion-reduce:hover:scale-100", [e.value === W.value && "ring-2 ring-primary ring-offset-2 ring-offset-surface", !G.value && "cursor-pointer"]]),
|
|
166
|
+
style: d({ backgroundColor: e.value }),
|
|
167
|
+
disabled: G.value,
|
|
168
|
+
"aria-label": e.label,
|
|
169
|
+
"aria-pressed": e.value === W.value,
|
|
170
|
+
title: e.label,
|
|
171
|
+
"data-testid": "ac-color-input-preset",
|
|
172
|
+
onClick: (t) => X(e.value)
|
|
173
|
+
}, null, 14, A))), 128))], 8, k)) : n("", !0),
|
|
174
|
+
K.value ? (f(), r("p", {
|
|
175
|
+
key: 3,
|
|
176
|
+
id: `${g(L)}-msg`,
|
|
177
|
+
class: "mt-1.5 flex items-center gap-1.5 text-base text-danger-strong",
|
|
178
|
+
role: "alert"
|
|
179
|
+
}, [o(g(S), {
|
|
180
|
+
class: "size-4 shrink-0",
|
|
181
|
+
"aria-hidden": "true"
|
|
182
|
+
}), a(" " + h(K.value), 1)], 8, j)) : n("", !0)
|
|
183
|
+
], 16));
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
//#endregion
|
|
187
|
+
export { M as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { Tone } from "./types";
|
|
3
|
+
export interface Props {
|
|
4
|
+
/** Heading that names the action, e.g. "Restart database". */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** What happens if the viewer confirms. The default slot replaces it for rich text. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Label of the confirm button. Name the action: "Restart", "Revoke token". */
|
|
9
|
+
confirmLabel?: string;
|
|
10
|
+
/** Same as `confirmLabel`; the name cloud-ui's ConfirmModal and AcDeleteModal use. Wins when both are set. */
|
|
11
|
+
confirmText?: string;
|
|
12
|
+
/** Label of the cancel button. */
|
|
13
|
+
cancelLabel?: string;
|
|
14
|
+
/** Colour of the confirm button and the icon tile. Use `danger` for destructive actions. cloud-ui's `error` is `danger`. */
|
|
15
|
+
color?: Tone;
|
|
16
|
+
/** Shows a spinner on the confirm button, disables Cancel and blocks closing while the request runs. cloud-ui's `is-loading`. */
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
/** A Lucide icon shown in a 32px tile tinted with `color`, beside the description. */
|
|
19
|
+
icon?: Component;
|
|
20
|
+
}
|
|
21
|
+
type __VLS_Props = Props;
|
|
22
|
+
type __VLS_Slots = {
|
|
23
|
+
/** Rich description, e.g. with the resource name in `<strong>`. Replaces `description`. */
|
|
24
|
+
default?: () => unknown;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_ModelProps = {
|
|
27
|
+
/** Whether the dialog is open. Bind with `v-model:open`. */
|
|
28
|
+
"open"?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
31
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
"update:open": (value: boolean) => any;
|
|
33
|
+
cancel: () => any;
|
|
34
|
+
confirm: () => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
36
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
37
|
+
onCancel?: (() => any) | undefined;
|
|
38
|
+
onConfirm?: (() => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
title: string;
|
|
41
|
+
description: string;
|
|
42
|
+
icon: Component;
|
|
43
|
+
color: Tone;
|
|
44
|
+
loading: boolean;
|
|
45
|
+
confirmLabel: string;
|
|
46
|
+
confirmText: string;
|
|
47
|
+
cancelLabel: string;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import e from "./AcButton.js";
|
|
2
|
+
import t from "./AcModal.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, useModel as h, withCtx as g } from "vue";
|
|
4
|
+
//#region src/lib/components/AcConfirmModal.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = {
|
|
6
|
+
class: "flex items-start gap-4",
|
|
7
|
+
"data-ac-ds": "",
|
|
8
|
+
"data-testid": "ac-confirm-modal"
|
|
9
|
+
}, v = /*@__PURE__*/ c({
|
|
10
|
+
__name: "AcConfirmModal",
|
|
11
|
+
props: /*@__PURE__*/ l({
|
|
12
|
+
title: { default: "Confirm action" },
|
|
13
|
+
description: { default: "" },
|
|
14
|
+
confirmLabel: { default: "Confirm" },
|
|
15
|
+
confirmText: { default: "" },
|
|
16
|
+
cancelLabel: { default: "Cancel" },
|
|
17
|
+
color: { default: "primary" },
|
|
18
|
+
loading: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
icon: { default: void 0 }
|
|
23
|
+
}, {
|
|
24
|
+
open: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
openModifiers: {}
|
|
29
|
+
}),
|
|
30
|
+
emits: /*@__PURE__*/ l(["confirm", "cancel"], ["update:open"]),
|
|
31
|
+
setup(c, { emit: l }) {
|
|
32
|
+
let v = c, y = h(c, "open"), b = l, x = {
|
|
33
|
+
primary: "border-primary/25 bg-primary/10 text-primary-strong",
|
|
34
|
+
info: "border-info/25 bg-info/10 text-info-strong",
|
|
35
|
+
success: "border-success/25 bg-success/10 text-success-strong",
|
|
36
|
+
warning: "border-warning/30 bg-warning/10 text-warning-strong",
|
|
37
|
+
danger: "border-danger/25 bg-danger/10 text-danger-strong"
|
|
38
|
+
}, S = n(() => v.confirmText || v.confirmLabel), C = n(() => v.color === "danger");
|
|
39
|
+
function w() {
|
|
40
|
+
y.value = !1, b("cancel");
|
|
41
|
+
}
|
|
42
|
+
return (n, l) => (d(), r(t, {
|
|
43
|
+
open: y.value,
|
|
44
|
+
"onUpdate:open": l[1] ||= (e) => y.value = e,
|
|
45
|
+
title: c.title,
|
|
46
|
+
size: "small",
|
|
47
|
+
closable: !c.loading,
|
|
48
|
+
"close-on-outside-click": !c.loading,
|
|
49
|
+
onClose: l[2] ||= (e) => b("cancel")
|
|
50
|
+
}, {
|
|
51
|
+
footer: g(() => [s(e, {
|
|
52
|
+
title: c.cancelLabel,
|
|
53
|
+
color: "white",
|
|
54
|
+
disabled: c.loading,
|
|
55
|
+
autofocus: C.value || void 0,
|
|
56
|
+
"data-ac-ds": "",
|
|
57
|
+
"data-testid": "ac-confirm-modal-cancel",
|
|
58
|
+
onClick: w
|
|
59
|
+
}, null, 8, [
|
|
60
|
+
"title",
|
|
61
|
+
"disabled",
|
|
62
|
+
"autofocus"
|
|
63
|
+
]), s(e, {
|
|
64
|
+
title: S.value,
|
|
65
|
+
color: c.color,
|
|
66
|
+
loading: c.loading,
|
|
67
|
+
autofocus: !C.value || void 0,
|
|
68
|
+
"data-ac-ds": "",
|
|
69
|
+
"data-testid": "ac-confirm-modal-confirm",
|
|
70
|
+
onClick: l[0] ||= (e) => b("confirm")
|
|
71
|
+
}, null, 8, [
|
|
72
|
+
"title",
|
|
73
|
+
"color",
|
|
74
|
+
"loading",
|
|
75
|
+
"autofocus"
|
|
76
|
+
])]),
|
|
77
|
+
default: g(() => [o("div", _, [c.icon ? (d(), a("span", {
|
|
78
|
+
key: 0,
|
|
79
|
+
class: u(["inline-flex size-8 shrink-0 items-center justify-center rounded-10 border", x[c.color]]),
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
}, [(d(), r(p(c.icon), { class: "size-4" }))], 2)) : i("", !0), o("div", { class: u(["min-w-0 flex-1 text-base text-muted [&_strong]:font-semibold [&_strong]:text-heading", c.icon && "pt-1.5"]) }, [f(n.$slots, "default", {}, () => [o("p", null, m(c.description), 1)])], 2)])]),
|
|
82
|
+
_: 3
|
|
83
|
+
}, 8, [
|
|
84
|
+
"open",
|
|
85
|
+
"title",
|
|
86
|
+
"closable",
|
|
87
|
+
"close-on-outside-click"
|
|
88
|
+
]));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { v as default };
|
|
@@ -7,7 +7,7 @@ export interface Props {
|
|
|
7
7
|
bordered?: boolean;
|
|
8
8
|
}
|
|
9
9
|
type __VLS_Slots = {
|
|
10
|
-
/**
|
|
10
|
+
/** A 16px Lucide icon before the title, shown in a tinted 32px tile. */
|
|
11
11
|
icon?: () => unknown;
|
|
12
12
|
/** Right after the title, e.g. a count badge or info tooltip. */
|
|
13
13
|
"title-actions"?: () => unknown;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s } from "vue";
|
|
2
2
|
//#region src/lib/components/AcContentHeader.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var c = { class: "flex min-w-0 items-center gap-
|
|
3
|
+
var c = { class: "flex min-w-0 items-center gap-3" }, l = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "inline-flex shrink-0 text-
|
|
6
|
-
|
|
5
|
+
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary-strong [&_svg]:size-4",
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}, u = { class: "min-w-0" }, d = { class: "flex items-center gap-2" }, f = { class: "truncate font-heading text-lg leading-tight font-semibold tracking-tight text-heading" }, p = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "mt-0.5 truncate text-xs text-muted"
|
|
9
10
|
}, m = {
|
|
@@ -21,7 +22,7 @@ var c = { class: "flex min-w-0 items-center gap-2.5" }, l = {
|
|
|
21
22
|
},
|
|
22
23
|
setup(r) {
|
|
23
24
|
return (h, g) => (a(), t("div", {
|
|
24
|
-
class: i(["flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-5
|
|
25
|
+
class: i(["flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-6 pt-5 pb-3", r.bordered && "border-b border-border"]),
|
|
25
26
|
"data-ac-ds": "",
|
|
26
27
|
"data-testid": "ac-content-header"
|
|
27
28
|
}, [n("div", c, [h.$slots.icon ? (a(), t("span", l, [o(h.$slots, "icon")])) : e("", !0), n("div", u, [n("div", d, [n("h5", f, s(r.title), 1), o(h.$slots, "title-actions")]), r.subtitle ? (a(), t("p", p, s(r.subtitle), 1)) : e("", !0)])]), h.$slots.default ? (a(), t("div", m, [o(h.$slots, "default")])) : e("", !0)], 2));
|
|
@@ -8,10 +8,10 @@ var o = /*@__PURE__*/ n({
|
|
|
8
8
|
} },
|
|
9
9
|
setup(n) {
|
|
10
10
|
return (o, s) => (i(), e("section", {
|
|
11
|
-
class: r(n.surface && "rounded-
|
|
11
|
+
class: r(n.surface && "rounded-14 border border-border bg-surface text-body"),
|
|
12
12
|
"data-ac-ds": "",
|
|
13
13
|
"data-testid": "ac-content-layout"
|
|
14
|
-
}, [a(o.$slots, "header"), t("div", { class: r(n.surface && ["overflow-hidden rounded-b-
|
|
14
|
+
}, [a(o.$slots, "header"), t("div", { class: r(n.surface && ["overflow-hidden rounded-b-14", !o.$slots.header && "rounded-t-14"]) }, [a(o.$slots, "default")], 2)], 2));
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
//#endregion
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** The text copied to the clipboard, e.g. a cluster ID, IP address or endpoint. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** What the value is, in lower case: "cluster ID", "public IP". Read as "Copy cluster ID" and announced as "Copied cluster ID". */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Text shown instead of `value`, e.g. the first 8 characters of a UUID. The tooltip shows the full value. */
|
|
7
|
+
display?: string;
|
|
8
|
+
/** Shows the text in JetBrains Mono, for IDs, IPs, versions and resource names. Turn off for plain text such as a team name. */
|
|
9
|
+
mono?: boolean;
|
|
10
|
+
/** Shows only a copy icon button, for placing after a value you render yourself. */
|
|
11
|
+
iconOnly?: boolean;
|
|
12
|
+
/** Text size: `small` 12px for table cells and chips, `normal` 14px for detail pages. */
|
|
13
|
+
size?: "small" | "normal";
|
|
14
|
+
/** `plain` text with a copy icon on hover, or `chip`: a bordered, tinted pill for IDs in page headers. */
|
|
15
|
+
variant?: "plain" | "chip";
|
|
16
|
+
}
|
|
17
|
+
type __VLS_Slots = {
|
|
18
|
+
/** Custom content instead of the text, e.g. a styled span. The copy icon still follows it. */
|
|
19
|
+
default?: () => unknown;
|
|
20
|
+
};
|
|
21
|
+
declare function focus(): void;
|
|
22
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
23
|
+
focus: typeof focus;
|
|
24
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
copy: (value: string) => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
27
|
+
onCopy?: ((value: string) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
variant: "plain" | "chip";
|
|
30
|
+
label: string;
|
|
31
|
+
display: string;
|
|
32
|
+
size: "small" | "normal";
|
|
33
|
+
iconOnly: boolean;
|
|
34
|
+
mono: boolean;
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import e from "./AcTooltip.js";
|
|
2
|
+
import { copyText as t } from "../composables/copyText.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, nextTick as f, normalizeClass as p, onBeforeUnmount as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as b, withCtx as x, withModifiers as S } from "vue";
|
|
4
|
+
import { Check as C, Copy as w } from "@lucide/vue";
|
|
5
|
+
//#region src/lib/components/AcCopyButton.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var T = ["aria-label"], E = { class: "sr-only" }, D = { class: "block font-mono break-all" }, O = {
|
|
7
|
+
class: "sr-only",
|
|
8
|
+
role: "status"
|
|
9
|
+
}, k = 1500, A = /*@__PURE__*/ u({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "AcCopyButton",
|
|
12
|
+
props: {
|
|
13
|
+
value: {},
|
|
14
|
+
label: { default: "value" },
|
|
15
|
+
display: { default: "" },
|
|
16
|
+
mono: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !0
|
|
19
|
+
},
|
|
20
|
+
iconOnly: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
size: { default: "normal" },
|
|
25
|
+
variant: { default: "plain" }
|
|
26
|
+
},
|
|
27
|
+
emits: ["copy"],
|
|
28
|
+
setup(u, { expose: A, emit: j }) {
|
|
29
|
+
let M = u, N = j, P = b(), F = g(null), I = g(null), L = g("idle"), R = g(!1), z, B = r(() => ({
|
|
30
|
+
class: P.class,
|
|
31
|
+
style: P.style
|
|
32
|
+
})), V = r(() => {
|
|
33
|
+
let { class: e, style: t, ...n } = P;
|
|
34
|
+
return n;
|
|
35
|
+
}), H = r(() => M.display || M.value), U = r(() => !M.iconOnly && (R.value || !!M.display && M.display !== M.value)), W = r(() => M.iconOnly ? M.size === "small" ? "size-6 justify-center rounded-6" : "size-7 justify-center rounded-8" : M.variant === "chip" ? M.size === "small" ? "gap-1.5 rounded-8 px-2 py-0.5 text-xs" : "gap-1.5 rounded-8 px-2.5 py-1 text-base" : M.size === "small" ? "gap-1 rounded-4 text-xs" : "gap-1.5 rounded-6 text-base"), G = r(() => M.iconOnly ? "text-muted hover:bg-surface-sunken hover:text-heading" : M.variant === "chip" ? "border border-border bg-surface-sunken/50 text-muted hover:border-border-dark hover:text-heading" : "text-heading"), K = r(() => M.iconOnly && M.size === "normal" ? "size-4" : "size-3.5"), q = r(() => M.iconOnly ? "" : M.variant === "chip" ? "text-muted opacity-60 group-hover:opacity-100 group-focus-visible:opacity-100" : "text-muted opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 pointer-coarse:opacity-100");
|
|
36
|
+
function J() {
|
|
37
|
+
let e = I.value;
|
|
38
|
+
R.value = !!e && e.scrollWidth > e.clientWidth + 1;
|
|
39
|
+
}
|
|
40
|
+
async function Y() {
|
|
41
|
+
clearTimeout(z);
|
|
42
|
+
try {
|
|
43
|
+
await t(M.value), L.value = "copied", N("copy", M.value);
|
|
44
|
+
} catch {
|
|
45
|
+
L.value = "failed";
|
|
46
|
+
}
|
|
47
|
+
z = setTimeout(() => L.value = "idle", k), await f(), X();
|
|
48
|
+
}
|
|
49
|
+
function X() {
|
|
50
|
+
let e = F.value?.closest("[data-testid=\"ac-tooltip\"]");
|
|
51
|
+
e && F.value?.matches(":hover") && e.dispatchEvent(new PointerEvent("pointerenter", { pointerType: "mouse" }));
|
|
52
|
+
}
|
|
53
|
+
function Z() {
|
|
54
|
+
F.value?.focus();
|
|
55
|
+
}
|
|
56
|
+
return m(() => clearTimeout(z)), A({ focus: Z }), (t, r) => (h(), o("span", d({ class: "inline-flex max-w-full min-w-0 align-middle" }, B.value, {
|
|
57
|
+
"data-ac-ds": "",
|
|
58
|
+
"data-testid": "ac-copy-button"
|
|
59
|
+
}), [l(e, {
|
|
60
|
+
class: "min-w-0 flex-auto",
|
|
61
|
+
delay: L.value === "idle" ? 300 : 0
|
|
62
|
+
}, {
|
|
63
|
+
content: x(() => [L.value === "copied" ? (h(), o(n, { key: 0 }, [c("Copied")], 64)) : L.value === "failed" ? (h(), o(n, { key: 1 }, [c("Couldn't copy. The browser blocked the clipboard.")], 64)) : U.value ? (h(), o(n, { key: 2 }, [s("span", D, v(u.value), 1), r[0] ||= s("span", { class: "block text-on-tooltip/70" }, "Click to copy", -1)], 64)) : (h(), o(n, { key: 3 }, [c("Copy")], 64))]),
|
|
64
|
+
default: x(() => [s("button", d({
|
|
65
|
+
ref_key: "button",
|
|
66
|
+
ref: F,
|
|
67
|
+
type: "button",
|
|
68
|
+
class: ["group inline-flex max-w-full min-w-0 flex-auto cursor-pointer items-center text-left transition-[color,background-color,border-color] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", [W.value, G.value]],
|
|
69
|
+
"aria-label": u.iconOnly ? `Copy ${u.label}` : void 0
|
|
70
|
+
}, V.value, {
|
|
71
|
+
onClick: S(Y, ["stop"]),
|
|
72
|
+
onPointerenter: J,
|
|
73
|
+
onFocus: J
|
|
74
|
+
}), [u.iconOnly ? a("", !0) : (h(), o(n, { key: 0 }, [s("span", E, v(`Copy ${u.label}: `), 1), s("span", {
|
|
75
|
+
ref_key: "text",
|
|
76
|
+
ref: I,
|
|
77
|
+
class: p(["min-w-0 truncate", u.mono && "font-mono"])
|
|
78
|
+
}, [_(t.$slots, "default", {}, () => [c(v(H.value), 1)])], 2)], 64)), L.value === "copied" ? (h(), i(y(C), {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: p(["shrink-0 text-success-strong", K.value]),
|
|
81
|
+
"aria-hidden": "true"
|
|
82
|
+
}, null, 8, ["class"])) : (h(), i(y(w), {
|
|
83
|
+
key: 2,
|
|
84
|
+
class: p(["shrink-0 transition-opacity duration-200", [K.value, q.value]]),
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
}, null, 8, ["class"]))], 16, T)]),
|
|
87
|
+
_: 3
|
|
88
|
+
}, 8, ["delay"]), s("span", O, v(L.value === "copied" ? `Copied ${u.label}` : L.value === "failed" ? `Couldn't copy ${u.label}` : ""), 1)], 16));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { A as default };
|
|
@@ -7,9 +7,9 @@ export interface DatePickerPreset {
|
|
|
7
7
|
value?: () => string | [string, string];
|
|
8
8
|
}
|
|
9
9
|
export interface Props {
|
|
10
|
-
/**
|
|
10
|
+
/** Label above the field. Doubles as the accessible name of the trigger and the popover. */
|
|
11
11
|
label?: string;
|
|
12
|
-
/** Text shown in the field
|
|
12
|
+
/** Text shown in the field while there's no value. Defaults to "Choose date" (or "Choose duration"). */
|
|
13
13
|
placeholder?: string;
|
|
14
14
|
/** `date` for a calendar day (`YYYY-MM-DD`), `datetime` for an instant with hours and minutes (UTC ISO 8601), or `duration` for a Go/Kubernetes duration such as `26h30m`. */
|
|
15
15
|
mode?: "date" | "datetime" | "duration";
|
|
@@ -37,9 +37,9 @@ export interface Props {
|
|
|
37
37
|
disabled?: boolean;
|
|
38
38
|
/** Marks the field required and adds a red asterisk. */
|
|
39
39
|
required?: boolean;
|
|
40
|
-
/** Error text under the field. */
|
|
40
|
+
/** Error text under the field. Turns the border red and sets `aria-invalid`. */
|
|
41
41
|
errorMsg?: string;
|
|
42
|
-
/**
|
|
42
|
+
/** Help text between the label and the field. */
|
|
43
43
|
hint?: string;
|
|
44
44
|
/** `small` 36px or `normal` 40px tall. */
|
|
45
45
|
size?: "small" | "normal";
|
|
@@ -75,10 +75,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
75
75
|
range: boolean;
|
|
76
76
|
clearable: boolean;
|
|
77
77
|
errorMsg: string;
|
|
78
|
+
presets: DatePickerPreset[];
|
|
78
79
|
minDate: string;
|
|
79
80
|
maxDate: string;
|
|
80
81
|
isDateDisabled: (day: string) => boolean;
|
|
81
|
-
presets: DatePickerPreset[];
|
|
82
82
|
timeZone: string;
|
|
83
83
|
locale: string;
|
|
84
84
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|