@ac-design/design-system 2.2.1 → 2.4.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 (77) hide show
  1. package/dist/lib/compat.css +421 -0
  2. package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
  4. package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
  5. package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
  6. package/dist/lib/components/AcButton.vue.d.ts +25 -13
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +122 -71
  8. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  9. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  10. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  11. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  12. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  13. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  14. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  15. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  16. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  17. package/dist/lib/components/AcColorInput.vue.d.ts +4 -4
  18. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  19. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  20. package/dist/lib/components/AcDatePicker.vue.d.ts +41 -10
  21. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +554 -446
  22. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  24. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  25. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  27. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  28. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  29. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  30. package/dist/lib/components/AcInput.vue.d.ts +86 -44
  31. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +319 -86
  32. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  33. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  34. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  35. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  36. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  37. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  38. package/dist/lib/components/AcModal.vue.d.ts +1 -1
  39. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  40. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  41. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  42. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  43. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  44. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  45. package/dist/lib/components/AcRadioCard.js +5 -0
  46. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  47. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  48. package/dist/lib/components/AcSelect.vue.d.ts +46 -6
  49. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +309 -197
  50. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  51. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  52. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  53. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  54. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  55. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  56. package/dist/lib/components/AcTable.vue.d.ts +50 -5
  57. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +257 -129
  58. package/dist/lib/components/AcTagInput.vue.d.ts +23 -4
  59. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  60. package/dist/lib/components/AcTaintInput.js +5 -0
  61. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  62. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  63. package/dist/lib/components/AcTextarea.vue.d.ts +64 -4
  64. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +159 -68
  65. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  66. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  67. package/dist/lib/components/AcTimePicker.vue.d.ts +36 -11
  68. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +232 -168
  69. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  70. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  71. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
  72. package/dist/lib/components/index.d.ts +2 -0
  73. package/dist/lib/components/types.d.ts +2 -0
  74. package/dist/lib/composables/useToast.d.ts +2 -2
  75. package/dist/lib/index.d.ts +2 -1
  76. package/dist/lib/index.js +51 -49
  77. package/package.json +1 -1
@@ -1,92 +1,103 @@
1
1
  import { useColorMode as e } from "../composables/useColorMode.js";
2
- import { Fragment as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, onBeforeUnmount as l, openBlock as u, ref as d, renderList as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, watch as g } from "vue";
3
- import { Monitor as _, Moon as v, Sun as y } from "@lucide/vue";
2
+ import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useModel as v, watch as y } from "vue";
3
+ import { Monitor as b, Moon as x, Sun as S } from "@lucide/vue";
4
4
  //#region src/lib/components/AcThemeMode.vue?vue&type=script&setup=true&lang.ts
5
- var b = ["aria-checked", "title"], x = {
5
+ var C = ["aria-checked", "title"], w = {
6
6
  key: 1,
7
7
  role: "radiogroup",
8
8
  "aria-label": "Theme",
9
9
  class: "inline-flex items-center gap-1 rounded-10 bg-surface-sunken p-1",
10
10
  "data-ac-ds": "",
11
11
  "data-testid": "ac-theme-mode"
12
- }, S = [
12
+ }, T = [
13
13
  "aria-checked",
14
14
  "aria-label",
15
15
  "title",
16
16
  "onClick"
17
- ], C = { key: 0 }, w = /*@__PURE__*/ s({
17
+ ], E = { key: 0 }, D = /*@__PURE__*/ c({
18
18
  __name: "AcThemeMode",
19
- props: {
19
+ props: /*@__PURE__*/ l({
20
20
  defaultMode: { default: "light" },
21
21
  display: { default: "icons" }
22
- },
23
- emits: ["set:theme"],
24
- setup(s, { emit: w }) {
25
- let T = s, E = w, D = [
22
+ }, {
23
+ dark: {
24
+ type: Boolean,
25
+ default: void 0
26
+ },
27
+ darkModifiers: {}
28
+ }),
29
+ emits: /*@__PURE__*/ l(["set:theme"], ["update:dark"]),
30
+ setup(c, { emit: l }) {
31
+ let D = c, O = v(c, "dark"), k = l, A = [
26
32
  {
27
33
  value: "light",
28
34
  label: "Light",
29
- icon: y
35
+ icon: S
30
36
  },
31
37
  {
32
38
  value: "dark",
33
39
  label: "Dark",
34
- icon: v
40
+ icon: x
35
41
  },
36
42
  {
37
43
  value: "system",
38
44
  label: "System",
39
- icon: _
45
+ icon: b
40
46
  }
41
- ], { mode: O, isDark: k, setMode: A } = e({ defaultMode: T.defaultMode }), j = d(k.value), M;
42
- function N(e) {
43
- A(e), E("set:theme", k.value ? "dark" : "light");
47
+ ], j = O.value === void 0 ? e({ defaultMode: D.defaultMode }) : null, M = n(() => j ? j.isDark.value : !!O.value), N = n(() => j ? j.mode.value : O.value ? "dark" : "light"), P = p(M.value), F;
48
+ function I(e) {
49
+ if (j) {
50
+ j.setMode(e), k("set:theme", M.value ? "dark" : "light");
51
+ return;
52
+ }
53
+ let t = e === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches : e === "dark";
54
+ O.value = t, k("set:theme", t ? "dark" : "light");
44
55
  }
45
- function P() {
46
- j.value = !j.value, clearTimeout(M), M = setTimeout(() => {
47
- M = void 0, N(j.value ? "dark" : "light");
56
+ function L() {
57
+ P.value = !P.value, clearTimeout(F), F = setTimeout(() => {
58
+ F = void 0, I(P.value ? "dark" : "light");
48
59
  }, 200);
49
60
  }
50
- return g(k, (e) => {
51
- M === void 0 && (j.value = e);
52
- }), l(() => clearTimeout(M)), (e, l) => s.display === "toggle" ? (u(), i("button", {
61
+ return y(M, (e) => {
62
+ F === void 0 && (P.value = e);
63
+ }), d(() => clearTimeout(F)), (e, n) => c.display === "toggle" ? (f(), a("button", {
53
64
  key: 0,
54
65
  type: "button",
55
66
  role: "switch",
56
- "aria-checked": j.value,
67
+ "aria-checked": P.value,
57
68
  "aria-label": "Dark mode",
58
- title: j.value ? "Switch to light mode" : "Switch to dark mode",
69
+ title: P.value ? "Switch to light mode" : "Switch to dark mode",
59
70
  class: "relative inline-flex h-8 w-16 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none",
60
71
  "data-ac-ds": "",
61
72
  "data-testid": "ac-theme-mode",
62
- onClick: P
73
+ onClick: L
63
74
  }, [
64
- a("span", {
65
- class: c(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", j.value ? "translate-x-[10px] rotate-0 opacity-0" : "translate-x-[3px] rotate-[15deg] opacity-100"]),
75
+ o("span", {
76
+ class: u(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", P.value ? "translate-x-[10px] rotate-0 opacity-0" : "translate-x-[3px] rotate-[15deg] opacity-100"]),
66
77
  "aria-hidden": "true"
67
- }, [o(h(y), { class: "size-[19px] text-theme-sun" })], 2),
68
- a("span", {
69
- class: c(["size-[21px] shrink-0 rounded-full inset-ring-2 transition-[translate,background-color] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", j.value ? "-translate-x-[14px] bg-theme-moon inset-ring-white" : "translate-x-4 bg-theme-sun-soft inset-ring-theme-sun"]),
78
+ }, [s(_(S), { class: "size-[19px] text-theme-sun" })], 2),
79
+ o("span", {
80
+ class: u(["size-[21px] shrink-0 rounded-full inset-ring-2 transition-[translate,background-color] duration-500 ease-[cubic-bezier(0.26,2,0.46,0.71)] motion-reduce:transition-none", P.value ? "-translate-x-[14px] bg-theme-moon inset-ring-white" : "translate-x-4 bg-theme-sun-soft inset-ring-theme-sun"]),
70
81
  "aria-hidden": "true"
71
82
  }, null, 2),
72
- a("span", {
73
- class: c(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2.5,0.46,0.71)] motion-reduce:transition-none", j.value ? "-translate-x-[3px] -rotate-[15deg] opacity-100" : "-translate-x-2 rotate-0 opacity-0"]),
83
+ o("span", {
84
+ class: u(["inline-flex transition-[translate,rotate,opacity] duration-500 ease-[cubic-bezier(0.26,2.5,0.46,0.71)] motion-reduce:transition-none", P.value ? "-translate-x-[3px] -rotate-[15deg] opacity-100" : "-translate-x-2 rotate-0 opacity-0"]),
74
85
  "aria-hidden": "true"
75
- }, [o(h(v), { class: "size-[21px] text-heading" })], 2)
76
- ], 8, b)) : (u(), i("div", x, [(u(), i(t, null, f(D, (e) => a("button", {
86
+ }, [s(_(x), { class: "size-[21px] text-heading" })], 2)
87
+ ], 8, C)) : (f(), a("div", w, [(f(), a(t, null, m(A, (e) => o("button", {
77
88
  key: e.value,
78
89
  type: "button",
79
90
  role: "radio",
80
- "aria-checked": h(O) === e.value,
81
- "aria-label": s.display === "icons" ? `${e.label} theme` : void 0,
82
- title: s.display === "icons" ? `${e.label} theme` : void 0,
83
- class: c(["inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-medium transition-[background-color,color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none", [s.display === "icons" ? "w-7" : "px-3", h(O) === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
84
- onClick: (t) => N(e.value)
85
- }, [(u(), n(p(e.icon), {
91
+ "aria-checked": N.value === e.value,
92
+ "aria-label": c.display === "icons" ? `${e.label} theme` : void 0,
93
+ title: c.display === "icons" ? `${e.label} theme` : void 0,
94
+ class: u(["inline-flex h-7 cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-medium transition-[background-color,color,box-shadow] duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset focus-visible:outline-none", [c.display === "icons" ? "w-7" : "px-3", N.value === e.value ? "bg-surface text-heading shadow-sm" : "text-muted hover:text-heading"]]),
95
+ onClick: (t) => I(e.value)
96
+ }, [(f(), r(h(e.icon), {
86
97
  class: "size-4",
87
98
  "aria-hidden": "true"
88
- })), s.display === "labels" ? (u(), i("span", C, m(e.label), 1)) : r("", !0)], 10, S)), 64))]));
99
+ })), c.display === "labels" ? (f(), a("span", E, g(e.label), 1)) : i("", !0)], 10, T)), 64))]));
89
100
  }
90
101
  });
91
102
  //#endregion
92
- export { w as default };
103
+ export { D as default };
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  export interface Props {
2
3
  /** Label above the field. Doubles as the accessible name of the trigger and the popover. */
3
4
  label?: string;
@@ -23,27 +24,42 @@ export interface Props {
23
24
  errorMsg?: string;
24
25
  /** Help text between the label and the field. */
25
26
  hint?: string;
26
- /** `small` 36px or `normal` 42px tall, the same as `AcInput`. */
27
- size?: "small" | "normal";
27
+ /** `small` 36px or `normal` 42px tall, the same as `AcInput`; `large` is cloud-ui's 50px date field with 16px medium text. */
28
+ size?: "small" | "normal" | "large";
28
29
  /** Adds a hidden input with this name so plain form posts include the value. */
29
30
  name?: string;
31
+ /** Draws the hour and minute columns in place, with no field, popover or border. Each click updates `v-model` at once. */
32
+ inline?: boolean;
33
+ /** `string` keeps `"HH:mm"`; `date` keeps a `Date` and changes only its hours and minutes, starting from today when empty. */
34
+ valueType?: "string" | "date";
35
+ /** Classes for the field box under the label, e.g. `max-w-md` to keep it narrower than the hint. */
36
+ fieldClass?: HTMLAttributes["class"];
30
37
  }
31
38
  type __VLS_Props = Props;
39
+ type __VLS_Slots = {
40
+ /** Content before the label text, such as a 14px icon. */
41
+ "label-icon"?: () => unknown;
42
+ /** Content after the label text, such as "(Optional)" or an info tooltip. */
43
+ "label-extra"?: () => unknown;
44
+ };
45
+ declare function scrollToSelected(): Promise<void>;
32
46
  type __VLS_ModelProps = {
33
- /** `"14:05"`, or `"14:05:30"` with `show-seconds`, always 24-hour. `null` when empty. */
34
- modelValue?: string | null;
47
+ /** `"14:05"`, or `"14:05:30"` with `show-seconds`, always 24-hour; a `Date` with `value-type="date"`. `null` when empty. */
48
+ modelValue?: string | Date | null;
35
49
  /** Whether the popover is open. */
36
50
  "open"?: boolean;
37
51
  };
38
52
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
39
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
40
- /** Moves focus to the field. */
41
- focus: () => void | undefined;
53
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
54
+ /** Moves focus to the field, or to the hours column when `inline`. */
55
+ focus: () => void;
56
+ /** Scrolls each column to its selected value. Call it when an `inline` picker becomes visible, e.g. on a tab switch. */
57
+ scrollToSelected: typeof scrollToSelected;
42
58
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
- "update:modelValue": (value: string | null) => any;
59
+ "update:modelValue": (value: string | Date | null) => any;
44
60
  "update:open": (value: boolean) => any;
45
61
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
46
- "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
62
+ "onUpdate:modelValue"?: ((value: string | Date | null) => any) | undefined;
47
63
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
48
64
  }>, {
49
65
  required: boolean;
@@ -52,14 +68,23 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
52
68
  max: string;
53
69
  min: string;
54
70
  name: string;
55
- size: "small" | "normal";
71
+ size: "small" | "normal" | "large";
56
72
  hint: string;
73
+ inline: boolean;
57
74
  placeholder: string;
58
- clearable: boolean;
59
75
  errorMsg: string;
76
+ clearable: boolean;
60
77
  showSeconds: boolean;
61
78
  hourCycle: 12 | 24;
79
+ valueType: "string" | "date";
80
+ fieldClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
62
81
  minuteStep: number;
63
82
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
83
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
64
84
  declare const _default: typeof __VLS_export;
65
85
  export default _default;
86
+ type __VLS_WithSlots<T, S> = T & {
87
+ new (): {
88
+ $slots: S;
89
+ };
90
+ };