@ac-design/design-system 2.2.0 → 2.3.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_vue_type_script_setup_true_lang.js +89 -88
- package/dist/lib/compat.css +210 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcButton.vue.d.ts +18 -12
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +28 -7
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +12 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcTable.vue.d.ts +13 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
- package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/index.js +34 -33
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
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,
|
|
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, renderSlot as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, useSlots as y, vModelText as b, watch as x, withDirectives as S } from "vue";
|
|
2
2
|
//#region src/lib/components/AcTextarea.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "text-muted"
|
|
6
|
-
}, C = {
|
|
3
|
+
var C = ["for"], w = { key: 0 }, T = {
|
|
7
4
|
key: 1,
|
|
5
|
+
class: "text-muted"
|
|
6
|
+
}, E = {
|
|
7
|
+
key: 2,
|
|
8
8
|
class: "text-danger",
|
|
9
9
|
"aria-hidden": "true"
|
|
10
|
-
},
|
|
10
|
+
}, D = ["id"], O = [
|
|
11
11
|
"id",
|
|
12
12
|
"name",
|
|
13
13
|
"rows",
|
|
@@ -15,19 +15,20 @@ var x = ["for"], S = {
|
|
|
15
15
|
"disabled",
|
|
16
16
|
"readonly",
|
|
17
17
|
"required",
|
|
18
|
+
"aria-label",
|
|
18
19
|
"aria-invalid",
|
|
19
20
|
"aria-describedby"
|
|
20
|
-
],
|
|
21
|
-
key:
|
|
21
|
+
], k = {
|
|
22
|
+
key: 2,
|
|
22
23
|
class: "mt-1 flex items-start gap-3"
|
|
23
|
-
},
|
|
24
|
+
}, A = ["id"], j = {
|
|
24
25
|
key: 1,
|
|
25
26
|
class: "flex-1"
|
|
26
|
-
},
|
|
27
|
+
}, M = ["id"], N = /*@__PURE__*/ a({
|
|
27
28
|
inheritAttrs: !1,
|
|
28
29
|
__name: "AcTextarea",
|
|
29
30
|
props: /*@__PURE__*/ o({
|
|
30
|
-
label: {},
|
|
31
|
+
label: { default: "" },
|
|
31
32
|
name: { default: "" },
|
|
32
33
|
rows: { default: void 0 },
|
|
33
34
|
autoResize: {
|
|
@@ -44,6 +45,10 @@ var x = ["for"], S = {
|
|
|
44
45
|
type: Boolean,
|
|
45
46
|
default: !1
|
|
46
47
|
},
|
|
48
|
+
requiredMark: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
},
|
|
47
52
|
disabled: {
|
|
48
53
|
type: Boolean,
|
|
49
54
|
default: !1
|
|
@@ -53,90 +58,116 @@ var x = ["for"], S = {
|
|
|
53
58
|
default: !1
|
|
54
59
|
},
|
|
55
60
|
errorMsg: { default: "" },
|
|
56
|
-
|
|
61
|
+
invalid: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !1
|
|
64
|
+
},
|
|
65
|
+
hint: { default: "" },
|
|
66
|
+
size: { default: "normal" },
|
|
67
|
+
inputClass: {
|
|
68
|
+
type: [
|
|
69
|
+
Boolean,
|
|
70
|
+
null,
|
|
71
|
+
String,
|
|
72
|
+
Object,
|
|
73
|
+
Array
|
|
74
|
+
],
|
|
75
|
+
default: void 0
|
|
76
|
+
}
|
|
57
77
|
}, {
|
|
58
78
|
modelValue: { default: "" },
|
|
59
79
|
modelModifiers: {}
|
|
60
80
|
}),
|
|
61
81
|
emits: ["update:modelValue"],
|
|
62
82
|
setup(a, { expose: o }) {
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
83
|
+
let N = a, P = v(a, "modelValue"), F = {
|
|
84
|
+
xsmall: "px-3 py-1.5",
|
|
85
|
+
small: "px-4 py-2",
|
|
86
|
+
normal: "px-5 py-2.5"
|
|
87
|
+
}, I = _(), L = g(), R = y(), z = e(() => ({
|
|
88
|
+
class: L.class,
|
|
89
|
+
style: L.style
|
|
90
|
+
})), B = e(() => {
|
|
91
|
+
let { class: e, style: t, ...n } = L;
|
|
68
92
|
return n;
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
93
|
+
}), V = f(null), H = f(!1), U = e(() => !!N.label || !!R["label-icon"] || !!R["label-extra"]), W = e(() => U.value ? void 0 : L["aria-label"] ?? L.placeholder), G = e(() => !!N.errorMsg || N.invalid), K = e(() => N.rows ?? 4), q = e(() => (P.value ?? "").length), J = e(() => N.maxlength !== void 0 && q.value >= N.maxlength), Y = e(() => [
|
|
94
|
+
L["aria-describedby"],
|
|
95
|
+
N.hint && `${I}-hint`,
|
|
96
|
+
N.errorMsg && `${I}-msg`,
|
|
97
|
+
N.maxlength !== void 0 && `${I}-count`
|
|
73
98
|
].filter(Boolean).join(" ") || void 0);
|
|
74
|
-
function
|
|
75
|
-
let e =
|
|
76
|
-
if (!e || !
|
|
77
|
-
let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i =
|
|
99
|
+
function X() {
|
|
100
|
+
let e = V.value;
|
|
101
|
+
if (!e || !N.autoResize) return;
|
|
102
|
+
let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || 20, r = parseFloat(t.paddingTop) + parseFloat(t.paddingBottom) + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth), i = K.value * n + r, a = N.maxRows > 0 ? N.maxRows * n + r : Infinity;
|
|
78
103
|
e.style.height = "auto";
|
|
79
104
|
let o = e.scrollHeight + parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth);
|
|
80
|
-
e.style.height = `${Math.min(Math.max(o, i), a)}px`,
|
|
105
|
+
e.style.height = `${Math.min(Math.max(o, i), a)}px`, H.value = o > a;
|
|
81
106
|
}
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
107
|
+
return x(P, () => c(X)), x(() => [
|
|
108
|
+
N.autoResize,
|
|
109
|
+
N.rows,
|
|
110
|
+
N.maxRows
|
|
86
111
|
], () => {
|
|
87
|
-
!
|
|
88
|
-
}), u(
|
|
112
|
+
!N.autoResize && V.value && (V.value.style.height = ""), c(X);
|
|
113
|
+
}), u(X), o({ focus: () => V.value?.focus() }), (e, o) => (d(), n("div", s(z.value, {
|
|
89
114
|
class: ["w-full", a.disabled && "opacity-50"],
|
|
90
115
|
"data-ac-ds": "",
|
|
91
116
|
"data-testid": "ac-textarea"
|
|
92
117
|
}), [
|
|
93
|
-
|
|
94
|
-
|
|
118
|
+
U.value ? (d(), n("label", {
|
|
119
|
+
key: 0,
|
|
120
|
+
for: h(I),
|
|
95
121
|
class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
|
|
96
122
|
}, [
|
|
97
|
-
|
|
98
|
-
a.
|
|
99
|
-
a.
|
|
100
|
-
|
|
123
|
+
p(e.$slots, "label-icon"),
|
|
124
|
+
a.label ? (d(), n("span", w, m(a.label), 1)) : t("", !0),
|
|
125
|
+
a.readonly ? (d(), n("span", T, "(read only)")) : t("", !0),
|
|
126
|
+
p(e.$slots, "label-extra"),
|
|
127
|
+
a.required || a.requiredMark ? (d(), n("span", E, "*")) : t("", !0)
|
|
128
|
+
], 8, C)) : t("", !0),
|
|
101
129
|
a.hint ? (d(), n("p", {
|
|
102
|
-
key:
|
|
103
|
-
id: `${
|
|
130
|
+
key: 1,
|
|
131
|
+
id: `${h(I)}-hint`,
|
|
104
132
|
class: "mb-2 text-base text-muted"
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
id:
|
|
133
|
+
}, m(a.hint), 9, D)) : t("", !0),
|
|
134
|
+
S(r("textarea", s({
|
|
135
|
+
id: h(I),
|
|
108
136
|
ref_key: "field",
|
|
109
|
-
ref:
|
|
110
|
-
},
|
|
111
|
-
"onUpdate:modelValue": o[0] ||= (e) =>
|
|
137
|
+
ref: V
|
|
138
|
+
}, B.value, {
|
|
139
|
+
"onUpdate:modelValue": o[0] ||= (e) => P.value = e,
|
|
112
140
|
name: a.name,
|
|
113
|
-
rows:
|
|
141
|
+
rows: K.value,
|
|
114
142
|
maxlength: a.maxlength,
|
|
115
143
|
disabled: a.disabled,
|
|
116
144
|
readonly: a.readonly,
|
|
117
145
|
required: a.required,
|
|
118
|
-
"aria-
|
|
119
|
-
"aria-
|
|
120
|
-
|
|
146
|
+
"aria-label": W.value,
|
|
147
|
+
"aria-invalid": G.value || void 0,
|
|
148
|
+
"aria-describedby": Y.value,
|
|
149
|
+
class: ["block w-full rounded-10 border text-base text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [
|
|
150
|
+
F[a.size] ?? F.normal,
|
|
121
151
|
a.readonly ? "bg-surface-muted" : "bg-background",
|
|
122
|
-
a.rows === void 0 && "min-h-40",
|
|
152
|
+
a.rows === void 0 && !a.inputClass && "min-h-40",
|
|
123
153
|
a.mono ? "font-mono text-xs leading-5 font-normal" : "font-medium",
|
|
124
|
-
a.autoResize ?
|
|
125
|
-
|
|
154
|
+
a.autoResize ? H.value ? "ac-scrollbar resize-none" : "resize-none overflow-hidden" : "ac-scrollbar resize-y",
|
|
155
|
+
G.value ? "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"],
|
|
156
|
+
a.inputClass
|
|
126
157
|
]]
|
|
127
|
-
}), null, 16,
|
|
128
|
-
a.errorMsg || a.maxlength !== void 0 ? (d(), n("div",
|
|
158
|
+
}), null, 16, O), [[b, P.value]]),
|
|
159
|
+
a.errorMsg || a.maxlength !== void 0 ? (d(), n("div", k, [a.errorMsg ? (d(), n("p", {
|
|
129
160
|
key: 0,
|
|
130
|
-
id: `${
|
|
161
|
+
id: `${h(I)}-msg`,
|
|
131
162
|
class: "min-w-0 flex-1 text-base text-danger-strong",
|
|
132
163
|
role: "alert"
|
|
133
|
-
},
|
|
164
|
+
}, m(a.errorMsg), 9, A)) : (d(), n("span", j)), a.maxlength === void 0 ? t("", !0) : (d(), n("p", {
|
|
134
165
|
key: 2,
|
|
135
|
-
id: `${
|
|
136
|
-
class: l(["shrink-0 text-xs tabular-nums",
|
|
137
|
-
}, [o[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(
|
|
166
|
+
id: `${h(I)}-count`,
|
|
167
|
+
class: l(["shrink-0 text-xs tabular-nums", J.value ? "font-medium text-danger-strong" : "text-muted"])
|
|
168
|
+
}, [o[1] ||= r("span", { class: "sr-only" }, "Characters used: ", -1), i(m(q.value) + " / " + m(a.maxlength), 1)], 10, M))])) : t("", !0)
|
|
138
169
|
], 16));
|
|
139
170
|
}
|
|
140
171
|
});
|
|
141
172
|
//#endregion
|
|
142
|
-
export {
|
|
173
|
+
export { N as default };
|
|
@@ -5,10 +5,18 @@ export interface Props {
|
|
|
5
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
6
|
display?: "icons" | "labels" | "toggle";
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type __VLS_Props = Props;
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
/** The theme as a boolean, for apps that keep it in their own store (e.g. cloud-ui's VueUse `useDark`). When bound, the switch only reads and writes this value and leaves the `dark` class and localStorage to the app. */
|
|
11
|
+
"dark"?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
15
|
"set:theme": (theme: "light" | "dark") => any;
|
|
10
|
-
|
|
16
|
+
"update:dark": (value: boolean | undefined) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
18
|
"onSet:theme"?: ((theme: "light" | "dark") => any) | undefined;
|
|
19
|
+
"onUpdate:dark"?: ((value: boolean | undefined) => any) | undefined;
|
|
12
20
|
}>, {
|
|
13
21
|
display: "icons" | "labels" | "toggle";
|
|
14
22
|
defaultMode: ColorMode;
|
|
@@ -1,92 +1,103 @@
|
|
|
1
1
|
import { useColorMode as e } from "../composables/useColorMode.js";
|
|
2
|
-
import { Fragment as t,
|
|
3
|
-
import { Monitor as
|
|
2
|
+
import { Fragment as t, 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, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useModel as v, watch as y } from "vue";
|
|
3
|
+
import { Monitor as b, Moon as x, Sun as S } from "@lucide/vue";
|
|
4
4
|
//#region src/lib/components/AcThemeMode.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var C = ["aria-checked", "title"], w = {
|
|
6
6
|
key: 1,
|
|
7
7
|
role: "radiogroup",
|
|
8
8
|
"aria-label": "Theme",
|
|
9
9
|
class: "inline-flex items-center gap-1 rounded-10 bg-surface-sunken p-1",
|
|
10
10
|
"data-ac-ds": "",
|
|
11
11
|
"data-testid": "ac-theme-mode"
|
|
12
|
-
},
|
|
12
|
+
}, T = [
|
|
13
13
|
"aria-checked",
|
|
14
14
|
"aria-label",
|
|
15
15
|
"title",
|
|
16
16
|
"onClick"
|
|
17
|
-
],
|
|
17
|
+
], E = { key: 0 }, D = /*@__PURE__*/ c({
|
|
18
18
|
__name: "AcThemeMode",
|
|
19
|
-
props: {
|
|
19
|
+
props: /*@__PURE__*/ l({
|
|
20
20
|
defaultMode: { default: "light" },
|
|
21
21
|
display: { default: "icons" }
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
}, {
|
|
23
|
+
dark: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
darkModifiers: {}
|
|
28
|
+
}),
|
|
29
|
+
emits: /*@__PURE__*/ l(["set:theme"], ["update:dark"]),
|
|
30
|
+
setup(c, { emit: l }) {
|
|
31
|
+
let D = c, O = v(c, "dark"), k = l, A = [
|
|
26
32
|
{
|
|
27
33
|
value: "light",
|
|
28
34
|
label: "Light",
|
|
29
|
-
icon:
|
|
35
|
+
icon: S
|
|
30
36
|
},
|
|
31
37
|
{
|
|
32
38
|
value: "dark",
|
|
33
39
|
label: "Dark",
|
|
34
|
-
icon:
|
|
40
|
+
icon: x
|
|
35
41
|
},
|
|
36
42
|
{
|
|
37
43
|
value: "system",
|
|
38
44
|
label: "System",
|
|
39
|
-
icon:
|
|
45
|
+
icon: b
|
|
40
46
|
}
|
|
41
|
-
], {
|
|
42
|
-
function
|
|
43
|
-
|
|
47
|
+
], j = O.value === void 0 ? e({ defaultMode: D.defaultMode }) : null, M = n(() => j ? j.isDark.value : !!O.value), N = n(() => j ? j.mode.value : O.value ? "dark" : "light"), P = p(M.value), F;
|
|
48
|
+
function I(e) {
|
|
49
|
+
if (j) {
|
|
50
|
+
j.setMode(e), k("set:theme", M.value ? "dark" : "light");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
let t = e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches : e === "dark";
|
|
54
|
+
O.value = t, k("set:theme", t ? "dark" : "light");
|
|
44
55
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
function L() {
|
|
57
|
+
P.value = !P.value, clearTimeout(F), F = setTimeout(() => {
|
|
58
|
+
F = void 0, I(P.value ? "dark" : "light");
|
|
48
59
|
}, 200);
|
|
49
60
|
}
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
}),
|
|
61
|
+
return y(M, (e) => {
|
|
62
|
+
F === void 0 && (P.value = e);
|
|
63
|
+
}), d(() => clearTimeout(F)), (e, n) => c.display === "toggle" ? (f(), a("button", {
|
|
53
64
|
key: 0,
|
|
54
65
|
type: "button",
|
|
55
66
|
role: "switch",
|
|
56
|
-
"aria-checked":
|
|
67
|
+
"aria-checked": P.value,
|
|
57
68
|
"aria-label": "Dark mode",
|
|
58
|
-
title:
|
|
69
|
+
title: P.value ? "Switch to light mode" : "Switch to dark mode",
|
|
59
70
|
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
71
|
"data-ac-ds": "",
|
|
61
72
|
"data-testid": "ac-theme-mode",
|
|
62
|
-
onClick:
|
|
73
|
+
onClick: L
|
|
63
74
|
}, [
|
|
64
|
-
|
|
65
|
-
class:
|
|
75
|
+
o("span", {
|
|
76
|
+
class: u(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", P.value ? "translate-x-[10px] rotate-0 opacity-0" : "translate-x-[3px] rotate-[15deg] opacity-100"]),
|
|
66
77
|
"aria-hidden": "true"
|
|
67
|
-
}, [
|
|
68
|
-
|
|
69
|
-
class:
|
|
78
|
+
}, [s(_(S), { class: "size-[19px] text-theme-sun" })], 2),
|
|
79
|
+
o("span", {
|
|
80
|
+
class: u(["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", P.value ? "-translate-x-[14px] bg-theme-moon inset-ring-white" : "translate-x-4 bg-theme-sun-soft inset-ring-theme-sun"]),
|
|
70
81
|
"aria-hidden": "true"
|
|
71
82
|
}, null, 2),
|
|
72
|
-
|
|
73
|
-
class:
|
|
83
|
+
o("span", {
|
|
84
|
+
class: u(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2.5,0.46,0.71)] motion-reduce:transition-none", P.value ? "-translate-x-[3px] -rotate-[15deg] opacity-100" : "-translate-x-2 rotate-0 opacity-0"]),
|
|
74
85
|
"aria-hidden": "true"
|
|
75
|
-
}, [
|
|
76
|
-
], 8,
|
|
86
|
+
}, [s(_(x), { class: "size-[21px] text-heading" })], 2)
|
|
87
|
+
], 8, C)) : (f(), a("div", w, [(f(), a(t, null, m(A, (e) => o("button", {
|
|
77
88
|
key: e.value,
|
|
78
89
|
type: "button",
|
|
79
90
|
role: "radio",
|
|
80
|
-
"aria-checked":
|
|
81
|
-
"aria-label":
|
|
82
|
-
title:
|
|
83
|
-
class:
|
|
84
|
-
onClick: (t) =>
|
|
85
|
-
}, [(
|
|
91
|
+
"aria-checked": N.value === e.value,
|
|
92
|
+
"aria-label": c.display === "icons" ? `${e.label} theme` : void 0,
|
|
93
|
+
title: c.display === "icons" ? `${e.label} theme` : void 0,
|
|
94
|
+
class: u(["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", [c.display === "icons" ? "w-7" : "px-3", N.value === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
|
|
95
|
+
onClick: (t) => I(e.value)
|
|
96
|
+
}, [(f(), r(h(e.icon), {
|
|
86
97
|
class: "size-4",
|
|
87
98
|
"aria-hidden": "true"
|
|
88
|
-
})),
|
|
99
|
+
})), c.display === "labels" ? (f(), a("span", E, g(e.label), 1)) : i("", !0)], 10, T)), 64))]));
|
|
89
100
|
}
|
|
90
101
|
});
|
|
91
102
|
//#endregion
|
|
92
|
-
export {
|
|
103
|
+
export { D as default };
|
|
@@ -27,8 +27,17 @@ export interface Props {
|
|
|
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;
|
|
30
|
+
/** Draws the hour and minute columns in place, with no field, popover or border. Each click updates `v-model` at once. */
|
|
31
|
+
inline?: boolean;
|
|
30
32
|
}
|
|
31
33
|
type __VLS_Props = Props;
|
|
34
|
+
type __VLS_Slots = {
|
|
35
|
+
/** Content before the label text, such as a 14px icon. */
|
|
36
|
+
"label-icon"?: () => unknown;
|
|
37
|
+
/** Content after the label text, such as "(Optional)" or an info tooltip. */
|
|
38
|
+
"label-extra"?: () => unknown;
|
|
39
|
+
};
|
|
40
|
+
declare function scrollToSelected(): Promise<void>;
|
|
32
41
|
type __VLS_ModelProps = {
|
|
33
42
|
/** `"14:05"`, or `"14:05:30"` with `show-seconds`, always 24-hour. `null` when empty. */
|
|
34
43
|
modelValue?: string | null;
|
|
@@ -36,9 +45,11 @@ type __VLS_ModelProps = {
|
|
|
36
45
|
"open"?: boolean;
|
|
37
46
|
};
|
|
38
47
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
|
-
declare const
|
|
40
|
-
/** Moves focus to the field
|
|
41
|
-
focus: () => void
|
|
48
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
49
|
+
/** Moves focus to the field, or to the hours column when `inline`. */
|
|
50
|
+
focus: () => void;
|
|
51
|
+
/** Scrolls each column to its selected value. Call it when an `inline` picker becomes visible, e.g. on a tab switch. */
|
|
52
|
+
scrollToSelected: typeof scrollToSelected;
|
|
42
53
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
54
|
"update:modelValue": (value: string | null) => any;
|
|
44
55
|
"update:open": (value: boolean) => any;
|
|
@@ -54,6 +65,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
54
65
|
name: string;
|
|
55
66
|
size: "small" | "normal";
|
|
56
67
|
hint: string;
|
|
68
|
+
inline: boolean;
|
|
57
69
|
placeholder: string;
|
|
58
70
|
clearable: boolean;
|
|
59
71
|
errorMsg: string;
|
|
@@ -61,5 +73,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
61
73
|
hourCycle: 12 | 24;
|
|
62
74
|
minuteStep: number;
|
|
63
75
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
76
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
64
77
|
declare const _default: typeof __VLS_export;
|
|
65
78
|
export default _default;
|
|
79
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
80
|
+
new (): {
|
|
81
|
+
$slots: S;
|
|
82
|
+
};
|
|
83
|
+
};
|