@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,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { fixedFrame as e } from "./fixedFrame.js";
|
|
2
|
+
import { Fragment as t, Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as ee, defineComponent as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as te, onMounted as m, onUpdated as h, openBlock as g, ref as _, renderList as v, renderSlot as y, resolveDynamicComponent as b, toDisplayString as x, useId as ne, useSlots as re, vShow as ie, watch as S, withCtx as ae, withDirectives as oe } from "vue";
|
|
3
|
+
import { CircleAlert as se, CircleCheck as ce, Info as le, TriangleAlert as ue } from "@lucide/vue";
|
|
3
4
|
//#region src/lib/components/AcTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
+
var C = ["data-side"], de = { class: "flex items-start gap-2" }, w = { class: "min-w-0 flex-1" }, fe = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "font-semibold text-on-tooltip"
|
|
7
|
-
},
|
|
8
|
+
}, pe = {
|
|
8
9
|
key: 1,
|
|
9
10
|
class: "ml-1 flex shrink-0 items-center gap-0.5 self-center"
|
|
10
|
-
},
|
|
11
|
+
}, T = null, E = 0, me = 400, D = /*@__PURE__*/ u({
|
|
11
12
|
__name: "AcTooltip",
|
|
12
13
|
props: {
|
|
13
14
|
content: { default: "" },
|
|
@@ -31,13 +32,13 @@ var ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class:
|
|
|
31
32
|
},
|
|
32
33
|
maxWidth: { default: "280px" }
|
|
33
34
|
},
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
35
|
+
setup(u) {
|
|
36
|
+
let D = u, he = re(), O = {
|
|
36
37
|
top: "bottom",
|
|
37
38
|
bottom: "top",
|
|
38
39
|
left: "right",
|
|
39
40
|
right: "left"
|
|
40
|
-
},
|
|
41
|
+
}, k = {
|
|
41
42
|
top: "translate-y-1",
|
|
42
43
|
bottom: "-translate-y-1",
|
|
43
44
|
left: "translate-x-1",
|
|
@@ -49,26 +50,26 @@ var ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class:
|
|
|
49
50
|
right: "border-b border-l"
|
|
50
51
|
}, j = {
|
|
51
52
|
info: {
|
|
52
|
-
icon:
|
|
53
|
+
icon: le,
|
|
53
54
|
class: "text-info"
|
|
54
55
|
},
|
|
55
56
|
success: {
|
|
56
|
-
icon:
|
|
57
|
+
icon: ce,
|
|
57
58
|
class: "text-success"
|
|
58
59
|
},
|
|
59
60
|
warning: {
|
|
60
|
-
icon:
|
|
61
|
+
icon: ue,
|
|
61
62
|
class: "text-warning"
|
|
62
63
|
},
|
|
63
64
|
danger: {
|
|
64
|
-
icon:
|
|
65
|
+
icon: se,
|
|
65
66
|
class: "text-danger"
|
|
66
67
|
}
|
|
67
|
-
}, M = `${
|
|
68
|
+
}, M = `${ne()}-tip`, N = _(null), P = _(null), F = _(!1), I = _(D.placement), L = _({
|
|
68
69
|
top: 0,
|
|
69
70
|
left: 0,
|
|
70
71
|
arrow: 0
|
|
71
|
-
}), R, z, B = null, V =
|
|
72
|
+
}), R, z, B = null, V = i(() => !D.disabled && !!(D.content || D.title || he.content)), H = i(() => D.tone === "neutral" ? null : j[D.tone]), ge = i(() => {
|
|
72
73
|
let { top: e, left: t, arrow: n } = L.value, r = {
|
|
73
74
|
top: `${n}px 100%`,
|
|
74
75
|
bottom: `${n}px 0`,
|
|
@@ -78,10 +79,10 @@ var ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class:
|
|
|
78
79
|
return {
|
|
79
80
|
top: `${e}px`,
|
|
80
81
|
left: `${t}px`,
|
|
81
|
-
maxWidth:
|
|
82
|
+
maxWidth: D.maxWidth,
|
|
82
83
|
transformOrigin: r
|
|
83
84
|
};
|
|
84
|
-
}),
|
|
85
|
+
}), _e = i(() => {
|
|
85
86
|
let e = `${L.value.arrow - 5}px`, t = "-6px";
|
|
86
87
|
return {
|
|
87
88
|
top: {
|
|
@@ -116,65 +117,65 @@ var ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class:
|
|
|
116
117
|
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== M);
|
|
117
118
|
t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function ve() {
|
|
120
121
|
let e = N.value;
|
|
121
122
|
return e ? [e, ...e.querySelectorAll("*")].some((e) => e.scrollWidth > e.clientWidth + 1) : !1;
|
|
122
123
|
}
|
|
123
|
-
async function
|
|
124
|
-
(!
|
|
124
|
+
async function ye() {
|
|
125
|
+
(!D.overflowOnly || ve()) && (T && T !== q && T(), T = q, F.value = !0, await d(), be());
|
|
125
126
|
}
|
|
126
127
|
function K(e) {
|
|
127
128
|
if (clearTimeout(z), !V.value || F.value) return;
|
|
128
129
|
clearTimeout(R);
|
|
129
|
-
let t =
|
|
130
|
-
R = setTimeout(
|
|
130
|
+
let t = T !== null || Date.now() - E < me;
|
|
131
|
+
R = setTimeout(ye, t ? 0 : e);
|
|
131
132
|
}
|
|
132
133
|
function q() {
|
|
133
|
-
clearTimeout(R), clearTimeout(z), F.value && (F.value = !1,
|
|
134
|
+
clearTimeout(R), clearTimeout(z), F.value && (F.value = !1, E = Date.now(), T === q && (T = null));
|
|
134
135
|
}
|
|
135
136
|
function J(e = 0) {
|
|
136
137
|
clearTimeout(R), clearTimeout(z), e ? z = setTimeout(q, e) : q();
|
|
137
138
|
}
|
|
138
|
-
function Y(e, t, n, r) {
|
|
139
|
-
return e === "top" ? t.top - 8 -
|
|
139
|
+
function Y(e, t, n, r, i) {
|
|
140
|
+
return e === "top" ? t.top - 8 - i >= n.top + 8 : e === "bottom" ? t.bottom + 8 + i <= n.bottom - 8 : e === "left" ? t.left - 8 - r >= n.left + 8 : t.right + 8 + r <= n.right - 8;
|
|
140
141
|
}
|
|
141
142
|
function X(e, t, n) {
|
|
142
|
-
return
|
|
143
|
+
return D.align === "start" ? e : D.align === "end" ? e + t - n : e + (t - n) / 2;
|
|
143
144
|
}
|
|
144
145
|
function Z(e, t, n) {
|
|
145
146
|
return Math.min(Math.max(e, t), Math.max(t, n));
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
let
|
|
149
|
-
if (!
|
|
150
|
-
let
|
|
151
|
-
if (I.value =
|
|
152
|
-
let e = Z(X(
|
|
148
|
+
function be() {
|
|
149
|
+
let t = U() ?? N.value;
|
|
150
|
+
if (!t || !P.value) return;
|
|
151
|
+
let n = t.getBoundingClientRect(), r = e(), { offsetWidth: i, offsetHeight: a } = P.value, o = D.placement, s = Y(o, n, r, i, a) || !Y(O[o], n, r, i, a) ? o : O[o];
|
|
152
|
+
if (I.value = s, s === "top" || s === "bottom") {
|
|
153
|
+
let e = Z(X(n.left - r.left, n.width, i), 8, r.width - 8 - i), t = Z(n.left - r.left + n.width / 2 - e, 12, i - 12);
|
|
153
154
|
L.value = {
|
|
154
|
-
top: Math.round(
|
|
155
|
+
top: Math.round((s === "top" ? n.top - 8 - a : n.bottom + 8) - r.top),
|
|
155
156
|
left: Math.round(e),
|
|
156
|
-
arrow:
|
|
157
|
+
arrow: t
|
|
157
158
|
};
|
|
158
159
|
} else {
|
|
159
|
-
let e = Z(X(
|
|
160
|
+
let e = Z(X(n.top - r.top, n.height, a), 8, r.height - 8 - a), t = Z(n.top - r.top + n.height / 2 - e, 12, a - 12);
|
|
160
161
|
L.value = {
|
|
161
162
|
top: Math.round(e),
|
|
162
|
-
left: Math.round(
|
|
163
|
-
arrow:
|
|
163
|
+
left: Math.round((s === "left" ? n.left - 8 - i : n.right + 8) - r.left),
|
|
164
|
+
arrow: t
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
|
-
function be(e) {
|
|
168
|
-
e.pointerType !== "touch" && K(O.delay);
|
|
169
|
-
}
|
|
170
168
|
function xe(e) {
|
|
171
|
-
e.
|
|
169
|
+
e.pointerType !== "touch" && K(D.delay);
|
|
172
170
|
}
|
|
173
|
-
function Se() {
|
|
174
|
-
|
|
171
|
+
function Se(e) {
|
|
172
|
+
e.target.matches(":focus-visible") && K(0);
|
|
175
173
|
}
|
|
176
174
|
function Ce() {
|
|
177
|
-
|
|
175
|
+
D.interactive && clearTimeout(z);
|
|
176
|
+
}
|
|
177
|
+
function we() {
|
|
178
|
+
D.interactive && J(120);
|
|
178
179
|
}
|
|
179
180
|
function Q() {
|
|
180
181
|
J();
|
|
@@ -182,60 +183,60 @@ var ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class:
|
|
|
182
183
|
function $(e) {
|
|
183
184
|
e.key === "Escape" && F.value && J();
|
|
184
185
|
}
|
|
185
|
-
return
|
|
186
|
+
return S(F, (e) => {
|
|
186
187
|
e ? (document.addEventListener("keydown", $), window.addEventListener("scroll", Q, !0)) : (document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0));
|
|
187
|
-
}),
|
|
188
|
+
}), S(V, (e) => {
|
|
188
189
|
W(), e || J();
|
|
189
|
-
}),
|
|
190
|
-
J(),
|
|
191
|
-
}), (
|
|
190
|
+
}), m(W), h(W), te(() => {
|
|
191
|
+
J(), T === q && (T = null), document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0), B && G(B);
|
|
192
|
+
}), (e, i) => (g(), s("span", {
|
|
192
193
|
ref_key: "root",
|
|
193
194
|
ref: N,
|
|
194
195
|
class: "inline-flex max-w-full",
|
|
195
196
|
"data-ac-ds": "",
|
|
196
197
|
"data-testid": "ac-tooltip",
|
|
197
|
-
onPointerenter:
|
|
198
|
-
onPointerleave:
|
|
199
|
-
onPointerdown:
|
|
200
|
-
onFocusin:
|
|
201
|
-
onFocusout:
|
|
202
|
-
}, [
|
|
198
|
+
onPointerenter: xe,
|
|
199
|
+
onPointerleave: i[0] ||= (e) => J(120),
|
|
200
|
+
onPointerdown: i[1] ||= (e) => J(),
|
|
201
|
+
onFocusin: Se,
|
|
202
|
+
onFocusout: i[2] ||= (e) => J()
|
|
203
|
+
}, [y(e.$slots, "default"), (g(), a(n, { to: "body" }, [ee(r, {
|
|
203
204
|
"enter-active-class": "transition-[opacity,scale,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
204
|
-
"enter-from-class": `opacity-0 scale-95 ${
|
|
205
|
+
"enter-from-class": `opacity-0 scale-95 ${k[I.value]}`,
|
|
205
206
|
"leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
|
|
206
207
|
"leave-to-class": "opacity-0 scale-95"
|
|
207
208
|
}, {
|
|
208
|
-
default:
|
|
209
|
+
default: ae(() => [oe(c("div", {
|
|
209
210
|
id: M,
|
|
210
211
|
ref_key: "tip",
|
|
211
212
|
ref: P,
|
|
212
213
|
role: "tooltip",
|
|
213
|
-
class:
|
|
214
|
+
class: f(["fixed z-[100] w-max rounded-10 border border-white/10 bg-tooltip text-xs leading-relaxed break-words whitespace-normal text-on-tooltip shadow-lg shadow-black/25", [u.title ? "px-3 py-2" : "px-2.5 py-1.5", u.interactive ? "pointer-events-auto" : "pointer-events-none"]]),
|
|
214
215
|
"data-side": I.value,
|
|
215
|
-
style:
|
|
216
|
+
style: p(ge.value),
|
|
216
217
|
"data-ac-ds": "",
|
|
217
218
|
"data-testid": "ac-tooltip-panel",
|
|
218
|
-
onPointerenter:
|
|
219
|
-
onPointerleave:
|
|
220
|
-
}, [
|
|
221
|
-
H.value ? (
|
|
219
|
+
onPointerenter: Ce,
|
|
220
|
+
onPointerleave: we
|
|
221
|
+
}, [c("div", de, [
|
|
222
|
+
H.value ? (g(), a(b(H.value.icon), {
|
|
222
223
|
key: 0,
|
|
223
|
-
class:
|
|
224
|
+
class: f(["mt-0.5 size-3.5 shrink-0", H.value.class]),
|
|
224
225
|
"aria-hidden": "true"
|
|
225
|
-
}, null, 8, ["class"])) :
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
}, null, 8, ["class"])) : o("", !0),
|
|
227
|
+
c("div", w, [u.title ? (g(), s("p", fe, x(u.title), 1)) : o("", !0), c("div", { class: f(u.title && "mt-0.5 text-on-tooltip/75") }, [y(e.$slots, "content", {}, () => [l(x(u.content), 1)])], 2)]),
|
|
228
|
+
u.shortcut.length ? (g(), s("span", pe, [(g(!0), s(t, null, v(u.shortcut, (e) => (g(), s("kbd", {
|
|
228
229
|
key: e,
|
|
229
230
|
class: "min-w-4 rounded-4 border border-white/15 bg-white/10 px-1 text-center font-mono text-xm leading-4 text-on-tooltip/75"
|
|
230
|
-
},
|
|
231
|
-
]),
|
|
231
|
+
}, x(e), 1))), 128))])) : o("", !0)
|
|
232
|
+
]), c("span", {
|
|
232
233
|
"aria-hidden": "true",
|
|
233
|
-
class:
|
|
234
|
-
style:
|
|
235
|
-
}, null, 6)], 46,
|
|
234
|
+
class: f(["absolute size-2.5 rotate-45 border-white/10 bg-tooltip", A[I.value]]),
|
|
235
|
+
style: p(_e.value)
|
|
236
|
+
}, null, 6)], 46, C), [[ie, F.value]])]),
|
|
236
237
|
_: 3
|
|
237
238
|
}, 8, ["enter-from-class"])]))], 544));
|
|
238
239
|
}
|
|
239
240
|
});
|
|
240
241
|
//#endregion
|
|
241
|
-
export {
|
|
242
|
+
export { D as default };
|
|
@@ -46,9 +46,15 @@ export interface Props {
|
|
|
46
46
|
workspaces?: UserMenuWorkspace[];
|
|
47
47
|
/** Heading of the workspace list. */
|
|
48
48
|
workspacesLabel?: string;
|
|
49
|
+
/** Shows the name, email and avatar at the top of the menu. cloud-ui's workspace menu leaves it out and starts with the workspaces. */
|
|
50
|
+
showProfile?: boolean;
|
|
51
|
+
/** Shows the sign-out icon before `logoutLabel`. cloud-ui's workspace menu shows the text only. */
|
|
52
|
+
logoutIcon?: boolean;
|
|
49
53
|
}
|
|
50
54
|
type __VLS_Props = Props;
|
|
51
55
|
type __VLS_Slots = {
|
|
56
|
+
/** Replaces the round avatar in the trigger, e.g. a square logo for an organisation workspace. */
|
|
57
|
+
avatar?: () => unknown;
|
|
52
58
|
/** Custom rows after `items`. Give each focusable row `role="menuitem"`, `tabindex="-1"` and the `itemClass` classes; call `close()` after an action. */
|
|
53
59
|
default?: (props: {
|
|
54
60
|
close: () => void;
|
|
@@ -88,6 +94,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
88
94
|
logoutLabel: string;
|
|
89
95
|
workspaces: UserMenuWorkspace[];
|
|
90
96
|
workspacesLabel: string;
|
|
97
|
+
showProfile: boolean;
|
|
98
|
+
logoutIcon: boolean;
|
|
91
99
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
92
100
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
93
101
|
declare const _default: typeof __VLS_export;
|