@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
@@ -0,0 +1,135 @@
1
+ import { Comment as e, Transition as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, normalizeClass as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, useSlots as y, withCtx as b } from "vue";
2
+ import { Check as x } from "@lucide/vue";
3
+ //#region src/lib/components/AcRadioCard.vue?vue&type=script&setup=true&lang.ts
4
+ var S = ["aria-disabled"], C = [
5
+ "name",
6
+ "value",
7
+ "checked",
8
+ "disabled",
9
+ "aria-labelledby",
10
+ "aria-describedby"
11
+ ], w = {
12
+ key: 1,
13
+ class: "flex min-w-0 flex-1 items-start gap-3"
14
+ }, T = {
15
+ key: 0,
16
+ class: "flex shrink-0 items-center"
17
+ }, E = { class: "flex min-w-0 flex-1 flex-col gap-2 md:flex-row md:items-start md:justify-between md:gap-4" }, D = { class: "block min-w-0" }, O = ["id"], k = ["id"], A = ["id"], j = ["id"], M = {
18
+ key: 0,
19
+ class: "absolute top-2 right-2 flex size-4 items-center justify-center rounded-full bg-primary text-white shadow-sm",
20
+ "aria-hidden": "true"
21
+ }, N = /*@__PURE__*/ s({
22
+ inheritAttrs: !1,
23
+ __name: "AcRadioCard",
24
+ props: /*@__PURE__*/ c({
25
+ name: {},
26
+ value: {},
27
+ title: { default: "" },
28
+ description: { default: "" },
29
+ disabled: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ showRadio: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ titleClass: { default: "text-base font-semibold text-heading" },
38
+ descriptionClass: { default: "mt-0.5 text-xs leading-relaxed text-muted" }
39
+ }, {
40
+ modelValue: {},
41
+ modelModifiers: {}
42
+ }),
43
+ emits: /*@__PURE__*/ c(["change"], ["update:modelValue"]),
44
+ setup(s, { expose: c, emit: N }) {
45
+ let P = s, F = v(s, "modelValue"), I = N, L = _(), R = g(), z = y(), B = f(null), V = n(() => ({
46
+ class: R.class,
47
+ style: R.style
48
+ })), H = n(() => {
49
+ let { class: e, style: t, ...n } = R;
50
+ return n;
51
+ }), U = n(() => F.value === P.value);
52
+ function W() {
53
+ return !!z.default?.().some((t) => t.type !== e);
54
+ }
55
+ function G() {
56
+ return !W() && (!!P.title || !!z.subtitle);
57
+ }
58
+ function K() {
59
+ if (!W()) return [
60
+ P.description && `${L}-desc`,
61
+ z.features && `${L}-features`,
62
+ z.right && `${L}-right`
63
+ ].filter(Boolean).join(" ") || void 0;
64
+ }
65
+ function q() {
66
+ P.disabled || (F.value = P.value, I("change", P.value));
67
+ }
68
+ return c({ focus: () => B.value?.focus() }), (e, n) => (d(), i("label", l(V.value, {
69
+ class: ["group relative flex items-start gap-3 rounded-14 border p-3 transition-[border-color,background-color,box-shadow] duration-200 ease-out has-[>span>input[type=radio]:focus-visible]:ring-2 has-[>span>input[type=radio]:focus-visible]:ring-ring has-[>span>input[type=radio]:focus-visible]:ring-offset-2 has-[>span>input[type=radio]:focus-visible]:ring-offset-background motion-reduce:transition-none", [
70
+ s.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer",
71
+ U.value ? "border-primary bg-primary/5 shadow-[inset_0_0_0_1px_var(--color-primary)]" : "border-border bg-surface",
72
+ !U.value && !s.disabled && "hover:border-primary/40 hover:bg-accent-hover"
73
+ ]],
74
+ "aria-disabled": s.disabled || void 0,
75
+ "data-ac-ds": "",
76
+ "data-testid": "ac-radio-card"
77
+ }), [
78
+ a("span", { class: u(s.showRadio ? "relative mt-0.5 inline-flex size-[18px] shrink-0" : "sr-only") }, [a("input", l({
79
+ ref_key: "input",
80
+ ref: B,
81
+ type: "radio",
82
+ name: s.name,
83
+ value: s.value,
84
+ checked: U.value,
85
+ disabled: s.disabled,
86
+ "aria-labelledby": G() ? `${h(L)}-title` : void 0,
87
+ "aria-describedby": K()
88
+ }, H.value, {
89
+ class: ["peer size-[18px] appearance-none rounded-full border transition-colors duration-200 focus-visible:outline-none disabled:cursor-not-allowed motion-reduce:transition-none", [U.value ? "border-primary bg-primary" : "border-muted/70 bg-background group-hover:border-primary/60", s.disabled ? "cursor-not-allowed" : "cursor-pointer"]],
90
+ onChange: q
91
+ }), null, 16, C), a("span", {
92
+ class: u(["pointer-events-none absolute inset-0 m-auto size-1.5 rounded-full bg-white transition-transform duration-200 motion-reduce:transition-none", U.value ? "scale-100" : "scale-0"]),
93
+ "aria-hidden": "true"
94
+ }, null, 2)], 2),
95
+ W() ? p(e.$slots, "default", {}, void 0, void 0, 0) : (d(), i("span", w, [e.$slots.icon ? (d(), i("span", T, [p(e.$slots, "icon")])) : r("", !0), a("span", E, [a("span", D, [
96
+ G() ? (d(), i("span", {
97
+ key: 0,
98
+ id: `${h(L)}-title`,
99
+ class: "flex flex-wrap items-center gap-x-2 gap-y-1"
100
+ }, [s.title ? (d(), i("span", {
101
+ key: 0,
102
+ class: u(["block font-heading tracking-[-0.012em] text-balance", s.titleClass])
103
+ }, m(s.title), 3)) : r("", !0), p(e.$slots, "subtitle")], 8, O)) : r("", !0),
104
+ s.description ? (d(), i("span", {
105
+ key: 1,
106
+ id: `${h(L)}-desc`,
107
+ class: u(["block text-pretty", s.descriptionClass])
108
+ }, m(s.description), 11, k)) : r("", !0),
109
+ e.$slots.features ? (d(), i("span", {
110
+ key: 2,
111
+ id: `${h(L)}-features`,
112
+ class: "mt-2.5 flex flex-wrap gap-1.5"
113
+ }, [p(e.$slots, "features")], 8, A)) : r("", !0)
114
+ ]), e.$slots.right ? (d(), i("span", {
115
+ key: 0,
116
+ id: `${h(L)}-right`,
117
+ class: "block shrink-0"
118
+ }, [p(e.$slots, "right")], 8, j)) : r("", !0)])])),
119
+ o(t, {
120
+ "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
121
+ "enter-from-class": "scale-50 opacity-0",
122
+ "leave-active-class": "transition duration-100 ease-in motion-reduce:transition-none",
123
+ "leave-to-class": "scale-50 opacity-0"
124
+ }, {
125
+ default: b(() => [U.value && !s.showRadio && !e.$slots.right ? (d(), i("span", M, [o(h(x), {
126
+ class: "size-2.5",
127
+ "stroke-width": 3.5
128
+ })])) : r("", !0)]),
129
+ _: 1
130
+ })
131
+ ], 16, S));
132
+ }
133
+ });
134
+ //#endregion
135
+ export { N as default };
@@ -22,6 +22,8 @@ export interface Props<T> {
22
22
  loading?: boolean;
23
23
  /** Shows a refresh button that emits `refresh`. */
24
24
  refreshable?: boolean;
25
+ /** With `refreshable`, spins the refresh icon while options reload. Unlike `loading`, the field stays usable. */
26
+ refreshing?: boolean;
25
27
  /** Disables the field. */
26
28
  disabled?: boolean;
27
29
  /** Marks the field required and adds a red asterisk. */
@@ -34,14 +36,19 @@ export interface Props<T> {
34
36
  size?: "compact" | "small" | "normal";
35
37
  /** Text shown when no option matches the search. */
36
38
  noResultText?: string;
39
+ /** Side of the field the list opens on: `bottom` or `top`. It flips to the other side when there isn't room. */
40
+ placement?: "bottom" | "top";
37
41
  }
38
42
  declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
39
43
  props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<V> & {
40
44
  modelValue?: V | V[] | null;
45
+ /** Whether the list is open. Bind `v-model:open` to react when it opens or closes, e.g. to check a required field. */
46
+ open?: boolean;
41
47
  }) & {
42
48
  onSearch?: ((query: string) => any) | undefined;
43
49
  onSelect?: ((option: SelectOption<V>) => any) | undefined;
44
50
  "onUpdate:modelValue"?: ((value: V | V[] | null) => any) | undefined;
51
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
45
52
  onCreate?: ((text: string) => any) | undefined;
46
53
  onRemove?: ((option: SelectOption<V>) => any) | undefined;
47
54
  onRefresh?: (() => any) | undefined;
@@ -60,12 +67,16 @@ declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
60
67
  selected: boolean;
61
68
  active: boolean;
62
69
  }) => unknown;
70
+ /** Content of the closed field for the chosen option in single select, e.g. an icon and a second line. Receives the option; defaults to its label. */
71
+ selected?: (props: {
72
+ option: SelectOption<V>;
73
+ }) => unknown;
63
74
  /** Content shown when the list is empty or nothing matches. */
64
75
  empty?: (props: {
65
76
  query: string;
66
77
  }) => unknown;
67
78
  };
68
- emit: (((evt: "search", query: string) => void) & ((evt: "select", option: SelectOption<V>) => void) & ((evt: "create", text: string) => void) & ((evt: "remove", option: SelectOption<V>) => void) & ((evt: "refresh") => void)) & ((event: "update:modelValue", value: V | V[] | null) => void);
79
+ emit: (((evt: "search", query: string) => void) & ((evt: "select", option: SelectOption<V>) => void) & ((evt: "create", text: string) => void) & ((evt: "remove", option: SelectOption<V>) => void) & ((evt: "refresh") => void)) & (((event: "update:modelValue", value: V | V[] | null) => void) & ((event: "update:open", value: boolean) => void));
69
80
  }>) => import("vue").VNode & {
70
81
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
71
82
  };