@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.
Files changed (54) hide show
  1. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +89 -88
  2. package/dist/lib/compat.css +210 -0
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
  4. package/dist/lib/components/AcButton.vue.d.ts +18 -12
  5. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
  6. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  7. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  8. package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
  9. package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
  10. package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
  11. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
  12. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
  13. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  14. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
  15. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  16. package/dist/lib/components/AcInput.vue.d.ts +28 -7
  17. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
  18. package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
  19. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  20. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  21. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
  22. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  23. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  24. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
  25. package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
  26. package/dist/lib/components/AcRadioCard.js +5 -0
  27. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  28. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  29. package/dist/lib/components/AcSelect.vue.d.ts +12 -1
  30. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
  31. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
  32. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  33. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  34. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  35. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  36. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  37. package/dist/lib/components/AcTable.vue.d.ts +13 -1
  38. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
  39. package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
  40. package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
  41. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
  42. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  43. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  44. package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
  45. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
  46. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
  47. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  48. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
  49. package/dist/lib/components/fixedFrame.d.ts +11 -0
  50. package/dist/lib/components/fixedFrame.js +24 -0
  51. package/dist/lib/components/index.d.ts +1 -0
  52. package/dist/lib/components/types.d.ts +2 -0
  53. package/dist/lib/index.js +34 -33
  54. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
- import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as ee, createVNode as te, defineComponent as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, onUpdated as ne, openBlock as m, ref as h, renderList as re, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, useId as y, useSlots as ie, vShow as b, watch as x, withCtx as S, withDirectives as C } from "vue";
2
- import { CircleAlert as w, CircleCheck as ae, Info as oe, TriangleAlert as se } from "@lucide/vue";
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 ce = ["data-side"], le = { class: "flex items-start gap-2" }, ue = { class: "min-w-0 flex-1" }, T = {
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
- }, de = {
8
+ }, pe = {
8
9
  key: 1,
9
10
  class: "ml-1 flex shrink-0 items-center gap-0.5 self-center"
10
- }, E = null, D = 0, fe = 400, O = /*@__PURE__*/ c({
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(c) {
35
- let O = c, pe = ie(), k = {
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
- }, me = {
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: oe,
53
+ icon: le,
53
54
  class: "text-info"
54
55
  },
55
56
  success: {
56
- icon: ae,
57
+ icon: ce,
57
58
  class: "text-success"
58
59
  },
59
60
  warning: {
60
- icon: se,
61
+ icon: ue,
61
62
  class: "text-warning"
62
63
  },
63
64
  danger: {
64
- icon: w,
65
+ icon: se,
65
66
  class: "text-danger"
66
67
  }
67
- }, M = `${y()}-tip`, N = h(null), P = h(null), F = h(!1), I = h(O.placement), L = h({
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 = r(() => !O.disabled && !!(O.content || O.title || pe.content)), H = r(() => O.tone === "neutral" ? null : j[O.tone]), he = r(() => {
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: O.maxWidth,
82
+ maxWidth: D.maxWidth,
82
83
  transformOrigin: r
83
84
  };
84
- }), ge = r(() => {
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 _e() {
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 ve() {
124
- (!O.overflowOnly || _e()) && (E && E !== q && E(), E = q, F.value = !0, await l(), ye());
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 = E !== null || Date.now() - D < fe;
130
- R = setTimeout(ve, t ? 0 : e);
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, D = Date.now(), E === q && (E = null));
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 - r >= 8 : e === "bottom" ? t.bottom + 8 + r <= window.innerHeight - 8 : e === "left" ? t.left - 8 - n >= 8 : t.right + 8 + n <= window.innerWidth - 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 O.align === "start" ? e : O.align === "end" ? e + t - n : e + (t - n) / 2;
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 ye() {
148
- let e = U() ?? N.value;
149
- if (!e || !P.value) return;
150
- let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = P.value, i = O.placement, a = Y(i, t, n, r) || !Y(k[i], t, n, r) ? i : k[i];
151
- if (I.value = a, a === "top" || a === "bottom") {
152
- let e = Z(X(t.left, t.width, n), 8, window.innerWidth - 8 - n), i = Z(t.left + t.width / 2 - e, 12, n - 12);
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(a === "top" ? t.top - 8 - r : t.bottom + 8),
155
+ top: Math.round((s === "top" ? n.top - 8 - a : n.bottom + 8) - r.top),
155
156
  left: Math.round(e),
156
- arrow: i
157
+ arrow: t
157
158
  };
158
159
  } else {
159
- let e = Z(X(t.top, t.height, r), 8, window.innerHeight - 8 - r), i = Z(t.top + t.height / 2 - e, 12, r - 12);
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(a === "left" ? t.left - 8 - n : t.right + 8),
163
- arrow: i
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.target.matches(":focus-visible") && K(0);
169
+ e.pointerType !== "touch" && K(D.delay);
172
170
  }
173
- function Se() {
174
- O.interactive && clearTimeout(z);
171
+ function Se(e) {
172
+ e.target.matches(":focus-visible") && K(0);
175
173
  }
176
174
  function Ce() {
177
- O.interactive && J(120);
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 x(F, (e) => {
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
- }), x(V, (e) => {
188
+ }), S(V, (e) => {
188
189
  W(), e || J();
189
- }), p(W), ne(W), f(() => {
190
- J(), E === q && (E = null), document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0), B && G(B);
191
- }), (r, l) => (m(), o("span", {
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: be,
198
- onPointerleave: l[0] ||= (e) => J(120),
199
- onPointerdown: l[1] ||= (e) => J(),
200
- onFocusin: xe,
201
- onFocusout: l[2] ||= (e) => J()
202
- }, [g(r.$slots, "default"), (m(), i(t, { to: "body" }, [te(n, {
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 ${me[I.value]}`,
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: S(() => [C(s("div", {
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: u(["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", [c.title ? "px-3 py-2" : "px-2.5 py-1.5", c.interactive ? "pointer-events-auto" : "pointer-events-none"]]),
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: d(he.value),
216
+ style: p(ge.value),
216
217
  "data-ac-ds": "",
217
218
  "data-testid": "ac-tooltip-panel",
218
- onPointerenter: Se,
219
- onPointerleave: Ce
220
- }, [s("div", le, [
221
- H.value ? (m(), i(_(H.value.icon), {
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: u(["mt-0.5 size-3.5 shrink-0", H.value.class]),
224
+ class: f(["mt-0.5 size-3.5 shrink-0", H.value.class]),
224
225
  "aria-hidden": "true"
225
- }, null, 8, ["class"])) : a("", !0),
226
- s("div", ue, [c.title ? (m(), o("p", T, v(c.title), 1)) : a("", !0), s("div", { class: u(c.title && "mt-0.5 text-on-tooltip/75") }, [g(r.$slots, "content", {}, () => [ee(v(c.content), 1)])], 2)]),
227
- c.shortcut.length ? (m(), o("span", de, [(m(!0), o(e, null, re(c.shortcut, (e) => (m(), o("kbd", {
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
- }, v(e), 1))), 128))])) : a("", !0)
231
- ]), s("span", {
231
+ }, x(e), 1))), 128))])) : o("", !0)
232
+ ]), c("span", {
232
233
  "aria-hidden": "true",
233
- class: u(["absolute size-2.5 rotate-45 border-white/10 bg-tooltip", A[I.value]]),
234
- style: d(ge.value)
235
- }, null, 6)], 46, ce), [[b, F.value]])]),
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 { O as default };
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;