@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,28 +1,29 @@
1
- import e from "../components/AcSkeleton.js";
2
- import t from "../components/AcEmptyState.js";
3
- import { Fragment as n, Teleport as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, useModel as b, watch as x } from "vue";
1
+ import { fixedFrame as e } from "../components/fixedFrame.js";
2
+ import t from "../components/AcSkeleton.js";
3
+ import n from "../components/AcEmptyState.js";
4
+ import { Fragment as r, Teleport as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, useModel as x, watch as S } from "vue";
4
5
  //#region src/lib/charts/ChartFrame.vue?vue&type=script&setup=true&lang.ts
5
- var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate" }, T = {
6
+ var C = ["data-testid"], w = ["aria-pressed", "onClick"], T = { class: "truncate" }, E = {
6
7
  key: 0,
7
8
  class: "ml-auto pl-3 font-medium text-heading tabular-nums"
8
- }, E = ["role", "aria-label"], D = ["aria-label"], O = {
9
+ }, D = ["role", "aria-label"], O = ["aria-label"], k = {
9
10
  key: 4,
10
11
  class: "sr-only"
11
- }, k = {
12
+ }, A = {
12
13
  key: 5,
13
14
  class: "sr-only"
14
- }, A = {
15
+ }, j = {
15
16
  scope: "row",
16
17
  class: "text-left"
17
- }, j = {
18
+ }, M = {
18
19
  key: 0,
19
20
  class: "mb-1.5 font-medium text-heading"
20
- }, M = { class: "m-0 flex list-none flex-col gap-1 p-0" }, N = { class: "min-w-0 flex-1 truncate text-muted" }, P = { class: "pl-4 font-medium text-heading tabular-nums" }, F = {
21
+ }, N = { class: "m-0 flex list-none flex-col gap-1 p-0" }, P = { class: "min-w-0 flex-1 truncate text-muted" }, F = { class: "pl-4 font-medium text-heading tabular-nums" }, I = {
21
22
  key: 1,
22
23
  class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
23
- }, I = { class: "font-medium text-heading tabular-nums" }, L = 14, R = 300, z = 200, B = /*@__PURE__*/ l({
24
+ }, L = { class: "font-medium text-heading tabular-nums" }, R = 14, z = 300, B = 200, V = /*@__PURE__*/ u({
24
25
  __name: "ChartFrame",
25
- props: /*@__PURE__*/ u({
26
+ props: /*@__PURE__*/ d({
26
27
  testid: {},
27
28
  height: {},
28
29
  loading: { type: Boolean },
@@ -48,126 +49,126 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
48
49
  widthModifiers: {}
49
50
  }),
50
51
  emits: ["update:hidden", "update:width"],
51
- setup(l) {
52
- let u = l, B = b(l, "hidden"), V = b(l, "width"), H = g(), U;
53
- function W(e) {
54
- let t = B.value.includes(e);
55
- !t && u.legendItems.length - B.value.length <= 1 || (B.value = t ? B.value.filter((t) => t !== e) : [...B.value, e]);
56
- }
52
+ setup(u) {
53
+ let d = u, V = x(u, "hidden"), H = x(u, "width"), U = _(), W;
57
54
  function G(e) {
58
- let t = e.clientX > window.innerWidth - R, n = e.clientY > window.innerHeight - z;
55
+ let t = V.value.includes(e);
56
+ !t && d.legendItems.length - V.value.length <= 1 || (V.value = t ? V.value.filter((t) => t !== e) : [...V.value, e]);
57
+ }
58
+ function K(t) {
59
+ let n = e(), r = t.clientX > n.right - z, i = t.clientY > n.bottom - B;
59
60
  return {
60
- left: t ? void 0 : `${e.clientX + L}px`,
61
- right: t ? `${window.innerWidth - e.clientX + L}px` : void 0,
62
- top: n ? void 0 : `${e.clientY + L}px`,
63
- bottom: n ? `${window.innerHeight - e.clientY + L}px` : void 0
61
+ left: r ? void 0 : `${t.clientX - n.left + R}px`,
62
+ right: r ? `${n.right - t.clientX + R}px` : void 0,
63
+ top: i ? void 0 : `${t.clientY - n.top + R}px`,
64
+ bottom: i ? `${n.bottom - t.clientY + R}px` : void 0
64
65
  };
65
66
  }
66
- function K() {
67
- U?.disconnect(), H.value && typeof ResizeObserver < "u" && (U = new ResizeObserver(([e]) => {
68
- e && (V.value = Math.round(e.contentRect.width));
69
- }), U.observe(H.value));
67
+ function q() {
68
+ W?.disconnect(), U.value && typeof ResizeObserver < "u" && (W = new ResizeObserver(([e]) => {
69
+ e && (H.value = Math.round(e.contentRect.width));
70
+ }), W.observe(U.value));
70
71
  }
71
- return x(H, K), m(K), p(() => U?.disconnect()), (u, p) => (h(), o("figure", {
72
- class: d(["m-0 flex w-full min-w-0 gap-3", l.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
72
+ return S(U, q), h(q), m(() => W?.disconnect()), (e, d) => (g(), s("figure", {
73
+ class: f(["m-0 flex w-full min-w-0 gap-3", u.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
73
74
  "data-ac-ds": "",
74
75
  "data-ac-chart": "",
75
- "data-testid": l.testid
76
+ "data-testid": u.testid
76
77
  }, [
77
- l.legend !== "none" && l.legendItems.length > 1 && !l.loading && !l.empty ? (h(), o("ul", {
78
+ u.legend !== "none" && u.legendItems.length > 1 && !u.loading && !u.empty ? (g(), s("ul", {
78
79
  key: 0,
79
- class: d(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
80
- l.legend === "bottom" && "order-last",
81
- l.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
82
- l.legendCentered && l.legend !== "right" && "justify-center"
80
+ class: f(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
81
+ u.legend === "bottom" && "order-last",
82
+ u.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
83
+ u.legendCentered && u.legend !== "right" && "justify-center"
83
84
  ]]),
84
85
  "aria-label": "Legend"
85
- }, [(h(!0), o(n, null, _(l.legendItems, (e) => (h(), o("li", {
86
+ }, [(g(!0), s(r, null, v(u.legendItems, (e) => (g(), s("li", {
86
87
  key: e.key,
87
88
  class: "flex"
88
- }, [s("button", {
89
+ }, [c("button", {
89
90
  type: "button",
90
- class: d(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [B.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", l.legend === "right" && "w-full"]]),
91
- "aria-pressed": !B.value.includes(e.key),
92
- onClick: (t) => W(e.key)
91
+ class: f(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [V.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", u.legend === "right" && "w-full"]]),
92
+ "aria-pressed": !V.value.includes(e.key),
93
+ onClick: (t) => G(e.key)
93
94
  }, [
94
- s("span", {
95
- class: d(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", B.value.includes(e.key) && "opacity-30"]),
96
- style: f({ backgroundColor: e.color }),
95
+ c("span", {
96
+ class: f(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", V.value.includes(e.key) && "opacity-30"]),
97
+ style: p({ backgroundColor: e.color }),
97
98
  "aria-hidden": "true"
98
99
  }, null, 6),
99
- s("span", w, y(e.name), 1),
100
- e.value ? (h(), o("span", T, y(e.value), 1)) : a("", !0)
101
- ], 10, C)]))), 128))], 2)) : a("", !0),
102
- l.loading ? (h(), i(e, {
100
+ c("span", T, b(e.name), 1),
101
+ e.value ? (g(), s("span", E, b(e.value), 1)) : o("", !0)
102
+ ], 10, w)]))), 128))], 2)) : o("", !0),
103
+ u.loading ? (g(), a(t, {
103
104
  key: 1,
104
105
  shape: "rect",
105
- height: `${l.height}px`,
106
+ height: `${u.height}px`,
106
107
  label: "Loading chart"
107
- }, null, 8, ["height"])) : l.empty ? (h(), o("div", {
108
+ }, null, 8, ["height"])) : u.empty ? (g(), s("div", {
108
109
  key: 2,
109
110
  class: "flex w-full items-center justify-center overflow-hidden",
110
- style: f({ height: `${l.height}px` })
111
- }, [c(t, {
111
+ style: p({ height: `${u.height}px` })
112
+ }, [l(n, {
112
113
  size: "small",
113
- icon: l.emptyIcon,
114
- title: l.emptyText
115
- }, null, 8, ["icon", "title"])], 4)) : (h(), o("div", {
114
+ icon: u.emptyIcon,
115
+ title: u.emptyText
116
+ }, null, 8, ["icon", "title"])], 4)) : (g(), s("div", {
116
117
  key: 3,
117
118
  ref_key: "plot",
118
- ref: H,
119
- class: d(["relative min-w-0", l.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
120
- style: f(l.legend === "right" ? {
121
- height: `${l.height}px`,
122
- width: `${l.height}px`
123
- } : { height: `${l.height}px` }),
124
- role: u.$slots.controls ? void 0 : "img",
125
- "aria-label": u.$slots.controls ? void 0 : l.summary
126
- }, [u.$slots.controls ? (h(), o("div", {
119
+ ref: U,
120
+ class: f(["relative min-w-0", u.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
121
+ style: p(u.legend === "right" ? {
122
+ height: `${u.height}px`,
123
+ width: `${u.height}px`
124
+ } : { height: `${u.height}px` }),
125
+ role: e.$slots.controls ? void 0 : "img",
126
+ "aria-label": e.$slots.controls ? void 0 : u.summary
127
+ }, [e.$slots.controls ? (g(), s("div", {
127
128
  key: 0,
128
129
  class: "size-full",
129
130
  role: "img",
130
- "aria-label": l.summary
131
- }, [v(u.$slots, "default")], 8, D)) : v(u.$slots, "default", {}, void 0, void 0, 1), v(u.$slots, "controls")], 14, E)),
132
- l.title || l.description ? (h(), o("figcaption", O, y([l.title, l.description].filter(Boolean).join(". ")), 1)) : a("", !0),
133
- !l.loading && !l.empty ? (h(), o("table", k, [
134
- s("caption", null, y(l.title ? `${l.title}: data` : "Chart data"), 1),
135
- s("thead", null, [s("tr", null, [(h(!0), o(n, null, _(l.table.columns, (e, t) => (h(), o("th", {
131
+ "aria-label": u.summary
132
+ }, [y(e.$slots, "default")], 8, O)) : y(e.$slots, "default", {}, void 0, void 0, 1), y(e.$slots, "controls")], 14, D)),
133
+ u.title || u.description ? (g(), s("figcaption", k, b([u.title, u.description].filter(Boolean).join(". ")), 1)) : o("", !0),
134
+ !u.loading && !u.empty ? (g(), s("table", A, [
135
+ c("caption", null, b(u.title ? `${u.title}: data` : "Chart data"), 1),
136
+ c("thead", null, [c("tr", null, [(g(!0), s(r, null, v(u.table.columns, (e, t) => (g(), s("th", {
136
137
  key: t,
137
138
  scope: "col",
138
139
  class: "text-left"
139
- }, y(e), 1))), 128))])]),
140
- s("tbody", null, [(h(!0), o(n, null, _(l.table.rows, (e, t) => (h(), o("tr", { key: t }, [s("th", A, y(e[0]), 1), (h(!0), o(n, null, _(e.slice(1), (e, t) => (h(), o("td", { key: t }, y(e), 1))), 128))]))), 128))])
141
- ])) : a("", !0),
142
- (h(), i(r, { to: "body" }, [l.tooltip && l.tip && !l.loading && !l.empty ? (h(), o("div", {
140
+ }, b(e), 1))), 128))])]),
141
+ c("tbody", null, [(g(!0), s(r, null, v(u.table.rows, (e, t) => (g(), s("tr", { key: t }, [c("th", j, b(e[0]), 1), (g(!0), s(r, null, v(e.slice(1), (e, t) => (g(), s("td", { key: t }, b(e), 1))), 128))]))), 128))])
142
+ ])) : o("", !0),
143
+ (g(), a(i, { to: "body" }, [u.tooltip && u.tip && !u.loading && !u.empty ? (g(), s("div", {
143
144
  key: 0,
144
145
  class: "pointer-events-none fixed z-[100] w-max max-w-[280px] min-w-[160px] rounded-10 border border-border bg-surface px-3 py-2.5 text-xs text-body shadow-lg",
145
- style: f(G(l.tip)),
146
+ style: p(K(u.tip)),
146
147
  "aria-hidden": "true",
147
148
  "data-ac-ds": "",
148
149
  "data-testid": "ac-chart-tooltip"
149
- }, [v(u.$slots, "tooltip", {
150
- datum: l.tip.datum,
151
- index: l.tip.index,
152
- title: l.tip.title,
153
- items: l.tip.items
150
+ }, [y(e.$slots, "tooltip", {
151
+ datum: u.tip.datum,
152
+ index: u.tip.index,
153
+ title: u.tip.title,
154
+ items: u.tip.items
154
155
  }, () => [
155
- l.tip.title ? (h(), o("p", j, y(l.tip.title), 1)) : a("", !0),
156
- s("ul", M, [(h(!0), o(n, null, _(l.tip.items, (e) => (h(), o("li", {
156
+ u.tip.title ? (g(), s("p", M, b(u.tip.title), 1)) : o("", !0),
157
+ c("ul", N, [(g(!0), s(r, null, v(u.tip.items, (e) => (g(), s("li", {
157
158
  key: e.key,
158
159
  class: "flex items-center gap-2"
159
160
  }, [
160
- s("span", {
161
+ c("span", {
161
162
  class: "size-2 shrink-0 rounded-full",
162
- style: f({ backgroundColor: e.color })
163
+ style: p({ backgroundColor: e.color })
163
164
  }, null, 4),
164
- s("span", N, y(e.name), 1),
165
- s("span", P, y(e.formatted), 1)
165
+ c("span", P, b(e.name), 1),
166
+ c("span", F, b(e.formatted), 1)
166
167
  ]))), 128))]),
167
- l.tip.total ? (h(), o("p", F, [p[0] ||= s("span", { class: "text-muted" }, "Total", -1), s("span", I, y(l.tip.total), 1)])) : a("", !0)
168
- ])], 4)) : a("", !0)]))
169
- ], 10, S));
168
+ u.tip.total ? (g(), s("p", I, [d[0] ||= c("span", { class: "text-muted" }, "Total", -1), c("span", L, b(u.tip.total), 1)])) : o("", !0)
169
+ ])], 4)) : o("", !0)]))
170
+ ], 10, C));
170
171
  }
171
172
  });
172
173
  //#endregion
173
- export { B as default };
174
+ export { V as default };