@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,12 +1,12 @@
1
1
  export interface Props {
2
- /** Small uppercase heading above the items. Hidden in the collapsed rail, where a divider takes its place. */
2
+ /** Small uppercase heading above the items. Hidden in the collapsed rail, where a divider takes its place. A section inside another section is a sub-group, like cloud-ui's Networking → VPC. */
3
3
  label?: string;
4
4
  /** Turns the heading into a button that shows and hides the items. */
5
5
  collapsible?: boolean;
6
6
  }
7
7
  type __VLS_Props = Props;
8
8
  type __VLS_Slots = {
9
- /** The section's `AcSidebarItem`s. */
9
+ /** The section's `AcSidebarItem`s, or nested `AcSidebarSection`s for sub-groups. */
10
10
  default?: () => unknown;
11
11
  };
12
12
  type __VLS_ModelProps = {
@@ -1,10 +1,7 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u, renderSlot as d, toDisplayString as f, unref as p, useId as m, useModel as h } from "vue";
2
- import { ChevronRight as g } from "@lucide/vue";
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u, provide as d, renderSlot as f, toDisplayString as p, unref as m, useId as h, useModel as g } from "vue";
2
+ import { ChevronRight as _ } from "@lucide/vue";
3
3
  //#region src/lib/components/AcSidebarSection.vue?vue&type=script&setup=true&lang.ts
4
- var _ = ["aria-expanded", "aria-controls"], v = { class: "truncate" }, y = {
5
- key: 1,
6
- class: "mb-2 truncate px-1 py-0.5 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
7
- }, b = ["id", "aria-label"], x = /*@__PURE__*/ o({
4
+ var v = ["aria-expanded", "aria-controls"], y = { class: "truncate" }, b = ["inert"], x = ["id", "aria-label"], S = /*@__PURE__*/ o({
8
5
  __name: "AcSidebarSection",
9
6
  props: /*@__PURE__*/ c({
10
7
  label: { default: "" },
@@ -21,28 +18,36 @@ var _ = ["aria-expanded", "aria-controls"], v = { class: "truncate" }, y = {
21
18
  }),
22
19
  emits: ["update:open"],
23
20
  setup(o) {
24
- let c = h(o, "open"), x = s("ac-sidebar", null), S = m(), C = t(() => x?.rail.value ?? !1);
21
+ let c = g(o, "open"), S = s("ac-sidebar", null), C = s("ac-sidebar-section", !1);
22
+ d("ac-sidebar-section", !0), d("ac-sidebar-subgroup", C);
23
+ let w = h(), T = t(() => S?.rail.value ?? !1), E = t(() => c.value || T.value), D = t(() => C ? "mt-2 first:mt-0" : T.value ? "mt-2 border-t border-muted/20 pt-2 first:mt-0 first:border-0 first:pt-0" : "mt-4 first:mt-0 [[data-testid=ac-sidebar-section]+&]:mt-5 [[data-testid=ac-sidebar-section]+&]:border-t [[data-testid=ac-sidebar-section]+&]:border-muted/20 [[data-testid=ac-sidebar-section]+&]:pt-4");
25
24
  return (t, s) => (u(), r("li", {
26
- class: l(["list-none", C.value ? "mt-2 border-t border-muted/20 pt-2 first:mt-0 first:border-0 first:pt-0" : "mt-4 border-t border-muted/20 pt-4 first:mt-0 first:border-0 first:pt-0"]),
25
+ class: l(["list-none", D.value]),
27
26
  "data-ac-ds": "",
28
27
  "data-testid": "ac-sidebar-section"
29
- }, [o.label && !C.value ? (u(), r(e, { key: 0 }, [o.collapsible ? (u(), r("button", {
28
+ }, [o.label && !T.value ? (u(), r(e, { key: 0 }, [o.collapsible ? (u(), r("button", {
30
29
  key: 0,
31
30
  type: "button",
32
- class: "mb-2 flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-1 py-0.5 text-left text-sm font-semibold tracking-[0.08em] text-muted uppercase transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset",
31
+ class: l(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-1 py-0.5 text-left font-semibold tracking-[0.08em] uppercase transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset", m(C) ? "mb-1 text-xm text-muted/80" : "mb-2 text-sm text-muted"]),
33
32
  "aria-expanded": c.value,
34
- "aria-controls": `${p(S)}-items`,
33
+ "aria-controls": `${m(w)}-items`,
35
34
  onClick: s[0] ||= (e) => c.value = !c.value
36
- }, [i("span", v, f(o.label), 1), a(p(g), {
37
- class: l(["size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none", c.value && "rotate-90"]),
35
+ }, [i("span", y, p(o.label), 1), a(m(_), {
36
+ class: l(["shrink-0 text-muted/70 transition-transform duration-200 ease-out motion-reduce:transition-none", [m(C) ? "size-3.5" : "size-4", c.value && "rotate-90"]]),
38
37
  "aria-hidden": "true"
39
- }, null, 8, ["class"])], 8, _)) : (u(), r("p", y, f(o.label), 1))], 64)) : n("", !0), i("ul", {
40
- id: `${p(S)}-items`,
38
+ }, null, 8, ["class"])], 10, v)) : (u(), r("p", {
39
+ key: 1,
40
+ class: l(["truncate px-1 py-0.5 font-semibold tracking-[0.08em] uppercase", m(C) ? "mb-1 text-xm text-muted/80" : "mb-2 text-sm text-muted"])
41
+ }, p(o.label), 3))], 64)) : n("", !0), i("div", {
42
+ class: l(["grid transition-[grid-template-rows,opacity] duration-300 ease-out-soft motion-reduce:transition-none", E.value ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"]),
43
+ inert: !E.value || void 0
44
+ }, [i("ul", {
45
+ id: `${m(w)}-items`,
41
46
  role: "list",
42
47
  "aria-label": o.label || void 0,
43
- class: l(["flex-col gap-1", c.value || C.value || !o.collapsible ? "flex" : "hidden"])
44
- }, [d(t.$slots, "default")], 10, b)], 2));
48
+ class: l(["flex min-h-0 flex-col gap-1 overflow-hidden", [m(C) && !T.value && "pl-1", E.value && "pb-0.5"]])
49
+ }, [f(t.$slots, "default")], 10, x)], 10, b)], 2));
45
50
  }
46
51
  });
47
52
  //#endregion
48
- export { x as default };
53
+ export { S as default };
@@ -76,7 +76,7 @@ var f = {
76
76
  class: "flex items-center gap-2 py-1",
77
77
  "aria-current": e.id === a.activeSubstep ? "step" : void 0
78
78
  }, [i("span", {
79
- class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < T(f) ? "bg-primary text-white" : c === T(f) ? "bg-surface text-primary ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
79
+ class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < T(f) ? "bg-primary text-white" : c === T(f) ? "bg-surface text-primary-strong ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
80
80
  "aria-hidden": "true"
81
81
  }, [c < T(f) ? (s(), t(u(d), {
82
82
  key: 0,
@@ -7,6 +7,8 @@ export interface Props {
7
7
  disabled?: boolean;
8
8
  /** Error text under the switch. */
9
9
  errorMsg?: string;
10
+ /** Pulses the track and blocks changes, e.g. while the new value is saved. Sets `aria-busy`. */
11
+ loading?: boolean;
10
12
  }
11
13
  type __VLS_Props = Props;
12
14
  type __VLS_Slots = {
@@ -32,6 +34,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
32
34
  label: string;
33
35
  disabled: boolean;
34
36
  name: string;
37
+ loading: boolean;
35
38
  errorMsg: string;
36
39
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
40
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,26 +1,31 @@
1
- import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeModels as s, mergeProps as c, normalizeClass as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, useAttrs as h, useId as g, useModel as _ } from "vue";
2
- import { CircleAlert as v } from "@lucide/vue";
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeModels as a, mergeProps as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, unref as f, useAttrs as p, useId as m, useModel as h } from "vue";
3
2
  //#region src/lib/components/AcSwitch.vue?vue&type=script&setup=true&lang.ts
4
- var y = { class: "flex items-center gap-2" }, b = ["for"], x = [
3
+ var g = { class: "flex items-center gap-2" }, _ = ["for"], v = [
5
4
  "id",
6
5
  "name",
7
6
  "aria-checked",
7
+ "aria-busy",
8
+ "aria-disabled",
8
9
  "disabled"
9
- ], S = {
10
+ ], y = {
10
11
  key: 0,
11
- class: "mt-1.5 flex items-center gap-1.5 text-base text-danger-strong",
12
+ class: "mt-1 text-base text-danger-strong",
12
13
  role: "alert"
13
- }, C = /*@__PURE__*/ o({
14
+ }, b = /*@__PURE__*/ i({
14
15
  inheritAttrs: !1,
15
16
  __name: "AcSwitch",
16
- props: /*@__PURE__*/ s({
17
+ props: /*@__PURE__*/ a({
17
18
  label: { default: "" },
18
19
  name: { default: "" },
19
20
  disabled: {
20
21
  type: Boolean,
21
22
  default: !1
22
23
  },
23
- errorMsg: { default: "" }
24
+ errorMsg: { default: "" },
25
+ loading: {
26
+ type: Boolean,
27
+ default: !1
28
+ }
24
29
  }, {
25
30
  modelValue: {
26
31
  type: Boolean,
@@ -29,44 +34,46 @@ var y = { class: "flex items-center gap-2" }, b = ["for"], x = [
29
34
  modelModifiers: {}
30
35
  }),
31
36
  emits: ["update:modelValue"],
32
- setup(o, { expose: s }) {
33
- let C = _(o, "modelValue"), w = g(), T = h(), E = e(() => ({
34
- class: T.class,
35
- style: T.style
36
- })), D = e(() => {
37
- let { class: e, style: t, ...n } = T;
37
+ setup(i, { expose: a }) {
38
+ let b = i, x = h(i, "modelValue"), S = m(), C = p(), w = e(() => ({
39
+ class: C.class,
40
+ style: C.style
41
+ })), T = e(() => {
42
+ let { class: e, style: t, ...n } = C;
38
43
  return n;
39
- }), O = d(null);
40
- return s({ focus: () => O.value?.focus() }), (e, s) => (u(), n("div", c(E.value, {
44
+ }), E = l(null);
45
+ function D() {
46
+ b.disabled || b.loading || (x.value = !x.value);
47
+ }
48
+ return a({ focus: () => E.value?.focus() }), (e, a) => (c(), n("div", o(w.value, {
41
49
  "data-ac-ds": "",
42
50
  "data-testid": "ac-switch"
43
- }), [r("div", y, [
44
- f(e.$slots, "left"),
45
- o.label ? (u(), n("label", {
51
+ }), [r("div", g, [
52
+ u(e.$slots, "left"),
53
+ i.label ? (c(), n("label", {
46
54
  key: 0,
47
- for: m(w),
48
- class: l(["cursor-pointer text-base font-medium text-heading", o.disabled && "cursor-not-allowed opacity-50"])
49
- }, p(o.label), 11, b)) : t("", !0),
50
- f(e.$slots, "middle"),
51
- r("button", c({
52
- id: m(w),
55
+ for: f(S),
56
+ class: s(["cursor-pointer text-base font-medium text-heading", i.disabled && "cursor-not-allowed opacity-50"])
57
+ }, d(i.label), 11, _)) : t("", !0),
58
+ u(e.$slots, "middle"),
59
+ r("button", o({
60
+ id: f(S),
53
61
  ref_key: "button",
54
- ref: O
55
- }, D.value, {
62
+ ref: E
63
+ }, T.value, {
56
64
  type: "button",
57
65
  role: "switch",
58
- name: o.name,
59
- "aria-checked": C.value,
60
- disabled: o.disabled,
61
- class: ["relative h-6 w-11 shrink-0 cursor-pointer rounded-full transition-colors duration-200 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 motion-reduce:transition-none", C.value ? "bg-primary" : "bg-muted/45"],
62
- onClick: s[0] ||= (e) => C.value = !C.value
63
- }), [r("span", { class: l(["pointer-events-none absolute top-0.5 left-0.5 size-5 rounded-full bg-white shadow-sm transition-transform duration-200 ease-out motion-reduce:transition-none", C.value ? "translate-x-5" : "translate-x-0"]) }, null, 2)], 16, x),
64
- f(e.$slots, "right")
65
- ]), o.errorMsg ? (u(), n("p", S, [a(m(v), {
66
- class: "size-4 shrink-0",
67
- "aria-hidden": "true"
68
- }), i(" " + p(o.errorMsg), 1)])) : t("", !0)], 16));
66
+ name: i.name,
67
+ "aria-checked": x.value,
68
+ "aria-busy": i.loading || void 0,
69
+ "aria-disabled": i.loading && !i.disabled || void 0,
70
+ disabled: i.disabled,
71
+ class: ["relative h-6 w-11 shrink-0 rounded-full transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none motion-reduce:transition-none", [x.value ? "bg-primary" : "bg-slate-80", i.disabled ? "cursor-not-allowed opacity-50" : i.loading ? "cursor-wait animate-pulse motion-reduce:animate-none" : "cursor-pointer"]],
72
+ onClick: D
73
+ }), [r("span", { class: s(["pointer-events-none absolute top-0.5 left-0.5 size-5 rounded-full border bg-white transition-transform duration-200 ease-out motion-reduce:transition-none", x.value ? "translate-x-5 border-white" : "translate-x-0 border-slate-70"]) }, null, 2)], 16, v),
74
+ u(e.$slots, "right")
75
+ ]), i.errorMsg ? (c(), n("p", y, d(i.errorMsg), 1)) : t("", !0)], 16));
69
76
  }
70
77
  });
71
78
  //#endregion
72
- export { C as default };
79
+ export { b as default };
@@ -12,11 +12,11 @@ export interface Props {
12
12
  icon?: Component;
13
13
  /** Adds a "Recommended" pill after the title. */
14
14
  recommended?: boolean;
15
- /** The switch is on but won't take effect yet: tints the card amber instead of primary. Explain why in the default slot. */
15
+ /** The choice won't take effect yet: tints the card and status amber instead of primary, on or off. Explain why in the default slot. */
16
16
  warning?: boolean;
17
17
  /** Turns the switch and the card click off. */
18
18
  disabled?: boolean;
19
- /** Shows a spinner beside the switch and blocks changes, e.g. while the change is saved. */
19
+ /** Shows a spinner beside the switch, pulses it and blocks changes, e.g. while the change is saved. */
20
20
  loading?: boolean;
21
21
  }
22
22
  type __VLS_Props = Props;
@@ -25,7 +25,7 @@ type __VLS_Slots = {
25
25
  badges?: () => unknown;
26
26
  /** Replaces the `status` text, e.g. a price with a muted unit. */
27
27
  status?: () => unknown;
28
- /** Content under the row, shown only while the switch is on: settings revealed after enabling, or a warning about the choice. */
28
+ /** Content under the row, e.g. a warning about the choice. Wrap it in `v-if="model"` to show settings only while the switch is on. */
29
29
  default?: () => unknown;
30
30
  };
31
31
  type __VLS_ModelProps = {
@@ -5,13 +5,13 @@ import { Sparkles as T } from "@lucide/vue";
5
5
  //#region src/lib/components/AcSwitchCard.vue?vue&type=script&setup=true&lang.ts
6
6
  var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3" }, O = { class: "min-w-0 flex-1" }, k = { class: "flex flex-wrap items-center gap-x-2 gap-y-1 text-base font-semibold text-heading" }, A = {
7
7
  key: 0,
8
- class: "inline-flex items-center gap-1 rounded-full bg-primary/15 px-2 py-0.5 text-sm font-bold tracking-wide text-primary-strong uppercase"
8
+ class: "inline-flex items-center gap-1 rounded-full bg-primary/15 px-2 py-0.5 text-xm font-bold tracking-wide text-primary-strong uppercase"
9
9
  }, j = { class: "ml-auto flex shrink-0 items-center gap-3" }, M = {
10
10
  key: 0,
11
11
  class: "text-sm text-muted"
12
12
  }, N = {
13
13
  key: 0,
14
- class: "mt-4 border-t border-border pt-4"
14
+ class: "mt-3"
15
15
  }, P = "a, button, input, select, textarea, label, [tabindex], [contenteditable]", F = /*@__PURE__*/ d({
16
16
  inheritAttrs: !1,
17
17
  __name: "AcSwitchCard",
@@ -52,12 +52,12 @@ var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3
52
52
  })), W = i(() => {
53
53
  let { class: e, style: t, ...n } = H;
54
54
  return n;
55
- }), G = g(null), K = i(() => F.disabled || F.loading), q = i(() => I.value && !F.disabled && !F.warning), J = i(() => !!(F.status || F.statusDetail || L.status)), Y = i(() => [F.description && B, J.value && V].filter(Boolean).join(" ") || void 0), X = i(() => I.value && F.warning ? "border-warning/40 bg-[color-mix(in_srgb,var(--color-warning)_5%,var(--color-surface))]" : q.value ? "border-primary bg-[color-mix(in_srgb,var(--color-primary)_5%,var(--color-surface))] ring-1 ring-primary/30" : ["border-border bg-surface", !K.value && "hover:border-primary/30"]), Z = i(() => I.value && F.warning ? "text-warning-strong" : q.value ? "text-heading" : "text-muted");
55
+ }), G = g(null), K = i(() => F.disabled || F.loading), q = i(() => I.value && !F.disabled && !F.warning), J = i(() => !!(F.status || F.statusDetail || L.status)), Y = i(() => [F.description && B, J.value && V].filter(Boolean).join(" ") || void 0), X = i(() => F.warning ? "border-warning/40 bg-[color-mix(in_srgb,var(--color-warning)_5%,var(--color-surface))]" : q.value ? "border-primary/40 bg-[color-mix(in_srgb,var(--color-primary)_5%,var(--color-surface))]" : "border-border bg-surface-sunken/5"), Z = i(() => F.warning ? "text-warning-strong" : q.value ? "text-heading" : "text-muted");
56
56
  function Q(e) {
57
57
  return !!e?.some((e) => e.type !== n && (e.type !== r || Q(e.children)));
58
58
  }
59
59
  function $() {
60
- return I.value && Q(L.default?.());
60
+ return Q(L.default?.());
61
61
  }
62
62
  function ee(e) {
63
63
  if (K.value) return;
@@ -65,12 +65,12 @@ var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3
65
65
  t && e.currentTarget.contains(t) || window.getSelection()?.toString() || (I.value = !I.value, G.value?.focus());
66
66
  }
67
67
  return f({ focus: () => G.value?.focus() }), (n, r) => (h(), s("div", p(U.value, {
68
- class: ["rounded-14 border p-4 transition-[background-color,border-color,box-shadow] duration-200 motion-reduce:transition-none", X.value],
68
+ class: ["rounded-14 border px-4 py-3 transition-colors duration-200 motion-reduce:transition-none", X.value],
69
69
  "aria-busy": d.loading || void 0,
70
70
  "data-ac-ds": "",
71
71
  "data-testid": "ac-switch-card"
72
72
  }), [c("div", {
73
- class: m(["flex flex-wrap items-center justify-between gap-x-4 gap-y-3", K.value ? "cursor-not-allowed" : "cursor-pointer"]),
73
+ class: m(["flex flex-wrap items-center justify-between gap-x-4 gap-y-3", d.disabled ? "cursor-not-allowed" : d.loading ? "cursor-wait" : "cursor-pointer"]),
74
74
  onClick: ee
75
75
  }, [c("div", D, [d.icon ? (h(), s("span", {
76
76
  key: 0,
@@ -104,12 +104,14 @@ var E = ["aria-busy"], D = { class: "flex min-w-[200px] flex-1 items-start gap-3
104
104
  }, W.value, {
105
105
  modelValue: I.value,
106
106
  "onUpdate:modelValue": r[0] ||= (e) => I.value = e,
107
- disabled: K.value,
107
+ disabled: d.disabled,
108
+ loading: d.loading,
108
109
  "aria-labelledby": z,
109
110
  "aria-describedby": Y.value
110
111
  }), null, 16, [
111
112
  "modelValue",
112
113
  "disabled",
114
+ "loading",
113
115
  "aria-describedby"
114
116
  ])
115
117
  ])], 2), $() ? (h(), s("div", N, [_(n.$slots, "default")])) : o("", !0)], 16, E));
@@ -1,39 +1,39 @@
1
1
  import e from "./AcCellValue.js";
2
2
  import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as ee, useModel as y, withModifiers as b } from "vue";
3
- import { ArrowUp as x, Check as S, ChevronRight as C, ChevronsUpDown as w, Minus as te } from "@lucide/vue";
3
+ import { Check as x, ChevronDown as S, ChevronRight as C, ChevronUp as w, Minus as te } from "@lucide/vue";
4
4
  //#region src/lib/components/AcTable.vue?vue&type=script&setup=true&lang.ts
5
- var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border-spacing-0 text-base" }, ie = { class: "relative flex size-4" }, ae = [
5
+ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border-spacing-0 text-base" }, ie = { class: "relative flex size-[18px]" }, ae = [
6
6
  "checked",
7
7
  "indeterminate",
8
8
  "disabled"
9
- ], oe = ["aria-sort", "onClick"], se = {
9
+ ], oe = ["aria-sort", "onClick"], se = { class: "inline-flex items-center gap-2" }, ce = {
10
10
  key: 0,
11
- class: "h-12 border-b border-border pl-4 [tr:last-child_&]:border-0"
12
- }, ce = {
11
+ class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
12
+ }, T = {
13
13
  key: 1,
14
- class: "h-12 border-b border-border pl-4 [tr:last-child_&]:border-0"
15
- }, T = [
14
+ class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
15
+ }, E = [
16
16
  "aria-current",
17
17
  "aria-disabled",
18
18
  "onClick"
19
- ], E = [
19
+ ], le = [
20
20
  "aria-expanded",
21
21
  "aria-controls",
22
22
  "aria-label",
23
23
  "onClick"
24
- ], le = { class: "relative flex size-4" }, ue = [
24
+ ], ue = { class: "relative flex size-[18px]" }, D = [
25
25
  "checked",
26
26
  "disabled",
27
27
  "aria-label",
28
28
  "onChange"
29
- ], de = {
29
+ ], O = {
30
30
  key: 0,
31
31
  class: "group",
32
32
  "data-testid": "ac-table-detail"
33
- }, D = ["colspan"], O = ["id", "aria-label"], fe = {
33
+ }, k = ["colspan"], de = ["id", "aria-label"], fe = {
34
34
  key: 0,
35
35
  class: "px-6 py-12 text-center text-muted"
36
- }, k = "border-border", A = "peer size-4 cursor-pointer appearance-none rounded-4 border border-muted/70 bg-surface align-middle transition-colors duration-150 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary 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", j = /*@__PURE__*/ l({
36
+ }, A = "border-border", j = "peer size-[18px] cursor-pointer appearance-none rounded-4 border border-muted/70 bg-background align-middle transition-colors duration-150 hover:border-primary/60 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary 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", M = /*@__PURE__*/ l({
37
37
  __name: "AcTable",
38
38
  props: /*@__PURE__*/ u({
39
39
  columns: {},
@@ -95,17 +95,17 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
95
95
  "update:sortBy"
96
96
  ]),
97
97
  setup(l, { emit: u }) {
98
- let j = l, M = y(l, "selected"), N = y(l, "expanded"), P = u, F = ee(), I = y(l, "sortBy"), L = n(() => I.value?.key ?? ""), R = n(() => I.value?.mode ?? "asc"), z = (e) => {
98
+ let M = l, N = y(l, "selected"), P = y(l, "expanded"), F = u, I = ee(), L = y(l, "sortBy"), R = n(() => L.value?.key ?? ""), z = n(() => L.value?.mode ?? "asc"), B = (e) => {
99
99
  if (!e.sortable) return;
100
- let t = L.value === e.key && R.value === "asc" ? "desc" : "asc";
101
- I.value = {
100
+ let t = R.value === e.key && z.value === "asc" ? "desc" : "asc";
101
+ L.value = {
102
102
  key: e.key,
103
103
  mode: t
104
- }, P("sort", e.key, t);
105
- }, B = n(() => {
106
- if (!L.value || j.manualSort) return j.rows;
107
- let e = L.value, t = R.value === "asc" ? 1 : -1;
108
- return [...j.rows].sort((n, r) => String(H(n[e]) ?? "").localeCompare(String(H(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
104
+ }, F("sort", e.key, t);
105
+ }, pe = n(() => {
106
+ if (!R.value || M.manualSort) return M.rows;
107
+ let e = R.value, t = z.value === "asc" ? 1 : -1;
108
+ return [...M.rows].sort((n, r) => String(H(n[e]) ?? "").localeCompare(String(H(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
109
109
  });
110
110
  function V(e) {
111
111
  return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
@@ -113,23 +113,23 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
113
113
  function H(e) {
114
114
  return V(e) ? e.sort ?? e.data : e;
115
115
  }
116
- let U = (e) => !!j.rowDisabled?.(e), W = n(() => j.rows.filter((e) => !U(e)).map((e) => e[j.rowKey])), G = n(() => new Set(M.value)), K = n(() => W.value.length > 0 && W.value.every((e) => G.value.has(e))), q = n(() => !K.value && W.value.some((e) => G.value.has(e)));
117
- function pe() {
116
+ let U = (e) => !!M.rowDisabled?.(e), W = n(() => M.rows.filter((e) => !U(e)).map((e) => e[M.rowKey])), G = n(() => new Set(N.value)), K = n(() => W.value.length > 0 && W.value.every((e) => G.value.has(e))), q = n(() => !K.value && W.value.some((e) => G.value.has(e)));
117
+ function me() {
118
118
  let e = new Set(W.value);
119
- M.value = K.value ? M.value.filter((t) => !e.has(t)) : [...M.value, ...W.value.filter((e) => !G.value.has(e))];
119
+ N.value = K.value ? N.value.filter((t) => !e.has(t)) : [...N.value, ...W.value.filter((e) => !G.value.has(e))];
120
120
  }
121
- function me(e) {
122
- let t = e[j.rowKey];
123
- M.value = G.value.has(t) ? M.value.filter((e) => e !== t) : [...M.value, t];
121
+ function he(e) {
122
+ let t = e[M.rowKey];
123
+ N.value = G.value.has(t) ? N.value.filter((e) => e !== t) : [...N.value, t];
124
124
  }
125
- let J = n(() => new Set(N.value)), Y = (e) => j.expandable && J.value.has(e[j.rowKey]), X = (e) => !j.canExpand || j.canExpand(e), Z = (e) => `${F}-detail-${String(e[j.rowKey])}`, he = n(() => j.columns.length + +!!j.selectable + +!!j.expandable);
126
- function ge(e) {
127
- let t = e[j.rowKey];
128
- N.value = J.value.has(t) ? N.value.filter((e) => e !== t) : [...N.value, t];
125
+ let J = n(() => new Set(P.value)), Y = (e) => M.expandable && J.value.has(e[M.rowKey]), X = (e) => !M.canExpand || M.canExpand(e), Z = (e) => `${I}-detail-${String(e[M.rowKey])}`, ge = n(() => M.columns.length + +!!M.selectable + +!!M.expandable);
126
+ function _e(e) {
127
+ let t = e[M.rowKey];
128
+ P.value = J.value.has(t) ? P.value.filter((e) => e !== t) : [...P.value, t];
129
129
  }
130
130
  function Q(e) {
131
- let t = e[j.columns[0]?.key ?? ""], n = V(t) ? t.data : t;
132
- return typeof n == "string" || typeof n == "number" ? n : String(e[j.rowKey]);
131
+ let t = e[M.columns[0]?.key ?? ""], n = V(t) ? t.data : t;
132
+ return typeof n == "string" || typeof n == "number" ? n : String(e[M.rowKey]);
133
133
  }
134
134
  let $ = (e) => ({
135
135
  left: "text-left",
@@ -144,22 +144,22 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
144
144
  l.expandable ? (p(), a("th", {
145
145
  key: 0,
146
146
  scope: "col",
147
- class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [k, !l.flat && "first:rounded-tl-10"]])
147
+ class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [A, !l.flat && "first:rounded-tl-10"]])
148
148
  }, [...u[2] ||= [o("span", { class: "sr-only" }, "Expand", -1)]], 2)) : i("", !0),
149
149
  l.selectable ? (p(), a("th", {
150
150
  key: 1,
151
151
  scope: "col",
152
- class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [k, !l.flat && "first:rounded-tl-10"]])
152
+ class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [A, !l.flat && "first:rounded-tl-10"]])
153
153
  }, [o("span", ie, [o("input", {
154
154
  type: "checkbox",
155
- class: d(A),
155
+ class: d(j),
156
156
  checked: K.value,
157
157
  indeterminate: q.value,
158
158
  disabled: l.loading || !l.rows.length,
159
159
  "aria-label": "Select all rows",
160
- onChange: pe
161
- }, null, 40, ae), (p(), r(g(q.value ? v(te) : v(S)), {
162
- class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
160
+ onChange: me
161
+ }, null, 40, ae), (p(), r(g(q.value ? v(te) : v(x)), {
162
+ class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
163
163
  "stroke-width": 3,
164
164
  "aria-hidden": "true"
165
165
  }))])], 2)) : i("", !0),
@@ -167,44 +167,44 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
167
167
  key: e.key,
168
168
  scope: "col",
169
169
  class: d(["h-11 border-b bg-surface-sunken/50 px-6 text-base font-semibold whitespace-nowrap text-muted", [
170
- k,
170
+ A,
171
171
  !l.flat && "first:rounded-tl-10 last:rounded-tr-10",
172
172
  $(e),
173
173
  e.sortable && "cursor-pointer select-none transition-colors hover:text-heading"
174
174
  ]]),
175
175
  style: f(e.width ? { width: e.width } : void 0),
176
- "aria-sort": L.value === e.key ? R.value === "asc" ? "ascending" : "descending" : void 0,
177
- onClick: (t) => z(e)
178
- }, [o("span", { class: d(["inline-flex items-center gap-2", L.value === e.key && "text-heading"]) }, [h(n.$slots, `header-${e.key}`, { column: e }, () => [s(_(e.label), 1)]), e.sortable ? (p(), r(g(L.value === e.key ? v(x) : v(w)), {
176
+ "aria-sort": R.value === e.key ? z.value === "asc" ? "ascending" : "descending" : void 0,
177
+ onClick: (t) => B(e)
178
+ }, [o("span", se, [h(n.$slots, `header-${e.key}`, { column: e }, () => [s(_(e.label), 1)]), e.sortable ? (p(), r(g(R.value === e.key && z.value === "asc" ? v(w) : v(S)), {
179
179
  key: 0,
180
- class: d(["size-4 shrink-0 transition-transform", [L.value === e.key ? "text-primary" : "text-muted/70", L.value === e.key && R.value === "desc" && "rotate-180"]]),
180
+ class: d(["size-4 shrink-0", R.value === e.key ? "text-primary-strong" : "text-muted"]),
181
181
  "aria-hidden": "true"
182
- }, null, 8, ["class"])) : i("", !0)], 2)], 14, oe))), 128))
182
+ }, null, 8, ["class"])) : i("", !0)])], 14, oe))), 128))
183
183
  ])]), o("tbody", null, [l.loading ? (p(!0), a(t, { key: 0 }, m(l.loaderRows, (e) => (p(), a("tr", { key: `loader-${e}` }, [
184
- l.expandable ? (p(), a("td", se)) : i("", !0),
185
- l.selectable ? (p(), a("td", ce)) : i("", !0),
184
+ l.expandable ? (p(), a("td", ce)) : i("", !0),
185
+ l.selectable ? (p(), a("td", T)) : i("", !0),
186
186
  (p(!0), a(t, null, m(l.columns, (t, n) => (p(), a("td", {
187
187
  key: t.key,
188
- class: "h-12 border-b border-border px-6 [tr:last-child_&]:border-0"
188
+ class: "h-11 border-b border-border px-6 [tr:last-child_&]:border-0"
189
189
  }, [o("span", {
190
190
  class: "block h-2.5 animate-pulse rounded-full bg-surface-sunken",
191
191
  style: f({ width: `${50 + (e * 17 + n * 23) % 40}%` })
192
192
  }, null, 4)]))), 128))
193
- ]))), 128)) : (p(!0), a(t, { key: 1 }, m(B.value, (f, g) => (p(), a(t, { key: String(f[l.rowKey] ?? g) }, [o("tr", {
193
+ ]))), 128)) : (p(!0), a(t, { key: 1 }, m(pe.value, (f, g) => (p(), a(t, { key: String(f[l.rowKey] ?? g) }, [o("tr", {
194
194
  "data-testid": "ac-table-row",
195
- class: d(["group transition-colors duration-150 hover:bg-surface-sunken/40", [
196
- l.clickable && "cursor-pointer",
195
+ class: d(["group transition-colors duration-150", [
196
+ l.clickable && "cursor-pointer hover:bg-surface-sunken/40",
197
197
  (l.rowActive?.(f) || l.selectable && G.value.has(f[l.rowKey])) && "bg-primary/5",
198
198
  l.rowActive?.(f) && "shadow-[inset_0_0_0_1px_var(--color-primary)]",
199
199
  U(f) && "pointer-events-none cursor-not-allowed opacity-50"
200
200
  ]]),
201
201
  "aria-current": l.rowActive?.(f) ? "true" : void 0,
202
202
  "aria-disabled": U(f) || void 0,
203
- onClick: (e) => l.clickable && !U(f) && P("row-click", f)
203
+ onClick: (e) => l.clickable && !U(f) && F("row-click", f)
204
204
  }, [
205
205
  l.expandable ? (p(), a("td", {
206
206
  key: 0,
207
- class: "h-12 w-10 border-b border-border pr-0 pl-4 group-last:border-0",
207
+ class: "h-11 w-10 border-b border-border pr-0 pl-4 group-last:border-0",
208
208
  onClick: u[0] ||= b(() => {}, ["stop"])
209
209
  }, [X(f) ? (p(), a("button", {
210
210
  key: 0,
@@ -214,30 +214,30 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
214
214
  "aria-controls": Z(f),
215
215
  "aria-label": `${Y(f) ? "Collapse" : "Expand"} ${Q(f)}`,
216
216
  "data-testid": "ac-table-expand",
217
- onClick: (e) => ge(f)
217
+ onClick: (e) => _e(f)
218
218
  }, [c(v(C), {
219
219
  class: d(["size-4 transition-transform duration-150 motion-reduce:transition-none", Y(f) && "rotate-90"]),
220
220
  "aria-hidden": "true"
221
- }, null, 8, ["class"])], 8, E)) : i("", !0)])) : i("", !0),
221
+ }, null, 8, ["class"])], 8, le)) : i("", !0)])) : i("", !0),
222
222
  l.selectable ? (p(), a("td", {
223
223
  key: 1,
224
- class: "h-12 w-10 border-b border-border pr-1 pl-4 group-last:border-0",
224
+ class: "h-11 w-10 border-b border-border pr-1 pl-4 group-last:border-0",
225
225
  onClick: u[1] ||= b(() => {}, ["stop"])
226
- }, [o("span", le, [o("input", {
226
+ }, [o("span", ue, [o("input", {
227
227
  type: "checkbox",
228
- class: d(A),
228
+ class: d(j),
229
229
  checked: G.value.has(f[l.rowKey]),
230
230
  disabled: U(f),
231
231
  "aria-label": `Select ${Q(f)}`,
232
- onChange: (e) => me(f)
233
- }, null, 40, ue), c(v(S), {
234
- class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100",
232
+ onChange: (e) => he(f)
233
+ }, null, 40, D), c(v(x), {
234
+ class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100",
235
235
  "stroke-width": 3,
236
236
  "aria-hidden": "true"
237
237
  })])])) : i("", !0),
238
238
  (p(!0), a(t, null, m(l.columns, (i) => (p(), a("td", {
239
239
  key: i.key,
240
- class: d(["h-12 border-b border-border px-6 whitespace-nowrap text-body tabular-nums group-last:border-0", $(i)])
240
+ class: d(["h-11 border-b border-border px-6 whitespace-nowrap text-body tabular-nums group-last:border-0", $(i)])
241
241
  }, [h(n.$slots, `cell-${i.key}`, {
242
242
  row: f,
243
243
  value: f[i.key]
@@ -257,16 +257,16 @@ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border
257
257
  "title",
258
258
  "resolve-link"
259
259
  ])) : (p(), a(t, { key: 1 }, [s(_(f[i.key]), 1)], 64))])], 2))), 128))
260
- ], 10, T), Y(f) && X(f) ? (p(), a("tr", de, [o("td", {
261
- colspan: he.value,
260
+ ], 10, E), Y(f) && X(f) ? (p(), a("tr", O, [o("td", {
261
+ colspan: ge.value,
262
262
  class: "border-b border-border bg-surface-muted p-0 group-last:border-0"
263
263
  }, [o("div", {
264
264
  id: Z(f),
265
265
  role: "region",
266
266
  "aria-label": `Details for ${Q(f)}`,
267
267
  class: "px-6 py-4 text-body"
268
- }, [h(n.$slots, "expanded", { row: f })], 8, O)], 8, D)])) : i("", !0)], 64))), 128))])])]), !l.loading && !l.rows.length ? (p(), a("div", fe, [h(n.$slots, "empty", {}, () => [s(_(l.emptyText), 1)])])) : i("", !0)], 2));
268
+ }, [h(n.$slots, "expanded", { row: f })], 8, de)], 8, k)])) : i("", !0)], 64))), 128))])])]), !l.loading && !l.rows.length ? (p(), a("div", fe, [h(n.$slots, "empty", {}, () => [s(_(l.emptyText), 1)])])) : i("", !0)], 2));
269
269
  }
270
270
  });
271
271
  //#endregion
272
- export { j as default };
272
+ export { M as default };
@@ -1,6 +1,9 @@
1
+ import type { Component } from "vue";
1
2
  export interface TabItem {
2
3
  key: string;
3
4
  label: string;
5
+ /** A Lucide icon shown at 16px before the label, in the tab's colour. */
6
+ icon?: Component;
4
7
  count?: number;
5
8
  disabled?: boolean;
6
9
  /** Makes the tab a `RouterLink` to this route (needs vue-router in the app). The tab for the current route becomes active by itself. */
@@ -11,8 +14,10 @@ export interface TabItem {
11
14
  testid?: string;
12
15
  }
13
16
  export interface Props {
14
- /** The tabs: `{ key, label, count?, disabled?, to?, href?, testid? }`. `v-model` holds the active `key`. With `to`, it follows the current route. */
17
+ /** The tabs: `{ key, label, icon?, count?, disabled?, to?, href?, testid? }`. `v-model` holds the active `key`. With `to`, it follows the current route. */
15
18
  items: TabItem[];
19
+ /** `soft` is cloud-ui's tab: a tinted active tab with rounded top corners, 4px apart, wrapping onto a second line when crowded. `underline` is a bare label with a 2px line under the active tab, 24px apart, scrolling sideways. */
20
+ variant?: "soft" | "underline";
16
21
  }
17
22
  type __VLS_Props = Props;
18
23
  type __VLS_Slots = {
@@ -29,7 +34,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
29
34
  "update:modelValue": (value: string) => any;
30
35
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
31
36
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
32
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ }>, {
38
+ variant: "soft" | "underline";
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
40
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
41
  declare const _default: typeof __VLS_export;
35
42
  export default _default;