@ac-design/design-system 2.0.0 → 2.1.1
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 +20 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
- 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,14 +1,13 @@
|
|
|
1
|
-
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i,
|
|
2
|
-
import { CircleAlert as S } from "@lucide/vue";
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, mergeModels as o, mergeProps as s, nextTick as c, normalizeClass as l, onMounted as u, openBlock as d, ref as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _, vModelText as v, watch as y, withDirectives as b } from "vue";
|
|
3
2
|
//#region src/lib/components/AcTextarea.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
3
|
+
var x = ["for"], S = {
|
|
5
4
|
key: 0,
|
|
6
|
-
class: "
|
|
7
|
-
},
|
|
5
|
+
class: "text-muted"
|
|
6
|
+
}, C = {
|
|
8
7
|
key: 1,
|
|
9
8
|
class: "text-danger",
|
|
10
9
|
"aria-hidden": "true"
|
|
11
|
-
},
|
|
10
|
+
}, w = ["id"], T = [
|
|
12
11
|
"id",
|
|
13
12
|
"name",
|
|
14
13
|
"rows",
|
|
@@ -18,19 +17,19 @@ var C = ["for"], w = {
|
|
|
18
17
|
"required",
|
|
19
18
|
"aria-invalid",
|
|
20
19
|
"aria-describedby"
|
|
21
|
-
],
|
|
20
|
+
], E = {
|
|
22
21
|
key: 1,
|
|
23
|
-
class: "mt-1
|
|
24
|
-
},
|
|
22
|
+
class: "mt-1 flex items-start gap-3"
|
|
23
|
+
}, D = ["id"], O = {
|
|
25
24
|
key: 1,
|
|
26
25
|
class: "flex-1"
|
|
27
|
-
},
|
|
26
|
+
}, k = ["id"], A = /*@__PURE__*/ a({
|
|
28
27
|
inheritAttrs: !1,
|
|
29
28
|
__name: "AcTextarea",
|
|
30
|
-
props: /*@__PURE__*/
|
|
29
|
+
props: /*@__PURE__*/ o({
|
|
31
30
|
label: {},
|
|
32
31
|
name: { default: "" },
|
|
33
|
-
rows: { default:
|
|
32
|
+
rows: { default: void 0 },
|
|
34
33
|
autoResize: {
|
|
35
34
|
type: Boolean,
|
|
36
35
|
default: !1
|
|
@@ -60,86 +59,84 @@ var C = ["for"], w = {
|
|
|
60
59
|
modelModifiers: {}
|
|
61
60
|
}),
|
|
62
61
|
emits: ["update:modelValue"],
|
|
63
|
-
setup(
|
|
64
|
-
let
|
|
65
|
-
class:
|
|
66
|
-
style:
|
|
67
|
-
})),
|
|
68
|
-
let { class: e, style: t, ...n } =
|
|
62
|
+
setup(a, { expose: o }) {
|
|
63
|
+
let A = a, j = _(a, "modelValue"), M = g(), N = h(), P = e(() => ({
|
|
64
|
+
class: N.class,
|
|
65
|
+
style: N.style
|
|
66
|
+
})), F = e(() => {
|
|
67
|
+
let { class: e, style: t, ...n } = N;
|
|
69
68
|
return n;
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
}), I = f(null), L = f(!1), R = e(() => A.rows ?? 4), z = e(() => (j.value ?? "").length), B = e(() => A.maxlength !== void 0 && z.value >= A.maxlength), V = e(() => [
|
|
70
|
+
A.hint && `${M}-hint`,
|
|
71
|
+
A.errorMsg && `${M}-msg`,
|
|
72
|
+
A.maxlength !== void 0 && `${M}-count`
|
|
74
73
|
].filter(Boolean).join(" ") || void 0);
|
|
75
|
-
function
|
|
76
|
-
let e =
|
|
77
|
-
if (!e || !
|
|
78
|
-
let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i =
|
|
74
|
+
function H() {
|
|
75
|
+
let e = I.value;
|
|
76
|
+
if (!e || !A.autoResize) return;
|
|
77
|
+
let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = R.value * n + r, a = A.maxRows > 0 ? A.maxRows * n + r : Infinity;
|
|
79
78
|
e.style.height = "auto";
|
|
80
79
|
let o = e.scrollHeight + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth);
|
|
81
|
-
e.style.height = `${Math.min(Math.max(o, i), a)}px`,
|
|
80
|
+
e.style.height = `${Math.min(Math.max(o, i), a)}px`, L.value = o > a;
|
|
82
81
|
}
|
|
83
|
-
return
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
return y(j, () => c(H)), y(() => [
|
|
83
|
+
A.autoResize,
|
|
84
|
+
A.rows,
|
|
85
|
+
A.maxRows
|
|
87
86
|
], () => {
|
|
88
|
-
!
|
|
89
|
-
}),
|
|
90
|
-
class: ["w-full",
|
|
87
|
+
!A.autoResize && I.value && (I.value.style.height = ""), c(H);
|
|
88
|
+
}), u(H), o({ focus: () => I.value?.focus() }), (e, o) => (d(), n("div", s(P.value, {
|
|
89
|
+
class: ["w-full", a.disabled && "opacity-50"],
|
|
91
90
|
"data-ac-ds": "",
|
|
92
91
|
"data-testid": "ac-textarea"
|
|
93
92
|
}), [
|
|
94
93
|
r("label", {
|
|
95
|
-
for:
|
|
94
|
+
for: m(M),
|
|
96
95
|
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
97
96
|
}, [
|
|
98
|
-
r("span", null,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
], 8,
|
|
102
|
-
|
|
97
|
+
r("span", null, p(a.label), 1),
|
|
98
|
+
a.readonly ? (d(), n("span", S, "(read only)")) : t("", !0),
|
|
99
|
+
a.required ? (d(), n("span", C, "*")) : t("", !0)
|
|
100
|
+
], 8, x),
|
|
101
|
+
a.hint ? (d(), n("p", {
|
|
103
102
|
key: 0,
|
|
104
|
-
id: `${
|
|
103
|
+
id: `${m(M)}-hint`,
|
|
105
104
|
class: "mb-2 text-base text-muted"
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
id:
|
|
105
|
+
}, p(a.hint), 9, w)) : t("", !0),
|
|
106
|
+
b(r("textarea", s({
|
|
107
|
+
id: m(M),
|
|
109
108
|
ref_key: "field",
|
|
110
|
-
ref:
|
|
111
|
-
},
|
|
112
|
-
"onUpdate:modelValue":
|
|
113
|
-
name:
|
|
114
|
-
rows:
|
|
115
|
-
maxlength:
|
|
116
|
-
disabled:
|
|
117
|
-
readonly:
|
|
118
|
-
required:
|
|
119
|
-
"aria-invalid": !!
|
|
120
|
-
"aria-describedby":
|
|
121
|
-
class: ["block w-full rounded-10 border px-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
ref: I
|
|
110
|
+
}, F.value, {
|
|
111
|
+
"onUpdate:modelValue": o[0] ||= (e) => j.value = e,
|
|
112
|
+
name: a.name,
|
|
113
|
+
rows: R.value,
|
|
114
|
+
maxlength: a.maxlength,
|
|
115
|
+
disabled: a.disabled,
|
|
116
|
+
readonly: a.readonly,
|
|
117
|
+
required: a.required,
|
|
118
|
+
"aria-invalid": !!a.errorMsg || void 0,
|
|
119
|
+
"aria-describedby": V.value,
|
|
120
|
+
class: ["block w-full rounded-10 border px-5 py-2.5 text-base text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
|
|
121
|
+
a.readonly ? "bg-surface-muted" : "bg-background",
|
|
122
|
+
a.rows === void 0 && "min-h-40",
|
|
123
|
+
a.mono ? "font-mono text-xs leading-5 font-normal" : "font-medium",
|
|
124
|
+
a.autoResize ? L.value ? "ac-scrollbar resize-none" : "resize-none overflow-hidden" : "ac-scrollbar resize-y",
|
|
125
|
+
a.errorMsg ? "border-danger/50 focus:border-danger focus:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus:focus-ring", !a.disabled && "hover:border-accent-active"]
|
|
126
126
|
]]
|
|
127
|
-
}), null, 16,
|
|
128
|
-
|
|
127
|
+
}), null, 16, T), [[v, j.value]]),
|
|
128
|
+
a.errorMsg || a.maxlength !== void 0 ? (d(), n("div", E, [a.errorMsg ? (d(), n("p", {
|
|
129
129
|
key: 0,
|
|
130
|
-
id: `${
|
|
131
|
-
class: "
|
|
130
|
+
id: `${m(M)}-msg`,
|
|
131
|
+
class: "min-w-0 flex-1 text-base text-danger-strong",
|
|
132
132
|
role: "alert"
|
|
133
|
-
},
|
|
134
|
-
class: "size-4 shrink-0",
|
|
135
|
-
"aria-hidden": "true"
|
|
136
|
-
}), i(" " + m(o.errorMsg), 1)], 8, k)) : (f(), n("span", A)), o.maxlength === void 0 ? t("", !0) : (f(), n("p", {
|
|
133
|
+
}, p(a.errorMsg), 9, D)) : (d(), n("span", O)), a.maxlength === void 0 ? t("", !0) : (d(), n("p", {
|
|
137
134
|
key: 2,
|
|
138
|
-
id: `${
|
|
139
|
-
class:
|
|
140
|
-
}, [
|
|
135
|
+
id: `${m(M)}-count`,
|
|
136
|
+
class: l(["shrink-0 text-xs tabular-nums", B.value ? "font-medium text-danger-strong" : "text-muted"])
|
|
137
|
+
}, [o[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(p(z.value) + " / " + p(a.maxlength), 1)], 10, k))])) : t("", !0)
|
|
141
138
|
], 16));
|
|
142
139
|
}
|
|
143
140
|
});
|
|
144
141
|
//#endregion
|
|
145
|
-
export {
|
|
142
|
+
export { A as default };
|
|
@@ -2,15 +2,15 @@ import type { ColorMode } from "../composables/useColorMode";
|
|
|
2
2
|
export interface Props {
|
|
3
3
|
/** Used until the viewer picks a mode. */
|
|
4
4
|
defaultMode?: ColorMode;
|
|
5
|
-
/** `icons` is a compact 3-icon switch; `labels` adds the words, for menus and settings pages. */
|
|
6
|
-
display?: "icons" | "labels";
|
|
5
|
+
/** `icons` is a compact 3-icon switch; `labels` adds the words, for menus and settings pages; `toggle` is cloud-ui's sun/moon switch for the navbar (64×32px), light or dark only. */
|
|
6
|
+
display?: "icons" | "labels" | "toggle";
|
|
7
7
|
}
|
|
8
8
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
"set:theme": (theme: "light" | "dark") => any;
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
11
11
|
"onSet:theme"?: ((theme: "light" | "dark") => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
-
display: "icons" | "labels";
|
|
13
|
+
display: "icons" | "labels" | "toggle";
|
|
14
14
|
defaultMode: ColorMode;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,60 +1,92 @@
|
|
|
1
1
|
import { useColorMode as e } from "../composables/useColorMode.js";
|
|
2
|
-
import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a,
|
|
3
|
-
import { Monitor as
|
|
2
|
+
import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, onBeforeUnmount as l, openBlock as u, ref as d, renderList as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, watch as g } from "vue";
|
|
3
|
+
import { Monitor as _, Moon as v, Sun as y } from "@lucide/vue";
|
|
4
4
|
//#region src/lib/components/AcThemeMode.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var b = ["aria-checked", "title"], x = {
|
|
6
|
+
key: 1,
|
|
6
7
|
role: "radiogroup",
|
|
7
8
|
"aria-label": "Theme",
|
|
8
9
|
class: "inline-flex items-center gap-1 rounded-10 bg-surface-sunken p-1",
|
|
9
10
|
"data-ac-ds": "",
|
|
10
11
|
"data-testid": "ac-theme-mode"
|
|
11
|
-
},
|
|
12
|
+
}, S = [
|
|
12
13
|
"aria-checked",
|
|
13
14
|
"aria-label",
|
|
14
15
|
"title",
|
|
15
16
|
"onClick"
|
|
16
|
-
],
|
|
17
|
+
], C = { key: 0 }, w = /*@__PURE__*/ s({
|
|
17
18
|
__name: "AcThemeMode",
|
|
18
19
|
props: {
|
|
19
20
|
defaultMode: { default: "light" },
|
|
20
21
|
display: { default: "icons" }
|
|
21
22
|
},
|
|
22
23
|
emits: ["set:theme"],
|
|
23
|
-
setup(
|
|
24
|
-
let
|
|
24
|
+
setup(s, { emit: w }) {
|
|
25
|
+
let T = s, E = w, D = [
|
|
25
26
|
{
|
|
26
27
|
value: "light",
|
|
27
28
|
label: "Light",
|
|
28
|
-
icon:
|
|
29
|
+
icon: y
|
|
29
30
|
},
|
|
30
31
|
{
|
|
31
32
|
value: "dark",
|
|
32
33
|
label: "Dark",
|
|
33
|
-
icon:
|
|
34
|
+
icon: v
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
37
|
value: "system",
|
|
37
38
|
label: "System",
|
|
38
|
-
icon:
|
|
39
|
+
icon: _
|
|
39
40
|
}
|
|
40
|
-
], { mode:
|
|
41
|
-
function
|
|
42
|
-
|
|
41
|
+
], { mode: O, isDark: k, setMode: A } = e({ defaultMode: T.defaultMode }), j = d(k.value), M;
|
|
42
|
+
function N(e) {
|
|
43
|
+
A(e), E("set:theme", k.value ? "dark" : "light");
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
function P() {
|
|
46
|
+
j.value = !j.value, clearTimeout(M), M = setTimeout(() => {
|
|
47
|
+
M = void 0, N(j.value ? "dark" : "light");
|
|
48
|
+
}, 200);
|
|
49
|
+
}
|
|
50
|
+
return g(k, (e) => {
|
|
51
|
+
M === void 0 && (j.value = e);
|
|
52
|
+
}), l(() => clearTimeout(M)), (e, l) => s.display === "toggle" ? (u(), i("button", {
|
|
53
|
+
key: 0,
|
|
54
|
+
type: "button",
|
|
55
|
+
role: "switch",
|
|
56
|
+
"aria-checked": j.value,
|
|
57
|
+
"aria-label": "Dark mode",
|
|
58
|
+
title: j.value ? "Switch to light mode" : "Switch to dark mode",
|
|
59
|
+
class: "relative inline-flex h-8 w-16 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none",
|
|
60
|
+
"data-ac-ds": "",
|
|
61
|
+
"data-testid": "ac-theme-mode",
|
|
62
|
+
onClick: P
|
|
63
|
+
}, [
|
|
64
|
+
a("span", {
|
|
65
|
+
class: c(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", j.value ? "translate-x-[10px] rotate-0 opacity-0" : "translate-x-[3px] rotate-[15deg] opacity-100"]),
|
|
66
|
+
"aria-hidden": "true"
|
|
67
|
+
}, [o(h(y), { class: "size-[19px] text-theme-sun" })], 2),
|
|
68
|
+
a("span", {
|
|
69
|
+
class: c(["size-[21px] shrink-0 rounded-full inset-ring-2 transition-[translate,background-color] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", j.value ? "-translate-x-[14px] bg-theme-moon inset-ring-white" : "translate-x-4 bg-theme-sun-soft inset-ring-theme-sun"]),
|
|
70
|
+
"aria-hidden": "true"
|
|
71
|
+
}, null, 2),
|
|
72
|
+
a("span", {
|
|
73
|
+
class: c(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2.5,0.46,0.71)] motion-reduce:transition-none", j.value ? "-translate-x-[3px] -rotate-[15deg] opacity-100" : "-translate-x-2 rotate-0 opacity-0"]),
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}, [o(h(v), { class: "size-[21px] text-heading" })], 2)
|
|
76
|
+
], 8, b)) : (u(), i("div", x, [(u(), i(t, null, f(D, (e) => a("button", {
|
|
45
77
|
key: e.value,
|
|
46
78
|
type: "button",
|
|
47
79
|
role: "radio",
|
|
48
|
-
"aria-checked":
|
|
49
|
-
"aria-label":
|
|
50
|
-
title:
|
|
51
|
-
class:
|
|
52
|
-
onClick: (t) =>
|
|
53
|
-
}, [(
|
|
80
|
+
"aria-checked": h(O) === e.value,
|
|
81
|
+
"aria-label": s.display === "icons" ? `${e.label} theme` : void 0,
|
|
82
|
+
title: s.display === "icons" ? `${e.label} theme` : void 0,
|
|
83
|
+
class: c(["inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-medium transition-[background-color,color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none", [s.display === "icons" ? "w-7" : "px-3", h(O) === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
|
|
84
|
+
onClick: (t) => N(e.value)
|
|
85
|
+
}, [(u(), n(p(e.icon), {
|
|
54
86
|
class: "size-4",
|
|
55
87
|
"aria-hidden": "true"
|
|
56
|
-
})),
|
|
88
|
+
})), s.display === "labels" ? (u(), i("span", C, m(e.label), 1)) : r("", !0)], 10, S)), 64))]));
|
|
57
89
|
}
|
|
58
90
|
});
|
|
59
91
|
//#endregion
|
|
60
|
-
export {
|
|
92
|
+
export { w as default };
|
|
@@ -23,7 +23,7 @@ export interface Props {
|
|
|
23
23
|
errorMsg?: string;
|
|
24
24
|
/** Help text between the label and the field. */
|
|
25
25
|
hint?: string;
|
|
26
|
-
/** `small` 36px or `normal`
|
|
26
|
+
/** `small` 36px or `normal` 42px tall, the same as `AcInput`. */
|
|
27
27
|
size?: "small" | "normal";
|
|
28
28
|
/** Adds a hidden input with this name so plain form posts include the value. */
|
|
29
29
|
name?: string;
|