@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
@@ -42,6 +42,8 @@ type __VLS_Props = {
42
42
  type __VLS_Slots = {
43
43
  default?: () => unknown;
44
44
  tooltip?: (props: ChartTooltipSlotProps) => unknown;
45
+ /** Buttons over the plot, e.g. zoom. Kept outside the role="img" element so they stay reachable. */
46
+ controls?: () => unknown;
45
47
  };
46
48
  type __VLS_ModelProps = {
47
49
  "hidden": string[];
@@ -5,22 +5,22 @@ import { Fragment as n, Teleport as r, createBlock as i, createCommentVNode as a
5
5
  var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate" }, T = {
6
6
  key: 0,
7
7
  class: "ml-auto pl-3 font-medium text-heading tabular-nums"
8
- }, E = ["aria-label"], D = {
8
+ }, E = ["role", "aria-label"], D = ["aria-label"], O = {
9
9
  key: 4,
10
10
  class: "sr-only"
11
- }, O = {
11
+ }, k = {
12
12
  key: 5,
13
13
  class: "sr-only"
14
- }, k = {
14
+ }, A = {
15
15
  scope: "row",
16
16
  class: "text-left"
17
- }, A = {
17
+ }, j = {
18
18
  key: 0,
19
19
  class: "mb-1.5 font-medium text-heading"
20
- }, j = { class: "m-0 flex list-none flex-col gap-1 p-0" }, M = { class: "min-w-0 flex-1 truncate text-muted" }, N = { class: "pl-4 font-medium text-heading tabular-nums" }, P = {
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
21
  key: 1,
22
22
  class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
23
- }, F = { class: "font-medium text-heading tabular-nums" }, I = 14, L = 300, R = 200, z = /*@__PURE__*/ l({
23
+ }, I = { class: "font-medium text-heading tabular-nums" }, L = 14, R = 300, z = 200, B = /*@__PURE__*/ l({
24
24
  __name: "ChartFrame",
25
25
  props: /*@__PURE__*/ u({
26
26
  testid: {},
@@ -49,26 +49,26 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
49
49
  }),
50
50
  emits: ["update:hidden", "update:width"],
51
51
  setup(l) {
52
- let u = l, z = b(l, "hidden"), B = b(l, "width"), V = g(), H;
53
- function U(e) {
54
- let t = z.value.includes(e);
55
- !t && u.legendItems.length - z.value.length <= 1 || (z.value = t ? z.value.filter((t) => t !== e) : [...z.value, e]);
56
- }
52
+ let u = l, B = b(l, "hidden"), V = b(l, "width"), H = g(), U;
57
53
  function W(e) {
58
- let t = e.clientX > window.innerWidth - L, n = e.clientY > window.innerHeight - R;
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
+ }
57
+ function G(e) {
58
+ let t = e.clientX > window.innerWidth - R, n = e.clientY > window.innerHeight - z;
59
59
  return {
60
- left: t ? void 0 : `${e.clientX + I}px`,
61
- right: t ? `${window.innerWidth - e.clientX + I}px` : void 0,
62
- top: n ? void 0 : `${e.clientY + I}px`,
63
- bottom: n ? `${window.innerHeight - e.clientY + I}px` : void 0
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
64
64
  };
65
65
  }
66
- function G() {
67
- H?.disconnect(), V.value && typeof ResizeObserver < "u" && (H = new ResizeObserver(([e]) => {
68
- e && (B.value = Math.round(e.contentRect.width));
69
- }), H.observe(V.value));
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));
70
70
  }
71
- return x(V, G), m(G), p(() => H?.disconnect()), (u, p) => (h(), o("figure", {
71
+ return x(H, K), m(K), p(() => U?.disconnect()), (u, p) => (h(), o("figure", {
72
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"]),
73
73
  "data-ac-ds": "",
74
74
  "data-ac-chart": "",
@@ -87,12 +87,12 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
87
87
  class: "flex"
88
88
  }, [s("button", {
89
89
  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", [z.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", l.legend === "right" && "w-full"]]),
91
- "aria-pressed": !z.value.includes(e.key),
92
- onClick: (t) => U(e.key)
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)
93
93
  }, [
94
94
  s("span", {
95
- class: d(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", z.value.includes(e.key) && "opacity-30"]),
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
96
  style: f({ backgroundColor: e.color }),
97
97
  "aria-hidden": "true"
98
98
  }, null, 6),
@@ -115,29 +115,34 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
115
115
  }, null, 8, ["icon", "title"])], 4)) : (h(), o("div", {
116
116
  key: 3,
117
117
  ref_key: "plot",
118
- ref: V,
118
+ ref: H,
119
119
  class: d(["relative min-w-0", l.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
120
120
  style: f(l.legend === "right" ? {
121
121
  height: `${l.height}px`,
122
122
  width: `${l.height}px`
123
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", {
127
+ key: 0,
128
+ class: "size-full",
124
129
  role: "img",
125
130
  "aria-label": l.summary
126
- }, [v(u.$slots, "default")], 14, E)),
127
- l.title || l.description ? (h(), o("figcaption", D, y([l.title, l.description].filter(Boolean).join(". ")), 1)) : a("", !0),
128
- !l.loading && !l.empty ? (h(), o("table", O, [
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, [
129
134
  s("caption", null, y(l.title ? `${l.title}: data` : "Chart data"), 1),
130
135
  s("thead", null, [s("tr", null, [(h(!0), o(n, null, _(l.table.columns, (e, t) => (h(), o("th", {
131
136
  key: t,
132
137
  scope: "col",
133
138
  class: "text-left"
134
139
  }, y(e), 1))), 128))])]),
135
- s("tbody", null, [(h(!0), o(n, null, _(l.table.rows, (e, t) => (h(), o("tr", { key: t }, [s("th", k, y(e[0]), 1), (h(!0), o(n, null, _(e.slice(1), (e, t) => (h(), o("td", { key: t }, y(e), 1))), 128))]))), 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))])
136
141
  ])) : a("", !0),
137
142
  (h(), i(r, { to: "body" }, [l.tooltip && l.tip && !l.loading && !l.empty ? (h(), o("div", {
138
143
  key: 0,
139
144
  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",
140
- style: f(W(l.tip)),
145
+ style: f(G(l.tip)),
141
146
  "aria-hidden": "true",
142
147
  "data-ac-ds": "",
143
148
  "data-testid": "ac-chart-tooltip"
@@ -147,8 +152,8 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
147
152
  title: l.tip.title,
148
153
  items: l.tip.items
149
154
  }, () => [
150
- l.tip.title ? (h(), o("p", A, y(l.tip.title), 1)) : a("", !0),
151
- s("ul", j, [(h(!0), o(n, null, _(l.tip.items, (e) => (h(), o("li", {
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", {
152
157
  key: e.key,
153
158
  class: "flex items-center gap-2"
154
159
  }, [
@@ -156,13 +161,13 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
156
161
  class: "size-2 shrink-0 rounded-full",
157
162
  style: f({ backgroundColor: e.color })
158
163
  }, null, 4),
159
- s("span", M, y(e.name), 1),
160
- s("span", N, y(e.formatted), 1)
164
+ s("span", N, y(e.name), 1),
165
+ s("span", P, y(e.formatted), 1)
161
166
  ]))), 128))]),
162
- l.tip.total ? (h(), o("p", P, [p[0] ||= s("span", { class: "text-muted" }, "Total", -1), s("span", F, y(l.tip.total), 1)])) : a("", !0)
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)
163
168
  ])], 4)) : a("", !0)]))
164
169
  ], 10, S));
165
170
  }
166
171
  });
167
172
  //#endregion
168
- export { z as default };
173
+ export { B as default };
@@ -0,0 +1,324 @@
1
+ import type { ECharts } from "echarts/core";
2
+ import type { ChartTheme } from "./echarts";
3
+ import type { useXYChart, XYChartProps } from "./xy";
4
+ type XYState = ReturnType<typeof useXYChart>;
5
+ interface CartesianOptions {
6
+ /** Bars sit between ticks; lines run edge to edge. */
7
+ boundaryGap: boolean;
8
+ /** Values on x and categories on y (horizontal bars). */
9
+ horizontal?: boolean;
10
+ /** `line` guide for lines and areas, `shadow` band for bars. */
11
+ pointer: "line" | "shadow";
12
+ }
13
+ /** Loads the zoom slider and wheel zoom only for charts that turn `zoom` on. */
14
+ export declare function prepareZoom(props: Pick<XYChartProps, "zoom">): Promise<unknown> | undefined;
15
+ export declare function animationFor(props: Pick<XYChartProps, "animation" | "data">, t: ChartTheme): boolean;
16
+ export declare function cartesianOption(t: ChartTheme, props: XYChartProps, s: XYState, o: CartesianOptions): {
17
+ dataZoom?: ({
18
+ filterMode: string;
19
+ zoomOnMouseWheel: string;
20
+ moveOnMouseWheel: boolean;
21
+ moveOnMouseMove: boolean;
22
+ yAxisIndex: number;
23
+ xAxisIndex?: undefined;
24
+ type: string;
25
+ } | {
26
+ filterMode: string;
27
+ zoomOnMouseWheel: string;
28
+ moveOnMouseWheel: boolean;
29
+ moveOnMouseMove: boolean;
30
+ xAxisIndex: number;
31
+ yAxisIndex?: undefined;
32
+ type: string;
33
+ } | {
34
+ filterMode: string;
35
+ height: number;
36
+ bottom: number;
37
+ left: number;
38
+ right: number;
39
+ borderColor: string;
40
+ borderRadius: number;
41
+ backgroundColor: string;
42
+ fillerColor: string;
43
+ dataBackground: {
44
+ lineStyle: {
45
+ color: string;
46
+ width: number;
47
+ };
48
+ areaStyle: {
49
+ color: string;
50
+ };
51
+ };
52
+ selectedDataBackground: {
53
+ lineStyle: {
54
+ color: string;
55
+ width: number;
56
+ };
57
+ areaStyle: {
58
+ color: string;
59
+ };
60
+ };
61
+ handleStyle: {
62
+ color: string;
63
+ borderColor: string;
64
+ };
65
+ moveHandleStyle: {
66
+ color: string;
67
+ };
68
+ emphasis: {
69
+ handleStyle: {
70
+ borderColor: string;
71
+ };
72
+ moveHandleStyle: {
73
+ color: string;
74
+ };
75
+ };
76
+ textStyle: {
77
+ color: string;
78
+ fontSize: number;
79
+ fontFamily: string;
80
+ };
81
+ labelFormatter: (v: number) => string;
82
+ brushSelect: boolean;
83
+ yAxisIndex: number;
84
+ xAxisIndex?: undefined;
85
+ type: string;
86
+ } | {
87
+ filterMode: string;
88
+ height: number;
89
+ bottom: number;
90
+ left: number;
91
+ right: number;
92
+ borderColor: string;
93
+ borderRadius: number;
94
+ backgroundColor: string;
95
+ fillerColor: string;
96
+ dataBackground: {
97
+ lineStyle: {
98
+ color: string;
99
+ width: number;
100
+ };
101
+ areaStyle: {
102
+ color: string;
103
+ };
104
+ };
105
+ selectedDataBackground: {
106
+ lineStyle: {
107
+ color: string;
108
+ width: number;
109
+ };
110
+ areaStyle: {
111
+ color: string;
112
+ };
113
+ };
114
+ handleStyle: {
115
+ color: string;
116
+ borderColor: string;
117
+ };
118
+ moveHandleStyle: {
119
+ color: string;
120
+ };
121
+ emphasis: {
122
+ handleStyle: {
123
+ borderColor: string;
124
+ };
125
+ moveHandleStyle: {
126
+ color: string;
127
+ };
128
+ };
129
+ textStyle: {
130
+ color: string;
131
+ fontSize: number;
132
+ fontFamily: string;
133
+ };
134
+ labelFormatter: (v: number) => string;
135
+ brushSelect: boolean;
136
+ xAxisIndex: number;
137
+ yAxisIndex?: undefined;
138
+ type: string;
139
+ })[] | undefined;
140
+ animation: boolean;
141
+ animationDuration: number;
142
+ textStyle: {
143
+ fontFamily: string;
144
+ color: string;
145
+ };
146
+ grid: {
147
+ left: number;
148
+ right: number;
149
+ top: number;
150
+ bottom: number;
151
+ outerBoundsMode: string;
152
+ outerBoundsContain: string;
153
+ };
154
+ xAxis: {
155
+ type: string;
156
+ data: string[] | undefined;
157
+ boundaryGap: boolean;
158
+ min: string | undefined;
159
+ max: string | undefined;
160
+ axisLabel: {
161
+ formatter: ((v: number) => string) | undefined;
162
+ color: string;
163
+ fontSize: number;
164
+ fontFamily: string;
165
+ hideOverlap: boolean;
166
+ };
167
+ splitLine: {
168
+ show: boolean;
169
+ };
170
+ axisPointer: {
171
+ show: boolean;
172
+ type: "line" | "shadow";
173
+ snap: boolean;
174
+ triggerTooltip: boolean;
175
+ lineStyle: {
176
+ color: string;
177
+ type: "dashed";
178
+ };
179
+ shadowStyle: {
180
+ color: string;
181
+ };
182
+ label: {
183
+ show: boolean;
184
+ };
185
+ z: number;
186
+ };
187
+ name: string | undefined;
188
+ nameLocation: "middle";
189
+ nameGap: number;
190
+ axisLine: {
191
+ lineStyle: {
192
+ color: string;
193
+ };
194
+ };
195
+ axisTick: {
196
+ show: boolean;
197
+ };
198
+ nameTextStyle: {
199
+ color: string;
200
+ fontSize: number;
201
+ fontFamily: string;
202
+ };
203
+ } | {
204
+ type: string;
205
+ min: number | undefined;
206
+ max: number | undefined;
207
+ splitNumber: number;
208
+ axisLine: {
209
+ show: boolean;
210
+ };
211
+ axisLabel: {
212
+ formatter: (v: number) => string;
213
+ color: string;
214
+ fontSize: number;
215
+ fontFamily: string;
216
+ hideOverlap: boolean;
217
+ };
218
+ splitLine: {
219
+ show: boolean;
220
+ lineStyle: {
221
+ color: string;
222
+ type: "dashed";
223
+ };
224
+ };
225
+ name: string | undefined;
226
+ nameLocation: "middle";
227
+ nameGap: number;
228
+ axisTick: {
229
+ show: boolean;
230
+ };
231
+ nameTextStyle: {
232
+ color: string;
233
+ fontSize: number;
234
+ fontFamily: string;
235
+ };
236
+ };
237
+ yAxis: {
238
+ type: string;
239
+ min: number | undefined;
240
+ max: number | undefined;
241
+ splitNumber: number;
242
+ axisLine: {
243
+ show: boolean;
244
+ };
245
+ axisLabel: {
246
+ formatter: (v: number) => string;
247
+ color: string;
248
+ fontSize: number;
249
+ fontFamily: string;
250
+ hideOverlap: boolean;
251
+ };
252
+ splitLine: {
253
+ show: boolean;
254
+ lineStyle: {
255
+ color: string;
256
+ type: "dashed";
257
+ };
258
+ };
259
+ name: string | undefined;
260
+ nameLocation: "middle";
261
+ nameGap: number;
262
+ axisTick: {
263
+ show: boolean;
264
+ };
265
+ nameTextStyle: {
266
+ color: string;
267
+ fontSize: number;
268
+ fontFamily: string;
269
+ };
270
+ } | {
271
+ inverse: boolean;
272
+ type: string;
273
+ data: string[] | undefined;
274
+ boundaryGap: boolean;
275
+ min: string | undefined;
276
+ max: string | undefined;
277
+ axisLabel: {
278
+ formatter: ((v: number) => string) | undefined;
279
+ color: string;
280
+ fontSize: number;
281
+ fontFamily: string;
282
+ hideOverlap: boolean;
283
+ };
284
+ splitLine: {
285
+ show: boolean;
286
+ };
287
+ axisPointer: {
288
+ show: boolean;
289
+ type: "line" | "shadow";
290
+ snap: boolean;
291
+ triggerTooltip: boolean;
292
+ lineStyle: {
293
+ color: string;
294
+ type: "dashed";
295
+ };
296
+ shadowStyle: {
297
+ color: string;
298
+ };
299
+ label: {
300
+ show: boolean;
301
+ };
302
+ z: number;
303
+ };
304
+ name: string | undefined;
305
+ nameLocation: "middle";
306
+ nameGap: number;
307
+ axisLine: {
308
+ lineStyle: {
309
+ color: string;
310
+ };
311
+ };
312
+ axisTick: {
313
+ show: boolean;
314
+ };
315
+ nameTextStyle: {
316
+ color: string;
317
+ fontSize: number;
318
+ fontFamily: string;
319
+ };
320
+ };
321
+ };
322
+ /** The row under the pointer: the category index, or the nearest x value on a time or number axis. */
323
+ export declare function locateRow(chart: ECharts, point: [number, number], s: XYState, horizontal?: boolean): number | null;
324
+ export {};
@@ -0,0 +1,137 @@
1
+ import { axisStyle as e, loadOnce as t, nearestIndex as n } from "./echarts.js";
2
+ import "./xy.js";
3
+ //#region src/lib/charts/cartesian.ts
4
+ function r(e) {
5
+ return e.zoom ? t("dataZoom", () => import("echarts/lib/component/dataZoom")) : void 0;
6
+ }
7
+ function i(e, t) {
8
+ return e.animation !== !1 && !t.reducedMotion && e.data.length <= 2e3;
9
+ }
10
+ function a(t, n, r, a) {
11
+ let o = e(t), s = r.byPosition.value, c = r.xKind.value, l = {
12
+ ...o,
13
+ type: s ? "category" : c === "time" ? "time" : "value",
14
+ data: s ? n.data.map((e, t) => r.xTickFormat(t)) : void 0,
15
+ boundaryGap: s ? a.boundaryGap : !1,
16
+ min: s ? void 0 : "dataMin",
17
+ max: s ? void 0 : "dataMax",
18
+ axisLabel: {
19
+ ...o.axisLabel,
20
+ formatter: s ? void 0 : (e) => r.xTickFormat(e)
21
+ },
22
+ splitLine: { show: !1 },
23
+ axisPointer: {
24
+ show: n.tooltip !== !1,
25
+ type: a.pointer,
26
+ snap: !0,
27
+ triggerTooltip: !1,
28
+ lineStyle: {
29
+ color: t.borderDark,
30
+ type: "dashed"
31
+ },
32
+ shadowStyle: { color: t.alpha(t.sunken, .6) },
33
+ label: { show: !1 },
34
+ z: 1
35
+ },
36
+ name: n.xLabel || void 0,
37
+ nameLocation: "middle",
38
+ nameGap: a.horizontal ? 36 : 28
39
+ }, [u, d] = n.yDomain ?? [void 0, void 0], f = n.data.some((e) => r.visibleKeys.value.some((t) => Number(e[t]) < 0)), p = u ?? (f ? void 0 : 0), m = d, h = {
40
+ ...o,
41
+ type: "value",
42
+ min: p,
43
+ max: m,
44
+ splitNumber: r.yTicks.value,
45
+ axisLine: { show: !1 },
46
+ axisLabel: {
47
+ ...o.axisLabel,
48
+ formatter: (e) => r.formatY(e)
49
+ },
50
+ splitLine: {
51
+ ...o.splitLine,
52
+ show: n.gridLines !== !1
53
+ },
54
+ name: n.yLabel || void 0,
55
+ nameLocation: "middle",
56
+ nameGap: a.horizontal ? 28 : 44
57
+ }, g = a.horizontal ? { yAxisIndex: 0 } : { xAxisIndex: 0 };
58
+ return {
59
+ animation: i(n, t),
60
+ animationDuration: 300,
61
+ textStyle: {
62
+ fontFamily: t.font,
63
+ color: t.body
64
+ },
65
+ grid: {
66
+ left: n.yLabel && !a.horizontal ? 24 : 4,
67
+ right: 12,
68
+ top: 10,
69
+ bottom: (n.zoom ? 40 : 4) + (n.xLabel ? 22 : 0),
70
+ outerBoundsMode: "same",
71
+ outerBoundsContain: "all"
72
+ },
73
+ xAxis: a.horizontal ? h : l,
74
+ yAxis: a.horizontal ? {
75
+ ...l,
76
+ inverse: !0
77
+ } : h,
78
+ ...n.zoom && { dataZoom: [{
79
+ type: "inside",
80
+ ...g,
81
+ filterMode: "none",
82
+ zoomOnMouseWheel: "ctrl",
83
+ moveOnMouseWheel: !1,
84
+ moveOnMouseMove: !0
85
+ }, {
86
+ type: "slider",
87
+ ...g,
88
+ filterMode: "none",
89
+ height: 20,
90
+ bottom: n.xLabel ? 26 : 6,
91
+ left: 48,
92
+ right: 48,
93
+ borderColor: t.border,
94
+ borderRadius: 6,
95
+ backgroundColor: t.alpha(t.sunken, .5),
96
+ fillerColor: t.alpha(t.primary, .12),
97
+ dataBackground: {
98
+ lineStyle: {
99
+ color: t.borderDark,
100
+ width: 1
101
+ },
102
+ areaStyle: { color: t.alpha(t.borderDark, .25) }
103
+ },
104
+ selectedDataBackground: {
105
+ lineStyle: {
106
+ color: t.primary,
107
+ width: 1
108
+ },
109
+ areaStyle: { color: t.alpha(t.primary, .15) }
110
+ },
111
+ handleStyle: {
112
+ color: t.surface,
113
+ borderColor: t.borderDark
114
+ },
115
+ moveHandleStyle: { color: t.borderDark },
116
+ emphasis: {
117
+ handleStyle: { borderColor: t.primary },
118
+ moveHandleStyle: { color: t.primary }
119
+ },
120
+ textStyle: {
121
+ color: t.muted,
122
+ fontSize: 11,
123
+ fontFamily: t.font
124
+ },
125
+ labelFormatter: (e) => r.xTickFormat(e),
126
+ brushSelect: !1
127
+ }] }
128
+ };
129
+ }
130
+ function o(e, t, r, i = !1) {
131
+ let a = e.convertFromPixel({ gridIndex: 0 }, t)?.[+!!i];
132
+ if (a === void 0 || !Number.isFinite(a)) return null;
133
+ let o = r.xNumbers.value.length;
134
+ return o ? r.byPosition.value ? Math.min(o - 1, Math.max(0, Math.round(a))) : n(r.xNumbers.value, a) : null;
135
+ }
136
+ //#endregion
137
+ export { i as animationFor, a as cartesianOption, o as locateRow, r as prepareZoom };