@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,33 +1,39 @@
1
- import e from "./AcAvatar.js";
2
- import t from "./AcFontScale.js";
3
- import n from "./AcThemeMode.js";
4
- import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, mergeModels as h, mergeProps as ee, nextTick as g, normalizeClass as _, normalizeStyle as te, onBeforeUnmount as ne, openBlock as v, ref as y, renderList as b, renderSlot as re, resolveDynamicComponent as x, toDisplayString as S, unref as C, useId as ie, useModel as w, watch as T, withCtx as E } from "vue";
5
- import { Building2 as ae, Check as oe, ChevronDown as se, LogOut as ce } from "@lucide/vue";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import t from "./AcAvatar.js";
3
+ import n from "./AcFontScale.js";
4
+ import r from "./AcThemeMode.js";
5
+ import { Fragment as i, Teleport as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as ee, mergeModels as h, mergeProps as te, nextTick as g, normalizeClass as _, normalizeStyle as ne, onBeforeUnmount as re, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useId as ie, useModel as T, useSlots as ae, watch as E, withCtx as D } from "vue";
6
+ import { Building2 as oe, Check as se, ChevronDown as ce, LogOut as le } from "@lucide/vue";
6
7
  //#region src/lib/components/AcUserMenu.vue?vue&type=script&setup=true&lang.ts
7
- var le = {
8
+ var ue = {
8
9
  class: "inline-flex",
9
10
  "data-ac-ds": "",
10
11
  "data-testid": "ac-user-menu"
11
- }, ue = [
12
+ }, de = [
12
13
  "aria-expanded",
13
14
  "aria-controls",
14
15
  "aria-label"
15
- ], de = {
16
+ ], fe = {
16
17
  key: 0,
17
18
  class: "hidden max-w-36 truncate text-base font-medium text-heading md:block"
18
- }, fe = {
19
+ }, pe = {
20
+ key: 1,
21
+ class: "inline-flex shrink-0",
22
+ "aria-hidden": "true"
23
+ }, me = {
24
+ key: 2,
19
25
  class: "inline-flex size-9 shrink-0 rounded-full bg-linear-to-r from-primary/70 to-primary/90 p-0.5",
20
26
  "aria-hidden": "true"
21
- }, pe = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, me = ["src"], he = {
27
+ }, he = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, ge = ["src"], _e = {
22
28
  class: "inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/10 text-base font-semibold text-primary-strong ring-1 ring-primary/25 ring-inset",
23
29
  "aria-hidden": "true"
24
- }, ge = ["src"], _e = { class: "min-w-0 flex-1" }, ve = { class: "block truncate text-base font-medium text-heading" }, ye = {
30
+ }, ve = ["src"], ye = { class: "min-w-0 flex-1" }, be = { class: "block truncate text-base font-medium text-heading" }, xe = {
25
31
  key: 0,
26
32
  class: "block truncate text-xs text-muted"
27
- }, be = ["aria-labelledby"], xe = ["id"], Se = { class: "flex flex-col gap-1" }, Ce = ["aria-checked", "onClick"], we = { class: "flex min-w-0 items-center gap-2" }, Te = { class: "min-w-0" }, Ee = { class: "block truncate font-medium text-heading" }, D = { class: "block truncate text-xs text-muted" }, De = ["aria-labelledby"], Oe = ["id"], ke = ["aria-labelledby"], Ae = ["id"], je = {
33
+ }, Se = ["aria-labelledby"], Ce = ["id"], we = { class: "flex flex-col gap-1" }, Te = ["aria-checked", "onClick"], Ee = { class: "flex min-w-0 items-center gap-2" }, De = { class: "min-w-0" }, Oe = { class: "block truncate font-medium text-heading" }, ke = { class: "block truncate text-xs text-muted" }, Ae = ["aria-labelledby"], je = ["id"], Me = ["aria-labelledby"], Ne = ["id"], Pe = {
28
34
  role: "group",
29
- class: "mt-1 flex flex-col border-t border-border py-1"
30
- }, Me = { class: "min-w-0 flex-1 truncate" }, O = "flex min-h-10 w-full cursor-pointer items-center gap-2 rounded-8 px-4 py-2.5 text-left text-base font-medium no-underline outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", Ne = "[role=\"menuitem\"]:not([aria-disabled=\"true\"]), [role=\"menuitemradio\"], [role=\"radio\"]", k = /*@__PURE__*/ p({
35
+ class: "mt-1 flex flex-col border-t border-border py-1 first:mt-0 first:border-t-0"
36
+ }, Fe = { class: "min-w-0 flex-1 truncate" }, O = "flex min-h-10 w-full cursor-pointer items-center gap-2 rounded-8 px-4 py-2.5 text-left text-base font-medium no-underline outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", Ie = "[role=\"menuitem\"]:not([aria-disabled=\"true\"]), [role=\"menuitemradio\"], [role=\"radio\"]", k = /*@__PURE__*/ m({
31
37
  __name: "AcUserMenu",
32
38
  props: /*@__PURE__*/ h({
33
39
  name: {},
@@ -50,7 +56,15 @@ var le = {
50
56
  logoutUrl: { default: "" },
51
57
  logoutLabel: { default: "Sign out" },
52
58
  workspaces: { default: () => [] },
53
- workspacesLabel: { default: "Workspaces" }
59
+ workspacesLabel: { default: "Workspaces" },
60
+ showProfile: {
61
+ type: Boolean,
62
+ default: !0
63
+ },
64
+ logoutIcon: {
65
+ type: Boolean,
66
+ default: !0
67
+ }
54
68
  }, {
55
69
  open: {
56
70
  type: Boolean,
@@ -66,18 +80,18 @@ var le = {
66
80
  "set:theme",
67
81
  "switch-workspace"
68
82
  ], ["update:open", "update:workspace"]),
69
- setup(p, { emit: h }) {
70
- let k = p, A = w(p, "open"), j = w(p, "workspace"), M = h, N = `${O} text-heading [&>svg]:text-muted`, Pe = `${O} text-danger-strong`, P = m()?.appContext.components.RouterLink, F = ie(), I = `${F}-trigger`, L = `${F}-menu`, R = y(null), z = y(null), B = y(!1), V = y({
83
+ setup(m, { emit: h }) {
84
+ let k = m, A = T(m, "open"), j = T(m, "workspace"), M = h, Le = ae(), N = `${O} text-heading [&>svg]:text-muted`, Re = `${O} text-danger-strong`, P = ee()?.appContext.components.RouterLink, F = ie(), I = `${F}-trigger`, L = `${F}-menu`, R = y(null), z = y(null), B = y(!1), V = y({
71
85
  top: 0,
72
86
  right: 0
73
- }), H = o(() => {
87
+ }), H = s(() => {
74
88
  let e = k.name.trim().split(/[\s._-]+/).filter(Boolean);
75
89
  return e.length ? (e[0].charAt(0) + (e.length > 1 ? e[e.length - 1].charAt(0) : "")).toUpperCase() : "?";
76
- }), U = o(() => !!k.avatarUrl && !B.value);
90
+ }), U = s(() => !!k.avatarUrl && !B.value);
77
91
  function W(e) {
78
92
  return e.to && P && !e.disabled ? P : e.to || e.href ? "a" : "button";
79
93
  }
80
- function Fe(e) {
94
+ function ze(e) {
81
95
  let t = W(e);
82
96
  return t === P ? { to: e.to } : t === "a" ? e.disabled ? { "aria-disabled": "true" } : { href: e.href ?? (typeof e.to == "string" ? e.to : void 0) } : {
83
97
  type: "button",
@@ -85,22 +99,22 @@ var le = {
85
99
  };
86
100
  }
87
101
  function G() {
88
- return [...z.value?.querySelectorAll(Ne) ?? []];
102
+ return [...z.value?.querySelectorAll(Ie) ?? []];
89
103
  }
90
104
  function K(e) {
91
105
  let t = G();
92
106
  t.length && t[(e + t.length) % t.length].focus();
93
107
  }
94
108
  function q() {
95
- let e = R.value;
96
- if (!e) return;
97
- let t = e.getBoundingClientRect(), n = z.value?.offsetHeight ?? 320, r = z.value?.offsetWidth ?? 256, i = Math.max(8, Math.min(window.innerWidth - t.right, window.innerWidth - r - 8)), a = window.innerHeight - t.bottom - 6 - 8;
98
- V.value = a < n && t.top > a ? {
99
- bottom: window.innerHeight - t.top + 6,
100
- right: i
109
+ let t = R.value;
110
+ if (!t) return;
111
+ let n = t.getBoundingClientRect(), r = e(), i = z.value?.offsetHeight ?? 320, a = z.value?.offsetWidth ?? 256, o = Math.max(8, Math.min(r.right - n.right, r.width - a - 8)), s = r.bottom - n.bottom - 6 - 8;
112
+ V.value = s < i && n.top - r.top > s ? {
113
+ bottom: r.bottom - n.top + 6,
114
+ right: o
101
115
  } : {
102
- top: t.bottom + 6,
103
- right: i
116
+ top: n.bottom + 6 - r.top,
117
+ right: o
104
118
  };
105
119
  }
106
120
  async function J(e = "first") {
@@ -109,7 +123,7 @@ var le = {
109
123
  function Y(e = !0) {
110
124
  A.value && (A.value = !1, e && R.value?.focus());
111
125
  }
112
- function Ie(e) {
126
+ function Be(e) {
113
127
  [
114
128
  "Enter",
115
129
  " ",
@@ -120,13 +134,13 @@ var le = {
120
134
  let t = G().indexOf(document.activeElement);
121
135
  e.key === "ArrowDown" ? (e.preventDefault(), K(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), K(t - 1)) : e.key === "Home" ? (e.preventDefault(), K(0)) : e.key === "End" ? (e.preventDefault(), K(-1)) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), Y()) : e.key === "Tab" && Y();
122
136
  }
123
- function Le(e) {
137
+ function Ve(e) {
124
138
  e.disabled || (M("select", e), Y());
125
139
  }
126
- function Re(e) {
140
+ function He(e) {
127
141
  e.name !== j.value && (j.value = e.name, M("switch-workspace", e)), Y();
128
142
  }
129
- function ze() {
143
+ function Ue() {
130
144
  M("logout"), Y(!1);
131
145
  }
132
146
  function Z(e) {
@@ -139,10 +153,10 @@ var le = {
139
153
  function $() {
140
154
  document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
141
155
  }
142
- return T(A, (e) => {
156
+ return E(A, (e) => {
143
157
  if (!e) return $();
144
158
  document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(q);
145
- }), T(() => k.avatarUrl, () => B.value = !1), ne($), (o, m) => (v(), l("div", le, [u("button", {
159
+ }), E(() => k.avatarUrl, () => B.value = !1), re($), (e, s) => (v(), u("div", ue, [d("button", {
146
160
  id: I,
147
161
  ref_key: "trigger",
148
162
  ref: R,
@@ -150,33 +164,33 @@ var le = {
150
164
  "aria-haspopup": "menu",
151
165
  "aria-expanded": A.value,
152
166
  "aria-controls": A.value ? L : void 0,
153
- "aria-label": `${p.name}, account menu`,
154
- class: _(["group inline-flex shrink-0 cursor-pointer items-center gap-2 rounded-10 border border-transparent p-2 transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface", [p.showName && "md:px-4", A.value && "border-border bg-surface-sunken/50"]]),
167
+ "aria-label": `${m.name}, account menu`,
168
+ class: _(["group inline-flex shrink-0 cursor-pointer items-center gap-2 rounded-10 border border-transparent p-2 transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface", [m.showName && "md:px-4", A.value && "border-border bg-surface-sunken/50"]]),
155
169
  "data-ac-ds": "",
156
170
  "data-testid": "ac-user-menu-trigger",
157
- onClick: m[1] ||= (e) => A.value ? Y() : J(),
158
- onKeydown: Ie
171
+ onClick: s[1] ||= (e) => A.value ? Y() : J(),
172
+ onKeydown: Be
159
173
  }, [
160
- p.showName ? (v(), l("span", de, S(p.name), 1)) : c("", !0),
161
- u("span", fe, [u("span", pe, [U.value ? (v(), l("img", {
174
+ m.showName ? (v(), u("span", fe, C(m.name), 1)) : l("", !0),
175
+ Le.avatar ? (v(), u("span", pe, [x(e.$slots, "avatar")])) : (v(), u("span", me, [d("span", he, [U.value ? (v(), u("img", {
162
176
  key: 0,
163
- src: p.avatarUrl,
177
+ src: m.avatarUrl,
164
178
  alt: "",
165
179
  class: "size-full object-cover",
166
- onError: m[0] ||= (e) => B.value = !0
167
- }, null, 40, me)) : (v(), l(r, { key: 1 }, [d(S(H.value), 1)], 64))])]),
168
- p.showName ? (v(), s(C(se), {
169
- key: 1,
180
+ onError: s[0] ||= (e) => B.value = !0
181
+ }, null, 40, ge)) : (v(), u(i, { key: 1 }, [f(C(H.value), 1)], 64))])])),
182
+ m.showName ? (v(), c(w(ce), {
183
+ key: 3,
170
184
  class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", A.value && "rotate-180"]),
171
185
  "aria-hidden": "true"
172
- }, null, 8, ["class"])) : c("", !0)
173
- ], 42, ue), (v(), s(i, { to: "body" }, [f(a, {
186
+ }, null, 8, ["class"])) : l("", !0)
187
+ ], 42, de), (v(), c(a, { to: "body" }, [p(o, {
174
188
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
175
189
  "enter-from-class": "opacity-0 scale-95",
176
190
  "leave-active-class": "transition duration-100 ease-in",
177
191
  "leave-to-class": "opacity-0"
178
192
  }, {
179
- default: E(() => [A.value ? (v(), l("div", {
193
+ default: D(() => [A.value ? (v(), u("div", {
180
194
  key: 0,
181
195
  id: L,
182
196
  ref_key: "panel",
@@ -184,7 +198,7 @@ var le = {
184
198
  role: "menu",
185
199
  "aria-labelledby": I,
186
200
  class: "fixed z-[90] w-64 max-w-[calc(100vw-16px)] origin-top-right overflow-hidden rounded-14 border border-border/80 bg-surface p-1 shadow-lg",
187
- style: te({
201
+ style: ne({
188
202
  top: V.value.top === void 0 ? void 0 : `${V.value.top}px`,
189
203
  bottom: V.value.bottom === void 0 ? void 0 : `${V.value.bottom}px`,
190
204
  right: `${V.value.right}px`
@@ -193,114 +207,118 @@ var le = {
193
207
  "data-testid": "ac-user-menu-panel",
194
208
  onKeydown: X
195
209
  }, [
196
- (v(), s(x(p.profileUrl ? "a" : "div"), {
197
- href: p.profileUrl || void 0,
198
- role: p.profileUrl ? "menuitem" : "presentation",
199
- tabindex: p.profileUrl ? -1 : void 0,
200
- class: _(["flex items-center gap-3 rounded-8 px-3 py-2.5 no-underline outline-none", p.profileUrl && "transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"])
210
+ m.showProfile ? (v(), c(S(m.profileUrl ? "a" : "div"), {
211
+ key: 0,
212
+ href: m.profileUrl || void 0,
213
+ role: m.profileUrl ? "menuitem" : "presentation",
214
+ tabindex: m.profileUrl ? -1 : void 0,
215
+ class: _(["flex items-center gap-3 rounded-8 px-3 py-2.5 no-underline outline-none", m.profileUrl && "transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"])
201
216
  }, {
202
- default: E(() => [u("span", he, [U.value ? (v(), l("img", {
217
+ default: D(() => [d("span", _e, [U.value ? (v(), u("img", {
203
218
  key: 0,
204
- src: p.avatarUrl,
219
+ src: m.avatarUrl,
205
220
  alt: "",
206
221
  class: "size-full object-cover",
207
- onError: m[2] ||= (e) => B.value = !0
208
- }, null, 40, ge)) : (v(), l(r, { key: 1 }, [d(S(H.value), 1)], 64))]), u("span", _e, [u("span", ve, S(p.name), 1), p.email ? (v(), l("span", ye, S(p.email), 1)) : c("", !0)])]),
222
+ onError: s[2] ||= (e) => B.value = !0
223
+ }, null, 40, ve)) : (v(), u(i, { key: 1 }, [f(C(H.value), 1)], 64))]), d("span", ye, [d("span", be, C(m.name), 1), m.email ? (v(), u("span", xe, C(m.email), 1)) : l("", !0)])]),
209
224
  _: 1
210
225
  }, 8, [
211
226
  "href",
212
227
  "role",
213
228
  "tabindex",
214
229
  "class"
215
- ])),
216
- p.workspaces.length ? (v(), l("div", {
217
- key: 0,
230
+ ])) : l("", !0),
231
+ m.workspaces.length ? (v(), u("div", {
232
+ key: 1,
218
233
  role: "group",
219
- "aria-labelledby": `${C(F)}-workspaces`,
220
- class: "mt-1 border-t border-border px-3 py-2"
221
- }, [u("p", {
222
- id: `${C(F)}-workspaces`,
234
+ "aria-labelledby": `${w(F)}-workspaces`,
235
+ class: "mt-1 border-t border-border px-3 py-2 first:mt-0 first:border-t-0"
236
+ }, [d("p", {
237
+ id: `${w(F)}-workspaces`,
223
238
  class: "mb-2 flex items-center gap-2 text-xs font-semibold tracking-wide text-muted uppercase"
224
- }, [f(C(ae), {
239
+ }, [p(w(oe), {
225
240
  class: "size-4",
226
241
  "aria-hidden": "true"
227
- }), d(" " + S(p.workspacesLabel), 1)], 8, xe), u("div", Se, [(v(!0), l(r, null, b(p.workspaces, (t) => (v(), l("button", {
228
- key: t.name,
242
+ }), f(" " + C(m.workspacesLabel), 1)], 8, Ce), d("div", we, [(v(!0), u(i, null, b(m.workspaces, (e) => (v(), u("button", {
243
+ key: e.name,
229
244
  type: "button",
230
245
  role: "menuitemradio",
231
246
  tabindex: "-1",
232
- "aria-checked": t.name === j.value,
233
- class: _(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-2 py-2 text-left text-base outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", t.name === j.value && "bg-surface-sunken/50"]),
247
+ "aria-checked": e.name === j.value,
248
+ class: _(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-2 py-2 text-left text-base outline-none transition-colors duration-150 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", e.name === j.value && "bg-surface-sunken/50"]),
234
249
  "data-ac-ds": "",
235
250
  "data-testid": "ac-user-menu-workspace",
236
- onClick: (e) => Re(t)
237
- }, [u("span", we, [f(e, {
238
- name: t.displayName || t.name,
239
- "img-url": t.avatarUrl,
240
- kind: t.type === "user" ? "person" : "organization",
251
+ onClick: (t) => He(e)
252
+ }, [d("span", Ee, [p(t, {
253
+ name: e.displayName || e.name,
254
+ "img-url": e.avatarUrl,
255
+ kind: e.type === "user" ? "person" : "organization",
241
256
  alt: ""
242
257
  }, null, 8, [
243
258
  "name",
244
259
  "img-url",
245
260
  "kind"
246
- ]), u("span", Te, [u("span", Ee, S(t.displayName || t.name), 1), u("span", D, [d(S(t.name), 1), t.type === "user" ? (v(), l(r, { key: 0 }, [d(" (Personal)")], 64)) : c("", !0)])])]), t.name === j.value ? (v(), s(C(oe), {
261
+ ]), d("span", De, [d("span", Oe, C(e.displayName || e.name), 1), d("span", ke, [f(C(e.name), 1), e.type === "user" ? (v(), u(i, { key: 0 }, [f(" (Personal)")], 64)) : l("", !0)])])]), e.name === j.value ? (v(), c(w(se), {
247
262
  key: 0,
248
263
  class: "size-4 shrink-0 text-primary",
249
264
  "aria-hidden": "true"
250
- })) : c("", !0)], 10, Ce))), 128))])], 8, be)) : c("", !0),
251
- p.showThemeMode ? (v(), l("div", {
252
- key: 1,
265
+ })) : l("", !0)], 10, Te))), 128))])], 8, Se)) : l("", !0),
266
+ m.showThemeMode ? (v(), u("div", {
267
+ key: 2,
253
268
  role: "group",
254
- "aria-labelledby": `${C(F)}-theme`,
255
- class: "mt-1 border-t border-border px-1 pt-2 pb-1"
256
- }, [u("p", {
257
- id: `${C(F)}-theme`,
269
+ "aria-labelledby": `${w(F)}-theme`,
270
+ class: "mt-1 border-t border-border px-1 pt-2 pb-1 first:mt-0 first:border-t-0"
271
+ }, [d("p", {
272
+ id: `${w(F)}-theme`,
258
273
  class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
259
- }, "Theme", 8, Oe), f(n, {
274
+ }, "Theme", 8, je), p(r, {
260
275
  display: "labels",
261
- "onSet:theme": m[3] ||= (e) => M("set:theme", e)
262
- })], 8, De)) : c("", !0),
263
- p.showFontScale ? (v(), l("div", {
264
- key: 2,
276
+ "onSet:theme": s[3] ||= (e) => M("set:theme", e)
277
+ })], 8, Ae)) : l("", !0),
278
+ m.showFontScale ? (v(), u("div", {
279
+ key: 3,
265
280
  role: "group",
266
- "aria-labelledby": `${C(F)}-scale`,
267
- class: "mt-1 border-t border-border px-1 pt-2 pb-1"
268
- }, [u("p", {
269
- id: `${C(F)}-scale`,
281
+ "aria-labelledby": `${w(F)}-scale`,
282
+ class: "mt-1 border-t border-border px-1 pt-2 pb-1 first:mt-0 first:border-t-0"
283
+ }, [d("p", {
284
+ id: `${w(F)}-scale`,
270
285
  class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
271
- }, "Text size", 8, Ae), f(t, { display: "labels" })], 8, ke)) : c("", !0),
272
- u("div", je, [
273
- (v(!0), l(r, null, b(p.items, (e) => (v(), s(x(W(e)), ee({ key: e.label }, { ref_for: !0 }, Fe(e), {
286
+ }, "Text size", 8, Ne), p(n, { display: "labels" })], 8, Me)) : l("", !0),
287
+ d("div", Pe, [
288
+ (v(!0), u(i, null, b(m.items, (e) => (v(), c(S(W(e)), te({ key: e.label }, { ref_for: !0 }, ze(e), {
274
289
  role: "menuitem",
275
290
  tabindex: "-1",
276
291
  class: N,
277
- onClick: (t) => Le(e)
292
+ onClick: (t) => Ve(e)
278
293
  }), {
279
- default: E(() => [e.icon ? (v(), s(x(e.icon), {
294
+ default: D(() => [e.icon ? (v(), c(S(e.icon), {
280
295
  key: 0,
281
296
  "aria-hidden": "true"
282
- })) : c("", !0), u("span", Me, S(e.label), 1)]),
297
+ })) : l("", !0), d("span", Fe, C(e.label), 1)]),
283
298
  _: 2
284
299
  }, 1040, ["onClick"]))), 128)),
285
- re(o.$slots, "default", {
300
+ x(e.$slots, "default", {
286
301
  close: Y,
287
302
  itemClass: N
288
303
  }),
289
- (v(), s(x(p.logoutUrl ? "a" : "button"), {
290
- href: p.logoutUrl || void 0,
291
- type: p.logoutUrl ? void 0 : "button",
304
+ (v(), c(S(m.logoutUrl ? "a" : "button"), {
305
+ href: m.logoutUrl || void 0,
306
+ type: m.logoutUrl ? void 0 : "button",
292
307
  role: "menuitem",
293
308
  tabindex: "-1",
294
- class: _(Pe),
309
+ class: _(Re),
295
310
  "data-ac-ds": "",
296
311
  "data-testid": "ac-user-menu-logout",
297
- onClick: ze
312
+ onClick: Ue
298
313
  }, {
299
- default: E(() => [f(C(ce), { "aria-hidden": "true" }), u("span", null, S(p.logoutLabel), 1)]),
314
+ default: D(() => [m.logoutIcon ? (v(), c(w(le), {
315
+ key: 0,
316
+ "aria-hidden": "true"
317
+ })) : l("", !0), d("span", null, C(m.logoutLabel), 1)]),
300
318
  _: 1
301
319
  }, 8, ["href", "type"]))
302
320
  ])
303
- ], 36)) : c("", !0)]),
321
+ ], 36)) : l("", !0)]),
304
322
  _: 3
305
323
  })]))]));
306
324
  }
@@ -0,0 +1,11 @@
1
+ /** The box `position: fixed` offsets are measured from, in viewport px. Matches the viewport when there's no gutter. */
2
+ export interface FixedFrame {
3
+ left: number;
4
+ top: number;
5
+ right: number;
6
+ bottom: number;
7
+ width: number;
8
+ height: number;
9
+ }
10
+ /** Measures the fixed containing block with a hidden probe. Call it once per positioning pass. */
11
+ export declare function fixedFrame(): FixedFrame;
@@ -0,0 +1,24 @@
1
+ //#region src/lib/components/fixedFrame.ts
2
+ function e() {
3
+ if (typeof document > "u") return {
4
+ left: 0,
5
+ top: 0,
6
+ right: 0,
7
+ bottom: 0,
8
+ width: 0,
9
+ height: 0
10
+ };
11
+ let e = document.createElement("div");
12
+ e.style.cssText = "position:fixed;inset:0;visibility:hidden;pointer-events:none", document.body.appendChild(e);
13
+ let { left: t, top: n, right: r, bottom: i, width: a, height: o } = e.getBoundingClientRect();
14
+ return e.remove(), {
15
+ left: t,
16
+ top: n,
17
+ right: r,
18
+ bottom: i,
19
+ width: a,
20
+ height: o
21
+ };
22
+ }
23
+ //#endregion
24
+ export { e as fixedFrame };
@@ -61,6 +61,7 @@ export { default as AcPagination } from "./AcPagination.vue";
61
61
  export { default as AcPreloader } from "./AcPreloader.vue";
62
62
  export { default as AcProgress } from "./AcProgress.vue";
63
63
  export { default as AcProductHero } from "./AcProductHero.vue";
64
+ export { default as AcRadioCard } from "./AcRadioCard.vue";
64
65
  export { default as AcResourceCard } from "./AcResourceCard.vue";
65
66
  export { default as AcSearchBar } from "./AcSearchBar.vue";
66
67
  export { default as AcSectionContent } from "./AcSectionContent.vue";
@@ -13,4 +13,6 @@ export interface SelectOption<V = string | number> {
13
13
  disabled?: boolean;
14
14
  /** Options with the same group are listed under that heading. */
15
15
  group?: string;
16
+ /** Extra data for the `option` and `selected` slots, e.g. an icon, a price or a role. */
17
+ custom?: Record<string, unknown>;
16
18
  }
package/dist/lib/index.js CHANGED
@@ -67,36 +67,37 @@ import me from "./components/AcPagination.js";
67
67
  import he from "./components/AcPreloader.js";
68
68
  import ge from "./components/AcProgress.js";
69
69
  import _e from "./components/AcProductHero.js";
70
- import ve from "./components/AcTag.js";
71
- import ye from "./components/AcResourceCard.js";
72
- import be from "./components/AcSectionContent.js";
73
- import xe from "./components/AcSegmentedControl.js";
74
- import Se from "./components/AcSettingsRow.js";
75
- import Ce from "./components/AcSidebar.js";
76
- import we from "./components/AcSidebarItem.js";
77
- import Te from "./components/AcSidebarSection.js";
78
- import Ee from "./components/AcSidePanel.js";
79
- import De from "./components/AcSideTabs.js";
80
- import Oe from "./components/AcSlider.js";
81
- import ke from "./components/AcStatCard.js";
82
- import Ae from "./components/AcStatusBar.js";
83
- import je from "./components/AcSteps.js";
84
- import Me from "./components/AcSwitch.js";
85
- import Ne from "./components/AcSwitchCard.js";
86
- import Pe from "./components/AcTable.js";
87
- import Fe from "./components/AcTabs.js";
88
- import Ie from "./components/AcTagInput.js";
89
- import Le from "./components/AcTextarea.js";
90
- import { useColorMode as Re } from "./composables/useColorMode.js";
91
- import ze from "./components/AcThemeMode.js";
92
- import Be from "./components/AcTimePicker.js";
93
- import { showToast as Ve, useToast as He } from "./composables/useToast.js";
94
- import Ue from "./components/AcToaster.js";
95
- import We from "./components/AcUsageCard.js";
96
- import Ge from "./components/AcUserMenu.js";
97
- import { useTablePagination as Ke } from "./composables/useTablePagination.js";
98
- import { useApiPagination as qe } from "./composables/useApiPagination.js";
99
- import { useBulkSelection as Je } from "./composables/useBulkSelection.js";
100
- import { useFormValidation as Ye } from "./composables/useFormValidation.js";
101
- import { HSLToHex as Xe, HexToHSL as Ze, MIN_CONTRAST as Qe, contrastOnWhite as $e, getThemeHSL as et, hexToHsl as tt, hslToHex as nt, readableLightness as rt, setThemeHSL as it, useBrandColor as at } from "./composables/useBrandColor.js";
102
- export { ee as AcAccordion, te as AcAccordionItem, n as AcAlert, a as AcAppSwitcher, o as AcAvatar, u as AcBadge, d as AcBanner, f as AcBreadcrumb, p as AcBulkActionBar, t as AcButton, m as AcButtons, h as AcCard, y as AcCellValue, b as AcCheckBox, x as AcCheckList, S as AcCheckRadio, C as AcCircularProgress, w as AcClusterSwitcher, T as AcColorInput, E as AcCommandBlock, D as AcConfirmModal, O as AcContentHeader, k as AcContentLayout, j as AcContentTable, M as AcCopyButton, N as AcCostSummary, P as AcDatePicker, I as AcDeleteConfirmationModal, I as AcDeleteModal, L as AcDivider, R as AcDropdown, z as AcDropdownDivider, B as AcDropdownItem, V as AcEmptyState, H as AcErrorState, U as AcFeatureCard, W as AcFileUpload, q as AcFontScale, J as AcFooter, Y as AcForm, X as AcFormArray, Z as AcFormFooter, Q as AcFormSection, ne as AcHeader, re as AcHeaderItem, ie as AcHeaderItems, ae as AcInfoTable, F as AcInput, oe as AcKbd, se as AcKeyValueInput, ce as AcLoader, le as AcLocaleSwitcher, r as AcLogo, g as AcModal, ue as AcNavbar, i as AcNavbarItem, de as AcNotificationMenu, fe as AcNumberInput, pe as AcPage, me as AcPagination, he as AcPreloader, _e as AcProductHero, ge as AcProgress, ye as AcResourceCard, A as AcSearchBar, be as AcSectionContent, xe as AcSegmentedControl, $ as AcSelect, Se as AcSettingsRow, Ee as AcSidePanel, De as AcSideTabs, Ce as AcSidebar, we as AcSidebarItem, Te as AcSidebarSection, _ as AcSkeleton, Oe as AcSlider, e as AcSpinner, ke as AcStatCard, Ae as AcStatusBar, je as AcSteps, Me as AcSwitch, Ne as AcSwitchCard, Pe as AcTable, Fe as AcTabs, ve as AcTag, Ie as AcTagInput, Le as AcTextarea, ze as AcThemeMode, Be as AcTimePicker, Ue as AcToaster, v as AcTooltip, We as AcUsageCard, Ge as AcUserMenu, G as FONT_SCALES, Xe as HSLToHex, Ze as HexToHSL, Qe as MIN_CONTRAST, $e as contrastOnWhite, et as getThemeHSL, tt as hexToHsl, nt as hslToHex, s as humanizeState, c as normalizeState, rt as readableLightness, it as setThemeHSL, Ve as showToast, l as statusMeta, qe as useApiPagination, at as useBrandColor, Je as useBulkSelection, Re as useColorMode, K as useFontScale, Ye as useFormValidation, Ke as useTablePagination, He as useToast };
70
+ import ve from "./components/AcRadioCard.js";
71
+ import ye from "./components/AcTag.js";
72
+ import be from "./components/AcResourceCard.js";
73
+ import xe from "./components/AcSectionContent.js";
74
+ import Se from "./components/AcSegmentedControl.js";
75
+ import Ce from "./components/AcSettingsRow.js";
76
+ import we from "./components/AcSidebar.js";
77
+ import Te from "./components/AcSidebarItem.js";
78
+ import Ee from "./components/AcSidebarSection.js";
79
+ import De from "./components/AcSidePanel.js";
80
+ import Oe from "./components/AcSideTabs.js";
81
+ import ke from "./components/AcSlider.js";
82
+ import Ae from "./components/AcStatCard.js";
83
+ import je from "./components/AcStatusBar.js";
84
+ import Me from "./components/AcSteps.js";
85
+ import Ne from "./components/AcSwitch.js";
86
+ import Pe from "./components/AcSwitchCard.js";
87
+ import Fe from "./components/AcTable.js";
88
+ import Ie from "./components/AcTabs.js";
89
+ import Le from "./components/AcTagInput.js";
90
+ import Re from "./components/AcTextarea.js";
91
+ import { useColorMode as ze } from "./composables/useColorMode.js";
92
+ import Be from "./components/AcThemeMode.js";
93
+ import Ve from "./components/AcTimePicker.js";
94
+ import { showToast as He, useToast as Ue } from "./composables/useToast.js";
95
+ import We from "./components/AcToaster.js";
96
+ import Ge from "./components/AcUsageCard.js";
97
+ import Ke from "./components/AcUserMenu.js";
98
+ import { useTablePagination as qe } from "./composables/useTablePagination.js";
99
+ import { useApiPagination as Je } from "./composables/useApiPagination.js";
100
+ import { useBulkSelection as Ye } from "./composables/useBulkSelection.js";
101
+ import { useFormValidation as Xe } from "./composables/useFormValidation.js";
102
+ import { HSLToHex as Ze, HexToHSL as Qe, MIN_CONTRAST as $e, contrastOnWhite as et, getThemeHSL as tt, hexToHsl as nt, hslToHex as rt, readableLightness as it, setThemeHSL as at, useBrandColor as ot } from "./composables/useBrandColor.js";
103
+ export { ee as AcAccordion, te as AcAccordionItem, n as AcAlert, a as AcAppSwitcher, o as AcAvatar, u as AcBadge, d as AcBanner, f as AcBreadcrumb, p as AcBulkActionBar, t as AcButton, m as AcButtons, h as AcCard, y as AcCellValue, b as AcCheckBox, x as AcCheckList, S as AcCheckRadio, C as AcCircularProgress, w as AcClusterSwitcher, T as AcColorInput, E as AcCommandBlock, D as AcConfirmModal, O as AcContentHeader, k as AcContentLayout, j as AcContentTable, M as AcCopyButton, N as AcCostSummary, P as AcDatePicker, I as AcDeleteConfirmationModal, I as AcDeleteModal, L as AcDivider, R as AcDropdown, z as AcDropdownDivider, B as AcDropdownItem, V as AcEmptyState, H as AcErrorState, U as AcFeatureCard, W as AcFileUpload, q as AcFontScale, J as AcFooter, Y as AcForm, X as AcFormArray, Z as AcFormFooter, Q as AcFormSection, ne as AcHeader, re as AcHeaderItem, ie as AcHeaderItems, ae as AcInfoTable, F as AcInput, oe as AcKbd, se as AcKeyValueInput, ce as AcLoader, le as AcLocaleSwitcher, r as AcLogo, g as AcModal, ue as AcNavbar, i as AcNavbarItem, de as AcNotificationMenu, fe as AcNumberInput, pe as AcPage, me as AcPagination, he as AcPreloader, _e as AcProductHero, ge as AcProgress, ve as AcRadioCard, be as AcResourceCard, A as AcSearchBar, xe as AcSectionContent, Se as AcSegmentedControl, $ as AcSelect, Ce as AcSettingsRow, De as AcSidePanel, Oe as AcSideTabs, we as AcSidebar, Te as AcSidebarItem, Ee as AcSidebarSection, _ as AcSkeleton, ke as AcSlider, e as AcSpinner, Ae as AcStatCard, je as AcStatusBar, Me as AcSteps, Ne as AcSwitch, Pe as AcSwitchCard, Fe as AcTable, Ie as AcTabs, ye as AcTag, Le as AcTagInput, Re as AcTextarea, Be as AcThemeMode, Ve as AcTimePicker, We as AcToaster, v as AcTooltip, Ge as AcUsageCard, Ke as AcUserMenu, G as FONT_SCALES, Ze as HSLToHex, Qe as HexToHSL, $e as MIN_CONTRAST, et as contrastOnWhite, tt as getThemeHSL, nt as hexToHsl, rt as hslToHex, s as humanizeState, c as normalizeState, it as readableLightness, at as setThemeHSL, He as showToast, l as statusMeta, Je as useApiPagination, ot as useBrandColor, Ye as useBulkSelection, ze as useColorMode, K as useFontScale, Xe as useFormValidation, qe as useTablePagination, Ue as useToast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ac-design/design-system",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "AppsCode design system: Tailwind CSS v4 theme and Vue 3 components.",
5
5
  "repository": {
6
6
  "type": "git",