@ac-design/design-system 1.0.2 → 2.0.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 (186) 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 +69 -0
  4. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +168 -0
  5. package/dist/lib/charts/index.d.ts +7 -0
  6. package/dist/lib/charts/index.js +5 -0
  7. package/dist/lib/charts/shared.d.ts +60 -0
  8. package/dist/lib/charts/shared.js +114 -0
  9. package/dist/lib/charts/xy.d.ts +65 -0
  10. package/dist/lib/charts/xy.js +92 -0
  11. package/dist/lib/compat.css +1707 -1042
  12. package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
  13. package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
  14. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
  15. package/dist/lib/components/AcAlert.vue.d.ts +1 -1
  16. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +19 -25
  17. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
  18. package/dist/lib/components/AcAreaChart.js +5 -0
  19. package/dist/lib/components/AcAreaChart.vue.d.ts +44 -0
  20. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +215 -0
  21. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +8 -8
  22. package/dist/lib/components/AcBadge.vue.d.ts +16 -7
  23. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +59 -43
  24. package/dist/lib/components/AcBanner.vue.d.ts +1 -1
  25. package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
  26. package/dist/lib/components/AcBarChart.js +5 -0
  27. package/dist/lib/components/AcBarChart.vue.d.ts +43 -0
  28. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +217 -0
  29. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +27 -26
  30. package/dist/lib/components/AcBulkActionBar.js +5 -0
  31. package/dist/lib/components/AcBulkActionBar.vue.d.ts +43 -0
  32. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
  33. package/dist/lib/components/AcButton.vue.d.ts +3 -3
  34. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +42 -34
  35. package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
  36. package/dist/lib/components/AcCard.vue.d.ts +10 -2
  37. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +37 -11
  38. package/dist/lib/components/AcCellValue.vue.d.ts +4 -1
  39. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +214 -179
  40. package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
  41. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +126 -29
  42. package/dist/lib/components/AcCheckRadio.vue.d.ts +1 -1
  43. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +33 -21
  44. package/dist/lib/components/AcCircularProgress.js +5 -0
  45. package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
  46. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +111 -0
  47. package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
  48. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
  49. package/dist/lib/components/AcColorInput.js +5 -0
  50. package/dist/lib/components/AcColorInput.vue.d.ts +54 -0
  51. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +187 -0
  52. package/dist/lib/components/AcConfirmModal.js +5 -0
  53. package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
  54. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +92 -0
  55. package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
  56. package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
  57. package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
  58. package/dist/lib/components/AcCopyButton.js +5 -0
  59. package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
  60. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
  61. package/dist/lib/components/AcDatePicker.vue.d.ts +5 -5
  62. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +204 -213
  63. package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
  64. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +37 -46
  65. package/dist/lib/components/AcDonutChart.js +5 -0
  66. package/dist/lib/components/AcDonutChart.vue.d.ts +73 -0
  67. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +210 -0
  68. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  69. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +9 -9
  70. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +2 -2
  71. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  72. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +3 -3
  73. package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
  74. package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
  75. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +14 -13
  76. package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
  77. package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
  78. package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
  79. package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
  80. package/dist/lib/components/AcFooter.js +5 -0
  81. package/dist/lib/components/AcFooter.vue.d.ts +37 -0
  82. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
  83. package/dist/lib/components/AcForm.vue.d.ts +3 -0
  84. package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
  85. package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
  86. package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
  87. package/dist/lib/components/AcFormFooter.vue.d.ts +2 -2
  88. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
  89. package/dist/lib/components/AcFormSection.vue.d.ts +7 -0
  90. package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
  91. package/dist/lib/components/AcHeader.vue.d.ts +3 -3
  92. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +22 -22
  93. package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
  94. package/dist/lib/components/AcInput.vue.d.ts +3 -3
  95. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +98 -87
  96. package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
  97. package/dist/lib/components/AcKeyValueInput.js +5 -0
  98. package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
  99. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +320 -0
  100. package/dist/lib/components/AcLineChart.js +5 -0
  101. package/dist/lib/components/AcLineChart.vue.d.ts +38 -0
  102. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +187 -0
  103. package/dist/lib/components/AcLocaleSwitcher.js +5 -0
  104. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +46 -0
  105. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +103 -0
  106. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +23 -23
  107. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +6 -6
  108. package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
  109. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +22 -22
  110. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +26 -26
  111. package/dist/lib/components/AcNumberInput.js +5 -0
  112. package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
  113. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
  114. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  115. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
  116. package/dist/lib/components/AcPagination.vue.d.ts +20 -3
  117. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +81 -53
  118. package/dist/lib/components/AcPreloader.vue.d.ts +1 -1
  119. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +3 -3
  120. package/dist/lib/components/AcProgress.vue.d.ts +2 -2
  121. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +4 -4
  122. package/dist/lib/components/AcResourceCard.vue.d.ts +2 -2
  123. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +13 -13
  124. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  125. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +9 -8
  126. package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
  127. package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
  128. package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
  129. package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
  130. package/dist/lib/components/AcSelect.vue.d.ts +4 -4
  131. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +230 -227
  132. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +31 -31
  133. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  134. package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
  135. package/dist/lib/components/AcSidebar.vue.d.ts +3 -3
  136. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +75 -75
  137. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +33 -32
  138. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +6 -6
  139. package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
  140. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  141. package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
  142. package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
  143. package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
  144. package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
  145. package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
  146. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
  147. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +39 -34
  148. package/dist/lib/components/AcSwitchCard.js +5 -0
  149. package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
  150. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +119 -0
  151. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +87 -87
  152. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +4 -4
  153. package/dist/lib/components/AcTag.vue.d.ts +1 -1
  154. package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
  155. package/dist/lib/components/AcTagInput.js +5 -0
  156. package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
  157. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +291 -0
  158. package/dist/lib/components/AcTextarea.vue.d.ts +3 -3
  159. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +89 -64
  160. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +3 -3
  161. package/dist/lib/components/AcTimePicker.js +5 -0
  162. package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
  163. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +463 -0
  164. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +65 -71
  165. package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
  166. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +77 -67
  167. package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
  168. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +111 -103
  169. package/dist/lib/components/index.d.ts +14 -2
  170. package/dist/lib/components/status.d.ts +26 -0
  171. package/dist/lib/components/status.js +110 -0
  172. package/dist/lib/composables/copyText.d.ts +2 -1
  173. package/dist/lib/composables/copyText.js +2 -2
  174. package/dist/lib/composables/useApiPagination.d.ts +55 -0
  175. package/dist/lib/composables/useApiPagination.js +58 -0
  176. package/dist/lib/composables/useBulkSelection.d.ts +44 -0
  177. package/dist/lib/composables/useBulkSelection.js +41 -0
  178. package/dist/lib/composables/useFormValidation.d.ts +65 -0
  179. package/dist/lib/composables/useFormValidation.js +148 -0
  180. package/dist/lib/composables/useTablePagination.d.ts +49 -0
  181. package/dist/lib/composables/useTablePagination.js +41 -0
  182. package/dist/lib/editor/theme.js +65 -62
  183. package/dist/lib/index.d.ts +14 -0
  184. package/dist/lib/index.js +95 -78
  185. package/dist/lib/theme.css +391 -272
  186. package/package.json +11 -4
@@ -0,0 +1,119 @@
1
+ import e from "./AcSpinner.js";
2
+ import t from "./AcSwitch.js";
3
+ import { Comment as n, Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, normalizeClass as m, openBlock as h, ref as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useAttrs as x, useId as S, useModel as C, useSlots as w } from "vue";
4
+ import { Sparkles as T } from "@lucide/vue";
5
+ //#region src/lib/components/AcSwitchCard.vue?vue&type=script&setup=true&lang.ts
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
+ 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"
9
+ }, j = { class: "ml-auto flex shrink-0 items-center gap-3" }, M = {
10
+ key: 0,
11
+ class: "text-sm text-muted"
12
+ }, N = {
13
+ key: 0,
14
+ class: "mt-4 border-t border-border pt-4"
15
+ }, P = "a, button, input, select, textarea, label, [tabindex], [contenteditable]", F = /*@__PURE__*/ d({
16
+ inheritAttrs: !1,
17
+ __name: "AcSwitchCard",
18
+ props: /*@__PURE__*/ f({
19
+ title: {},
20
+ description: { default: "" },
21
+ status: { default: "" },
22
+ statusDetail: { default: "" },
23
+ icon: { default: void 0 },
24
+ recommended: {
25
+ type: Boolean,
26
+ default: !1
27
+ },
28
+ warning: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ disabled: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ loading: {
37
+ type: Boolean,
38
+ default: !1
39
+ }
40
+ }, {
41
+ modelValue: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ modelModifiers: {}
46
+ }),
47
+ emits: ["update:modelValue"],
48
+ setup(d, { expose: f }) {
49
+ let F = d, I = C(d, "modelValue"), L = w(), R = S(), z = `${R}-title`, B = `${R}-description`, V = `${R}-status`, H = x(), U = i(() => ({
50
+ class: H.class,
51
+ style: H.style
52
+ })), W = i(() => {
53
+ let { class: e, style: t, ...n } = H;
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");
56
+ function Q(e) {
57
+ return !!e?.some((e) => e.type !== n && (e.type !== r || Q(e.children)));
58
+ }
59
+ function $() {
60
+ return I.value && Q(L.default?.());
61
+ }
62
+ function ee(e) {
63
+ if (K.value) return;
64
+ let t = e.target.closest(P);
65
+ t && e.currentTarget.contains(t) || window.getSelection()?.toString() || (I.value = !I.value, G.value?.focus());
66
+ }
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],
69
+ "aria-busy": d.loading || void 0,
70
+ "data-ac-ds": "",
71
+ "data-testid": "ac-switch-card"
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"]),
74
+ onClick: ee
75
+ }, [c("div", D, [d.icon ? (h(), s("span", {
76
+ key: 0,
77
+ class: m(["flex size-8 shrink-0 items-center justify-center rounded-10 border transition-colors duration-200", q.value ? "border-primary/25 bg-primary/10 text-primary-strong" : "border-border bg-surface-sunken text-muted"]),
78
+ "aria-hidden": "true"
79
+ }, [(h(), a(v(d.icon), { class: "size-4" }))], 2)) : o("", !0), c("div", O, [c("p", k, [
80
+ c("span", { id: z }, y(d.title), 1),
81
+ d.recommended ? (h(), s("span", A, [u(b(T), {
82
+ class: "size-3",
83
+ "aria-hidden": "true"
84
+ }), r[1] ||= l(" Recommended ", -1)])) : o("", !0),
85
+ _(n.$slots, "badges")
86
+ ]), d.description ? (h(), s("p", {
87
+ key: 0,
88
+ id: B,
89
+ class: "mt-0.5 text-xs leading-snug text-muted"
90
+ }, y(d.description), 1)) : o("", !0)])]), c("div", j, [
91
+ J.value ? (h(), s("div", {
92
+ key: 0,
93
+ id: V,
94
+ class: "text-right"
95
+ }, [c("div", { class: m(["text-base font-bold tabular-nums", Z.value]) }, [_(n.$slots, "status", {}, () => [l(y(d.status), 1)])], 2), d.statusDetail ? (h(), s("div", M, y(d.statusDetail), 1)) : o("", !0)])) : o("", !0),
96
+ d.loading ? (h(), a(e, {
97
+ key: 1,
98
+ class: "text-muted",
99
+ label: "Saving"
100
+ })) : o("", !0),
101
+ u(t, p({
102
+ ref_key: "toggle",
103
+ ref: G
104
+ }, W.value, {
105
+ modelValue: I.value,
106
+ "onUpdate:modelValue": r[0] ||= (e) => I.value = e,
107
+ disabled: K.value,
108
+ "aria-labelledby": z,
109
+ "aria-describedby": Y.value
110
+ }), null, 16, [
111
+ "modelValue",
112
+ "disabled",
113
+ "aria-describedby"
114
+ ])
115
+ ])], 2), $() ? (h(), s("div", N, [_(n.$slots, "default")])) : o("", !0)], 16, E));
116
+ }
117
+ });
118
+ //#endregion
119
+ export { F as default };
@@ -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 te, Check as x, ChevronRight as S, ChevronsUpDown as C, Minus as w } from "@lucide/vue";
3
+ import { ArrowUp as x, Check as S, ChevronRight as C, ChevronsUpDown 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 T = { class: "ac-scrollbar" }, ne = { class: "w-full border-separate border-spacing-0 text-base" }, re = { class: "relative flex size-4" }, ie = [
5
+ var ne = { class: "ac-scrollbar" }, re = { class: "w-full border-separate border-spacing-0 text-base" }, ie = { class: "relative flex size-4" }, ae = [
6
6
  "checked",
7
7
  "indeterminate",
8
8
  "disabled"
9
- ], ae = ["aria-sort", "onClick"], E = {
9
+ ], oe = ["aria-sort", "onClick"], se = {
10
10
  key: 0,
11
- class: "h-12 border-b border-border-light pl-3 [tr:last-child_&]:border-0"
12
- }, oe = {
11
+ class: "h-12 border-b border-border pl-4 [tr:last-child_&]:border-0"
12
+ }, ce = {
13
13
  key: 1,
14
- class: "h-12 border-b border-border-light pl-4 [tr:last-child_&]:border-0"
15
- }, se = [
14
+ class: "h-12 border-b border-border pl-4 [tr:last-child_&]:border-0"
15
+ }, T = [
16
16
  "aria-current",
17
17
  "aria-disabled",
18
18
  "onClick"
19
- ], D = [
19
+ ], E = [
20
20
  "aria-expanded",
21
21
  "aria-controls",
22
22
  "aria-label",
23
23
  "onClick"
24
- ], ce = { class: "relative flex size-4" }, le = [
24
+ ], le = { class: "relative flex size-4" }, ue = [
25
25
  "checked",
26
26
  "disabled",
27
27
  "aria-label",
28
28
  "onChange"
29
- ], ue = {
29
+ ], de = {
30
30
  key: 0,
31
31
  class: "group",
32
32
  "data-testid": "ac-table-detail"
33
- }, O = ["colspan"], de = ["id", "aria-label"], fe = {
33
+ }, D = ["colspan"], O = ["id", "aria-label"], fe = {
34
34
  key: 0,
35
- class: "px-4 py-12 text-center text-muted"
36
- }, k = "peer size-4 cursor-pointer appearance-none rounded-4 border border-border-dark bg-surface align-middle shadow-xs transition-[background-color,border-color,box-shadow] duration-150 hover:border-slate-60 checked:border-primary checked:bg-primary checked:shadow-button indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", A = /*@__PURE__*/ l({
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({
37
37
  __name: "AcTable",
38
38
  props: /*@__PURE__*/ u({
39
39
  columns: {},
@@ -95,70 +95,70 @@ var T = { class: "ac-scrollbar" }, ne = { class: "w-full border-separate border-
95
95
  "update:sortBy"
96
96
  ]),
97
97
  setup(l, { emit: u }) {
98
- let A = l, j = y(l, "selected"), M = y(l, "expanded"), N = u, P = ee(), F = y(l, "sortBy"), I = n(() => F.value?.key ?? ""), L = n(() => F.value?.mode ?? "asc"), R = (e) => {
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) => {
99
99
  if (!e.sortable) return;
100
- let t = I.value === e.key && L.value === "asc" ? "desc" : "asc";
101
- F.value = {
100
+ let t = L.value === e.key && R.value === "asc" ? "desc" : "asc";
101
+ I.value = {
102
102
  key: e.key,
103
103
  mode: t
104
- }, N("sort", e.key, t);
105
- }, z = n(() => {
106
- if (!I.value || A.manualSort) return A.rows;
107
- let e = I.value, t = L.value === "asc" ? 1 : -1;
108
- return [...A.rows].sort((n, r) => String(V(n[e]) ?? "").localeCompare(String(V(r[e]) ?? ""), void 0, { numeric: !0 }) * 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);
109
109
  });
110
- function B(e) {
110
+ function V(e) {
111
111
  return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
112
112
  }
113
- function V(e) {
114
- return B(e) ? e.sort ?? e.data : e;
113
+ function H(e) {
114
+ return V(e) ? e.sort ?? e.data : e;
115
115
  }
116
- let H = (e) => !!A.rowDisabled?.(e), U = n(() => A.rows.filter((e) => !H(e)).map((e) => e[A.rowKey])), W = n(() => new Set(j.value)), G = n(() => U.value.length > 0 && U.value.every((e) => W.value.has(e))), K = n(() => !G.value && U.value.some((e) => W.value.has(e)));
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
117
  function pe() {
118
- let e = new Set(U.value);
119
- j.value = G.value ? j.value.filter((t) => !e.has(t)) : [...j.value, ...U.value.filter((e) => !W.value.has(e))];
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))];
120
120
  }
121
121
  function me(e) {
122
- let t = e[A.rowKey];
123
- j.value = W.value.has(t) ? j.value.filter((e) => e !== t) : [...j.value, t];
122
+ let t = e[j.rowKey];
123
+ M.value = G.value.has(t) ? M.value.filter((e) => e !== t) : [...M.value, t];
124
124
  }
125
- let q = n(() => new Set(M.value)), J = (e) => A.expandable && q.value.has(e[A.rowKey]), Y = (e) => !A.canExpand || A.canExpand(e), X = (e) => `${P}-detail-${String(e[A.rowKey])}`, he = n(() => A.columns.length + +!!A.selectable + +!!A.expandable);
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
126
  function ge(e) {
127
- let t = e[A.rowKey];
128
- M.value = q.value.has(t) ? M.value.filter((e) => e !== t) : [...M.value, t];
127
+ let t = e[j.rowKey];
128
+ N.value = J.value.has(t) ? N.value.filter((e) => e !== t) : [...N.value, t];
129
129
  }
130
- function Z(e) {
131
- let t = e[A.columns[0]?.key ?? ""], n = B(t) ? t.data : t;
132
- return typeof n == "string" || typeof n == "number" ? n : String(e[A.rowKey]);
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]);
133
133
  }
134
- let Q = n(() => A.flat ? "border-border-light" : "border-border"), $ = (e) => ({
134
+ let $ = (e) => ({
135
135
  left: "text-left",
136
136
  center: "text-center",
137
137
  right: "text-right"
138
138
  })[e.align ?? "left"];
139
139
  return (n, u) => (p(), a("div", {
140
- class: d(["w-full overflow-hidden bg-surface", !l.flat && "rounded-10 border border-border shadow-xs"]),
140
+ class: d(["w-full overflow-hidden bg-surface", !l.flat && "rounded-10 border border-border"]),
141
141
  "data-ac-ds": "",
142
142
  "data-testid": "ac-table"
143
- }, [o("div", T, [o("table", ne, [o("thead", null, [o("tr", null, [
143
+ }, [o("div", ne, [o("table", re, [o("thead", null, [o("tr", null, [
144
144
  l.expandable ? (p(), a("th", {
145
145
  key: 0,
146
146
  scope: "col",
147
- class: d(["h-9 w-10 border-b bg-surface-muted pr-0 pl-3", [Q.value, !l.flat && "first:rounded-tl-10"]])
147
+ class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-0 pl-4", [k, !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-9 w-10 border-b bg-surface-muted pr-0 pl-4", [Q.value, !l.flat && "first:rounded-tl-10"]])
153
- }, [o("span", re, [o("input", {
152
+ class: d(["h-11 w-10 border-b bg-surface-sunken/50 pr-1 pl-4", [k, !l.flat && "first:rounded-tl-10"]])
153
+ }, [o("span", ie, [o("input", {
154
154
  type: "checkbox",
155
- class: d(k),
156
- checked: G.value,
157
- indeterminate: K.value,
155
+ class: d(A),
156
+ checked: K.value,
157
+ indeterminate: q.value,
158
158
  disabled: l.loading || !l.rows.length,
159
159
  "aria-label": "Select all rows",
160
160
  onChange: pe
161
- }, null, 40, ie), (p(), r(g(K.value ? v(w) : v(x)), {
161
+ }, null, 40, ae), (p(), r(g(q.value ? v(te) : v(S)), {
162
162
  class: "pointer-events-none absolute inset-0 m-auto size-3 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
163
163
  "stroke-width": 3,
164
164
  "aria-hidden": "true"
@@ -166,85 +166,85 @@ var T = { class: "ac-scrollbar" }, ne = { class: "w-full border-separate border-
166
166
  (p(!0), a(t, null, m(l.columns, (e) => (p(), a("th", {
167
167
  key: e.key,
168
168
  scope: "col",
169
- class: d(["h-9 border-b bg-surface-muted px-4 text-xs font-medium whitespace-nowrap text-label", [
170
- Q.value,
169
+ class: d(["h-11 border-b bg-surface-sunken/50 px-6 text-base font-semibold whitespace-nowrap text-muted", [
170
+ k,
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": I.value === e.key ? L.value === "asc" ? "ascending" : "descending" : void 0,
177
- onClick: (t) => R(e)
178
- }, [o("span", { class: d(["inline-flex items-center gap-1", I.value === e.key && "text-heading"]) }, [h(n.$slots, `header-${e.key}`, { column: e }, () => [s(_(e.label), 1)]), e.sortable ? (p(), r(g(I.value === e.key ? v(te) : v(C)), {
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)), {
179
179
  key: 0,
180
- class: d(["size-3 transition-transform", [I.value === e.key ? "text-primary" : "text-slate-60", I.value === e.key && L.value === "desc" && "rotate-180"]]),
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"]]),
181
181
  "aria-hidden": "true"
182
- }, null, 8, ["class"])) : i("", !0)], 2)], 14, ae))), 128))
182
+ }, null, 8, ["class"])) : i("", !0)], 2)], 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", E)) : i("", !0),
185
- l.selectable ? (p(), a("td", oe)) : i("", !0),
184
+ l.expandable ? (p(), a("td", se)) : i("", !0),
185
+ l.selectable ? (p(), a("td", ce)) : 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-light px-4 [tr:last-child_&]:border-0"
188
+ class: "h-12 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(z.value, (f, g) => (p(), a(t, { key: String(f[l.rowKey] ?? g) }, [o("tr", {
193
+ ]))), 128)) : (p(!0), a(t, { key: 1 }, m(B.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-100 hover:bg-surface-muted/70", [
195
+ class: d(["group transition-colors duration-150 hover:bg-surface-sunken/40", [
196
196
  l.clickable && "cursor-pointer",
197
- (l.rowActive?.(f) || l.selectable && W.value.has(f[l.rowKey])) && "bg-primary-97",
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
- H(f) && "pointer-events-none cursor-not-allowed opacity-50"
199
+ U(f) && "pointer-events-none cursor-not-allowed opacity-50"
200
200
  ]]),
201
201
  "aria-current": l.rowActive?.(f) ? "true" : void 0,
202
- "aria-disabled": H(f) || void 0,
203
- onClick: (e) => l.clickable && !H(f) && N("row-click", f)
202
+ "aria-disabled": U(f) || void 0,
203
+ onClick: (e) => l.clickable && !U(f) && P("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-light pr-0 pl-3 group-last:border-0",
207
+ class: "h-12 w-10 border-b border-border pr-0 pl-4 group-last:border-0",
208
208
  onClick: u[0] ||= b(() => {}, ["stop"])
209
- }, [Y(f) ? (p(), a("button", {
209
+ }, [X(f) ? (p(), a("button", {
210
210
  key: 0,
211
211
  type: "button",
212
- class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-6 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
213
- "aria-expanded": J(f),
214
- "aria-controls": X(f),
215
- "aria-label": `${J(f) ? "Collapse" : "Expand"} ${Z(f)}`,
212
+ class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
213
+ "aria-expanded": Y(f),
214
+ "aria-controls": Z(f),
215
+ "aria-label": `${Y(f) ? "Collapse" : "Expand"} ${Q(f)}`,
216
216
  "data-testid": "ac-table-expand",
217
217
  onClick: (e) => ge(f)
218
- }, [c(v(S), {
219
- class: d(["size-4 transition-transform duration-150 motion-reduce:transition-none", J(f) && "rotate-90"]),
218
+ }, [c(v(C), {
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, D)) : i("", !0)])) : i("", !0),
221
+ }, null, 8, ["class"])], 8, E)) : 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-light pr-0 pl-4 group-last:border-0",
224
+ class: "h-12 w-10 border-b border-border pr-1 pl-4 group-last:border-0",
225
225
  onClick: u[1] ||= b(() => {}, ["stop"])
226
- }, [o("span", ce, [o("input", {
226
+ }, [o("span", le, [o("input", {
227
227
  type: "checkbox",
228
- class: d(k),
229
- checked: W.value.has(f[l.rowKey]),
230
- disabled: H(f),
231
- "aria-label": `Select ${Z(f)}`,
228
+ class: d(A),
229
+ checked: G.value.has(f[l.rowKey]),
230
+ disabled: U(f),
231
+ "aria-label": `Select ${Q(f)}`,
232
232
  onChange: (e) => me(f)
233
- }, null, 40, le), c(v(x), {
233
+ }, null, 40, ue), c(v(S), {
234
234
  class: "pointer-events-none absolute inset-0 m-auto size-3 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-light px-4 whitespace-nowrap text-body tabular-nums group-last:border-0", $(i)])
240
+ class: d(["h-12 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]
244
244
  }, () => [i.type || i.descriptor ? (p(), r(e, {
245
245
  key: 0,
246
- value: B(f[i.key]) ? void 0 : f[i.key],
247
- cell: B(f[i.key]) ? f[i.key] : void 0,
246
+ value: V(f[i.key]) ? void 0 : f[i.key],
247
+ cell: V(f[i.key]) ? f[i.key] : void 0,
248
248
  column: i.descriptor,
249
249
  type: i.type,
250
250
  title: i.label,
@@ -257,16 +257,16 @@ var T = { class: "ac-scrollbar" }, ne = { 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, se), J(f) && Y(f) ? (p(), a("tr", ue, [o("td", {
260
+ ], 10, T), Y(f) && X(f) ? (p(), a("tr", de, [o("td", {
261
261
  colspan: he.value,
262
- class: "border-b border-border-light bg-surface-muted/50 p-0 group-last:border-0"
262
+ class: "border-b border-border bg-surface-muted p-0 group-last:border-0"
263
263
  }, [o("div", {
264
- id: X(f),
264
+ id: Z(f),
265
265
  role: "region",
266
- "aria-label": `Details for ${Z(f)}`,
267
- class: "px-4 py-3 text-body"
268
- }, [h(n.$slots, "expanded", { row: f })], 8, de)], 8, O)])) : i("", !0)], 64))), 128))])])]), !l.loading && !l.rows.length ? (p(), a("div", fe, [h(n.$slots, "empty", {}, () => [s(_(l.emptyText), 1)])])) : i("", !0)], 2));
266
+ "aria-label": `Details for ${Q(f)}`,
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));
269
269
  }
270
270
  });
271
271
  //#endregion
272
- export { A as default };
272
+ export { j as default };
@@ -5,11 +5,11 @@ var b = {
5
5
  "data-testid": "ac-tabs"
6
6
  }, x = {
7
7
  role: "tablist",
8
- class: "flex gap-5 overflow-x-auto overflow-y-hidden border-b border-border-light [scrollbar-width:none]"
8
+ class: "flex gap-6 overflow-x-auto overflow-y-hidden border-b border-border px-1 text-base font-medium [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
9
9
  }, S = {
10
10
  key: 0,
11
11
  role: "tabpanel",
12
- class: "pt-5"
12
+ class: "pt-6"
13
13
  }, C = /*@__PURE__*/ s({
14
14
  __name: "AcTabs",
15
15
  props: /*@__PURE__*/ l({ items: {} }, {
@@ -53,12 +53,12 @@ var b = {
53
53
  return (t, c) => (f(), i("div", b, [a("div", x, [(f(!0), i(e, null, p(s.items, (e) => (f(), n(h(O(e)), u({ key: e.key }, { ref_for: !0 }, k(e), {
54
54
  role: "tab",
55
55
  "aria-selected": C.value === e.key,
56
- class: ["relative -mb-px inline-flex h-10 cursor-pointer items-center gap-2 border-b-2 text-base font-medium whitespace-nowrap transition-colors duration-150 focus-visible:rounded-4 focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring no-underline disabled:cursor-not-allowed disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-40", C.value === e.key ? "border-primary text-heading" : "border-transparent text-muted hover:border-border-dark hover:text-heading"],
56
+ class: ["relative inline-flex shrink-0 cursor-pointer items-center gap-2 border-b-2 pt-1 pb-3 whitespace-nowrap no-underline transition-colors duration-200 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-40", C.value === e.key ? "border-primary text-primary-strong" : "border-transparent text-muted hover:border-border hover:text-heading"],
57
57
  onClick: (t) => A(e, t)
58
58
  }), {
59
59
  default: y(() => [o(g(e.label) + " ", 1), e.count === void 0 ? r("", !0) : (f(), i("span", {
60
60
  key: 0,
61
- class: d(["inline-flex h-4.5 min-w-4.5 items-center justify-center rounded-50 px-1.5 text-sm leading-none tabular-nums", C.value === e.key ? "bg-primary-95 text-primary-10" : "bg-surface-sunken text-label"])
61
+ class: d(["inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-xs leading-none font-medium tabular-nums", C.value === e.key ? "bg-primary/10 text-primary-strong" : "bg-surface-sunken text-muted"])
62
62
  }, g(e.count), 3))]),
63
63
  _: 2
64
64
  }, 1040, [
@@ -4,7 +4,7 @@ export interface Props {
4
4
  label?: string;
5
5
  /** `neutral` for most labels; a tone to group filters by kind, e.g. environment or region. */
6
6
  color?: Tone | "neutral";
7
- /** Pill shape (`rounded-50`) instead of the 6px control radius. */
7
+ /** Pill shape (`rounded-full`), as cloud-ui's label chips, instead of 6px corners. */
8
8
  rounded?: boolean;
9
9
  /** Shows a remove button that emits `remove`. */
10
10
  removable?: boolean;
@@ -29,49 +29,49 @@ var m = {
29
29
  setup(s, { emit: b }) {
30
30
  let x = s, S = b, C = {
31
31
  neutral: {
32
- box: "bg-surface text-body border-border",
33
- value: "bg-surface text-heading",
32
+ box: "bg-surface-sunken text-heading border-border",
33
+ value: "text-heading",
34
34
  divider: "border-border"
35
35
  },
36
36
  primary: {
37
- box: "bg-primary-97 text-primary-20 border-primary-80",
38
- value: "bg-primary-95 text-primary-10",
39
- divider: "border-primary-80"
37
+ box: "bg-primary/10 text-primary-strong border-primary/25",
38
+ value: "bg-primary/10 text-primary-strong",
39
+ divider: "border-primary/25"
40
40
  },
41
41
  info: {
42
- box: "bg-blue-97 text-blue-20 border-blue-80",
43
- value: "bg-blue-95 text-blue-10",
44
- divider: "border-blue-80"
42
+ box: "bg-info/10 text-info-strong border-info/25",
43
+ value: "bg-info/10 text-info-strong",
44
+ divider: "border-info/25"
45
45
  },
46
46
  success: {
47
- box: "bg-green-97 text-green-20 border-green-80",
48
- value: "bg-green-95 text-green-10",
49
- divider: "border-green-80"
47
+ box: "bg-success/10 text-success-strong border-success/25",
48
+ value: "bg-success/10 text-success-strong",
49
+ divider: "border-success/25"
50
50
  },
51
51
  warning: {
52
- box: "bg-yellow-97 text-yellow-20 border-yellow-80",
53
- value: "bg-yellow-95 text-yellow-10",
54
- divider: "border-yellow-80"
52
+ box: "bg-warning/10 text-warning-strong border-warning/30",
53
+ value: "bg-warning/10 text-warning-strong",
54
+ divider: "border-warning/30"
55
55
  },
56
56
  danger: {
57
- box: "bg-red-97 text-red-20 border-red-80",
58
- value: "bg-red-95 text-red-10",
59
- divider: "border-red-80"
57
+ box: "bg-danger/10 text-danger-strong border-danger/25",
58
+ value: "bg-danger/10 text-danger-strong",
59
+ divider: "border-danger/25"
60
60
  }
61
- }, w = t(() => !!x.keyLabel), T = t(() => C[x.color]), E = t(() => w.value ? `${x.keyLabel}=${x.valueLabel}` : x.label), D = t(() => w.value ? ["bg-surface text-label", x.color === "neutral" ? "border-border" : T.value.divider] : T.value.box);
61
+ }, w = t(() => !!x.keyLabel), T = t(() => C[x.color]), E = t(() => w.value ? `${x.keyLabel}=${x.valueLabel}` : x.label), D = t(() => w.value ? ["bg-surface-sunken text-muted", T.value.divider] : T.value.box);
62
62
  function O() {
63
63
  S("remove");
64
64
  }
65
65
  return (t, b) => (l(), r("span", {
66
- class: c(["inline-flex h-6 max-w-full items-stretch overflow-hidden border text-xs leading-none whitespace-nowrap", [
66
+ class: c(["inline-flex h-6 max-w-full items-stretch overflow-hidden border text-xs leading-none font-medium whitespace-nowrap", [
67
67
  D.value,
68
- s.rounded ? "rounded-50" : "rounded-6",
69
- w.value && "font-mono text-[length:calc(11.5px*var(--ac-scale))]"
68
+ s.rounded ? "rounded-full" : "rounded-6",
69
+ w.value && "font-mono"
70
70
  ]]),
71
71
  "data-ac-ds": "",
72
72
  "data-testid": "ac-tag"
73
73
  }, [w.value ? (l(), r(e, { key: 0 }, [
74
- i("span", { class: c(["inline-flex min-w-0 items-center gap-1.5 bg-surface-muted pr-1.5 text-label", s.rounded ? "pl-2.5" : "pl-2"]) }, [t.$slots.icon ? (l(), r("span", m, [u(t.$slots, "icon")])) : n("", !0), i("span", h, d(s.keyLabel), 1)], 2),
74
+ i("span", { class: c(["inline-flex min-w-0 items-center gap-1.5 pr-1.5 text-muted", s.rounded ? "pl-2.5" : "pl-2"]) }, [t.$slots.icon ? (l(), r("span", m, [u(t.$slots, "icon")])) : n("", !0), i("span", h, d(s.keyLabel), 1)], 2),
75
75
  b[0] ||= i("span", { class: "sr-only" }, "=", -1),
76
76
  i("span", { class: c(["inline-flex min-w-0 shrink-[0.25] items-center border-l pl-1.5", [
77
77
  T.value.value,
@@ -0,0 +1,5 @@
1
+ import e from "./AcTagInput.vue_vue_type_script_setup_true_lang.js";
2
+ //#region src/lib/components/AcTagInput.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,74 @@
1
+ export interface Props {
2
+ /** Label above the field. Also the accessible name of the input and of the list of values. */
3
+ label: string;
4
+ /** Native `name` attribute of the text input. */
5
+ name?: string;
6
+ /** Example value shown in the empty input, e.g. "e.g. 10.0.0.0/16". */
7
+ placeholder?: string;
8
+ /** Help text between the label and the field. */
9
+ hint?: string;
10
+ /** Error text under the field. Turns the border red and sets `aria-invalid`. A rejected value's own message shows first. */
11
+ errorMsg?: string;
12
+ /** `small` 36px or `normal` 40px tall when empty; the field grows as values wrap. */
13
+ size?: "small" | "normal";
14
+ /** Most values allowed. The count shows under the field and adding more shows an error. */
15
+ maxItems?: number;
16
+ /** Lets the same value be added twice. Off by default: a repeat shows “… is already added”. */
17
+ allowDuplicates?: boolean;
18
+ /** Checks a value before it's added. Return a message to reject it; the text stays in the input with the message. */
19
+ validate?: (value: string, values: string[]) => string | void | null | undefined;
20
+ /** Cleans typed text before it's checked and added, e.g. `(v) => v.trim().toLowerCase()`. Defaults to trimming. */
21
+ transform?: (value: string) => string;
22
+ /** Shows a button that removes every value. Was `show-all-clear` in cloud-ui. */
23
+ showClear?: boolean;
24
+ /** Adds the typed text when the input loses focus, so a value isn't lost when people click Save. */
25
+ addOnBlur?: boolean;
26
+ /** Shows values and the input in the monospace font, for IPs, CIDRs and resource names. */
27
+ mono?: boolean;
28
+ /** Marks the field required and adds a red asterisk. Pass `error-msg` when the list is empty on submit. Was `is-required` in cloud-ui. */
29
+ required?: boolean;
30
+ /** Disables the field. Was `is-disabled` in cloud-ui. */
31
+ disabled?: boolean;
32
+ /** Shows the values on a muted fill, without remove buttons or the text input. Was `is-read-only` in cloud-ui. */
33
+ readonly?: boolean;
34
+ }
35
+ type __VLS_Props = Props;
36
+ type __VLS_ModelProps = {
37
+ /** The values, in the order they were added. Replaced with a new array on every change. */
38
+ modelValue?: string[];
39
+ };
40
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
41
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
42
+ /** Moves focus to the text input. */
43
+ focus: () => void | undefined;
44
+ /** Adds the typed text now, e.g. before submitting. Returns `false` when text was rejected and is still in the input. */
45
+ commit: () => boolean;
46
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
47
+ "update:modelValue": (value: string[]) => any;
48
+ clear: () => any;
49
+ add: (value: string) => any;
50
+ remove: (value: string, index: number) => any;
51
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
52
+ "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
53
+ onClear?: (() => any) | undefined;
54
+ onAdd?: ((value: string) => any) | undefined;
55
+ onRemove?: ((value: string, index: number) => any) | undefined;
56
+ }>, {
57
+ required: boolean;
58
+ disabled: boolean;
59
+ name: string;
60
+ transform: (value: string) => string;
61
+ size: "small" | "normal";
62
+ maxItems: number;
63
+ readonly: boolean;
64
+ hint: string;
65
+ validate: (value: string, values: string[]) => string | void | null | undefined;
66
+ placeholder: string;
67
+ errorMsg: string;
68
+ mono: boolean;
69
+ allowDuplicates: boolean;
70
+ showClear: boolean;
71
+ addOnBlur: boolean;
72
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
73
+ declare const _default: typeof __VLS_export;
74
+ export default _default;