@ac-design/design-system 1.0.3 → 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 (235) hide show
  1. package/README.md +27 -18
  2. package/dist/lib/charts/ChartFrame.js +5 -0
  3. package/dist/lib/charts/ChartFrame.vue.d.ts +71 -0
  4. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +173 -0
  5. package/dist/lib/charts/cartesian.d.ts +324 -0
  6. package/dist/lib/charts/cartesian.js +137 -0
  7. package/dist/lib/charts/echarts.d.ts +86 -0
  8. package/dist/lib/charts/echarts.js +173 -0
  9. package/dist/lib/charts/graph.d.ts +77 -0
  10. package/dist/lib/charts/graph.js +155 -0
  11. package/dist/lib/charts/index.d.ts +11 -0
  12. package/dist/lib/charts/index.js +7 -0
  13. package/dist/lib/charts/shared.d.ts +53 -0
  14. package/dist/lib/charts/shared.js +96 -0
  15. package/dist/lib/charts/xy.d.ts +69 -0
  16. package/dist/lib/charts/xy.js +73 -0
  17. package/dist/lib/compat.css +2770 -1061
  18. package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
  19. package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
  20. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
  21. package/dist/lib/components/AcAlert.vue.d.ts +10 -1
  22. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +139 -45
  23. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
  24. package/dist/lib/components/AcAreaChart.js +5 -0
  25. package/dist/lib/components/AcAreaChart.vue.d.ts +47 -0
  26. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +205 -0
  27. package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
  28. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +66 -61
  29. package/dist/lib/components/AcBadge.vue.d.ts +20 -7
  30. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +67 -44
  31. package/dist/lib/components/AcBanner.vue.d.ts +1 -1
  32. package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
  33. package/dist/lib/components/AcBarChart.js +5 -0
  34. package/dist/lib/components/AcBarChart.vue.d.ts +46 -0
  35. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +213 -0
  36. package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
  37. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -34
  38. package/dist/lib/components/AcBulkActionBar.js +5 -0
  39. package/dist/lib/components/AcBulkActionBar.vue.d.ts +45 -0
  40. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
  41. package/dist/lib/components/AcButton.vue.d.ts +13 -7
  42. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +93 -47
  43. package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
  44. package/dist/lib/components/AcCard.vue.d.ts +42 -3
  45. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +175 -14
  46. package/dist/lib/components/AcCellValue.vue.d.ts +6 -3
  47. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +219 -178
  48. package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
  49. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +113 -30
  50. package/dist/lib/components/AcCheckList.js +5 -0
  51. package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
  52. package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
  53. package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
  54. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +102 -26
  55. package/dist/lib/components/AcCircularProgress.js +5 -0
  56. package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
  57. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +114 -0
  58. package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
  59. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
  60. package/dist/lib/components/AcColorInput.js +5 -0
  61. package/dist/lib/components/AcColorInput.vue.d.ts +57 -0
  62. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +217 -0
  63. package/dist/lib/components/AcCommandBlock.js +5 -0
  64. package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
  65. package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
  66. package/dist/lib/components/AcConfirmModal.js +5 -0
  67. package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
  68. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +96 -0
  69. package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
  70. package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
  71. package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
  72. package/dist/lib/components/AcCopyButton.js +5 -0
  73. package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
  74. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
  75. package/dist/lib/components/AcCostSummary.js +5 -0
  76. package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
  77. package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
  78. package/dist/lib/components/AcDatePicker.vue.d.ts +8 -8
  79. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +634 -417
  80. package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
  81. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +57 -60
  82. package/dist/lib/components/AcDonutChart.js +5 -0
  83. package/dist/lib/components/AcDonutChart.vue.d.ts +83 -0
  84. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +237 -0
  85. package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
  86. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +91 -78
  87. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
  88. package/dist/lib/components/AcDropdownItem.vue.d.ts +2 -2
  89. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +18 -18
  90. package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
  91. package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
  92. package/dist/lib/components/AcErrorState.js +5 -0
  93. package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
  94. package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
  95. package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
  96. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +139 -116
  97. package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
  98. package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
  99. package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
  100. package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
  101. package/dist/lib/components/AcFooter.js +5 -0
  102. package/dist/lib/components/AcFooter.vue.d.ts +37 -0
  103. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
  104. package/dist/lib/components/AcForm.vue.d.ts +3 -0
  105. package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
  106. package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
  107. package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
  108. package/dist/lib/components/AcFormFooter.vue.d.ts +3 -3
  109. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
  110. package/dist/lib/components/AcFormSection.vue.d.ts +8 -1
  111. package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
  112. package/dist/lib/components/AcGraphChart.js +5 -0
  113. package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
  114. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
  115. package/dist/lib/components/AcHeader.vue.d.ts +20 -5
  116. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +82 -28
  117. package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
  118. package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
  119. package/dist/lib/components/AcInput.vue.d.ts +4 -4
  120. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +99 -91
  121. package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
  122. package/dist/lib/components/AcKeyValueInput.js +5 -0
  123. package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
  124. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +336 -0
  125. package/dist/lib/components/AcLineChart.js +5 -0
  126. package/dist/lib/components/AcLineChart.vue.d.ts +44 -0
  127. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +175 -0
  128. package/dist/lib/components/AcLoader.js +5 -0
  129. package/dist/lib/components/AcLoader.vue.d.ts +15 -0
  130. package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
  131. package/dist/lib/components/AcLocaleSwitcher.js +5 -0
  132. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +48 -0
  133. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +111 -0
  134. package/dist/lib/components/AcMapChart.js +5 -0
  135. package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
  136. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
  137. package/dist/lib/components/AcModal.vue.d.ts +6 -3
  138. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +88 -64
  139. package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
  140. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +29 -21
  141. package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
  142. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +23 -24
  143. package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
  144. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +139 -174
  145. package/dist/lib/components/AcNumberInput.js +5 -0
  146. package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
  147. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +241 -0
  148. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  149. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
  150. package/dist/lib/components/AcPagination.vue.d.ts +22 -5
  151. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +87 -56
  152. package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
  153. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
  154. package/dist/lib/components/AcProductHero.js +5 -0
  155. package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
  156. package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
  157. package/dist/lib/components/AcProgress.vue.d.ts +19 -4
  158. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +85 -31
  159. package/dist/lib/components/AcResourceCard.vue.d.ts +3 -3
  160. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +17 -17
  161. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  162. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +14 -9
  163. package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
  164. package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
  165. package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
  166. package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
  167. package/dist/lib/components/AcSelect.vue.d.ts +6 -6
  168. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +246 -254
  169. package/dist/lib/components/AcSettingsRow.js +5 -0
  170. package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
  171. package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
  172. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +32 -32
  173. package/dist/lib/components/AcSideTabs.vue.d.ts +2 -2
  174. package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
  175. package/dist/lib/components/AcSidebar.vue.d.ts +6 -3
  176. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +67 -57
  177. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  178. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +46 -45
  179. package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
  180. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
  181. package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
  182. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  183. package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
  184. package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
  185. package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
  186. package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
  187. package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
  188. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
  189. package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
  190. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +31 -19
  191. package/dist/lib/components/AcSwitchCard.js +5 -0
  192. package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
  193. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +121 -0
  194. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +97 -97
  195. package/dist/lib/components/AcTabs.vue.d.ts +9 -2
  196. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +43 -28
  197. package/dist/lib/components/AcTag.vue.d.ts +2 -2
  198. package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
  199. package/dist/lib/components/AcTagInput.js +5 -0
  200. package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
  201. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +289 -0
  202. package/dist/lib/components/AcTextarea.vue.d.ts +4 -4
  203. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +85 -63
  204. package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
  205. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +56 -24
  206. package/dist/lib/components/AcTimePicker.js +5 -0
  207. package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
  208. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +455 -0
  209. package/dist/lib/components/AcToaster.vue.d.ts +6 -3
  210. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +115 -82
  211. package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
  212. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +203 -79
  213. package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
  214. package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
  215. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +166 -115
  216. package/dist/lib/components/index.d.ts +21 -2
  217. package/dist/lib/components/status.d.ts +28 -0
  218. package/dist/lib/components/status.js +125 -0
  219. package/dist/lib/composables/copyText.d.ts +2 -1
  220. package/dist/lib/composables/copyText.js +2 -2
  221. package/dist/lib/composables/useApiPagination.d.ts +55 -0
  222. package/dist/lib/composables/useApiPagination.js +58 -0
  223. package/dist/lib/composables/useBulkSelection.d.ts +44 -0
  224. package/dist/lib/composables/useBulkSelection.js +41 -0
  225. package/dist/lib/composables/useFormValidation.d.ts +65 -0
  226. package/dist/lib/composables/useFormValidation.js +148 -0
  227. package/dist/lib/composables/useTablePagination.d.ts +49 -0
  228. package/dist/lib/composables/useTablePagination.js +41 -0
  229. package/dist/lib/composables/useToast.d.ts +17 -1
  230. package/dist/lib/composables/useToast.js +10 -2
  231. package/dist/lib/editor/theme.js +65 -62
  232. package/dist/lib/index.d.ts +21 -3
  233. package/dist/lib/index.js +99 -75
  234. package/dist/lib/theme.css +377 -273
  235. package/package.json +20 -4
@@ -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 - 4 - 8, a = e.top - 4 - 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 = {
49
- [o ? "bottom" : "top"]: `${o ? window.innerHeight - e.top + 4 : e.bottom + 4}px`,
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 = {
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 && 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-7 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring 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 duration-150 ease-out",
127
- "enter-from-class": `opacity-0 motion-safe:scale-[0.98] ${F.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
128
- "leave-active-class": "transition duration-100 ease-in",
129
- "leave-to-class": "opacity-0"
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",
141
+ "leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
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-8 border border-border bg-surface p-1 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-2.5 pt-1.5 pb-1 text-sm font-medium tracking-wide 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-1 my-1 h-px bg-border-light 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 };
@@ -8,7 +8,7 @@ export interface Props {
8
8
  icon?: Component;
9
9
  /** Keyboard shortcut hint shown at the right, e.g. "⌘D". Display only; bind the key yourself. */
10
10
  shortcut?: string;
11
- /** Red text for destructive actions such as Delete. Confirm them before acting. */
11
+ /** Red text and a red hover tint for destructive actions such as Delete. Confirm them before acting. */
12
12
  danger?: boolean;
13
13
  /** Disables the item; it's skipped by the arrow keys. */
14
14
  disabled?: boolean;
@@ -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
- class: "block text-xs text-muted"
6
- }, y = {
7
- key: 1,
8
- class: "mt-0.5 shrink-0 font-sans text-xs text-muted"
9
- }, b = /*@__PURE__*/ o({
5
+ class: "mt-0.5 block text-xs text-muted"
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-6 px-2.5 py-1.5 text-left text-base no-underline outline-none select-none transition-colors duration-75 disabled:cursor-not-allowed disabled:opacity-40", o.danger ? "text-red-30 focus:bg-red-95 focus:text-red-20" : "text-heading focus:bg-surface-sunken"]),
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 };
@@ -12,8 +12,10 @@ export interface Props {
12
12
  query?: string;
13
13
  /** A Lucide icon component to replace the variant's default icon. */
14
14
  icon?: Component;
15
- /** `small` for inside a table or card, `normal` for a list area, `large` for a whole page. */
15
+ /** `small` for inside a table or card, `normal` for a list area, `large` for a whole page. Icon tiles are 48px, 64px and 64px. */
16
16
  size?: "small" | "normal" | "large";
17
+ /** Draws a dashed 16px-round frame on the card surface (a red one for `error`), for a state that stands alone on the page rather than inside a card or table. */
18
+ framed?: boolean;
17
19
  }
18
20
  type __VLS_Slots = {
19
21
  /** Replaces the icon, e.g. with an illustration. */
@@ -30,6 +32,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
30
32
  description: string;
31
33
  icon: Component;
32
34
  size: "small" | "normal" | "large";
35
+ framed: boolean;
33
36
  query: string;
34
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,13 +1,10 @@
1
1
  import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, resolveDynamicComponent as u, toDisplayString as d } from "vue";
2
2
  import { Inbox as f, SearchX as p, TriangleAlert as m } from "@lucide/vue";
3
3
  //#region src/lib/components/AcEmptyState.vue?vue&type=script&setup=true&lang.ts
4
- var h = ["role"], g = { class: "flex flex-col items-center gap-1" }, _ = {
4
+ var h = ["role"], g = {
5
5
  key: 0,
6
- class: "font-mono text-xs font-medium tracking-wide text-muted uppercase"
7
- }, v = {
8
- key: 0,
9
- class: "mt-1 flex flex-wrap items-center justify-center gap-2"
10
- }, y = /*@__PURE__*/ o({
6
+ class: "mb-1 font-mono text-xs font-medium tracking-wide text-muted uppercase"
7
+ }, _ = /*@__PURE__*/ o({
11
8
  __name: "AcEmptyState",
12
9
  props: {
13
10
  variant: { default: "empty" },
@@ -16,66 +13,80 @@ var h = ["role"], g = { class: "flex flex-col items-center gap-1" }, _ = {
16
13
  description: { default: "" },
17
14
  query: { default: "" },
18
15
  icon: { default: void 0 },
19
- size: { default: "normal" }
16
+ size: { default: "normal" },
17
+ framed: {
18
+ type: Boolean,
19
+ default: !1
20
+ }
20
21
  },
21
22
  setup(o) {
22
- let y = o, b = {
23
+ let _ = o, v = {
23
24
  empty: {
24
25
  glyph: f,
25
26
  title: "Nothing here yet",
26
- tile: "border-border bg-surface-muted text-muted"
27
+ tile: "bg-primary/10 text-primary-strong",
28
+ frame: "border-border bg-surface"
27
29
  },
28
30
  search: {
29
31
  glyph: p,
30
32
  title: "No results found",
31
- tile: "border-border bg-surface-muted text-muted"
33
+ tile: "bg-primary/10 text-primary-strong",
34
+ frame: "border-border bg-surface"
32
35
  },
33
36
  error: {
34
37
  glyph: m,
35
38
  title: "Something went wrong",
36
- tile: "border-red-90 bg-red-97 text-red-40"
39
+ tile: "bg-danger/10 text-danger-strong",
40
+ frame: "border-danger/25 bg-danger/5"
37
41
  }
38
- }, x = {
42
+ }, y = {
39
43
  small: {
40
- root: "py-6 gap-3",
41
- tile: "size-9 rounded-8 [&_svg]:size-4",
42
- title: "text-lg leading-6",
43
- text: "text-base max-w-80"
44
+ root: "py-8",
45
+ gap: "mb-3",
46
+ tile: "size-12 [&_svg]:size-6",
47
+ title: "text-lg",
48
+ text: "max-w-80 text-base",
49
+ actions: "mt-4"
44
50
  },
45
51
  normal: {
46
- root: "py-12 gap-4",
47
- tile: "size-11 rounded-10 [&_svg]:size-5",
48
- title: "text-xl leading-6",
49
- text: "text-base max-w-100"
52
+ root: "py-16",
53
+ gap: "mb-4",
54
+ tile: "size-16 [&_svg]:size-8",
55
+ title: "text-xl",
56
+ text: "max-w-md text-base",
57
+ actions: "mt-6"
50
58
  },
51
59
  large: {
52
- root: "py-20 gap-5",
53
- tile: "size-14 rounded-12 [&_svg]:size-6",
54
- title: "text-2xl leading-7",
55
- text: "text-lg max-w-120"
60
+ root: "py-20",
61
+ gap: "mb-5",
62
+ tile: "size-16 [&_svg]:size-8",
63
+ title: "text-2xl",
64
+ text: "max-w-120 text-lg",
65
+ actions: "mt-6"
56
66
  }
57
- }, S = e(() => b[y.variant]), C = e(() => x[y.size]), w = e(() => y.icon ?? S.value.glyph), T = e(() => y.title ? y.title : y.variant === "search" && y.query ? `No results for “${y.query}”` : S.value.title);
67
+ }, b = e(() => v[_.variant]), x = e(() => y[_.size]), S = e(() => _.icon ?? b.value.glyph), C = e(() => _.title ? _.title : _.variant === "search" && _.query ? `No results for “${_.query}”` : b.value.title);
58
68
  return (e, f) => (c(), r("div", {
59
- class: s(["flex flex-col items-center px-4 text-center", C.value.root]),
69
+ class: s(["flex flex-col items-center justify-center text-center", [x.value.root, o.framed ? ["rounded-16 border border-dashed px-6", b.value.frame] : "px-4"]]),
60
70
  role: o.variant === "error" ? "alert" : void 0,
61
71
  "data-ac-ds": "",
62
72
  "data-testid": "ac-empty-state"
63
73
  }, [
64
- l(e.$slots, "icon", {}, () => [i("span", {
65
- class: s(["inline-flex shrink-0 items-center justify-center border shadow-xs", [S.value.tile, C.value.tile]]),
74
+ i("div", { class: s(["flex justify-center", x.value.gap]) }, [l(e.$slots, "icon", {}, () => [i("span", {
75
+ class: s(["inline-flex shrink-0 items-center justify-center rounded-16", [b.value.tile, x.value.tile]]),
66
76
  "aria-hidden": "true"
67
- }, [(c(), t(u(w.value)))], 2)]),
68
- i("div", g, [
69
- o.code ? (c(), r("p", _, d(o.code), 1)) : n("", !0),
70
- i("p", { class: s(["font-semibold tracking-[-0.01em] text-balance text-heading", C.value.title]) }, d(T.value), 3),
71
- o.description || e.$slots.default ? (c(), r("div", {
72
- key: 1,
73
- class: s(["text-pretty text-muted [&_a]:font-medium [&_a]:text-primary-20 [&_a]:underline [&_a]:underline-offset-2", C.value.text])
74
- }, [l(e.$slots, "default", {}, () => [a(d(o.description), 1)])], 2)) : n("", !0)
75
- ]),
76
- e.$slots.actions ? (c(), r("div", v, [l(e.$slots, "actions")])) : n("", !0)
77
+ }, [(c(), t(u(S.value)))], 2)])], 2),
78
+ o.code ? (c(), r("p", g, d(o.code), 1)) : n("", !0),
79
+ i("p", { class: s(["font-heading font-semibold tracking-tight text-balance text-heading", x.value.title]) }, d(C.value), 3),
80
+ o.description || e.$slots.default ? (c(), r("div", {
81
+ key: 1,
82
+ class: s(["mt-1.5 text-pretty text-muted [&_a]:font-medium [&_a]:text-primary-strong [&_a]:underline [&_a]:underline-offset-2", x.value.text])
83
+ }, [l(e.$slots, "default", {}, () => [a(d(o.description), 1)])], 2)) : n("", !0),
84
+ e.$slots.actions ? (c(), r("div", {
85
+ key: 2,
86
+ class: s(["flex flex-wrap items-center justify-center gap-3", x.value.actions])
87
+ }, [l(e.$slots, "actions")], 2)) : n("", !0)
77
88
  ], 10, h));
78
89
  }
79
90
  });
80
91
  //#endregion
81
- export { y as default };
92
+ export { _ as default };
@@ -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
+ };