@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,19 +1,19 @@
1
- import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderSlot as u, resolveDynamicComponent as d, toDisplayString as f, useSlots as p, withCtx as m } from "vue";
1
+ import { Comment as e, Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, useSlots as m, withCtx as h } from "vue";
2
2
  //#region src/lib/components/AcCard.vue?vue&type=script&setup=true&lang.ts
3
- var h = {
3
+ var g = {
4
4
  key: 0,
5
5
  class: "pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]",
6
6
  "aria-hidden": "true"
7
- }, g = { class: "flex min-w-0 flex-1 items-center gap-3" }, _ = { class: "min-w-0 flex-1" }, v = { class: "flex flex-wrap items-center gap-2" }, y = {
7
+ }, _ = { class: "min-w-0 flex-1" }, v = {
8
8
  key: 0,
9
9
  class: "mt-0.5 text-xs leading-4 text-muted"
10
- }, b = {
10
+ }, y = {
11
11
  key: 1,
12
12
  class: "mt-0.5 text-xs leading-4 text-muted"
13
- }, x = {
13
+ }, b = {
14
14
  key: 1,
15
15
  class: "flex shrink-0 flex-wrap items-center gap-2"
16
- }, S = /*@__PURE__*/ s({
16
+ }, x = /*@__PURE__*/ c({
17
17
  __name: "AcCard",
18
18
  props: {
19
19
  title: { default: "" },
@@ -28,6 +28,11 @@ var h = {
28
28
  variant: { default: "default" },
29
29
  color: { default: "primary" },
30
30
  headerSize: { default: "normal" },
31
+ titleTag: { default: "h3" },
32
+ bare: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
31
36
  hoverable: {
32
37
  type: Boolean,
33
38
  default: !1
@@ -42,12 +47,17 @@ var h = {
42
47
  },
43
48
  as: { default: "section" }
44
49
  },
45
- setup(s) {
46
- let S = s, C = p(), w = {
50
+ setup(c) {
51
+ let x = c, S = m(), C = {
47
52
  default: "border-border bg-surface",
48
53
  muted: "border-border bg-surface-sunken/40",
49
54
  dashed: "border-dashed border-border bg-transparent",
50
55
  danger: "border-danger/30 bg-danger/5"
56
+ }, w = {
57
+ default: "border-border [:where(&)]:bg-surface",
58
+ muted: "border-border [:where(&)]:bg-surface-sunken/40",
59
+ dashed: "border-dashed border-border [:where(&)]:bg-transparent",
60
+ danger: "border-danger/30 [:where(&)]:bg-danger/5"
51
61
  }, T = {
52
62
  none: "",
53
63
  xs: "p-3",
@@ -113,77 +123,115 @@ var h = {
113
123
  washSm: "from-warning/[0.07]",
114
124
  watermark: "text-warning/5"
115
125
  }
116
- }, A = n(() => S.headerSize === "small"), j = n(() => k[S.color]), M = n(() => S.description || S.subtitle), N = n(() => [
117
- w[S.variant],
118
- S.as !== "section" && "w-full text-left no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
119
- S.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
120
- S.shadow && "shadow-xs hover:shadow-card",
121
- S.hoverable && S.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
126
+ }, A = n(() => x.headerSize === "bar"), j = n(() => x.headerSize === "small" || A.value), M = n(() => k[x.color]), N = n(() => x.description || x.subtitle), P = n(() => [
127
+ C[x.variant],
128
+ x.as !== "section" && "w-full text-left no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
129
+ x.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
130
+ x.shadow && "shadow-xs hover:shadow-card",
131
+ x.hoverable && x.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
122
132
  ]);
123
- function P() {
124
- return !!(S.title || S.icon || C.icon || C.actions || C.badges);
125
- }
126
- function F(n) {
127
- return n.some((n) => n.type === e ? !1 : n.type !== t || F(n.children));
133
+ function F() {
134
+ return !!(x.title || N.value || x.icon || S.icon || S.actions || S.badges || S.description);
128
135
  }
129
136
  function I() {
130
- return F(C.default?.() ?? []);
131
- }
132
- function L() {
133
- let e = I(), t = S.padding;
137
+ let e = x.padding ?? (x.padded ? "md" : "none"), t = x.as !== "section" && x.as !== "div";
134
138
  return [
139
+ w[x.variant],
140
+ T[e],
141
+ t && "block no-underline outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
142
+ x.hoverable && "cursor-pointer hover:border-primary/30 hover:bg-accent-hover/60",
143
+ x.shadow && "shadow-xs hover:shadow-card",
144
+ x.hoverable && x.shadow && "hover:-translate-y-0.5 motion-reduce:hover:translate-y-0"
145
+ ];
146
+ }
147
+ function L(n) {
148
+ return n.some((n) => n.type === e ? !1 : n.type !== t || L(n.children));
149
+ }
150
+ function R() {
151
+ return L(S.default?.() ?? []);
152
+ }
153
+ function z() {
154
+ let e = R(), t = x.padding;
155
+ return A.value ? [
156
+ "items-center gap-2.5 px-4 py-2.5",
157
+ e && "border-b border-border",
158
+ !e && !S.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
159
+ x.accent && ["bg-linear-to-r to-transparent", M.value.washSm]
160
+ ] : [
135
161
  t ? [
136
162
  "items-start gap-3",
137
163
  E[t],
138
164
  D[t],
139
- !A.value && "border-border/60"
140
- ] : A.value ? "items-start gap-3 px-5 pt-5" : "items-start gap-3 border-border/60 px-6 pt-5",
165
+ !j.value && "border-border/60"
166
+ ] : j.value ? "items-start gap-3 px-5 pt-5" : "items-start gap-3 border-border/60 px-6 pt-5",
141
167
  !e && (t ? O[t] : "pb-5"),
142
- e && !A.value && "border-b pb-3",
143
- !e && !C.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
144
- S.accent && (A.value ? ["bg-linear-to-r to-transparent", j.value.washSm] : ["bg-linear-to-br to-transparent", j.value.wash])
168
+ e && !j.value && "border-b pb-3",
169
+ !e && !S.footer && "rounded-b-[calc(var(--radius-14)-1px)]",
170
+ x.accent && (j.value ? ["bg-linear-to-r to-transparent", M.value.washSm] : ["bg-linear-to-br to-transparent", M.value.wash])
145
171
  ];
146
172
  }
147
- function R() {
148
- return S.padding && S.padding !== "none" ? T[S.padding] : S.padded && S.padding !== "none" ? A.value ? "p-5" : "p-6" : [
173
+ function B() {
174
+ return x.padding && x.padding !== "none" ? T[x.padding] : x.padded && x.padding !== "none" ? j.value ? "p-5" : "p-6" : [
149
175
  "overflow-hidden",
150
- !C.footer && "rounded-b-14",
151
- !P() && "rounded-t-14"
176
+ !S.footer && "rounded-b-14",
177
+ !F() && "rounded-t-14"
152
178
  ];
153
179
  }
154
- return (e, t) => (l(), r(d(s.as), {
155
- class: c(["flex flex-col rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", N.value]),
180
+ return (e, t) => c.bare ? (u(), r(f(c.as), {
181
+ key: 0,
182
+ class: l(["rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", I()]),
156
183
  "data-ac-ds": "",
157
184
  "data-testid": "ac-card"
158
185
  }, {
159
- default: m(() => [
160
- P() ? (l(), a("header", {
186
+ default: h(() => [d(e.$slots, "default")]),
187
+ _: 3
188
+ }, 8, ["class"])) : (u(), r(f(c.as), {
189
+ key: 1,
190
+ class: l(["flex flex-col rounded-14 border text-body transition-[background-color,border-color,box-shadow,translate] duration-200 ease-out motion-reduce:transition-none", P.value]),
191
+ "data-ac-ds": "",
192
+ "data-testid": "ac-card"
193
+ }, {
194
+ default: h(() => [
195
+ F() ? (u(), a("header", {
161
196
  key: 0,
162
- class: c(["relative isolate flex flex-wrap justify-between rounded-t-[calc(var(--radius-14)-1px)]", L()])
197
+ class: l(["relative isolate flex flex-wrap justify-between rounded-t-[calc(var(--radius-14)-1px)]", z()])
163
198
  }, [
164
- s.accent && s.icon && !A.value ? (l(), a("div", h, [(l(), r(d(s.icon), { class: c(["absolute -top-4 -right-4 size-24", j.value.watermark]) }, null, 8, ["class"]))])) : i("", !0),
165
- o("div", g, [s.icon || e.$slots.icon ? (l(), a("span", {
199
+ c.accent && (c.icon || e.$slots.icon) && !j.value ? (u(), a("div", g, [c.icon ? (u(), r(f(c.icon), {
200
+ key: 0,
201
+ class: l(["absolute -top-4 -right-4 size-24", M.value.watermark])
202
+ }, null, 8, ["class"])) : (u(), a("span", {
203
+ key: 1,
204
+ class: l(["absolute -top-4 -right-4 [&_svg]:size-24!", M.value.watermark])
205
+ }, [d(e.$slots, "icon")], 2))])) : i("", !0),
206
+ o("div", { class: l(["flex min-w-0 flex-1 items-center", A.value ? "gap-2.5" : "gap-3"]) }, [c.icon || e.$slots.icon ? (u(), a("span", {
166
207
  key: 0,
167
- class: c(["flex shrink-0 items-center justify-center", [j.value.tile, A.value ? ["size-7 rounded-8 ring-1 ring-inset", j.value.ring] : ["size-8 rounded-10 border", j.value.border]]]),
208
+ class: l(["flex shrink-0 items-center justify-center", [
209
+ M.value.tile,
210
+ j.value ? ["size-7 rounded-8 ring-1 ring-inset", M.value.ring] : ["size-8 rounded-10 border", M.value.border],
211
+ c.headerSize === "small" ? "[:where(&)_svg]:size-3.5" : "[:where(&)_svg]:size-4"
212
+ ]]),
168
213
  "aria-hidden": "true"
169
- }, [u(e.$slots, "icon", {}, () => [(l(), r(d(s.icon), { class: c(A.value ? "size-3.5" : "size-4") }, null, 8, ["class"]))])], 2)) : i("", !0), o("div", _, [o("div", v, [s.title ? (l(), a("h3", {
214
+ }, [d(e.$slots, "icon", {}, () => [(u(), r(f(c.icon), { class: l(c.headerSize === "small" ? "size-3.5" : "size-4") }, null, 8, ["class"]))])], 2)) : i("", !0), o("div", _, [o("div", { class: l(["flex flex-wrap items-center", A.value ? "gap-2.5" : "gap-2"]) }, [c.title ? (u(), r(f(c.titleTag), {
170
215
  key: 0,
171
- class: c(["truncate font-heading font-semibold tracking-tight text-heading", A.value ? "text-base" : "text-lg leading-tight"])
172
- }, f(s.title), 3)) : i("", !0), u(e.$slots, "badges")]), e.$slots.description ? (l(), a("div", y, [u(e.$slots, "description")])) : M.value ? (l(), a("p", b, f(M.value), 1)) : i("", !0)])]),
173
- e.$slots.actions ? (l(), a("div", x, [u(e.$slots, "actions")])) : i("", !0)
216
+ class: l(["truncate font-heading font-semibold tracking-tight text-heading", j.value ? "text-base" : "text-lg leading-tight"])
217
+ }, {
218
+ default: h(() => [s(p(c.title), 1)]),
219
+ _: 1
220
+ }, 8, ["class"])) : i("", !0), d(e.$slots, "badges")], 2), e.$slots.description ? (u(), a("div", v, [d(e.$slots, "description")])) : N.value ? (u(), a("p", y, p(N.value), 1)) : i("", !0)])], 2),
221
+ e.$slots.actions ? (u(), a("div", b, [d(e.$slots, "actions")])) : i("", !0)
174
222
  ], 2)) : i("", !0),
175
- I() ? (l(), a("div", {
223
+ R() ? (u(), a("div", {
176
224
  key: 1,
177
- class: c(["flex-1", R()])
178
- }, [u(e.$slots, "default")], 2)) : i("", !0),
179
- e.$slots.footer ? (l(), a("footer", {
225
+ class: l(["flex-1", B()])
226
+ }, [d(e.$slots, "default")], 2)) : i("", !0),
227
+ e.$slots.footer ? (u(), a("footer", {
180
228
  key: 2,
181
- class: c(["flex flex-wrap items-center gap-3 border-t border-border py-3 text-base text-muted", s.padding ? E[s.padding] : A.value ? "px-5" : "px-6"])
182
- }, [u(e.$slots, "footer")], 2)) : i("", !0)
229
+ class: l(["flex flex-wrap items-center gap-3 border-t border-border py-3 text-base text-muted", c.padding ? E[c.padding] : j.value ? "px-5" : "px-6"])
230
+ }, [d(e.$slots, "footer")], 2)) : i("", !0)
183
231
  ]),
184
232
  _: 3
185
233
  }, 8, ["class"]));
186
234
  }
187
235
  });
188
236
  //#endregion
189
- export { S as default };
237
+ export { x as default };