@ac-design/design-system 2.0.0 → 2.1.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 (167) hide show
  1. package/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
  2. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
  3. package/dist/lib/charts/cartesian.d.ts +324 -0
  4. package/dist/lib/charts/cartesian.js +137 -0
  5. package/dist/lib/charts/echarts.d.ts +86 -0
  6. package/dist/lib/charts/echarts.js +173 -0
  7. package/dist/lib/charts/graph.d.ts +77 -0
  8. package/dist/lib/charts/graph.js +155 -0
  9. package/dist/lib/charts/index.d.ts +4 -0
  10. package/dist/lib/charts/index.js +3 -1
  11. package/dist/lib/charts/shared.d.ts +0 -7
  12. package/dist/lib/charts/shared.js +1 -19
  13. package/dist/lib/charts/xy.d.ts +11 -7
  14. package/dist/lib/charts/xy.js +53 -72
  15. package/dist/lib/compat.css +1322 -278
  16. package/dist/lib/components/AcAlert.vue.d.ts +9 -0
  17. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
  18. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
  19. package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
  20. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
  21. package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
  22. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
  23. package/dist/lib/components/AcBadge.vue.d.ts +7 -3
  24. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
  25. package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
  26. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
  27. package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
  28. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
  29. package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
  30. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/lib/components/AcButton.vue.d.ts +12 -6
  32. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
  33. package/dist/lib/components/AcCard.vue.d.ts +34 -3
  34. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
  35. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  36. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
  37. package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
  38. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
  39. package/dist/lib/components/AcCheckList.js +5 -0
  40. package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
  41. package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
  42. package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
  43. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
  44. package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
  45. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
  46. package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
  47. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
  48. package/dist/lib/components/AcCommandBlock.js +5 -0
  49. package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
  50. package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
  51. package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
  52. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
  53. package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
  54. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
  55. package/dist/lib/components/AcCostSummary.js +5 -0
  56. package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
  57. package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
  58. package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
  59. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
  60. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
  61. package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
  62. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
  63. package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
  64. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
  65. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
  66. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  67. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
  68. package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
  69. package/dist/lib/components/AcErrorState.js +5 -0
  70. package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
  71. package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
  72. package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
  73. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
  74. package/dist/lib/components/AcFooter.vue.d.ts +1 -1
  75. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
  76. package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
  77. package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
  78. package/dist/lib/components/AcGraphChart.js +5 -0
  79. package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
  80. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
  81. package/dist/lib/components/AcHeader.vue.d.ts +17 -2
  82. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +79 -25
  83. package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
  84. package/dist/lib/components/AcInput.vue.d.ts +1 -1
  85. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
  86. package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
  87. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
  88. package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
  89. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
  90. package/dist/lib/components/AcLoader.js +5 -0
  91. package/dist/lib/components/AcLoader.vue.d.ts +15 -0
  92. package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
  93. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
  94. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
  95. package/dist/lib/components/AcMapChart.js +5 -0
  96. package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
  97. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
  98. package/dist/lib/components/AcModal.vue.d.ts +6 -3
  99. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
  100. package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
  101. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
  102. package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
  103. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
  104. package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
  105. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
  106. package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
  107. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
  108. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  109. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
  110. package/dist/lib/components/AcPagination.vue.d.ts +5 -5
  111. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
  112. package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
  113. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
  114. package/dist/lib/components/AcProductHero.js +5 -0
  115. package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
  116. package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
  117. package/dist/lib/components/AcProgress.vue.d.ts +17 -2
  118. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
  119. package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
  120. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
  121. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  122. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
  123. package/dist/lib/components/AcSelect.vue.d.ts +3 -3
  124. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
  125. package/dist/lib/components/AcSettingsRow.js +5 -0
  126. package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
  127. package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
  128. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
  129. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  130. package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
  131. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
  132. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  133. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
  134. package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
  135. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
  136. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
  137. package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
  138. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
  139. package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
  140. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
  141. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
  142. package/dist/lib/components/AcTabs.vue.d.ts +9 -2
  143. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
  144. package/dist/lib/components/AcTag.vue.d.ts +1 -1
  145. package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
  146. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
  147. package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
  148. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
  149. package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
  150. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
  151. package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
  152. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
  153. package/dist/lib/components/AcToaster.vue.d.ts +6 -3
  154. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
  155. package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
  156. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
  157. package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
  158. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
  159. package/dist/lib/components/index.d.ts +7 -0
  160. package/dist/lib/components/status.d.ts +3 -1
  161. package/dist/lib/components/status.js +20 -5
  162. package/dist/lib/composables/useToast.d.ts +17 -1
  163. package/dist/lib/composables/useToast.js +10 -2
  164. package/dist/lib/index.d.ts +7 -3
  165. package/dist/lib/index.js +80 -73
  166. package/dist/lib/theme.css +39 -54
  167. package/package.json +12 -3
@@ -1,15 +1,19 @@
1
- import e from "./AcButton.js";
1
+ import e from "./AcSpinner.js";
2
2
  import t from "./AcModal.js";
3
3
  import n from "./AcInput.js";
4
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, useModel as _, watch as v, withCtx as y } from "vue";
4
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, normalizeClass as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, useModel as v, watch as y, withCtx as b } from "vue";
5
5
  //#region src/lib/components/AcDeleteModal.vue?vue&type=script&setup=true&lang.ts
6
- var b = { class: "flex flex-col gap-5" }, x = { class: "text-base text-body" }, S = { class: "font-mono font-semibold break-all text-heading" }, C = {
6
+ var x = {
7
+ class: "flex flex-col gap-5",
8
+ "data-ac-ds": "",
9
+ "data-testid": "ac-delete-modal"
10
+ }, S = { class: "text-lg text-muted" }, C = { class: "font-mono font-semibold break-all text-heading" }, w = {
7
11
  key: 0,
8
- class: "mt-1.5 text-base text-muted"
9
- }, w = {
12
+ class: "mt-2 text-base text-muted"
13
+ }, T = {
10
14
  key: 0,
11
15
  class: "flex flex-col gap-2"
12
- }, T = { class: "self-start rounded-8 bg-surface-sunken px-2.5 py-1.5 font-mono text-base break-all text-heading" }, E = { key: 1 }, D = /*@__PURE__*/ d({
16
+ }, E = { class: "self-start rounded-8 bg-surface-sunken px-2.5 py-1.5 font-mono text-base break-all text-heading" }, D = { key: 1 }, O = ["disabled"], k = ["disabled", "aria-busy"], A = "inline-flex h-10 cursor-pointer items-center justify-center gap-2 rounded-10 border px-4 text-lg whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", j = /*@__PURE__*/ d({
13
17
  __name: "AcDeleteModal",
14
18
  props: /*@__PURE__*/ f({
15
19
  title: { default: "Delete" },
@@ -34,59 +38,61 @@ var b = { class: "flex flex-col gap-5" }, x = { class: "text-base text-body" },
34
38
  }),
35
39
  emits: /*@__PURE__*/ f(["confirm", "cancel"], ["update:open"]),
36
40
  setup(d, { emit: f }) {
37
- let D = d, O = f, k = _(d, "open"), A = m("");
38
- v(k, (e) => e && (A.value = ""));
39
- let j = i(() => !D.confirmByTyping || A.value === D.itemName), M = () => {
40
- k.value = !1, O("cancel");
41
- };
42
- return (i, f) => (p(), a(t, {
43
- open: k.value,
44
- "onUpdate:open": f[2] ||= (e) => k.value = e,
41
+ let j = d, M = v(d, "open"), N = f, P = h("");
42
+ y(M, (e) => e && (P.value = ""));
43
+ let F = i(() => !j.confirmByTyping || P.value === j.itemName);
44
+ function I() {
45
+ M.value = !1, N("cancel");
46
+ }
47
+ return (i, f) => (m(), a(t, {
48
+ open: M.value,
49
+ "onUpdate:open": f[2] ||= (e) => M.value = e,
45
50
  title: d.title,
46
51
  size: "small",
52
+ variant: "plain",
47
53
  closable: !d.loading,
48
54
  "close-on-outside-click": !d.loading,
49
- onClose: f[3] ||= (e) => O("cancel")
55
+ onClose: f[3] ||= (e) => N("cancel")
50
56
  }, {
51
- footer: y(() => [u(e, {
52
- title: "Cancel",
53
- color: "white",
57
+ footer: b(() => [c("button", {
58
+ type: "button",
59
+ class: p([A, "border-border bg-transparent text-heading hover:bg-surface-sunken focus-visible:ring-ring"]),
54
60
  disabled: d.loading,
55
61
  "data-ac-ds": "",
56
62
  "data-testid": "ac-delete-modal-cancel",
57
- onClick: M
58
- }, null, 8, ["disabled"]), u(e, {
59
- title: d.confirmText,
60
- color: "danger",
61
- loading: d.loading,
62
- disabled: !j.value,
63
+ onClick: I
64
+ }, " Cancel ", 8, O), c("button", {
65
+ type: "button",
66
+ class: p([[A, d.loading && "pointer-events-none"], "border-transparent bg-danger text-white hover:bg-danger-hover focus-visible:ring-danger"]),
67
+ disabled: !F.value || void 0,
68
+ "aria-busy": d.loading || void 0,
63
69
  "data-ac-ds": "",
64
70
  "data-testid": "ac-delete-modal-confirm",
65
- onClick: f[1] ||= (e) => O("confirm", d.itemName)
66
- }, null, 8, [
67
- "title",
68
- "loading",
69
- "disabled"
70
- ])]),
71
- default: y(() => [c("div", b, [
72
- c("div", null, [c("p", x, [
73
- l(g(d.message), 1),
74
- d.itemName ? (p(), s(r, { key: 0 }, [f[4] ||= l(g(" "), -1), c("strong", S, g(d.itemName), 1)], 64)) : o("", !0),
71
+ onClick: f[1] ||= (e) => !d.loading && N("confirm", d.itemName)
72
+ }, [d.loading ? (m(), a(e, {
73
+ key: 0,
74
+ class: "-ml-0.5",
75
+ label: ""
76
+ })) : o("", !0), l(" " + _(d.confirmText), 1)], 10, k)]),
77
+ default: b(() => [c("div", x, [
78
+ c("div", null, [c("p", S, [
79
+ l(_(d.message), 1),
80
+ d.itemName ? (m(), s(r, { key: 0 }, [f[4] ||= l(_(" "), -1), c("strong", C, _(d.itemName), 1)], 64)) : o("", !0),
75
81
  f[5] ||= l("? ", -1)
76
- ]), d.detail ? (p(), s("p", C, g(d.detail), 1)) : o("", !0)]),
77
- d.confirmByTyping && d.itemName ? (p(), s("div", w, [
82
+ ]), d.detail ? (m(), s("p", w, _(d.detail), 1)) : o("", !0)]),
83
+ d.confirmByTyping && d.itemName ? (m(), s("div", T, [
78
84
  f[6] ||= c("p", { class: "text-base text-muted" }, "To confirm, type the name below.", -1),
79
- c("code", T, g(d.itemName), 1),
85
+ c("code", E, _(d.itemName), 1),
80
86
  u(n, {
81
- modelValue: A.value,
82
- "onUpdate:modelValue": f[0] ||= (e) => A.value = e,
87
+ modelValue: P.value,
88
+ "onUpdate:modelValue": f[0] ||= (e) => P.value = e,
83
89
  class: "mt-3",
84
90
  label: "Resource name",
85
91
  placeholder: "Enter the name",
86
92
  autocomplete: "off"
87
93
  }, null, 8, ["modelValue"])
88
94
  ])) : o("", !0),
89
- i.$slots.default ? (p(), s("div", E, [h(i.$slots, "default")])) : o("", !0)
95
+ i.$slots.default ? (m(), s("div", D, [g(i.$slots, "default")])) : o("", !0)
90
96
  ])]),
91
97
  _: 3
92
98
  }, 8, [
@@ -98,4 +104,4 @@ var b = { class: "flex flex-col gap-5" }, x = { class: "text-base text-body" },
98
104
  }
99
105
  });
100
106
  //#endregion
101
- export { D as default };
107
+ export { j as default };
@@ -1,4 +1,5 @@
1
1
  import type { ChartTooltipSlotProps } from "../charts/ChartFrame.vue";
2
+ import type { ChartRenderer } from "../charts/echarts";
2
3
  import type { ChartAccessor, ChartCategory, ChartDatum } from "../charts/shared";
3
4
  export interface Props {
4
5
  /** One row per segment, e.g. `{ engine: "Postgres", count: 42 }`. */
@@ -13,6 +14,8 @@ export interface Props {
13
14
  height?: number;
14
15
  /** Ring thickness in px. `0` draws a pie. */
15
16
  arcWidth?: number;
17
+ /** Draws the top half of the ring only, like a gauge, e.g. for a quota. The centre value sits under the arc. */
18
+ half?: boolean;
16
19
  /** Formats values in the legend, tooltip, centre and data table. Defaults to compact numbers: `1.2K`. */
17
20
  valueFormatter?: (value: number) => string;
18
21
  /** Legend to the `right` (it wraps below on narrow screens), `top`, `bottom`, or `none`. Clicking an entry hides or shows that segment. */
@@ -35,6 +38,10 @@ export interface Props {
35
38
  title?: string;
36
39
  /** A sentence for screen readers on what the chart shows. Defaults to each segment's share. */
37
40
  description?: string;
41
+ /** `canvas` (default) or `svg`, which is crisper when printed or zoomed. */
42
+ renderer?: ChartRenderer;
43
+ /** Sweeps the segments in and animates changes. Always off when the viewer asks for reduced motion. */
44
+ animation?: boolean;
38
45
  }
39
46
  type __VLS_Slots = {
40
47
  /** Content in the ring's centre. Gets the visible total, raw and formatted. */
@@ -52,11 +59,14 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
52
59
  description: string;
53
60
  height: number;
54
61
  loading: boolean;
62
+ animation: boolean;
55
63
  index: ChartAccessor<string>;
56
64
  tooltip: boolean;
57
65
  emptyText: string;
66
+ renderer: ChartRenderer;
58
67
  categories: Record<string, ChartCategory>;
59
68
  arcWidth: number;
69
+ half: boolean;
60
70
  valueFormatter: (value: number) => string;
61
71
  legendValues: boolean;
62
72
  centerLabel: string;
@@ -1,20 +1,18 @@
1
1
  import e from "../charts/ChartFrame.js";
2
- import { chartColor as t, chartDuration as n, formatCompact as r, readValue as i } from "../charts/shared.js";
3
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, createVNode as d, defineComponent as f, guardReactiveProps as p, normalizeProps as m, normalizeStyle as h, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, unref as x, withCtx as S } from "vue";
4
- import { ChartPie as C } from "@lucide/vue";
5
- import { VisDonut as w, VisSingleContainer as T } from "@unovis/vue";
6
- import { Donut as E } from "@unovis/ts";
2
+ import { bindItemHover as t, useEChart as n } from "../charts/echarts.js";
3
+ import { chartColor as r, formatCompact as i, readValue as a } from "../charts/shared.js";
4
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, defineComponent as p, guardReactiveProps as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, openBlock as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, unref as ee, withCtx as C } from "vue";
5
+ import { ChartPie as w } from "@lucide/vue";
6
+ import { use as T } from "echarts/core";
7
+ import { PieChart as E } from "echarts/charts";
7
8
  //#region src/lib/components/AcDonutChart.vue?vue&type=script&setup=true&lang.ts
8
9
  var D = {
9
- key: 0,
10
- class: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center"
11
- }, O = {
12
10
  key: 0,
13
11
  class: "text-2xl font-semibold tracking-tight text-heading tabular-nums"
14
- }, k = {
12
+ }, O = {
15
13
  key: 1,
16
14
  class: "text-xs text-muted"
17
- }, A = 24, j = .04, M = /*@__PURE__*/ f({
15
+ }, k = 24, A = .04, j = 4, M = /*@__PURE__*/ p({
18
16
  __name: "AcDonutChart",
19
17
  props: {
20
18
  data: {},
@@ -29,6 +27,10 @@ var D = {
29
27
  categories: { default: void 0 },
30
28
  height: { default: 240 },
31
29
  arcWidth: { default: 24 },
30
+ half: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
32
34
  valueFormatter: {
33
35
  type: Function,
34
36
  default: void 0
@@ -54,22 +56,28 @@ var D = {
54
56
  },
55
57
  emptyText: { default: "No data to show yet" },
56
58
  title: { default: "" },
57
- description: { default: "" }
59
+ description: { default: "" },
60
+ renderer: { default: "canvas" },
61
+ animation: {
62
+ type: Boolean,
63
+ default: !0
64
+ }
58
65
  },
59
- setup(f) {
60
- let M = f, N = n(), P = _([]), F = _(0), I = _(null), L = o(() => M.data.map((e, t) => String(i(e, t, M.index)))), R = o(() => M.data.map((e, t) => Math.max(0, Number(i(e, t, M.value)) || 0))), z = o(() => R.value.map((e, t) => P.value.includes(L.value[t]) ? 0 : e)), B = o(() => z.value.reduce((e, t) => e + t, 0)), V = o(() => L.value.map((e, n) => t(M.categories?.[e]?.color, n))), H = o(() => L.value.map((e) => M.categories?.[e]?.name ?? e));
66
+ setup(p) {
67
+ T([E]);
68
+ let M = p, N = y(), P = y([]), F = y(0), I = y(null), L = s(() => M.data.map((e, t) => String(a(e, t, M.index)))), R = s(() => M.data.map((e, t) => Math.max(0, Number(a(e, t, M.value)) || 0))), z = s(() => R.value.map((e, t) => P.value.includes(L.value[t]) ? 0 : e)), B = s(() => z.value.reduce((e, t) => e + t, 0)), V = s(() => L.value.map((e, t) => r(M.categories?.[e]?.color, t))), H = s(() => L.value.map((e) => M.categories?.[e]?.name ?? e));
61
69
  function U(e) {
62
- return M.valueFormatter ? M.valueFormatter(e) : r(e);
70
+ return M.valueFormatter ? M.valueFormatter(e) : i(e);
63
71
  }
64
72
  function W(e, t = B.value) {
65
73
  return t ? `${Math.round(e / t * 100)}%` : "0%";
66
74
  }
67
- let G = o(() => L.value.map((e, t) => ({
75
+ let G = s(() => L.value.map((e, t) => ({
68
76
  key: e,
69
77
  name: H.value[t],
70
78
  color: V.value[t],
71
79
  value: M.legendValues ? U(R.value[t]) : void 0
72
- }))), K = o(() => R.value.reduce((e, t) => e + t, 0)), q = o(() => ({
80
+ }))), K = s(() => R.value.reduce((e, t) => e + t, 0)), q = s(() => ({
73
81
  columns: [
74
82
  "Name",
75
83
  "Value",
@@ -80,112 +88,131 @@ var D = {
80
88
  U(R.value[t]),
81
89
  W(R.value[t], K.value)
82
90
  ])
83
- })), J = o(() => {
91
+ })), J = s(() => {
84
92
  let e = L.value.map((e, t) => `${H.value[t]} ${W(R.value[t], K.value)}`).join(", ");
85
93
  return [M.title, M.description || `${L.value.length} segments: ${e}.`].filter(Boolean).join(". ");
86
- }), Y = o(() => Math.min(F.value || M.height, M.height)), X = o(() => M.arcLabels ? Math.max(40, Y.value / 2 - A) : void 0), Z = o(() => {
94
+ }), Y = s(() => F.value || M.height), X = s(() => {
95
+ let e = M.half ? Math.min(Y.value / 2, M.height) : Math.min(Y.value, M.height) / 2;
96
+ return Math.max(40, e - j - (M.arcLabels ? k : 0));
97
+ }), Z = s(() => M.arcWidth > 0 ? Math.max(0, X.value - M.arcWidth) : 0), Q = s(() => Y.value / 2), $ = s(() => M.half ? M.height / 2 + X.value / 2 : M.height / 2), te = s(() => {
87
98
  if (!M.arcLabels || !B.value || !F.value) return [];
88
- let e = (X.value ?? Y.value / 2) + A / 2 + 2, t = 0;
89
- return z.value.flatMap((n, r) => {
90
- let i = (t + n / 2) / B.value * 2 * Math.PI;
91
- return t += n, n / B.value < j ? [] : [{
92
- key: L.value[r],
93
- text: W(n),
94
- left: F.value / 2 + e * Math.sin(i),
95
- top: M.height / 2 - e * Math.cos(i)
99
+ let e = X.value + k / 2 + 2, t = M.half ? Math.PI : 2 * Math.PI, n = M.half ? -Math.PI / 2 : 0, r = 0;
100
+ return z.value.flatMap((i, a) => {
101
+ let o = n + (r + i / 2) / B.value * t;
102
+ return r += i, i / B.value < A ? [] : [{
103
+ key: L.value[a],
104
+ text: W(i),
105
+ left: Q.value + e * Math.sin(o),
106
+ top: $.value - e * Math.cos(o)
96
107
  }];
97
108
  });
98
- }), Q = (e, t) => z.value[t], $ = (e, t) => V.value[t];
99
- function ee(e, t) {
100
- let n = e.index, r = z.value[n];
109
+ });
110
+ function ne(e) {
111
+ return {
112
+ type: "pie",
113
+ data: L.value.flatMap((t, n) => P.value.includes(t) ? [] : [{
114
+ name: H.value[n],
115
+ value: R.value[n],
116
+ row: n,
117
+ itemStyle: { color: e.color(V.value[n]) }
118
+ }]),
119
+ center: [Q.value, $.value],
120
+ radius: [Z.value, X.value],
121
+ startAngle: M.half ? 180 : 90,
122
+ endAngle: M.half ? 360 : "auto",
123
+ avoidLabelOverlap: !1,
124
+ label: { show: !1 },
125
+ labelLine: { show: !1 },
126
+ itemStyle: {
127
+ borderColor: e.surface,
128
+ borderWidth: 2,
129
+ borderRadius: M.arcWidth > 0 ? 4 : 0
130
+ },
131
+ emphasis: {
132
+ scale: !0,
133
+ scaleSize: j
134
+ },
135
+ animationType: "expansion",
136
+ animationTypeUpdate: "transition",
137
+ animationDuration: 500,
138
+ animationDurationUpdate: 300
139
+ };
140
+ }
141
+ function re(e, t, n) {
142
+ if (!e || !M.tooltip) return;
143
+ let r = e.row, i = z.value[r];
101
144
  I.value = {
102
- clientX: t.clientX,
103
- clientY: t.clientY,
145
+ clientX: t,
146
+ clientY: n,
104
147
  title: "",
105
148
  items: [{
106
- key: L.value[n],
107
- name: H.value[n],
108
- color: V.value[n],
109
- value: r,
110
- formatted: `${U(r)} (${W(r)})`
149
+ key: L.value[r],
150
+ name: H.value[r],
151
+ color: V.value[r],
152
+ value: i,
153
+ formatted: `${U(i)} (${W(i)})`
111
154
  }],
112
- datum: e.data,
113
- index: n
155
+ datum: M.data[r],
156
+ index: r
114
157
  };
115
158
  }
116
- function te() {
117
- I.value = null;
118
- }
119
- let ne = { [E.selectors.segment]: {
120
- mousemove: ee,
121
- mouseleave: te
122
- } };
123
- return (t, n) => (g(), s(e, {
159
+ return n({
160
+ host: N,
161
+ renderer: () => M.renderer,
162
+ option: (e) => ({
163
+ animation: M.animation && !e.reducedMotion,
164
+ series: [ne(e)]
165
+ }),
166
+ setup: (e) => t(e, (e) => re(e.data, e.clientX, e.clientY), () => I.value = null)
167
+ }), (t, n) => (v(), c(e, {
124
168
  hidden: P.value,
125
169
  "onUpdate:hidden": n[0] ||= (e) => P.value = e,
126
170
  width: F.value,
127
171
  "onUpdate:width": n[1] ||= (e) => F.value = e,
128
172
  testid: "ac-donut-chart",
129
- height: f.height,
130
- loading: f.loading,
131
- empty: !f.data.length || !K.value,
132
- "empty-text": f.emptyText,
133
- "empty-icon": x(C),
134
- legend: f.legend,
173
+ height: p.height,
174
+ loading: p.loading,
175
+ empty: !p.data.length || !K.value,
176
+ "empty-text": p.emptyText,
177
+ "empty-icon": ee(w),
178
+ legend: p.legend,
135
179
  "legend-items": G.value,
136
180
  "legend-centered": "",
137
181
  summary: J.value,
138
- title: f.title,
139
- description: f.description,
182
+ title: p.title,
183
+ description: p.description,
140
184
  table: q.value,
141
185
  tip: I.value,
142
- tooltip: f.tooltip
143
- }, u({
144
- default: S(() => [
145
- d(x(T), {
146
- data: f.data,
147
- height: f.height,
148
- duration: x(N)
149
- }, {
150
- default: S(() => [d(x(w), {
151
- value: Q,
152
- color: $,
153
- "arc-width": f.arcWidth,
154
- radius: X.value,
155
- "pad-angle": 0,
156
- "corner-radius": f.arcWidth ? 2 : 0,
157
- "show-background": !0,
158
- events: f.tooltip ? ne : void 0
159
- }, null, 8, [
160
- "arc-width",
161
- "radius",
162
- "corner-radius",
163
- "events"
164
- ])]),
165
- _: 1
166
- }, 8, [
167
- "data",
168
- "height",
169
- "duration"
170
- ]),
171
- t.$slots.center || f.centerValue !== "" || f.centerLabel ? (g(), l("div", D, [y(t.$slots, "center", {
186
+ tooltip: p.tooltip
187
+ }, f({
188
+ default: C(() => [
189
+ d("div", {
190
+ ref_key: "host",
191
+ ref: N,
192
+ class: "size-full"
193
+ }, null, 512),
194
+ t.$slots.center || p.centerValue !== "" || p.centerLabel ? (v(), u("div", {
195
+ key: 0,
196
+ class: h(["pointer-events-none absolute inset-x-0 flex flex-col items-center text-center", p.half ? "justify-end" : "inset-y-0 justify-center"]),
197
+ style: _(p.half ? { bottom: `${p.height - $.value + 2}px` } : void 0)
198
+ }, [x(t.$slots, "center", {
172
199
  total: B.value,
173
200
  formatted: U(B.value)
174
- }, () => [f.centerValue === "" ? c("", !0) : (g(), l("span", O, b(f.centerValue), 1)), f.centerLabel ? (g(), l("span", k, b(f.centerLabel), 1)) : c("", !0)])])) : c("", !0),
175
- (g(!0), l(a, null, v(Z.value, (e) => (g(), l("span", {
201
+ }, () => [p.centerValue === "" ? l("", !0) : (v(), u("span", D, S(p.centerValue), 1)), p.centerLabel ? (v(), u("span", O, S(p.centerLabel), 1)) : l("", !0)])], 6)) : l("", !0),
202
+ (v(!0), u(o, null, b(te.value, (e) => (v(), u("span", {
176
203
  key: e.key,
177
204
  class: "pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 text-xs font-medium text-muted tabular-nums",
178
- style: h({
205
+ style: _({
179
206
  left: `${e.left}px`,
180
207
  top: `${e.top}px`
181
208
  }),
182
209
  "aria-hidden": "true"
183
- }, b(e.text), 5))), 128))
210
+ }, S(e.text), 5))), 128))
184
211
  ]),
185
212
  _: 2
186
213
  }, [t.$slots.tooltip ? {
187
214
  name: "tooltip",
188
- fn: S((e) => [y(t.$slots, "tooltip", m(p(e)))]),
215
+ fn: C((e) => [x(t.$slots, "tooltip", g(m(e)))]),
189
216
  key: "0"
190
217
  } : void 0]), 1032, [
191
218
  "hidden",
@@ -1,7 +1,7 @@
1
1
  export interface Props {
2
- /** Text of the default trigger button. Without it (and without a `trigger` slot) a 32px ⋮ icon button is shown. */
2
+ /** Text of the default trigger button. Without it (and without a `trigger` slot) a 28px ⋯ icon button is shown. */
3
3
  label?: string;
4
- /** Accessible name of the menu and of the ⋮ trigger, e.g. "Actions for demo-postgres". */
4
+ /** Accessible name of the menu and of the ⋯ trigger, e.g. "Actions for demo-postgres". */
5
5
  menuLabel?: string;
6
6
  /** Which edge of the trigger the menu lines up with. Use `end` for menus at the right of a row. Old `is-right`. */
7
7
  align?: "start" | "end";
@@ -9,6 +9,8 @@ export interface Props {
9
9
  placement?: "bottom" | "top";
10
10
  /** Disables the default trigger and stops the menu opening. */
11
11
  disabled?: boolean;
12
+ /** `menu`: cloud-ui's row-action list, at least 240px, full-width rows. `panel`: its navbar Create menu, 320px, padded with rounded rows, 20px icons and a medium-weight label over the description. */
13
+ variant?: "menu" | "panel";
12
14
  }
13
15
  type __VLS_Props = Props;
14
16
  type __VLS_Slots = {
@@ -29,6 +31,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
29
31
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
32
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
31
33
  }>, {
34
+ variant: "menu" | "panel";
32
35
  label: string;
33
36
  disabled: boolean;
34
37
  align: "start" | "end";