@ac-design/design-system 2.0.0 → 2.1.1

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 +20 -2
  82. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
  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,10 +1,10 @@
1
1
  import e from "./AcButton.js";
2
- import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createVNode as o, defineComponent as s, mergeModels as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, onUpdated as m, openBlock as h, provide as g, ref as _, renderSlot as v, unref as y, useId as b, useModel as ee, useSlots as te, watch as x, withCtx as S } from "vue";
3
- import { ChevronDown as C, EllipsisVertical as w } from "@lucide/vue";
2
+ import { Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createVNode as s, defineComponent as c, mergeModels as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, onUpdated as h, openBlock as g, provide as _, ref as v, renderSlot as y, toRef as ee, unref as b, useId as x, useModel as S, useSlots as te, watch as C, withCtx as w } from "vue";
3
+ import { ChevronDown as T, Ellipsis as E } from "@lucide/vue";
4
4
  //#region src/lib/components/AcDropdown.vue?vue&type=script&setup=true&lang.ts
5
- var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "[role=\"menuitem\"]:not([aria-disabled=\"true\"])", O = /*@__PURE__*/ s({
5
+ var ne = ["aria-label", "disabled"], re = ["aria-labelledby", "aria-label"], D = "[role=\"menuitem\"]:not([aria-disabled=\"true\"])", O = /*@__PURE__*/ c({
6
6
  __name: "AcDropdown",
7
- props: /*@__PURE__*/ c({
7
+ props: /*@__PURE__*/ l({
8
8
  label: { default: "" },
9
9
  menuLabel: { default: "Actions" },
10
10
  align: { default: "start" },
@@ -12,7 +12,8 @@ var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "
12
12
  disabled: {
13
13
  type: Boolean,
14
14
  default: !1
15
- }
15
+ },
16
+ variant: { default: "menu" }
16
17
  }, {
17
18
  open: {
18
19
  type: Boolean,
@@ -21,131 +22,143 @@ var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "
21
22
  openModifiers: {}
22
23
  }),
23
24
  emits: ["update:open"],
24
- setup(s) {
25
- let c = s, O = ee(s, "open"), k = te(), A = b(), j = `${A}-menu`, M = _(null), N = _(null), P = _({}), F = _(!1), I = _(""), L = null, R = "menu", z = "", B;
26
- function V() {
27
- L = M.value?.querySelector("button, a[href], [tabindex]") ?? null, L && (L.id || (L.id = `${A}-trigger`), I.value = L.id, L.setAttribute("aria-haspopup", "menu"), L.setAttribute("aria-expanded", String(O.value)), O.value ? L.setAttribute("aria-controls", j) : L.removeAttribute("aria-controls"));
25
+ setup(c) {
26
+ let l = c, O = S(c, "open"), k = te(), A = {
27
+ menu: 240,
28
+ panel: 320
29
+ }, j = {
30
+ "top-start": "origin-top-left",
31
+ "top-end": "origin-top-right",
32
+ "bottom-start": "origin-bottom-left",
33
+ "bottom-end": "origin-bottom-right"
34
+ }, M = {
35
+ menu: "rounded-10 border-border py-1",
36
+ panel: "rounded-14 border-border/80 p-2"
37
+ }, N = x(), P = `${N}-menu`, F = v(null), I = v(null), L = v({}), R = v(!1), z = v(""), B = null, V = "menu", H = "", U, W = r(() => j[`${R.value ? "top" : "bottom"}-${l.align}`]);
38
+ function G() {
39
+ B = F.value?.querySelector("button, a[href], [tabindex]") ?? null, B && (B.id || (B.id = `${N}-trigger`), z.value = B.id, B.setAttribute("aria-haspopup", "menu"), B.setAttribute("aria-expanded", String(O.value)), O.value ? B.setAttribute("aria-controls", P) : B.removeAttribute("aria-controls"));
28
40
  }
29
- function H() {
30
- return [...N.value?.querySelectorAll(D) ?? []];
41
+ function K() {
42
+ return [...I.value?.querySelectorAll(D) ?? []];
31
43
  }
32
- function U(e) {
33
- let t = H();
34
- if (!t.length) return N.value?.focus();
44
+ function q(e) {
45
+ let t = K();
46
+ if (!t.length) return I.value?.focus();
35
47
  t[e === "first" ? 0 : e === "last" ? t.length - 1 : (e + t.length) % t.length]?.focus();
36
48
  }
37
- function W(e) {
38
- c.disabled || (R = e, O.value = !0);
49
+ function J(e) {
50
+ l.disabled || (V = e, O.value = !0);
39
51
  }
40
- function G(e = !0) {
41
- O.value && (O.value = !1, e && L?.focus());
52
+ function Y(e = !0) {
53
+ O.value && (O.value = !1, e && B?.focus());
42
54
  }
43
- function K() {
44
- if (!L || !N.value) return;
45
- let e = L.getBoundingClientRect(), t = `${Math.min(Math.max(e.width, 192), window.innerWidth - 16)}px`;
46
- N.value.style.minWidth = t;
47
- let { offsetWidth: n, offsetHeight: r } = N.value, i = window.innerHeight - e.bottom - 8 - 8, a = e.top - 8 - 8, o = c.placement === "top" ? a >= r || a > i : i < r && a > i, s = c.align === "end" ? e.right - n : e.left;
48
- F.value = !o, P.value = {
55
+ function X() {
56
+ if (!B || !I.value) return;
57
+ let e = B.getBoundingClientRect(), t = `${Math.min(Math.max(e.width, A[l.variant]), window.innerWidth - 16)}px`;
58
+ I.value.style.minWidth = t;
59
+ let { offsetWidth: n, offsetHeight: r } = I.value, i = window.innerHeight - e.bottom - 8 - 8, a = e.top - 8 - 8, o = l.placement === "top" ? a >= r || a > i : i < r && a > i, s = l.align === "end" ? e.right - n : e.left;
60
+ R.value = !o, L.value = {
49
61
  [o ? "bottom" : "top"]: `${o ? window.innerHeight - e.top + 8 : e.bottom + 8}px`,
50
62
  left: `${Math.max(8, Math.min(s, window.innerWidth - n - 8))}px`,
51
63
  minWidth: t,
52
64
  maxHeight: `${Math.max(o ? a : i, 120)}px`
53
65
  };
54
66
  }
55
- function q(e) {
56
- if (L?.contains(e.target)) {
57
- if (O.value) return G();
58
- W(e.detail === 0 ? "first" : "menu");
67
+ function ie(e) {
68
+ if (B?.contains(e.target)) {
69
+ if (O.value) return Y();
70
+ J(e.detail === 0 ? "first" : "menu");
59
71
  }
60
72
  }
61
- function J(e) {
73
+ function ae(e) {
62
74
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
63
- if (e.preventDefault(), O.value) return U(e.key === "ArrowDown" ? "first" : "last");
64
- W(e.key === "ArrowDown" ? "first" : "last");
75
+ if (e.preventDefault(), O.value) return q(e.key === "ArrowDown" ? "first" : "last");
76
+ J(e.key === "ArrowDown" ? "first" : "last");
65
77
  }
66
78
  }
67
- function Y(e) {
68
- let t = H(), n = t.indexOf(document.activeElement);
79
+ function oe(e) {
80
+ let t = K(), n = t.indexOf(document.activeElement);
69
81
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
70
82
  e.preventDefault();
71
83
  let t = e.key === "ArrowDown" ? 1 : -1;
72
- U(n < 0 ? t > 0 ? "first" : "last" : n + t);
73
- } else e.key === "Home" || e.key === "End" ? (e.preventDefault(), U(e.key === "Home" ? "first" : "last")) : e.key === "Escape" ? (e.preventDefault(), G()) : e.key === "Tab" ? G() : e.key === " " && n >= 0 && t[n].tagName !== "BUTTON" ? (e.preventDefault(), t[n].click()) : e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && e.key !== " " && X(e.key, t, n);
84
+ q(n < 0 ? t > 0 ? "first" : "last" : n + t);
85
+ } else e.key === "Home" || e.key === "End" ? (e.preventDefault(), q(e.key === "Home" ? "first" : "last")) : e.key === "Escape" ? (e.preventDefault(), Y()) : e.key === "Tab" ? Y() : e.key === " " && n >= 0 && t[n].tagName !== "BUTTON" ? (e.preventDefault(), t[n].click()) : e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && e.key !== " " && se(e.key, t, n);
74
86
  }
75
- function X(e, t, n) {
76
- z += e.toLowerCase(), clearTimeout(B), B = setTimeout(() => z = "", 500);
77
- let r = (e) => (e.dataset.acLabel || e.textContent || "").trim().toLowerCase(), i = z.length === 1 ? n + 1 : Math.max(n, 0);
78
- [...t.slice(i), ...t.slice(0, i)].find((e) => r(e).startsWith(z))?.focus();
87
+ function se(e, t, n) {
88
+ H += e.toLowerCase(), clearTimeout(U), U = setTimeout(() => H = "", 500);
89
+ let r = (e) => (e.dataset.acLabel || e.textContent || "").trim().toLowerCase(), i = H.length === 1 ? n + 1 : Math.max(n, 0);
90
+ [...t.slice(i), ...t.slice(0, i)].find((e) => r(e).startsWith(H))?.focus();
79
91
  }
80
92
  function Z(e) {
81
93
  let t = e.target;
82
- M.value?.contains(t) || N.value?.contains(t) || G(!1);
94
+ F.value?.contains(t) || I.value?.contains(t) || Y(!1);
83
95
  }
84
96
  function Q(e) {
85
- e?.target instanceof Node && N.value?.contains(e.target) || K();
97
+ e?.target instanceof Node && I.value?.contains(e.target) || X();
86
98
  }
87
99
  function $(e) {
88
100
  e ? (document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q)) : (document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q));
89
101
  }
90
- return g("ac-dropdown", {
91
- close: G,
92
- focusMenu: () => N.value?.focus()
93
- }), x(O, async (e) => {
94
- V(), $(e), e && (await l(), K(), R === "menu" ? N.value?.focus() : U(R), R = "menu");
95
- }), p(V), m(V), f(() => {
96
- $(!1), clearTimeout(B);
97
- }), (c, l) => (h(), a("div", {
102
+ return _("ac-dropdown", {
103
+ close: Y,
104
+ focusMenu: () => I.value?.focus(),
105
+ variant: ee(l, "variant")
106
+ }), C(O, async (e) => {
107
+ G(), $(e), e && (await u(), X(), V === "menu" ? I.value?.focus() : q(V), V = "menu");
108
+ }), m(G), h(G), p(() => {
109
+ $(!1), clearTimeout(U);
110
+ }), (r, l) => (g(), o("div", {
98
111
  ref_key: "root",
99
- ref: M,
112
+ ref: F,
100
113
  class: "inline-flex",
101
114
  "data-ac-ds": "",
102
115
  "data-testid": "ac-dropdown",
103
- onClick: q,
104
- onKeydown: J
105
- }, [k.trigger ? v(c.$slots, "trigger", { open: O.value }, void 0, void 0, 0) : s.label ? (h(), r(e, {
116
+ onClick: ie,
117
+ onKeydown: ae
118
+ }, [k.trigger ? y(r.$slots, "trigger", { open: O.value }, void 0, void 0, 0) : c.label ? (g(), i(e, {
106
119
  key: 1,
107
- title: s.label,
120
+ title: c.label,
108
121
  color: "white",
109
- disabled: s.disabled
122
+ disabled: c.disabled
110
123
  }, {
111
- default: S(() => [o(y(C), {
112
- class: u(["-mr-1 text-muted transition-transform duration-200", O.value && "rotate-180"]),
124
+ default: w(() => [s(b(T), {
125
+ class: d(["-mr-1 text-muted transition-transform duration-200", O.value && "rotate-180"]),
113
126
  "aria-hidden": "true"
114
127
  }, null, 8, ["class"])]),
115
128
  _: 1
116
- }, 8, ["title", "disabled"])) : (h(), a("button", {
129
+ }, 8, ["title", "disabled"])) : (g(), o("button", {
117
130
  key: 2,
118
131
  type: "button",
119
- "aria-label": s.menuLabel,
120
- disabled: s.disabled,
121
- class: u(["inline-flex size-8 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 disabled:cursor-not-allowed disabled:opacity-50", O.value && "bg-surface-sunken text-heading"])
122
- }, [o(y(w), {
132
+ "aria-label": c.menuLabel,
133
+ disabled: c.disabled,
134
+ class: d(["inline-flex size-7 cursor-pointer items-center justify-center rounded-8 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 disabled:cursor-not-allowed disabled:opacity-50", O.value && "bg-surface-sunken text-heading"])
135
+ }, [s(b(E), {
123
136
  class: "size-4",
124
137
  "aria-hidden": "true"
125
- })], 10, T)), (h(), r(t, { to: "body" }, [o(n, {
126
- "enter-active-class": "transition-[opacity,scale,translate] duration-150 ease-out motion-reduce:transition-none",
127
- "enter-from-class": `opacity-0 motion-safe:scale-95 ${F.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
138
+ })], 10, ne)), (g(), i(t, { to: "body" }, [s(n, {
139
+ "enter-active-class": "transition-[opacity,scale] duration-150 ease-out motion-reduce:transition-none",
140
+ "enter-from-class": "opacity-0 motion-safe:scale-95",
128
141
  "leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
129
142
  "leave-to-class": "opacity-0 motion-safe:scale-95"
130
143
  }, {
131
- default: S(() => [O.value ? (h(), a("div", {
144
+ default: w(() => [O.value ? (g(), o("div", {
132
145
  key: 0,
133
- id: j,
146
+ id: P,
134
147
  ref_key: "panel",
135
- ref: N,
148
+ ref: I,
136
149
  role: "menu",
137
150
  tabindex: "-1",
138
151
  "aria-orientation": "vertical",
139
- "aria-labelledby": (k.trigger || s.label) && I.value ? I.value : void 0,
140
- "aria-label": k.trigger || s.label ? void 0 : s.menuLabel,
141
- class: u(["ac-scrollbar fixed z-[90] flex w-max max-w-[min(320px,calc(100vw-16px))] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg outline-none", F.value ? "origin-top" : "origin-bottom"]),
142
- style: d(P.value),
152
+ "aria-labelledby": (k.trigger || c.label) && z.value ? z.value : void 0,
153
+ "aria-label": k.trigger || c.label ? void 0 : c.menuLabel,
154
+ class: d(["ac-scrollbar fixed z-[90] flex w-max max-w-[min(320px,calc(100vw-16px))] flex-col border bg-surface shadow-lg outline-none", [M[c.variant], W.value]]),
155
+ style: f(L.value),
143
156
  "data-ac-ds": "",
144
157
  "data-testid": "ac-dropdown-menu",
145
- onKeydown: Y
146
- }, [v(c.$slots, "default")], 46, E)) : i("", !0)]),
158
+ onKeydown: oe
159
+ }, [y(r.$slots, "default")], 46, re)) : a("", !0)]),
147
160
  _: 3
148
- }, 8, ["enter-from-class"])]))], 544));
161
+ })]))], 544));
149
162
  }
150
163
  });
151
164
  //#endregion
@@ -1,20 +1,21 @@
1
- import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, defineComponent as r, openBlock as i, toDisplayString as a } from "vue";
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, inject as a, normalizeClass as o, openBlock as s, toDisplayString as c } from "vue";
2
2
  //#region src/lib/components/AcDropdownDivider.vue?vue&type=script&setup=true&lang.ts
3
- var o = ["aria-label"], s = {
4
- key: 0,
5
- class: "px-3 pt-2 pb-1 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
6
- }, c = /*@__PURE__*/ r({
3
+ var l = ["aria-label"], u = /*@__PURE__*/ i({
7
4
  __name: "AcDropdownDivider",
8
5
  props: { label: { default: "" } },
9
- setup(r) {
10
- return (c, l) => (i(), t("div", {
6
+ setup(i) {
7
+ let u = a("ac-dropdown", null), d = e(() => (u?.variant?.value ?? "menu") === "menu");
8
+ return (e, a) => (s(), n("div", {
11
9
  role: "separator",
12
- "aria-label": r.label || void 0,
10
+ "aria-label": i.label || void 0,
13
11
  class: "group",
14
12
  "data-ac-ds": "",
15
13
  "data-testid": "ac-dropdown-divider"
16
- }, [l[0] ||= n("div", { class: "-mx-2 my-1 h-px bg-border group-first:hidden" }, null, -1), r.label ? (i(), t("div", s, a(r.label), 1)) : e("", !0)], 8, o));
14
+ }, [r("div", { class: o(["my-1 h-px bg-border group-first:hidden", !d.value && "-mx-2"]) }, null, 2), i.label ? (s(), n("div", {
15
+ key: 0,
16
+ class: o(["pt-2 pb-1 text-sm font-semibold tracking-[0.08em] text-muted uppercase", d.value ? "px-4" : "px-3"])
17
+ }, c(i.label), 3)) : t("", !0)], 8, l));
17
18
  }
18
19
  });
19
20
  //#endregion
20
- export { c as default };
21
+ export { u as default };
@@ -22,7 +22,7 @@ export interface Props {
22
22
  type __VLS_Slots = {
23
23
  /** Item content, after the icon and `label`. */
24
24
  default?: () => unknown;
25
- /** A 16px icon before the label. */
25
+ /** An icon before the label: 16px in a `menu`, 20px in a `panel` dropdown. */
26
26
  icon?: () => unknown;
27
27
  };
28
28
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,12 +1,9 @@
1
1
  import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, inject as s, normalizeClass as c, openBlock as l, renderSlot as u, resolveComponent as d, resolveDynamicComponent as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
2
2
  //#region src/lib/components/AcDropdownItem.vue?vue&type=script&setup=true&lang.ts
3
- var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
3
+ var g = { class: "min-w-0 flex-1" }, _ = {
4
4
  key: 0,
5
5
  class: "mt-0.5 block text-xs text-muted"
6
- }, y = {
7
- key: 1,
8
- class: "mt-0.5 shrink-0 font-sans text-xs text-muted tabular-nums"
9
- }, b = /*@__PURE__*/ o({
6
+ }, v = /*@__PURE__*/ o({
10
7
  __name: "AcDropdownItem",
11
8
  props: {
12
9
  label: { default: "" },
@@ -26,22 +23,22 @@ var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
26
23
  to: { default: void 0 }
27
24
  },
28
25
  emits: ["click"],
29
- setup(o, { emit: b }) {
30
- let x = o, S = b, C = s("ac-dropdown", null), w = x.to ? d("RouterLink") : null, T = e(() => x.disabled ? "button" : x.to && w ? w : x.href ? "a" : "button");
26
+ setup(o, { emit: v }) {
27
+ let y = o, b = v, x = s("ac-dropdown", null), S = y.to ? d("RouterLink") : null, C = e(() => x?.variant?.value === "panel"), w = e(() => y.danger ? "text-danger-strong focus:bg-danger/10" : C.value ? "text-heading focus:bg-primary/10" : "text-heading focus:bg-surface-sunken"), T = e(() => y.disabled ? "button" : y.to && S ? S : y.href ? "a" : "button");
31
28
  function E(e) {
32
- if (x.disabled) {
29
+ if (y.disabled) {
33
30
  e.preventDefault();
34
31
  return;
35
32
  }
36
- S("click", e), C?.close();
33
+ b("click", e), x?.close();
37
34
  }
38
35
  function D(e) {
39
- if (x.disabled || e.pointerType === "touch") return;
36
+ if (y.disabled || e.pointerType === "touch") return;
40
37
  let t = e.currentTarget;
41
38
  document.activeElement !== t && t.focus({ preventScroll: !0 });
42
39
  }
43
40
  function O(e) {
44
- e.pointerType !== "touch" && document.activeElement === e.currentTarget && C?.focusMenu();
41
+ e.pointerType !== "touch" && document.activeElement === e.currentTarget && x?.focusMenu();
45
42
  }
46
43
  return (e, s) => (l(), t(f(T.value), {
47
44
  role: "menuitem",
@@ -49,11 +46,11 @@ var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
49
46
  type: T.value === "button" ? "button" : void 0,
50
47
  href: T.value === "a" ? o.href : void 0,
51
48
  target: T.value === "a" ? o.target : void 0,
52
- to: T.value === m(w) ? o.to : void 0,
49
+ to: T.value === m(S) ? o.to : void 0,
53
50
  disabled: T.value === "button" && o.disabled || void 0,
54
51
  "aria-disabled": o.disabled || void 0,
55
52
  "data-ac-label": o.label || void 0,
56
- class: c(["flex w-full cursor-pointer items-start gap-2.5 rounded-8 px-3 py-2 text-left text-base no-underline outline-none select-none transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", o.danger ? "text-danger-strong focus:bg-danger/10" : "text-heading focus:bg-accent"]),
53
+ class: c(["flex w-full shrink-0 cursor-pointer gap-2 text-left text-base no-underline outline-none select-none transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", [C.value ? "items-center rounded-10 px-5 py-2.5" : "items-start px-4 py-2", w.value]]),
57
54
  "data-ac-ds": "",
58
55
  "data-testid": "ac-dropdown-item",
59
56
  onClick: E,
@@ -63,11 +60,14 @@ var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
63
60
  default: h(() => [
64
61
  o.icon || e.$slots.icon ? (l(), r("span", {
65
62
  key: 0,
66
- class: c(["mt-0.5 inline-flex shrink-0 [&_svg]:size-4", o.danger ? "text-current" : "text-muted"]),
63
+ class: c(["inline-flex shrink-0", C.value ? ["[&_svg]:size-5", o.danger ? "text-current" : "text-muted"] : "mt-0.5 [&_svg]:size-4"]),
67
64
  "aria-hidden": "true"
68
65
  }, [u(e.$slots, "icon", {}, () => [(l(), t(f(o.icon)))])], 2)) : n("", !0),
69
- i("span", g, [i("span", _, [a(p(o.label), 1), u(e.$slots, "default")]), o.description ? (l(), r("span", v, p(o.description), 1)) : n("", !0)]),
70
- o.shortcut ? (l(), r("kbd", y, p(o.shortcut), 1)) : n("", !0)
66
+ i("span", g, [i("span", { class: c(["block truncate", C.value && "font-medium"]) }, [a(p(o.label), 1), u(e.$slots, "default")], 2), o.description ? (l(), r("span", _, p(o.description), 1)) : n("", !0)]),
67
+ o.shortcut ? (l(), r("kbd", {
68
+ key: 1,
69
+ class: c(["shrink-0 font-sans text-xs text-muted tabular-nums", !C.value && "mt-0.5"])
70
+ }, p(o.shortcut), 3)) : n("", !0)
71
71
  ]),
72
72
  _: 3
73
73
  }, 40, [
@@ -83,4 +83,4 @@ var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
83
83
  }
84
84
  });
85
85
  //#endregion
86
- export { b as default };
86
+ export { v as default };
@@ -32,8 +32,8 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
32
32
  description: string;
33
33
  icon: Component;
34
34
  size: "small" | "normal" | "large";
35
- query: string;
36
35
  framed: boolean;
36
+ query: string;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
39
  declare const _default: typeof __VLS_export;
@@ -0,0 +1,5 @@
1
+ import e from "./AcErrorState.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcErrorState.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,46 @@
1
+ export interface Props {
2
+ /** What failed, in a short sentence: "Couldn't load databases". */
3
+ title?: string;
4
+ /** The failed request's error. A string, or the `message` of an `Error`, is shown under the title; other values are ignored. */
5
+ error?: unknown;
6
+ /** A message to show instead of the one taken from `error`. */
7
+ description?: string;
8
+ /** Shows a spinner on the retry button while the request runs again. */
9
+ retrying?: boolean;
10
+ /** Less padding, for a card or table body: 32px instead of 56px above and below. */
11
+ compact?: boolean;
12
+ /** Text of the retry button. */
13
+ retryText?: string;
14
+ /** Hides the retry button, e.g. for a 403 that retrying won't fix. */
15
+ hideRetry?: boolean;
16
+ /** Heading tag of the title, so it fits the page outline. */
17
+ titleTag?: "h2" | "h3" | "h4" | "p";
18
+ }
19
+ type __VLS_Slots = {
20
+ /** Extra content under the message, e.g. a request ID or a support link. */
21
+ default?: () => unknown;
22
+ /** Buttons next to the retry button, e.g. "Go to dashboard". */
23
+ actions?: () => unknown;
24
+ };
25
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ retry: () => any;
27
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
28
+ onRetry?: (() => any) | undefined;
29
+ }>, {
30
+ title: string;
31
+ description: string;
32
+ error: undefined;
33
+ compact: boolean;
34
+ retrying: boolean;
35
+ retryText: string;
36
+ hideRetry: boolean;
37
+ titleTag: "h2" | "h3" | "h4" | "p";
38
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
40
+ declare const _default: typeof __VLS_export;
41
+ export default _default;
42
+ type __VLS_WithSlots<T, S> = T & {
43
+ new (): {
44
+ $slots: S;
45
+ };
46
+ };
@@ -0,0 +1,66 @@
1
+ import e from "./AcButton.js";
2
+ import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
3
+ import { CircleAlert as g, RotateCw as _ } from "@lucide/vue";
4
+ //#region src/lib/components/AcErrorState.vue?vue&type=script&setup=true&lang.ts
5
+ var v = {
6
+ class: "mb-4 inline-flex size-12 items-center justify-center rounded-16 bg-danger/10 text-danger-strong",
7
+ "aria-hidden": "true"
8
+ }, y = {
9
+ key: 0,
10
+ class: "mt-1.5 max-w-md text-base break-words text-muted"
11
+ }, b = {
12
+ key: 1,
13
+ class: "mt-5 flex flex-wrap items-center justify-center gap-3"
14
+ }, x = /*@__PURE__*/ c({
15
+ __name: "AcErrorState",
16
+ props: {
17
+ title: { default: "Something went wrong" },
18
+ error: { default: void 0 },
19
+ description: { default: "" },
20
+ retrying: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ compact: {
25
+ type: Boolean,
26
+ default: !1
27
+ },
28
+ retryText: { default: "Try again" },
29
+ hideRetry: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ titleTag: { default: "h2" }
34
+ },
35
+ emits: ["retry"],
36
+ setup(c, { emit: x }) {
37
+ let S = c, C = x, w = t(() => S.description ? S.description : typeof S.error == "string" ? S.error : S.error instanceof Error ? S.error.message : "");
38
+ return (t, x) => (u(), i("div", {
39
+ role: "alert",
40
+ class: l(["flex flex-col items-center justify-center rounded-16 border border-danger/25 bg-danger/5 px-6 text-center", c.compact ? "py-8" : "py-14"]),
41
+ "data-ac-ds": "",
42
+ "data-testid": "ac-error-state"
43
+ }, [
44
+ a("div", v, [s(m(g), { class: "size-6" })]),
45
+ (u(), n(f(c.titleTag), { class: "font-heading text-lg font-semibold text-heading" }, {
46
+ default: h(() => [o(p(c.title), 1)]),
47
+ _: 1
48
+ })),
49
+ w.value ? (u(), i("p", y, p(w.value), 1)) : r("", !0),
50
+ d(t.$slots, "default"),
51
+ !c.hideRetry || t.$slots.actions ? (u(), i("div", b, [c.hideRetry ? r("", !0) : (u(), n(e, {
52
+ key: 0,
53
+ color: "white",
54
+ loading: c.retrying,
55
+ "data-testid": "ac-error-state-retry",
56
+ onClick: x[0] ||= (e) => C("retry")
57
+ }, {
58
+ icon: h(() => [s(m(_))]),
59
+ default: h(() => [o(" " + p(c.retryText), 1)]),
60
+ _: 1
61
+ }, 8, ["loading"])), d(t.$slots, "actions")])) : r("", !0)
62
+ ], 2));
63
+ }
64
+ });
65
+ //#endregion
66
+ export { x as default };
@@ -3,8 +3,12 @@ import type { Tone } from "./types";
3
3
  export interface Props {
4
4
  /** Name of the feature, product or option. Also the card's accessible name. */
5
5
  title: string;
6
+ /** A short muted line under the title, e.g. "NoSQL database". With an icon, the description then runs the full width of the card below them. */
7
+ subtitle?: string;
6
8
  /** One or two sentences on what it does. Clamped to three lines. Old `card-sub-title` slot. */
7
9
  description?: string;
10
+ /** Lights the border and lifts a soft shadow on hover, as cloud-ui's engine and "Learn more" cards do, for a card that holds its own links but isn't a link itself. */
11
+ hoverable?: boolean;
8
12
  /** A Lucide icon, shown in a tinted tile. Or use the `icon` slot. */
9
13
  icon?: Component;
10
14
  /** Logo image URL, e.g. a product or cloud-provider logo. Takes the place of `icon`. */
@@ -67,6 +71,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
67
71
  href: string;
68
72
  to: string | Record<string, unknown>;
69
73
  status: string;
74
+ subtitle: string;
75
+ hoverable: boolean;
70
76
  logo: string;
71
77
  logoAlt: string;
72
78
  statusColor: Tone | "default";