@ac-design/design-system 2.2.1 → 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 (42) hide show
  1. package/dist/lib/compat.css +210 -0
  2. package/dist/lib/components/AcButton.vue.d.ts +18 -12
  3. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
  4. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  5. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  6. package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
  7. package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
  8. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +432 -369
  9. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  10. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  11. package/dist/lib/components/AcInput.vue.d.ts +28 -7
  12. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
  13. package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
  14. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  15. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  16. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  17. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  18. package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
  19. package/dist/lib/components/AcRadioCard.js +5 -0
  20. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  21. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  22. package/dist/lib/components/AcSelect.vue.d.ts +12 -1
  23. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +190 -174
  24. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  25. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  26. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  27. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  28. package/dist/lib/components/AcTable.vue.d.ts +13 -1
  29. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
  30. package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
  31. package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
  32. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
  33. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  34. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  35. package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
  36. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +206 -174
  37. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  38. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
  39. package/dist/lib/components/index.d.ts +1 -0
  40. package/dist/lib/components/types.d.ts +2 -0
  41. package/dist/lib/index.js +34 -33
  42. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { fixedFrame as e } from "./fixedFrame.js";
2
2
  import t from "./AcAvatar.js";
3
3
  import n from "./AcFontScale.js";
4
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 ie, resolveDynamicComponent as x, toDisplayString as S, unref as C, useId as ae, useModel as w, watch as T, withCtx as E } from "vue";
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
6
  import { Building2 as oe, Check as se, ChevronDown as ce, LogOut as le } from "@lucide/vue";
7
7
  //#region src/lib/components/AcUserMenu.vue?vue&type=script&setup=true&lang.ts
8
8
  var ue = {
@@ -17,18 +17,23 @@ var ue = {
17
17
  key: 0,
18
18
  class: "hidden max-w-36 truncate text-base font-medium text-heading md:block"
19
19
  }, pe = {
20
+ key: 1,
21
+ class: "inline-flex shrink-0",
22
+ "aria-hidden": "true"
23
+ }, me = {
24
+ key: 2,
20
25
  class: "inline-flex size-9 shrink-0 rounded-full bg-linear-to-r from-primary/70 to-primary/90 p-0.5",
21
26
  "aria-hidden": "true"
22
- }, me = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, he = ["src"], ge = {
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 = {
23
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",
24
29
  "aria-hidden": "true"
25
- }, _e = ["src"], ve = { class: "min-w-0 flex-1" }, ye = { class: "block truncate text-base font-medium text-heading" }, be = {
30
+ }, ve = ["src"], ye = { class: "min-w-0 flex-1" }, be = { class: "block truncate text-base font-medium text-heading" }, xe = {
26
31
  key: 0,
27
32
  class: "block truncate text-xs text-muted"
28
- }, xe = ["aria-labelledby"], Se = ["id"], Ce = { class: "flex flex-col gap-1" }, we = ["aria-checked", "onClick"], Te = { class: "flex min-w-0 items-center gap-2" }, Ee = { class: "min-w-0" }, D = { class: "block truncate font-medium text-heading" }, De = { class: "block truncate text-xs text-muted" }, Oe = ["aria-labelledby"], ke = ["id"], Ae = ["aria-labelledby"], je = ["id"], Me = {
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 = {
29
34
  role: "group",
30
- class: "mt-1 flex flex-col border-t border-border py-1"
31
- }, O = { class: "min-w-0 flex-1 truncate" }, k = "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\"]", A = /*@__PURE__*/ m({
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({
32
37
  __name: "AcUserMenu",
33
38
  props: /*@__PURE__*/ h({
34
39
  name: {},
@@ -51,7 +56,15 @@ var ue = {
51
56
  logoutUrl: { default: "" },
52
57
  logoutLabel: { default: "Sign out" },
53
58
  workspaces: { default: () => [] },
54
- 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
+ }
55
68
  }, {
56
69
  open: {
57
70
  type: Boolean,
@@ -68,35 +81,35 @@ var ue = {
68
81
  "switch-workspace"
69
82
  ], ["update:open", "update:workspace"]),
70
83
  setup(m, { emit: h }) {
71
- let A = m, j = w(m, "open"), M = w(m, "workspace"), N = h, P = `${k} text-heading [&>svg]:text-muted`, Pe = `${k} text-danger-strong`, F = ee()?.appContext.components.RouterLink, I = ae(), L = `${I}-trigger`, R = `${I}-menu`, z = y(null), B = y(null), V = y(!1), H = y({
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({
72
85
  top: 0,
73
86
  right: 0
74
- }), U = s(() => {
75
- let e = A.name.trim().split(/[\s._-]+/).filter(Boolean);
87
+ }), H = s(() => {
88
+ let e = k.name.trim().split(/[\s._-]+/).filter(Boolean);
76
89
  return e.length ? (e[0].charAt(0) + (e.length > 1 ? e[e.length - 1].charAt(0) : "")).toUpperCase() : "?";
77
- }), W = s(() => !!A.avatarUrl && !V.value);
78
- function G(e) {
79
- return e.to && F && !e.disabled ? F : e.to || e.href ? "a" : "button";
90
+ }), U = s(() => !!k.avatarUrl && !B.value);
91
+ function W(e) {
92
+ return e.to && P && !e.disabled ? P : e.to || e.href ? "a" : "button";
80
93
  }
81
- function Fe(e) {
82
- let t = G(e);
83
- return t === F ? { to: e.to } : t === "a" ? e.disabled ? { "aria-disabled": "true" } : { href: e.href ?? (typeof e.to == "string" ? e.to : void 0) } : {
94
+ function ze(e) {
95
+ let t = W(e);
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) } : {
84
97
  type: "button",
85
98
  "aria-disabled": e.disabled ? "true" : void 0
86
99
  };
87
100
  }
88
- function K() {
89
- return [...B.value?.querySelectorAll(Ne) ?? []];
101
+ function G() {
102
+ return [...z.value?.querySelectorAll(Ie) ?? []];
90
103
  }
91
- function q(e) {
92
- let t = K();
104
+ function K(e) {
105
+ let t = G();
93
106
  t.length && t[(e + t.length) % t.length].focus();
94
107
  }
95
- function J() {
96
- let t = z.value;
108
+ function q() {
109
+ let t = R.value;
97
110
  if (!t) return;
98
- let n = t.getBoundingClientRect(), r = e(), i = B.value?.offsetHeight ?? 320, a = B.value?.offsetWidth ?? 256, o = Math.max(8, Math.min(r.right - n.right, r.width - a - 8)), s = r.bottom - n.bottom - 6 - 8;
99
- H.value = s < i && n.top - r.top > s ? {
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 ? {
100
113
  bottom: r.bottom - n.top + 6,
101
114
  right: o
102
115
  } : {
@@ -104,71 +117,71 @@ var ue = {
104
117
  right: o
105
118
  };
106
119
  }
107
- async function Y(e = "first") {
108
- j.value = !0, await g(), J(), q(e === "first" ? 0 : -1);
120
+ async function J(e = "first") {
121
+ A.value = !0, await g(), q(), K(e === "first" ? 0 : -1);
109
122
  }
110
- function X(e = !0) {
111
- j.value && (j.value = !1, e && z.value?.focus());
123
+ function Y(e = !0) {
124
+ A.value && (A.value = !1, e && R.value?.focus());
112
125
  }
113
- function Ie(e) {
126
+ function Be(e) {
114
127
  [
115
128
  "Enter",
116
129
  " ",
117
130
  "ArrowDown"
118
- ].includes(e.key) ? (e.preventDefault(), Y("first")) : e.key === "ArrowUp" && (e.preventDefault(), Y("last"));
131
+ ].includes(e.key) ? (e.preventDefault(), J("first")) : e.key === "ArrowUp" && (e.preventDefault(), J("last"));
119
132
  }
120
- function Le(e) {
121
- let t = K().indexOf(document.activeElement);
122
- e.key === "ArrowDown" ? (e.preventDefault(), q(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), q(t - 1)) : e.key === "Home" ? (e.preventDefault(), q(0)) : e.key === "End" ? (e.preventDefault(), q(-1)) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), X()) : e.key === "Tab" && X();
133
+ function X(e) {
134
+ let t = G().indexOf(document.activeElement);
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();
123
136
  }
124
- function Re(e) {
125
- e.disabled || (N("select", e), X());
137
+ function Ve(e) {
138
+ e.disabled || (M("select", e), Y());
126
139
  }
127
- function ze(e) {
128
- e.name !== M.value && (M.value = e.name, N("switch-workspace", e)), X();
140
+ function He(e) {
141
+ e.name !== j.value && (j.value = e.name, M("switch-workspace", e)), Y();
129
142
  }
130
- function Be() {
131
- N("logout"), X(!1);
143
+ function Ue() {
144
+ M("logout"), Y(!1);
132
145
  }
133
146
  function Z(e) {
134
147
  let t = e.target;
135
- z.value?.contains(t) || B.value?.contains(t) || X(!1);
148
+ R.value?.contains(t) || z.value?.contains(t) || Y(!1);
136
149
  }
137
150
  function Q() {
138
- J();
151
+ q();
139
152
  }
140
153
  function $() {
141
154
  document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
142
155
  }
143
- return T(j, (e) => {
156
+ return E(A, (e) => {
144
157
  if (!e) return $();
145
- document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(J);
146
- }), T(() => A.avatarUrl, () => V.value = !1), re($), (e, s) => (v(), u("div", ue, [d("button", {
147
- id: L,
158
+ document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(q);
159
+ }), E(() => k.avatarUrl, () => B.value = !1), re($), (e, s) => (v(), u("div", ue, [d("button", {
160
+ id: I,
148
161
  ref_key: "trigger",
149
- ref: z,
162
+ ref: R,
150
163
  type: "button",
151
164
  "aria-haspopup": "menu",
152
- "aria-expanded": j.value,
153
- "aria-controls": j.value ? R : void 0,
165
+ "aria-expanded": A.value,
166
+ "aria-controls": A.value ? L : void 0,
154
167
  "aria-label": `${m.name}, account menu`,
155
- 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", j.value && "border-border bg-surface-sunken/50"]]),
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"]]),
156
169
  "data-ac-ds": "",
157
170
  "data-testid": "ac-user-menu-trigger",
158
- onClick: s[1] ||= (e) => j.value ? X() : Y(),
159
- onKeydown: Ie
171
+ onClick: s[1] ||= (e) => A.value ? Y() : J(),
172
+ onKeydown: Be
160
173
  }, [
161
- m.showName ? (v(), u("span", fe, S(m.name), 1)) : l("", !0),
162
- d("span", pe, [d("span", me, [W.value ? (v(), u("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", {
163
176
  key: 0,
164
177
  src: m.avatarUrl,
165
178
  alt: "",
166
179
  class: "size-full object-cover",
167
- onError: s[0] ||= (e) => V.value = !0
168
- }, null, 40, he)) : (v(), u(i, { key: 1 }, [f(S(U.value), 1)], 64))])]),
169
- m.showName ? (v(), c(C(ce), {
170
- key: 1,
171
- class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", j.value && "rotate-180"]),
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,
184
+ class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", A.value && "rotate-180"]),
172
185
  "aria-hidden": "true"
173
186
  }, null, 8, ["class"])) : l("", !0)
174
187
  ], 42, de), (v(), c(a, { to: "body" }, [p(o, {
@@ -177,65 +190,66 @@ var ue = {
177
190
  "leave-active-class": "transition duration-100 ease-in",
178
191
  "leave-to-class": "opacity-0"
179
192
  }, {
180
- default: E(() => [j.value ? (v(), u("div", {
193
+ default: D(() => [A.value ? (v(), u("div", {
181
194
  key: 0,
182
- id: R,
195
+ id: L,
183
196
  ref_key: "panel",
184
- ref: B,
197
+ ref: z,
185
198
  role: "menu",
186
- "aria-labelledby": L,
199
+ "aria-labelledby": I,
187
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",
188
201
  style: ne({
189
- top: H.value.top === void 0 ? void 0 : `${H.value.top}px`,
190
- bottom: H.value.bottom === void 0 ? void 0 : `${H.value.bottom}px`,
191
- right: `${H.value.right}px`
202
+ top: V.value.top === void 0 ? void 0 : `${V.value.top}px`,
203
+ bottom: V.value.bottom === void 0 ? void 0 : `${V.value.bottom}px`,
204
+ right: `${V.value.right}px`
192
205
  }),
193
206
  "data-ac-ds": "",
194
207
  "data-testid": "ac-user-menu-panel",
195
- onKeydown: Le
208
+ onKeydown: X
196
209
  }, [
197
- (v(), c(x(m.profileUrl ? "a" : "div"), {
210
+ m.showProfile ? (v(), c(S(m.profileUrl ? "a" : "div"), {
211
+ key: 0,
198
212
  href: m.profileUrl || void 0,
199
213
  role: m.profileUrl ? "menuitem" : "presentation",
200
214
  tabindex: m.profileUrl ? -1 : void 0,
201
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"])
202
216
  }, {
203
- default: E(() => [d("span", ge, [W.value ? (v(), u("img", {
217
+ default: D(() => [d("span", _e, [U.value ? (v(), u("img", {
204
218
  key: 0,
205
219
  src: m.avatarUrl,
206
220
  alt: "",
207
221
  class: "size-full object-cover",
208
- onError: s[2] ||= (e) => V.value = !0
209
- }, null, 40, _e)) : (v(), u(i, { key: 1 }, [f(S(U.value), 1)], 64))]), d("span", ve, [d("span", ye, S(m.name), 1), m.email ? (v(), u("span", be, S(m.email), 1)) : l("", !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)])]),
210
224
  _: 1
211
225
  }, 8, [
212
226
  "href",
213
227
  "role",
214
228
  "tabindex",
215
229
  "class"
216
- ])),
230
+ ])) : l("", !0),
217
231
  m.workspaces.length ? (v(), u("div", {
218
- key: 0,
232
+ key: 1,
219
233
  role: "group",
220
- "aria-labelledby": `${C(I)}-workspaces`,
221
- class: "mt-1 border-t border-border px-3 py-2"
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"
222
236
  }, [d("p", {
223
- id: `${C(I)}-workspaces`,
237
+ id: `${w(F)}-workspaces`,
224
238
  class: "mb-2 flex items-center gap-2 text-xs font-semibold tracking-wide text-muted uppercase"
225
- }, [p(C(oe), {
239
+ }, [p(w(oe), {
226
240
  class: "size-4",
227
241
  "aria-hidden": "true"
228
- }), f(" " + S(m.workspacesLabel), 1)], 8, Se), d("div", Ce, [(v(!0), u(i, null, b(m.workspaces, (e) => (v(), u("button", {
242
+ }), f(" " + C(m.workspacesLabel), 1)], 8, Ce), d("div", we, [(v(!0), u(i, null, b(m.workspaces, (e) => (v(), u("button", {
229
243
  key: e.name,
230
244
  type: "button",
231
245
  role: "menuitemradio",
232
246
  tabindex: "-1",
233
- "aria-checked": e.name === M.value,
234
- 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 === M.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"]),
235
249
  "data-ac-ds": "",
236
250
  "data-testid": "ac-user-menu-workspace",
237
- onClick: (t) => ze(e)
238
- }, [d("span", Te, [p(t, {
251
+ onClick: (t) => He(e)
252
+ }, [d("span", Ee, [p(t, {
239
253
  name: e.displayName || e.name,
240
254
  "img-url": e.avatarUrl,
241
255
  kind: e.type === "user" ? "person" : "organization",
@@ -244,60 +258,63 @@ var ue = {
244
258
  "name",
245
259
  "img-url",
246
260
  "kind"
247
- ]), d("span", Ee, [d("span", D, S(e.displayName || e.name), 1), d("span", De, [f(S(e.name), 1), e.type === "user" ? (v(), u(i, { key: 0 }, [f(" (Personal)")], 64)) : l("", !0)])])]), e.name === M.value ? (v(), c(C(se), {
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), {
248
262
  key: 0,
249
263
  class: "size-4 shrink-0 text-primary",
250
264
  "aria-hidden": "true"
251
- })) : l("", !0)], 10, we))), 128))])], 8, xe)) : l("", !0),
265
+ })) : l("", !0)], 10, Te))), 128))])], 8, Se)) : l("", !0),
252
266
  m.showThemeMode ? (v(), u("div", {
253
- key: 1,
267
+ key: 2,
254
268
  role: "group",
255
- "aria-labelledby": `${C(I)}-theme`,
256
- class: "mt-1 border-t border-border px-1 pt-2 pb-1"
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"
257
271
  }, [d("p", {
258
- id: `${C(I)}-theme`,
272
+ id: `${w(F)}-theme`,
259
273
  class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
260
- }, "Theme", 8, ke), p(r, {
274
+ }, "Theme", 8, je), p(r, {
261
275
  display: "labels",
262
- "onSet:theme": s[3] ||= (e) => N("set:theme", e)
263
- })], 8, Oe)) : l("", !0),
276
+ "onSet:theme": s[3] ||= (e) => M("set:theme", e)
277
+ })], 8, Ae)) : l("", !0),
264
278
  m.showFontScale ? (v(), u("div", {
265
- key: 2,
279
+ key: 3,
266
280
  role: "group",
267
- "aria-labelledby": `${C(I)}-scale`,
268
- class: "mt-1 border-t border-border px-1 pt-2 pb-1"
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"
269
283
  }, [d("p", {
270
- id: `${C(I)}-scale`,
284
+ id: `${w(F)}-scale`,
271
285
  class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
272
- }, "Text size", 8, je), p(n, { display: "labels" })], 8, Ae)) : l("", !0),
273
- d("div", Me, [
274
- (v(!0), u(i, null, b(m.items, (e) => (v(), c(x(G(e)), te({ 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), {
275
289
  role: "menuitem",
276
290
  tabindex: "-1",
277
- class: P,
278
- onClick: (t) => Re(e)
291
+ class: N,
292
+ onClick: (t) => Ve(e)
279
293
  }), {
280
- default: E(() => [e.icon ? (v(), c(x(e.icon), {
294
+ default: D(() => [e.icon ? (v(), c(S(e.icon), {
281
295
  key: 0,
282
296
  "aria-hidden": "true"
283
- })) : l("", !0), d("span", O, S(e.label), 1)]),
297
+ })) : l("", !0), d("span", Fe, C(e.label), 1)]),
284
298
  _: 2
285
299
  }, 1040, ["onClick"]))), 128)),
286
- ie(e.$slots, "default", {
287
- close: X,
288
- itemClass: P
300
+ x(e.$slots, "default", {
301
+ close: Y,
302
+ itemClass: N
289
303
  }),
290
- (v(), c(x(m.logoutUrl ? "a" : "button"), {
304
+ (v(), c(S(m.logoutUrl ? "a" : "button"), {
291
305
  href: m.logoutUrl || void 0,
292
306
  type: m.logoutUrl ? void 0 : "button",
293
307
  role: "menuitem",
294
308
  tabindex: "-1",
295
- class: _(Pe),
309
+ class: _(Re),
296
310
  "data-ac-ds": "",
297
311
  "data-testid": "ac-user-menu-logout",
298
- onClick: Be
312
+ onClick: Ue
299
313
  }, {
300
- default: E(() => [p(C(le), { "aria-hidden": "true" }), d("span", null, S(m.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)]),
301
318
  _: 1
302
319
  }, 8, ["href", "type"]))
303
320
  ])
@@ -307,4 +324,4 @@ var ue = {
307
324
  }
308
325
  });
309
326
  //#endregion
310
- export { A as default };
327
+ export { k as default };
@@ -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.1",
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",