@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,16 +1,23 @@
1
1
  import e from "../charts/ChartFrame.js";
2
- import { CURVES as t, chartDuration as n } from "../charts/shared.js";
3
- import { useXYChart as r } from "../charts/xy.js";
4
- import { computed as i, createBlock as a, createCommentVNode as o, createSlots as s, createVNode as c, defineComponent as l, guardReactiveProps as u, isRef as d, normalizeProps as f, openBlock as p, ref as m, renderSlot as h, unref as g, withCtx as _ } from "vue";
5
- import { ChartLine as v } from "@lucide/vue";
6
- import { VisAxis as y, VisCrosshair as b, VisLine as x, VisXYContainer as S } from "@unovis/vue";
7
- import { Scale as C } from "@unovis/ts";
2
+ import { bindAxisHover as t, useEChart as n } from "../charts/echarts.js";
3
+ import { readNumber as r } from "../charts/shared.js";
4
+ import { LARGE_DATA as i, useXYChart as a } from "../charts/xy.js";
5
+ import { cartesianOption as o, locateRow as s, prepareZoom as c } from "../charts/cartesian.js";
6
+ import { createBlock as l, createElementVNode as u, createSlots as d, defineComponent as f, guardReactiveProps as p, isRef as m, normalizeProps as h, openBlock as g, ref as _, renderSlot as v, unref as y, withCtx as b } from "vue";
7
+ import { ChartLine as x } from "@lucide/vue";
8
+ import { use as S } from "echarts/core";
9
+ import { LineChart as C } from "echarts/charts";
10
+ import { AxisPointerComponent as w, GridComponent as T } from "echarts/components";
8
11
  //#region src/lib/components/AcLineChart.vue?vue&type=script&setup=true&lang.ts
9
- var w = /*@__PURE__*/ l({
12
+ var E = /*@__PURE__*/ f({
10
13
  __name: "AcLineChart",
11
14
  props: {
12
15
  curve: { default: "monotone" },
13
16
  lineWidth: { default: 2 },
17
+ points: {
18
+ type: [Boolean, String],
19
+ default: "auto"
20
+ },
14
21
  data: {},
15
22
  index: {},
16
23
  categories: {},
@@ -41,128 +48,109 @@ var w = /*@__PURE__*/ l({
41
48
  },
42
49
  emptyText: { default: "No data to show yet" },
43
50
  title: { default: "" },
44
- description: { default: "" }
51
+ description: { default: "" },
52
+ zoom: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ renderer: { default: "canvas" },
57
+ animation: {
58
+ type: Boolean,
59
+ default: !0
60
+ }
45
61
  },
46
- setup(l) {
47
- let w = l, T = n(), { hidden: E, width: D, colors: O, legendItems: k, xKind: A, byPosition: j, x: M, yAccessors: N, xTickValues: P, maxXTicks: F, yTicks: I, xTickFormat: L, formatY: R, rowLabel: z, yDomain: B, tooltipItems: V, table: H, ariaLabel: U } = r(w, { stacked: () => !1 }), W = m(null), G = i(() => A.value === "time" && !j.value ? C.scaleTime() : void 0);
48
- function K(e, t, n, r) {
49
- if (!t || n === void 0 || !r || r.type === "wheel") {
50
- W.value = null;
51
- return;
52
- }
53
- W.value = {
54
- clientX: r.clientX,
55
- clientY: r.clientY,
56
- title: z(n),
57
- items: V(t),
58
- datum: t,
59
- index: n
60
- };
62
+ setup(f) {
63
+ S([
64
+ C,
65
+ T,
66
+ w
67
+ ]);
68
+ let E = f, D = a(E, { stacked: () => !1 }), { hidden: O, width: k, legendItems: A, rowLabel: j, tooltipItems: M, table: N, ariaLabel: P } = D, F = _(), I = _(null);
69
+ function L(e) {
70
+ let t = E.data.length > i, n = E.points === "auto" ? E.data.length <= 60 : E.points;
71
+ return D.visibleKeys.value.map((i) => {
72
+ let a = e.color(D.colorOf.value[i]), o = E.data.map((e) => r(e, i));
73
+ return {
74
+ id: i,
75
+ type: "line",
76
+ name: E.categories[i]?.name ?? i,
77
+ data: D.byPosition.value ? o : o.map((e, t) => [D.xNumbers.value[t], e]),
78
+ smooth: E.curve === "monotone" && .4,
79
+ smoothMonotone: E.curve === "monotone" ? "x" : void 0,
80
+ step: E.curve === "step" && "middle",
81
+ showSymbol: n && !t,
82
+ symbol: "circle",
83
+ symbolSize: 6,
84
+ lineStyle: {
85
+ width: E.lineWidth,
86
+ color: a
87
+ },
88
+ itemStyle: {
89
+ color: a,
90
+ borderColor: e.surface,
91
+ borderWidth: 2
92
+ },
93
+ emphasis: {
94
+ scale: 1.4,
95
+ lineStyle: { width: E.lineWidth }
96
+ },
97
+ sampling: t ? "lttb" : void 0,
98
+ progressive: t ? 4e3 : 0,
99
+ connectNulls: !1
100
+ };
101
+ });
61
102
  }
62
- return (n, r) => (p(), a(e, {
63
- hidden: g(E),
64
- "onUpdate:hidden": r[0] ||= (e) => d(E) ? E.value = e : null,
65
- width: g(D),
66
- "onUpdate:width": r[1] ||= (e) => d(D) ? D.value = e : null,
103
+ return n({
104
+ host: F,
105
+ renderer: () => E.renderer,
106
+ prepare: () => c(E),
107
+ option: (e) => ({
108
+ ...o(e, E, D, {
109
+ boundaryGap: !1,
110
+ pointer: "line"
111
+ }),
112
+ series: L(e)
113
+ }),
114
+ setup: (e) => t(e, (t) => s(e, t, D), (e, t, n) => {
115
+ let r = E.data[e];
116
+ r && E.tooltip && (I.value = {
117
+ clientX: t,
118
+ clientY: n,
119
+ title: j(e),
120
+ items: M(r),
121
+ datum: r,
122
+ index: e
123
+ });
124
+ }, () => I.value = null)
125
+ }), (t, n) => (g(), l(e, {
126
+ hidden: y(O),
127
+ "onUpdate:hidden": n[0] ||= (e) => m(O) ? O.value = e : null,
128
+ width: y(k),
129
+ "onUpdate:width": n[1] ||= (e) => m(k) ? k.value = e : null,
67
130
  testid: "ac-line-chart",
68
- height: l.height,
69
- loading: l.loading,
70
- empty: !l.data.length,
71
- "empty-text": l.emptyText,
72
- "empty-icon": g(v),
73
- legend: l.legend,
74
- "legend-items": g(k),
75
- summary: g(U),
76
- title: l.title,
77
- description: l.description,
78
- table: g(H),
79
- tip: W.value,
80
- tooltip: l.tooltip
81
- }, s({
82
- default: _(() => [c(g(S), {
83
- data: l.data,
84
- height: l.height,
85
- duration: g(T),
86
- "x-scale": G.value,
87
- "y-domain": g(B),
88
- padding: {
89
- top: 8,
90
- right: 8
91
- }
92
- }, {
93
- default: _(() => [
94
- c(g(x), {
95
- x: g(M),
96
- y: g(N),
97
- color: g(O),
98
- "curve-type": g(t)[l.curve],
99
- "line-width": l.lineWidth
100
- }, null, 8, [
101
- "x",
102
- "y",
103
- "color",
104
- "curve-type",
105
- "line-width"
106
- ]),
107
- c(g(y), {
108
- type: "x",
109
- label: l.xLabel || void 0,
110
- "tick-format": g(L),
111
- "tick-values": g(P),
112
- "num-ticks": g(F),
113
- "min-max-ticks-only-when-width-is-less": 160,
114
- "grid-line": !1,
115
- "tick-line": !1,
116
- "tick-text-hide-overlapping": !0
117
- }, null, 8, [
118
- "label",
119
- "tick-format",
120
- "tick-values",
121
- "num-ticks"
122
- ]),
123
- c(g(y), {
124
- type: "y",
125
- label: l.yLabel || void 0,
126
- "tick-format": g(R),
127
- "num-ticks": g(I),
128
- "grid-line": l.gridLines,
129
- "tick-line": !1,
130
- "domain-line": !1
131
- }, null, 8, [
132
- "label",
133
- "tick-format",
134
- "num-ticks",
135
- "grid-line"
136
- ]),
137
- l.tooltip ? (p(), a(g(b), {
138
- key: 0,
139
- x: g(M),
140
- y: g(N),
141
- color: g(O),
142
- circleRadius: 4,
143
- strokeColor: "var(--color-surface)",
144
- strokeWidth: 2,
145
- hideWhenFarFromPointer: !1,
146
- duration: 0,
147
- onCrosshairMove: K
148
- }, null, 8, [
149
- "x",
150
- "y",
151
- "color"
152
- ])) : o("", !0)
153
- ]),
154
- _: 1
155
- }, 8, [
156
- "data",
157
- "height",
158
- "duration",
159
- "x-scale",
160
- "y-domain"
161
- ])]),
131
+ height: f.height,
132
+ loading: f.loading,
133
+ empty: !f.data.length,
134
+ "empty-text": f.emptyText,
135
+ "empty-icon": y(x),
136
+ legend: f.legend,
137
+ "legend-items": y(A),
138
+ summary: y(P),
139
+ title: f.title,
140
+ description: f.description,
141
+ table: y(N),
142
+ tip: I.value,
143
+ tooltip: f.tooltip
144
+ }, d({
145
+ default: b(() => [u("div", {
146
+ ref_key: "host",
147
+ ref: F,
148
+ class: "size-full"
149
+ }, null, 512)]),
162
150
  _: 2
163
- }, [n.$slots.tooltip ? {
151
+ }, [t.$slots.tooltip ? {
164
152
  name: "tooltip",
165
- fn: _((e) => [h(n.$slots, "tooltip", f(u(e)))]),
153
+ fn: b((e) => [v(t.$slots, "tooltip", h(p(e)))]),
166
154
  key: "0"
167
155
  } : void 0]), 1032, [
168
156
  "hidden",
@@ -184,4 +172,4 @@ var w = /*@__PURE__*/ l({
184
172
  }
185
173
  });
186
174
  //#endregion
187
- export { w as default };
175
+ export { E as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcLoader.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcLoader.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,15 @@
1
+ export interface Props {
2
+ /** Ring diameter: `small` 28px, `normal` 40px, `large` 60px, `xlarge` 80px. cloud-ui's `sm`, `md`, `lg` and `xl`. */
3
+ size?: "small" | "normal" | "large" | "xlarge";
4
+ /** Read by screen readers, and shown under the dots with `show-label`. */
5
+ label?: string;
6
+ /** Shows `label` under the dots, e.g. "Loading databases…". */
7
+ showLabel?: boolean;
8
+ }
9
+ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
10
+ label: string;
11
+ size: "small" | "normal" | "large" | "xlarge";
12
+ showLabel: boolean;
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -0,0 +1,66 @@
1
+ import { Fragment as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderList as o, toDisplayString as s } from "vue";
2
+ //#region src/lib/components/AcLoader.vue?vue&type=script&setup=true&lang.ts
3
+ var c = {
4
+ class: "flex size-full flex-col items-center justify-center",
5
+ role: "status",
6
+ "data-ac-ds": "",
7
+ "data-testid": "ac-loader"
8
+ }, l = {
9
+ class: "mt-4 flex justify-center gap-1.5",
10
+ "aria-hidden": "true"
11
+ }, u = {
12
+ key: 0,
13
+ class: "mt-3 text-base text-muted"
14
+ }, d = {
15
+ key: 1,
16
+ class: "sr-only"
17
+ }, f = /*@__PURE__*/ r({
18
+ __name: "AcLoader",
19
+ props: {
20
+ size: { default: "large" },
21
+ label: { default: "Loading" },
22
+ showLabel: {
23
+ type: Boolean,
24
+ default: !1
25
+ }
26
+ },
27
+ setup(r) {
28
+ let f = {
29
+ small: "size-7",
30
+ normal: "size-10",
31
+ large: "size-15",
32
+ xlarge: "size-20"
33
+ }, p = {
34
+ small: "border-2",
35
+ normal: "border-2",
36
+ large: "border-[3px]",
37
+ xlarge: "border-4"
38
+ }, m = {
39
+ small: "size-1",
40
+ normal: "size-1.5",
41
+ large: "size-2",
42
+ xlarge: "size-2.5"
43
+ }, h = [
44
+ "animate-loader-dot-1",
45
+ "animate-loader-dot-2",
46
+ "animate-loader-dot-3"
47
+ ];
48
+ return (g, _) => (a(), t("div", c, [
49
+ n("div", {
50
+ class: i(["relative shrink-0", f[r.size]]),
51
+ "aria-hidden": "true"
52
+ }, [
53
+ _[0] ||= n("div", { class: "absolute inset-0 animate-loader-glow rounded-full bg-primary/20 blur-md motion-reduce:animate-none" }, null, -1),
54
+ n("div", { class: i(["absolute inset-0 rounded-full border-primary/15", p[r.size]]) }, null, 2),
55
+ n("div", { class: i(["absolute inset-0 animate-loader-spin rounded-full border-transparent border-t-primary border-r-primary/50", p[r.size]]) }, null, 2)
56
+ ], 2),
57
+ n("div", l, [(a(), t(e, null, o(h, (e) => n("span", {
58
+ key: e,
59
+ class: i(["rounded-full bg-primary motion-reduce:animate-none", [e, m[r.size]]])
60
+ }, null, 2)), 64))]),
61
+ r.showLabel ? (a(), t("p", u, s(r.label), 1)) : (a(), t("span", d, s(r.label), 1))
62
+ ]));
63
+ }
64
+ });
65
+ //#endregion
66
+ export { f as default };
@@ -5,11 +5,13 @@ export interface LocaleOption {
5
5
  label: string;
6
6
  /** A muted second line, e.g. the name in English: "Bengali". */
7
7
  description?: string;
8
+ /** A flag emoji shown before the name at 20px, as in cloud-ui's language menu. */
9
+ flag?: string;
8
10
  }
9
11
  export interface Props {
10
12
  /** Languages to offer, each named in its own language. With fewer than two, nothing renders. */
11
13
  locales: LocaleOption[];
12
- /** `icon` is a 36px icon button for the navbar; `button` adds the current code (EN) and a chevron. */
14
+ /** `icon` is cloud-ui's bare 20px icon trigger for the navbar; `button` adds the current code (EN) and a chevron. */
13
15
  variant?: "icon" | "button";
14
16
  /** Accessible name of the trigger. The current language is added after it. */
15
17
  ariaLabel?: string;
@@ -1,13 +1,21 @@
1
1
  import e from "./AcDropdown.js";
2
2
  import t from "./AcDropdownItem.js";
3
3
  import { Fragment as n, computed 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, openBlock as f, renderList as p, toDisplayString as m, unref as h, useModel as g, withCtx as _ } from "vue";
4
- import { Check as v, ChevronDown as y, Languages as b } from "@lucide/vue";
4
+ import { ChevronDown as v, Languages as y } from "@lucide/vue";
5
5
  //#region src/lib/components/AcLocaleSwitcher.vue?vue&type=script&setup=true&lang.ts
6
- var x = ["aria-label"], S = ["aria-label"], C = { class: "font-mono text-xs tracking-wide uppercase" }, w = {
6
+ var b = ["aria-label"], x = ["aria-label"], S = { class: "font-mono text-xs tracking-wide uppercase" }, C = {
7
7
  key: 0,
8
- class: "mb-1 border-b border-border px-3 pt-1 pb-2 text-xs font-semibold text-muted",
8
+ class: "mb-2 border-b border-border px-4 py-2 text-xs font-semibold text-muted",
9
9
  "aria-hidden": "true"
10
- }, T = { class: "flex items-center gap-3" }, E = ["lang"], D = /*@__PURE__*/ l({
10
+ }, w = { class: "flex items-center gap-2" }, T = {
11
+ key: 0,
12
+ class: "shrink-0 text-xl leading-none",
13
+ "aria-hidden": "true"
14
+ }, E = ["lang"], D = {
15
+ key: 1,
16
+ class: "size-2 shrink-0 rounded-full bg-primary",
17
+ "aria-hidden": "true"
18
+ }, O = /*@__PURE__*/ l({
11
19
  __name: "AcLocaleSwitcher",
12
20
  props: /*@__PURE__*/ u({
13
21
  locales: {},
@@ -26,22 +34,22 @@ var x = ["aria-label"], S = ["aria-label"], C = { class: "font-mono text-xs trac
26
34
  }),
27
35
  emits: /*@__PURE__*/ u(["change"], ["update:modelValue"]),
28
36
  setup(l, { emit: u }) {
29
- let D = l, O = g(l, "modelValue"), k = u, A = r(() => D.locales.find((e) => e.value === O.value)), j = r(() => A.value ? `${D.ariaLabel} (${A.value.label})` : D.ariaLabel);
30
- function M() {
37
+ let O = l, k = g(l, "modelValue"), A = u, j = r(() => O.locales.find((e) => e.value === k.value)), M = r(() => j.value ? `${O.ariaLabel} (${j.value.label})` : O.ariaLabel);
38
+ function N() {
31
39
  try {
32
- return localStorage.getItem(D.storageKey);
40
+ return localStorage.getItem(O.storageKey);
33
41
  } catch {
34
42
  return null;
35
43
  }
36
44
  }
37
- function N(e) {
38
- if (e !== O.value && (O.value = e, k("change", e), D.persist)) try {
39
- localStorage.setItem(D.storageKey, e);
45
+ function P(e) {
46
+ if (e !== k.value && (k.value = e, A("change", e), O.persist)) try {
47
+ localStorage.setItem(O.storageKey, e);
40
48
  } catch {}
41
49
  }
42
- if (D.persist && typeof window < "u") {
43
- let e = M();
44
- e && e !== O.value && D.locales.some((t) => t.value === e) && N(e);
50
+ if (O.persist && typeof window < "u") {
51
+ let e = N();
52
+ e && e !== k.value && O.locales.some((t) => t.value === e) && P(e);
45
53
  }
46
54
  return (r, u) => l.locales.length > 1 ? (f(), i(e, {
47
55
  key: 0,
@@ -52,42 +60,42 @@ var x = ["aria-label"], S = ["aria-label"], C = { class: "font-mono text-xs trac
52
60
  trigger: _(({ open: e }) => [l.variant === "icon" ? (f(), o("button", {
53
61
  key: 0,
54
62
  type: "button",
55
- "aria-label": j.value,
56
- class: d(["inline-flex size-9 cursor-pointer items-center justify-center rounded-10 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", e && "bg-surface-sunken text-heading"])
57
- }, [c(h(b), {
63
+ "aria-label": M.value,
64
+ class: d(["inline-flex cursor-pointer items-center gap-2 rounded-10 px-2 py-0.5 transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", e ? "text-heading" : "text-muted"])
65
+ }, [c(h(y), {
58
66
  class: "size-5",
59
67
  "aria-hidden": "true"
60
- })], 10, x)) : (f(), o("button", {
68
+ })], 10, b)) : (f(), o("button", {
61
69
  key: 1,
62
70
  type: "button",
63
- "aria-label": j.value,
64
- class: d(["inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-10 border border-border bg-surface px-3 text-base font-medium text-heading transition-colors duration-200 hover:bg-surface-sunken/70 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", e && "bg-surface-sunken/70"])
71
+ "aria-label": M.value,
72
+ class: d(["inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-10 border border-border bg-surface px-3 text-base font-medium text-heading transition-colors duration-200 hover:bg-surface-sunken/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", e && "bg-surface-sunken/50"])
65
73
  }, [
66
- c(h(b), {
74
+ c(h(y), {
67
75
  class: "size-4 text-muted",
68
76
  "aria-hidden": "true"
69
77
  }),
70
- s("span", C, m(A.value?.value ?? ""), 1),
71
- c(h(y), {
78
+ s("span", S, m(j.value?.value ?? ""), 1),
79
+ c(h(v), {
72
80
  class: d(["size-4 text-muted transition-transform duration-200 motion-reduce:transition-none", e && "rotate-180"]),
73
81
  "aria-hidden": "true"
74
82
  }, null, 8, ["class"])
75
- ], 10, S))]),
76
- default: _(() => [l.menuTitle ? (f(), o("p", w, m(l.menuTitle), 1)) : a("", !0), (f(!0), o(n, null, p(l.locales, (e) => (f(), i(t, {
83
+ ], 10, x))]),
84
+ default: _(() => [l.menuTitle ? (f(), o("p", C, m(l.menuTitle), 1)) : a("", !0), (f(!0), o(n, null, p(l.locales, (e) => (f(), i(t, {
77
85
  key: e.value,
78
86
  description: e.description,
79
- "aria-current": e.value === O.value ? "true" : void 0,
80
- class: d(e.value === O.value && "bg-surface-sunken/50 font-medium"),
81
- onClick: (t) => N(e.value)
87
+ "aria-current": e.value === k.value ? "true" : void 0,
88
+ class: d(e.value === k.value && "bg-surface-sunken/50"),
89
+ onClick: (t) => P(e.value)
82
90
  }, {
83
- default: _(() => [s("span", T, [s("span", {
84
- class: "min-w-0 flex-1 truncate",
85
- lang: e.value
86
- }, m(e.label), 9, E), e.value === O.value ? (f(), i(h(v), {
87
- key: 0,
88
- class: "size-4 shrink-0 text-primary",
89
- "aria-hidden": "true"
90
- })) : a("", !0)])]),
91
+ default: _(() => [s("span", w, [
92
+ e.flag ? (f(), o("span", T, m(e.flag), 1)) : a("", !0),
93
+ s("span", {
94
+ class: "min-w-0 flex-1 truncate font-medium text-heading",
95
+ lang: e.value
96
+ }, m(e.label), 9, E),
97
+ e.value === k.value ? (f(), o("span", D)) : a("", !0)
98
+ ])]),
91
99
  _: 2
92
100
  }, 1032, [
93
101
  "description",
@@ -100,4 +108,4 @@ var x = ["aria-label"], S = ["aria-label"], C = { class: "font-mono text-xs trac
100
108
  }
101
109
  });
102
110
  //#endregion
103
- export { D as default };
111
+ export { O as default };
@@ -0,0 +1,5 @@
1
+ import e from "./AcMapChart.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcMapChart.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,136 @@
1
+ import type { ChartRenderer } from "../charts/echarts";
2
+ import type { ChartColor, ChartLegendPosition } from "../charts/shared";
3
+ /** The statuses with a built-in colour and label. Any other string is matched like AcBadge's `status`: `running` is green, `down` red. */
4
+ export type MapPointStatus = "success" | "info" | "warning" | "danger" | "pending" | "neutral";
5
+ /** One location on the map. */
6
+ export interface MapPoint {
7
+ /** Unique key, e.g. the datacenter slug `nyc1`. */
8
+ id: string;
9
+ /** Name in the tooltip, data table and `labels`, e.g. "New York 1". */
10
+ label: string;
11
+ /** Degrees north; negative is south. */
12
+ latitude: number;
13
+ /** Degrees east; negative is west. */
14
+ longitude: number;
15
+ /** Sets the colour and legend group: `success`, `warning`, `danger`, `info`, `pending`, `neutral`, or a raw state such as `RUNNING` or `down`. Defaults to `neutral`. */
16
+ status?: MapPointStatus | (string & {});
17
+ /** A line under the label in the tooltip, e.g. "New York, United States". */
18
+ description?: string;
19
+ /** A number shown in the tooltip and data table, e.g. the cluster count. */
20
+ value?: number;
21
+ /** Colour of this point only. Wins over the status colour. */
22
+ color?: ChartColor;
23
+ /** Other fields, read by your `tooltip` slot. */
24
+ [key: string]: any;
25
+ }
26
+ /** A GeoJSON `FeatureCollection` of the areas to draw, in longitude and latitude, e.g. countries or regions. */
27
+ export interface MapGeoJson {
28
+ type: "FeatureCollection";
29
+ features: {
30
+ type: "Feature";
31
+ geometry: {
32
+ type: string;
33
+ coordinates?: unknown;
34
+ } | null;
35
+ properties?: Record<string, any> | null;
36
+ id?: string | number;
37
+ }[];
38
+ }
39
+ export interface MapChartTooltipSlotProps {
40
+ /** The hovered point. */
41
+ point: MapPoint;
42
+ /** Its status as shown in the legend, e.g. "Healthy". */
43
+ statusLabel: string;
44
+ /** Its colour as CSS, e.g. `var(--color-success)`. */
45
+ color: string;
46
+ /** `value` run through `valueFormatter`; empty when the point has none. */
47
+ formattedValue: string;
48
+ }
49
+ export interface Props {
50
+ /** The locations to plot: `{ id, label, latitude, longitude, status?, description?, value? }`. */
51
+ points: MapPoint[];
52
+ /** Map height in px. The width fills the container; on narrow screens the world view shrinks to keep its shape. */
53
+ height?: number;
54
+ /** Point diameter in px, or a function of the point, e.g. to size by `value`. cloud-ui uses 10px. */
55
+ pointSize?: number | ((point: MapPoint) => number);
56
+ /** Legend names per status, e.g. `{ success: "Live", danger: "Disabled" }`. Defaults: success "Healthy", warning "Degraded", danger "Down", info "Info", pending "Pending", neutral "Unknown"; other states are humanized. */
57
+ statusLabels?: Record<string, string>;
58
+ /** Colour per status, overriding the status colour: `{ maintenance: "chart-4" }`. */
59
+ statusColors?: Record<string, ChartColor>;
60
+ /** Legend of statuses above or below the map, or `none`. Hidden anyway when every point shares one status; clicking an entry hides or shows those points. */
61
+ legend?: ChartLegendPosition;
62
+ /** Shows how many points have each status in the legend. */
63
+ legendValues?: boolean;
64
+ /** Pulses a ring around points to show they're live: `true` for healthy (`success`) points, or a list of statuses, e.g. `["danger"]`. Points stay still when the viewer asks for reduced motion. */
65
+ pulse?: boolean | string[];
66
+ /** Prints each point's `label` under it. Labels that would overlap are hidden. */
67
+ labels?: boolean;
68
+ /** Lets viewers drag to pan and scroll to zoom, and shows zoom buttons. Off by default, so the wheel keeps scrolling the page. */
69
+ zoom?: boolean;
70
+ /** Smallest and largest zoom, as multiples of the whole-world view. */
71
+ zoomExtent?: [number, number];
72
+ /** Starts zoomed to fit the points instead of the whole world. */
73
+ fitToPoints?: boolean;
74
+ /** Your own map in place of the built-in world, e.g. one your API serves. Without it, a 110m Natural Earth world (no Antarctica) loads on first use, about 40 KB gzipped. */
75
+ geoJson?: MapGeoJson;
76
+ /** Name of `value` in the tooltip and data table, e.g. "Clusters". */
77
+ valueLabel?: string;
78
+ /** Formats `value` in the tooltip and data table. Defaults to compact numbers: `1.2K`. */
79
+ valueFormatter?: (value: number) => string;
80
+ /** Plural noun for the points in the screen-reader summary: "World map, 10 datacenters: 8 healthy, 2 down." */
81
+ pointsLabel?: string;
82
+ /** Shows a tooltip with the point's label, description, status and value on hover. Customise it with the `tooltip` slot. */
83
+ tooltip?: boolean;
84
+ /** Shows a skeleton of the same height while data loads. */
85
+ loading?: boolean;
86
+ /** Text shown in place of the map when `points` is empty. */
87
+ emptyText?: string;
88
+ /** Accessible name, e.g. "Datacenters". Show the visible title in the surrounding card. */
89
+ title?: string;
90
+ /** A sentence for screen readers on what the map shows. Defaults to the point count per status. */
91
+ description?: string;
92
+ /** `canvas` (default) or `svg`, which is crisper when printed or zoomed. */
93
+ renderer?: ChartRenderer;
94
+ /** Fades the points in and animates changes. Always off when the viewer asks for reduced motion. */
95
+ animation?: boolean;
96
+ }
97
+ type __VLS_Slots = {
98
+ /** Replaces the tooltip body for the hovered point. */
99
+ tooltip?: (props: MapChartTooltipSlotProps) => unknown;
100
+ };
101
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
102
+ "point-click": (point: MapPoint) => any;
103
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
104
+ "onPoint-click"?: ((point: MapPoint) => any) | undefined;
105
+ }>, {
106
+ legend: ChartLegendPosition;
107
+ title: string;
108
+ description: string;
109
+ height: number;
110
+ loading: boolean;
111
+ animation: boolean;
112
+ pulse: boolean | string[];
113
+ tooltip: boolean;
114
+ emptyText: string;
115
+ labels: boolean;
116
+ valueLabel: string;
117
+ renderer: ChartRenderer;
118
+ zoom: boolean;
119
+ valueFormatter: (value: number) => string;
120
+ legendValues: boolean;
121
+ pointSize: number | ((point: MapPoint) => number);
122
+ statusLabels: Record<string, string>;
123
+ statusColors: Record<string, ChartColor>;
124
+ zoomExtent: [number, number];
125
+ fitToPoints: boolean;
126
+ geoJson: MapGeoJson;
127
+ pointsLabel: string;
128
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
129
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
130
+ declare const _default: typeof __VLS_export;
131
+ export default _default;
132
+ type __VLS_WithSlots<T, S> = T & {
133
+ new (): {
134
+ $slots: S;
135
+ };
136
+ };