@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
|
@@ -21,8 +21,10 @@ export interface Props {
|
|
|
21
21
|
errorMsg?: string;
|
|
22
22
|
/** Help text between the label and the field. */
|
|
23
23
|
hint?: string;
|
|
24
|
-
/** `small` 36px or `normal`
|
|
24
|
+
/** `small` 36px or `normal` 42px tall. With `swatch-only`, a 40px or 48px swatch. */
|
|
25
25
|
size?: "small" | "normal";
|
|
26
|
+
/** Shows only the native colour swatch, with no hex field: cloud-ui's AcColorInput look. */
|
|
27
|
+
swatchOnly?: boolean;
|
|
26
28
|
}
|
|
27
29
|
type __VLS_Props = Props;
|
|
28
30
|
type __VLS_ModelProps = {
|
|
@@ -31,7 +33,7 @@ type __VLS_ModelProps = {
|
|
|
31
33
|
};
|
|
32
34
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
33
35
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
34
|
-
/** Moves focus to the hex field
|
|
36
|
+
/** Moves focus to the hex field, or to the swatch with `swatch-only`. */
|
|
35
37
|
focus: () => void | undefined;
|
|
36
38
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
39
|
"update:modelValue": (value: string) => any;
|
|
@@ -49,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
49
51
|
hint: string;
|
|
50
52
|
errorMsg: string;
|
|
51
53
|
presets: (string | ColorPreset)[];
|
|
54
|
+
swatchOnly: boolean;
|
|
52
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
56
|
declare const _default: typeof __VLS_export;
|
|
54
57
|
export default _default;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i,
|
|
2
|
-
import { CircleAlert as S } from "@lucide/vue";
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _, watch as v, withKeys as y } from "vue";
|
|
3
2
|
//#region src/lib/components/AcColorInput.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
3
|
+
var b = ["for"], x = {
|
|
5
4
|
key: 0,
|
|
6
5
|
class: "font-normal text-muted"
|
|
7
|
-
},
|
|
6
|
+
}, S = {
|
|
8
7
|
key: 1,
|
|
9
8
|
class: "text-danger",
|
|
10
9
|
"aria-hidden": "true"
|
|
11
|
-
},
|
|
10
|
+
}, C = ["id"], w = [
|
|
11
|
+
"id",
|
|
12
|
+
"value",
|
|
13
|
+
"name",
|
|
14
|
+
"disabled",
|
|
15
|
+
"required",
|
|
16
|
+
"aria-label",
|
|
17
|
+
"aria-invalid",
|
|
18
|
+
"aria-describedby"
|
|
19
|
+
], T = [
|
|
12
20
|
"value",
|
|
13
21
|
"disabled",
|
|
14
22
|
"aria-label"
|
|
15
|
-
],
|
|
23
|
+
], E = [
|
|
16
24
|
"id",
|
|
17
25
|
"value",
|
|
18
26
|
"name",
|
|
@@ -21,16 +29,16 @@ var C = ["for"], w = {
|
|
|
21
29
|
"required",
|
|
22
30
|
"aria-invalid",
|
|
23
31
|
"aria-describedby"
|
|
24
|
-
],
|
|
32
|
+
], D = ["aria-label"], O = [
|
|
25
33
|
"disabled",
|
|
26
34
|
"aria-label",
|
|
27
35
|
"aria-pressed",
|
|
28
36
|
"title",
|
|
29
37
|
"onClick"
|
|
30
|
-
],
|
|
38
|
+
], k = ["id"], A = /*@__PURE__*/ a({
|
|
31
39
|
inheritAttrs: !1,
|
|
32
40
|
__name: "AcColorInput",
|
|
33
|
-
props: /*@__PURE__*/
|
|
41
|
+
props: /*@__PURE__*/ o({
|
|
34
42
|
label: { default: "" },
|
|
35
43
|
name: { default: "" },
|
|
36
44
|
presets: { default: () => [] },
|
|
@@ -48,140 +56,162 @@ var C = ["for"], w = {
|
|
|
48
56
|
},
|
|
49
57
|
errorMsg: { default: "" },
|
|
50
58
|
hint: { default: "" },
|
|
51
|
-
size: { default: "normal" }
|
|
59
|
+
size: { default: "normal" },
|
|
60
|
+
swatchOnly: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
}
|
|
52
64
|
}, {
|
|
53
65
|
modelValue: { default: "" },
|
|
54
66
|
modelModifiers: {}
|
|
55
67
|
}),
|
|
56
|
-
emits: /*@__PURE__*/
|
|
57
|
-
setup(
|
|
58
|
-
let
|
|
59
|
-
class:
|
|
60
|
-
style:
|
|
61
|
-
})),
|
|
62
|
-
let { class: e, style: t, ...n } =
|
|
68
|
+
emits: /*@__PURE__*/ o(["change"], ["update:modelValue"]),
|
|
69
|
+
setup(a, { expose: o, emit: A }) {
|
|
70
|
+
let j = a, M = _(a, "modelValue"), N = A, P = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i, F = g(), I = h(), L = t(() => ({
|
|
71
|
+
class: I.class,
|
|
72
|
+
style: I.style
|
|
73
|
+
})), R = t(() => {
|
|
74
|
+
let { class: e, style: t, ...n } = I;
|
|
63
75
|
return n;
|
|
64
|
-
}),
|
|
65
|
-
let t = typeof e == "string" ? { value: e } : e, n =
|
|
76
|
+
}), z = d(null), B = d(null), V = d(M.value), H = d(""), U = t(() => J(M.value)), W = t(() => j.disabled || j.readonly), G = t(() => j.errorMsg || H.value), K = t(() => [j.hint && `${F}-hint`, G.value && `${F}-msg`].filter(Boolean).join(" ") || void 0), q = t(() => j.presets.flatMap((e) => {
|
|
77
|
+
let t = typeof e == "string" ? { value: e } : e, n = J(t.value);
|
|
66
78
|
return n ? [{
|
|
67
79
|
value: n,
|
|
68
80
|
label: t.label || n
|
|
69
81
|
}] : [];
|
|
70
82
|
}));
|
|
71
|
-
function
|
|
72
|
-
let t = e ?
|
|
83
|
+
function J(e) {
|
|
84
|
+
let t = e ? P.exec(e.trim()) : null;
|
|
73
85
|
if (!t) return null;
|
|
74
86
|
let n = t[1].toLowerCase();
|
|
75
87
|
return `#${n.length === 3 ? [...n].map((e) => e + e).join("") : n}`;
|
|
76
88
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
89
|
+
function Y(e) {
|
|
90
|
+
H.value = "", V.value = e, e !== M.value && (M.value = e, N("change", e));
|
|
79
91
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
let t =
|
|
83
|
-
t && (
|
|
92
|
+
function X(e) {
|
|
93
|
+
V.value = e.target.value, H.value = "";
|
|
94
|
+
let t = V.value.trim().replace(/^#?/, "").length === 6 ? J(V.value) : null;
|
|
95
|
+
t && (M.value = t);
|
|
84
96
|
}
|
|
85
|
-
function
|
|
86
|
-
let e =
|
|
87
|
-
if (!e) return
|
|
88
|
-
let t =
|
|
89
|
-
t ?
|
|
97
|
+
function Z() {
|
|
98
|
+
let e = V.value.trim();
|
|
99
|
+
if (!e) return Y("");
|
|
100
|
+
let t = J(e);
|
|
101
|
+
t ? Y(t) : H.value = "Enter a hex colour such as #1c7c54 or #fff";
|
|
90
102
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
103
|
+
function Q(e) {
|
|
104
|
+
H.value = "";
|
|
93
105
|
let t = e.target.value.toLowerCase();
|
|
94
|
-
|
|
106
|
+
V.value = t, M.value = t;
|
|
95
107
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
108
|
+
function $(e) {
|
|
109
|
+
N("change", e.target.value.toLowerCase());
|
|
98
110
|
}
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
}),
|
|
102
|
-
class: ["w-full",
|
|
111
|
+
return v(M, (e) => {
|
|
112
|
+
J(V.value) !== J(e) && (V.value = e ?? "");
|
|
113
|
+
}), o({ focus: () => (j.swatchOnly ? B.value : z.value)?.focus() }), (t, o) => (u(), r("div", s(L.value, {
|
|
114
|
+
class: [a.swatchOnly ? "w-fit" : "w-full", a.disabled && "opacity-50"],
|
|
103
115
|
"data-ac-ds": "",
|
|
104
116
|
"data-testid": "ac-color-input"
|
|
105
117
|
}), [
|
|
106
|
-
|
|
118
|
+
a.label ? (u(), r("label", {
|
|
107
119
|
key: 0,
|
|
108
|
-
for:
|
|
120
|
+
for: a.swatchOnly ? `${m(F)}-picker` : m(F),
|
|
109
121
|
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
110
122
|
}, [
|
|
111
|
-
i("span", null,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
], 8,
|
|
115
|
-
|
|
123
|
+
i("span", null, p(a.label), 1),
|
|
124
|
+
a.readonly ? (u(), r("span", x, "(read only)")) : n("", !0),
|
|
125
|
+
a.required ? (u(), r("span", S, "*")) : n("", !0)
|
|
126
|
+
], 8, b)) : n("", !0),
|
|
127
|
+
a.hint ? (u(), r("p", {
|
|
116
128
|
key: 1,
|
|
117
|
-
id: `${
|
|
129
|
+
id: `${m(F)}-hint`,
|
|
118
130
|
class: "mb-2 text-base text-muted"
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
}, p(a.hint), 9, C)) : n("", !0),
|
|
132
|
+
a.swatchOnly ? (u(), r("input", s({
|
|
133
|
+
key: 2,
|
|
134
|
+
id: `${m(F)}-picker`,
|
|
135
|
+
ref_key: "picker",
|
|
136
|
+
ref: B
|
|
137
|
+
}, R.value, {
|
|
138
|
+
type: "color",
|
|
139
|
+
value: U.value ?? "#000000",
|
|
140
|
+
name: a.name,
|
|
141
|
+
disabled: W.value,
|
|
142
|
+
required: a.required,
|
|
143
|
+
"aria-label": a.label ? void 0 : R.value["aria-label"] ?? "Colour",
|
|
144
|
+
"aria-invalid": !!G.value || void 0,
|
|
145
|
+
"aria-describedby": K.value,
|
|
146
|
+
class: ["block cursor-pointer rounded-6 border-2 bg-background text-heading transition-all duration-200 focus:border-primary/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:cursor-not-allowed motion-reduce:transition-none", [a.size === "small" ? "size-10" : "size-12", G.value ? "border-danger/50" : "border-border"]],
|
|
147
|
+
"data-testid": "ac-color-input-swatch",
|
|
148
|
+
onInput: Q,
|
|
149
|
+
onChange: $
|
|
150
|
+
}), null, 16, w)) : (u(), r("div", {
|
|
151
|
+
key: 3,
|
|
152
|
+
class: c(["relative flex min-w-0 items-center rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
|
|
153
|
+
a.size === "small" ? "h-9" : "h-10.5",
|
|
154
|
+
a.readonly ? "bg-surface-muted" : "bg-background",
|
|
155
|
+
G.value ? "border-danger/50 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", !a.disabled && "hover:border-accent-active"]
|
|
156
|
+
]])
|
|
157
|
+
}, [i("span", {
|
|
158
|
+
class: c(["relative ml-1 shrink-0 overflow-hidden rounded-8 border-2 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", [a.size === "small" ? "size-7" : "size-8", !U.value && "bg-surface-sunken"]]),
|
|
159
|
+
style: l(U.value ? { backgroundColor: U.value } : void 0),
|
|
127
160
|
"data-testid": "ac-color-input-swatch"
|
|
128
161
|
}, [i("input", {
|
|
129
162
|
type: "color",
|
|
130
|
-
value:
|
|
131
|
-
disabled:
|
|
132
|
-
"aria-label":
|
|
163
|
+
value: U.value ?? "#000000",
|
|
164
|
+
disabled: W.value,
|
|
165
|
+
"aria-label": a.label ? `${a.label}: open colour picker` : "Open colour picker",
|
|
133
166
|
class: "absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
134
|
-
onInput:
|
|
135
|
-
onChange:
|
|
136
|
-
}, null, 40,
|
|
137
|
-
id:
|
|
167
|
+
onInput: Q,
|
|
168
|
+
onChange: $
|
|
169
|
+
}, null, 40, T)], 6), i("input", s({
|
|
170
|
+
id: m(F),
|
|
138
171
|
ref_key: "input",
|
|
139
|
-
ref:
|
|
140
|
-
},
|
|
172
|
+
ref: z
|
|
173
|
+
}, R.value, {
|
|
141
174
|
type: "text",
|
|
142
175
|
autocomplete: "off",
|
|
143
176
|
spellcheck: "false",
|
|
144
177
|
maxlength: "7",
|
|
145
|
-
value:
|
|
146
|
-
name:
|
|
147
|
-
disabled:
|
|
148
|
-
readonly:
|
|
149
|
-
required:
|
|
150
|
-
"aria-invalid": !!
|
|
151
|
-
"aria-describedby":
|
|
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",
|
|
153
|
-
onInput:
|
|
154
|
-
onBlur:
|
|
155
|
-
onKeydown:
|
|
156
|
-
}), null, 16,
|
|
157
|
-
|
|
158
|
-
key:
|
|
178
|
+
value: V.value,
|
|
179
|
+
name: a.name,
|
|
180
|
+
disabled: a.disabled,
|
|
181
|
+
readonly: a.readonly,
|
|
182
|
+
required: a.required,
|
|
183
|
+
"aria-invalid": !!G.value || void 0,
|
|
184
|
+
"aria-describedby": K.value,
|
|
185
|
+
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", a.size === "small" ? "pr-3" : "pr-4"],
|
|
186
|
+
onInput: X,
|
|
187
|
+
onBlur: Z,
|
|
188
|
+
onKeydown: y(Z, ["enter"])
|
|
189
|
+
}), null, 16, E)], 2)),
|
|
190
|
+
q.value.length ? (u(), r("div", {
|
|
191
|
+
key: 4,
|
|
159
192
|
class: "mt-2.5 flex flex-wrap gap-2",
|
|
160
193
|
role: "group",
|
|
161
|
-
"aria-label":
|
|
162
|
-
}, [(
|
|
194
|
+
"aria-label": a.label ? `${a.label} presets` : "Presets"
|
|
195
|
+
}, [(u(!0), r(e, null, f(q.value, (e) => (u(), r("button", {
|
|
163
196
|
key: e.value,
|
|
164
197
|
type: "button",
|
|
165
|
-
class:
|
|
166
|
-
style:
|
|
167
|
-
disabled:
|
|
198
|
+
class: c(["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 === U.value && "ring-2 ring-primary ring-offset-2 ring-offset-surface", !W.value && "cursor-pointer"]]),
|
|
199
|
+
style: l({ backgroundColor: e.value }),
|
|
200
|
+
disabled: W.value,
|
|
168
201
|
"aria-label": e.label,
|
|
169
|
-
"aria-pressed": e.value ===
|
|
202
|
+
"aria-pressed": e.value === U.value,
|
|
170
203
|
title: e.label,
|
|
171
204
|
"data-testid": "ac-color-input-preset",
|
|
172
|
-
onClick: (t) =>
|
|
173
|
-
}, null, 14,
|
|
174
|
-
|
|
175
|
-
key:
|
|
176
|
-
id: `${
|
|
177
|
-
class: "mt-1
|
|
205
|
+
onClick: (t) => Y(e.value)
|
|
206
|
+
}, null, 14, O))), 128))], 8, D)) : n("", !0),
|
|
207
|
+
G.value ? (u(), r("p", {
|
|
208
|
+
key: 5,
|
|
209
|
+
id: `${m(F)}-msg`,
|
|
210
|
+
class: "mt-1 text-base text-danger-strong",
|
|
178
211
|
role: "alert"
|
|
179
|
-
},
|
|
180
|
-
class: "size-4 shrink-0",
|
|
181
|
-
"aria-hidden": "true"
|
|
182
|
-
}), a(" " + h(K.value), 1)], 8, j)) : n("", !0)
|
|
212
|
+
}, p(G.value), 9, k)) : n("", !0)
|
|
183
213
|
], 16));
|
|
184
214
|
}
|
|
185
215
|
});
|
|
186
216
|
//#endregion
|
|
187
|
-
export {
|
|
217
|
+
export { A as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface Props {
|
|
2
|
+
/** The commands or text to show and copy. An array is joined with line breaks. */
|
|
3
|
+
commands: string | string[];
|
|
4
|
+
/** A line above the block saying where to run it, e.g. "On the machine that runs the tunnel:". */
|
|
5
|
+
caption?: string;
|
|
6
|
+
/** What the block holds, read by screen readers in "Copy commands" and "Copied commands". */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Masks the text with dots until the viewer clicks the eye button, for passwords and tokens. Copy still copies the real value. */
|
|
9
|
+
secret?: boolean;
|
|
10
|
+
/** Tallest the block grows before it scrolls, as a CSS length, e.g. `"240px"`. Leave empty to show everything. */
|
|
11
|
+
maxHeight?: string;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Slots = {
|
|
14
|
+
/** Extra buttons next to Copy, e.g. a "Download script" link. Use small, quiet buttons. */
|
|
15
|
+
actions?: () => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
|
+
copy: (text: string) => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
20
|
+
onCopy?: ((text: string) => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
caption: string;
|
|
23
|
+
label: string;
|
|
24
|
+
maxHeight: string;
|
|
25
|
+
secret: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { copyText as e } from "../composables/copyText.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeStyle as c, onBeforeUnmount as l, openBlock as u, ref as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useId as g } from "vue";
|
|
3
|
+
import { Check as _, Copy as v, Eye as y, EyeOff as b } from "@lucide/vue";
|
|
4
|
+
//#region src/lib/components/AcCommandBlock.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var x = {
|
|
6
|
+
"data-ac-ds": "",
|
|
7
|
+
"data-testid": "ac-command-block"
|
|
8
|
+
}, S = ["id"], C = { class: "relative" }, w = ["aria-describedby", "aria-label"], T = { class: "absolute top-2 right-2 flex items-center gap-1 rounded-8 bg-background" }, E = ["aria-label", "aria-pressed"], D = { class: "sr-only" }, O = {
|
|
9
|
+
class: "sr-only",
|
|
10
|
+
role: "status"
|
|
11
|
+
}, k = /*@__PURE__*/ s({
|
|
12
|
+
__name: "AcCommandBlock",
|
|
13
|
+
props: {
|
|
14
|
+
commands: {},
|
|
15
|
+
caption: { default: "" },
|
|
16
|
+
label: { default: "commands" },
|
|
17
|
+
secret: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
maxHeight: { default: "" }
|
|
22
|
+
},
|
|
23
|
+
emits: ["copy"],
|
|
24
|
+
setup(s, { emit: k }) {
|
|
25
|
+
let A = s, j = k, M = g(), N = d(!1), P = d(!1), F = d(!1), I, L = t(() => Array.isArray(A.commands) ? A.commands.join("\n") : A.commands), R = t(() => A.secret && !F.value ? L.value.replace(/[^\n]/g, "•") : L.value), z = t(() => N.value ? `Copied ${A.label}` : P.value ? "Copy failed. Select the text and copy it by hand." : "");
|
|
26
|
+
async function B() {
|
|
27
|
+
clearTimeout(I);
|
|
28
|
+
try {
|
|
29
|
+
await e(L.value), N.value = !0, P.value = !1, j("copy", L.value);
|
|
30
|
+
} catch {
|
|
31
|
+
P.value = !0;
|
|
32
|
+
}
|
|
33
|
+
I = setTimeout(() => {
|
|
34
|
+
N.value = !1, P.value = !1;
|
|
35
|
+
}, 2e3);
|
|
36
|
+
}
|
|
37
|
+
return l(() => clearTimeout(I)), (e, t) => (u(), i("div", x, [s.caption ? (u(), i("p", {
|
|
38
|
+
key: 0,
|
|
39
|
+
id: `${h(M)}-caption`,
|
|
40
|
+
class: "mb-1.5 text-xs text-muted"
|
|
41
|
+
}, m(s.caption), 9, S)) : r("", !0), a("div", C, [
|
|
42
|
+
a("pre", {
|
|
43
|
+
class: "ac-scrollbar overflow-auto rounded-10 border border-border bg-background/60 p-3 pr-28 font-mono text-xs leading-relaxed whitespace-pre text-heading",
|
|
44
|
+
style: c(s.maxHeight ? { maxHeight: s.maxHeight } : void 0),
|
|
45
|
+
"aria-describedby": s.caption ? `${h(M)}-caption` : void 0,
|
|
46
|
+
"aria-label": s.secret && !F.value ? `${s.label} (hidden)` : void 0,
|
|
47
|
+
tabindex: "0",
|
|
48
|
+
"data-testid": "ac-command-block-text"
|
|
49
|
+
}, m(R.value), 13, w),
|
|
50
|
+
a("div", T, [
|
|
51
|
+
f(e.$slots, "actions"),
|
|
52
|
+
s.secret ? (u(), i("button", {
|
|
53
|
+
key: 0,
|
|
54
|
+
type: "button",
|
|
55
|
+
class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-8 border border-border bg-surface text-muted transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
56
|
+
"aria-label": F.value ? `Hide ${s.label}` : `Show ${s.label}`,
|
|
57
|
+
"aria-pressed": F.value,
|
|
58
|
+
"data-testid": "ac-command-block-reveal",
|
|
59
|
+
onClick: t[0] ||= (e) => F.value = !F.value
|
|
60
|
+
}, [(u(), n(p(F.value ? h(b) : h(y)), {
|
|
61
|
+
class: "size-3.5",
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}))], 8, E)) : r("", !0),
|
|
64
|
+
a("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
class: "group inline-flex h-6 cursor-pointer items-center gap-1 rounded-8 border border-border bg-surface px-1.5 text-xs text-muted transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
67
|
+
"data-testid": "ac-command-block-copy",
|
|
68
|
+
onClick: B
|
|
69
|
+
}, [
|
|
70
|
+
N.value ? (u(), n(h(_), {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "size-3.5 text-primary",
|
|
73
|
+
"aria-hidden": "true"
|
|
74
|
+
})) : (u(), n(h(v), {
|
|
75
|
+
key: 1,
|
|
76
|
+
class: "size-3.5",
|
|
77
|
+
"aria-hidden": "true"
|
|
78
|
+
})),
|
|
79
|
+
o(" " + m(N.value ? "Copied" : "Copy"), 1),
|
|
80
|
+
a("span", D, m(s.label), 1)
|
|
81
|
+
])
|
|
82
|
+
]),
|
|
83
|
+
a("span", O, m(z.value), 1)
|
|
84
|
+
])]));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
export { k as default };
|
|
@@ -11,7 +11,7 @@ export interface Props {
|
|
|
11
11
|
confirmText?: string;
|
|
12
12
|
/** Label of the cancel button. */
|
|
13
13
|
cancelLabel?: string;
|
|
14
|
-
/** Colour of the confirm button and the icon tile.
|
|
14
|
+
/** Colour of the soft confirm button and the icon tile. Defaults to `danger`, as cloud-ui's ConfirmModal (its `error`); pass `primary` for safe actions. */
|
|
15
15
|
color?: Tone;
|
|
16
16
|
/** Shows a spinner on the confirm button, disables Cancel and blocks closing while the request runs. cloud-ui's `is-loading`. */
|
|
17
17
|
loading?: boolean;
|
|
@@ -14,7 +14,7 @@ var _ = {
|
|
|
14
14
|
confirmLabel: { default: "Confirm" },
|
|
15
15
|
confirmText: { default: "" },
|
|
16
16
|
cancelLabel: { default: "Cancel" },
|
|
17
|
-
color: { default: "
|
|
17
|
+
color: { default: "danger" },
|
|
18
18
|
loading: {
|
|
19
19
|
type: Boolean,
|
|
20
20
|
default: !1
|
|
@@ -44,13 +44,15 @@ var _ = {
|
|
|
44
44
|
"onUpdate:open": l[1] ||= (e) => y.value = e,
|
|
45
45
|
title: c.title,
|
|
46
46
|
size: "small",
|
|
47
|
+
variant: "plain",
|
|
47
48
|
closable: !c.loading,
|
|
48
49
|
"close-on-outside-click": !c.loading,
|
|
49
50
|
onClose: l[2] ||= (e) => b("cancel")
|
|
50
51
|
}, {
|
|
51
52
|
footer: g(() => [s(e, {
|
|
52
53
|
title: c.cancelLabel,
|
|
53
|
-
|
|
54
|
+
variant: "light",
|
|
55
|
+
size: "medium",
|
|
54
56
|
disabled: c.loading,
|
|
55
57
|
autofocus: C.value || void 0,
|
|
56
58
|
"data-ac-ds": "",
|
|
@@ -63,6 +65,8 @@ var _ = {
|
|
|
63
65
|
]), s(e, {
|
|
64
66
|
title: S.value,
|
|
65
67
|
color: c.color,
|
|
68
|
+
variant: "light",
|
|
69
|
+
size: "medium",
|
|
66
70
|
loading: c.loading,
|
|
67
71
|
autofocus: !C.value || void 0,
|
|
68
72
|
"data-ac-ds": "",
|
|
@@ -78,7 +82,7 @@ var _ = {
|
|
|
78
82
|
key: 0,
|
|
79
83
|
class: u(["inline-flex size-8 shrink-0 items-center justify-center rounded-10 border", x[c.color]]),
|
|
80
84
|
"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-
|
|
85
|
+
}, [(d(), r(p(c.icon), { class: "size-4" }))], 2)) : i("", !0), o("div", { class: u(["min-w-0 flex-1 text-lg text-muted [&_strong]:font-semibold [&_strong]:text-heading", c.icon && "pt-1"]) }, [f(n.$slots, "default", {}, () => [o("p", null, m(c.description), 1)])], 2)])]),
|
|
82
86
|
_: 3
|
|
83
87
|
}, 8, [
|
|
84
88
|
"open",
|
|
@@ -5,11 +5,11 @@ export interface Props {
|
|
|
5
5
|
label?: string;
|
|
6
6
|
/** Text shown instead of `value`, e.g. the first 8 characters of a UUID. The tooltip shows the full value. */
|
|
7
7
|
display?: string;
|
|
8
|
-
/** Shows the text in JetBrains Mono, for IDs, IPs, versions and resource names.
|
|
8
|
+
/** Shows the text in JetBrains Mono, for IDs, IPs, versions and resource names. Off by default: the text takes the surrounding font, as in cloud-ui. */
|
|
9
9
|
mono?: boolean;
|
|
10
10
|
/** Shows only a copy icon button, for placing after a value you render yourself. */
|
|
11
11
|
iconOnly?: boolean;
|
|
12
|
-
/** Text size
|
|
12
|
+
/** Text size. Unset, plain text takes the surrounding size and colour, as in cloud-ui. `small` sets 12px for table cells and chips, `normal` 14px in the heading colour. */
|
|
13
13
|
size?: "small" | "normal";
|
|
14
14
|
/** `plain` text with a copy icon on hover, or `chip`: a bordered, tinted pill for IDs in page headers. */
|
|
15
15
|
variant?: "plain" | "chip";
|
|
@@ -15,13 +15,13 @@ var T = ["aria-label"], E = { class: "sr-only" }, D = { class: "block font-mono
|
|
|
15
15
|
display: { default: "" },
|
|
16
16
|
mono: {
|
|
17
17
|
type: Boolean,
|
|
18
|
-
default: !
|
|
18
|
+
default: !1
|
|
19
19
|
},
|
|
20
20
|
iconOnly: {
|
|
21
21
|
type: Boolean,
|
|
22
22
|
default: !1
|
|
23
23
|
},
|
|
24
|
-
size: { default:
|
|
24
|
+
size: { default: void 0 },
|
|
25
25
|
variant: { default: "plain" }
|
|
26
26
|
},
|
|
27
27
|
emits: ["copy"],
|
|
@@ -32,7 +32,7 @@ var T = ["aria-label"], E = { class: "sr-only" }, D = { class: "block font-mono
|
|
|
32
32
|
})), V = r(() => {
|
|
33
33
|
let { class: e, style: t, ...n } = P;
|
|
34
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
|
|
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" : M.size === "normal" ? "gap-1.5 rounded-6 text-base" : "gap-1 rounded-4"), 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" : M.size ? "text-heading" : ""), K = r(() => M.iconOnly && M.size !== "small" ? "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
36
|
function J() {
|
|
37
37
|
let e = I.value;
|
|
38
38
|
R.value = !!e && e.scrollWidth > e.clientWidth + 1;
|
|
@@ -77,7 +77,7 @@ var T = ["aria-label"], E = { class: "sr-only" }, D = { class: "block font-mono
|
|
|
77
77
|
class: p(["min-w-0 truncate", u.mono && "font-mono"])
|
|
78
78
|
}, [_(t.$slots, "default", {}, () => [c(v(H.value), 1)])], 2)], 64)), L.value === "copied" ? (h(), i(y(C), {
|
|
79
79
|
key: 1,
|
|
80
|
-
class: p(["shrink-0 text-
|
|
80
|
+
class: p(["shrink-0 text-primary", K.value]),
|
|
81
81
|
"aria-hidden": "true"
|
|
82
82
|
}, null, 8, ["class"])) : (h(), i(y(w), {
|
|
83
83
|
key: 2,
|