@ac-design/design-system 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
  2. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
  3. package/dist/lib/charts/cartesian.d.ts +324 -0
  4. package/dist/lib/charts/cartesian.js +137 -0
  5. package/dist/lib/charts/echarts.d.ts +86 -0
  6. package/dist/lib/charts/echarts.js +173 -0
  7. package/dist/lib/charts/graph.d.ts +77 -0
  8. package/dist/lib/charts/graph.js +155 -0
  9. package/dist/lib/charts/index.d.ts +4 -0
  10. package/dist/lib/charts/index.js +3 -1
  11. package/dist/lib/charts/shared.d.ts +0 -7
  12. package/dist/lib/charts/shared.js +1 -19
  13. package/dist/lib/charts/xy.d.ts +11 -7
  14. package/dist/lib/charts/xy.js +53 -72
  15. package/dist/lib/compat.css +1322 -278
  16. package/dist/lib/components/AcAlert.vue.d.ts +9 -0
  17. package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
  18. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
  19. package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
  20. package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
  21. package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
  22. package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
  23. package/dist/lib/components/AcBadge.vue.d.ts +7 -3
  24. package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
  25. package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
  26. package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
  27. package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
  28. package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
  29. package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
  30. package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
  31. package/dist/lib/components/AcButton.vue.d.ts +12 -6
  32. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
  33. package/dist/lib/components/AcCard.vue.d.ts +34 -3
  34. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
  35. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  36. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
  37. package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
  38. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
  39. package/dist/lib/components/AcCheckList.js +5 -0
  40. package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
  41. package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
  42. package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
  43. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
  44. package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
  45. package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
  46. package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
  47. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
  48. package/dist/lib/components/AcCommandBlock.js +5 -0
  49. package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
  50. package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
  51. package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
  52. package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
  53. package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
  54. package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
  55. package/dist/lib/components/AcCostSummary.js +5 -0
  56. package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
  57. package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
  58. package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
  59. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
  60. package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
  61. package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
  62. package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
  63. package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
  64. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
  65. package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
  66. package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
  67. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
  68. package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
  69. package/dist/lib/components/AcErrorState.js +5 -0
  70. package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
  71. package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
  72. package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
  73. package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
  74. package/dist/lib/components/AcFooter.vue.d.ts +1 -1
  75. package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
  76. package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
  77. package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
  78. package/dist/lib/components/AcGraphChart.js +5 -0
  79. package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
  80. package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
  81. package/dist/lib/components/AcHeader.vue.d.ts +20 -2
  82. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
  83. package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
  84. package/dist/lib/components/AcInput.vue.d.ts +1 -1
  85. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
  86. package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
  87. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
  88. package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
  89. package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
  90. package/dist/lib/components/AcLoader.js +5 -0
  91. package/dist/lib/components/AcLoader.vue.d.ts +15 -0
  92. package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
  93. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
  94. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
  95. package/dist/lib/components/AcMapChart.js +5 -0
  96. package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
  97. package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
  98. package/dist/lib/components/AcModal.vue.d.ts +6 -3
  99. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
  100. package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
  101. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
  102. package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
  103. package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
  104. package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
  105. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
  106. package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
  107. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
  108. package/dist/lib/components/AcPage.vue.d.ts +2 -2
  109. package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
  110. package/dist/lib/components/AcPagination.vue.d.ts +5 -5
  111. package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
  112. package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
  113. package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
  114. package/dist/lib/components/AcProductHero.js +5 -0
  115. package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
  116. package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
  117. package/dist/lib/components/AcProgress.vue.d.ts +17 -2
  118. package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
  119. package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
  120. package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
  121. package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
  122. package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
  123. package/dist/lib/components/AcSelect.vue.d.ts +3 -3
  124. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
  125. package/dist/lib/components/AcSettingsRow.js +5 -0
  126. package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
  127. package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
  128. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
  129. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  130. package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
  131. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
  132. package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
  133. package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
  134. package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
  135. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
  136. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
  137. package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
  138. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
  139. package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
  140. package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
  141. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
  142. package/dist/lib/components/AcTabs.vue.d.ts +9 -2
  143. package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
  144. package/dist/lib/components/AcTag.vue.d.ts +1 -1
  145. package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
  146. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
  147. package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
  148. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
  149. package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
  150. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
  151. package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
  152. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
  153. package/dist/lib/components/AcToaster.vue.d.ts +6 -3
  154. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
  155. package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
  156. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
  157. package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
  158. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
  159. package/dist/lib/components/index.d.ts +7 -0
  160. package/dist/lib/components/status.d.ts +3 -1
  161. package/dist/lib/components/status.js +20 -5
  162. package/dist/lib/composables/useToast.d.ts +17 -1
  163. package/dist/lib/composables/useToast.js +10 -2
  164. package/dist/lib/index.d.ts +7 -3
  165. package/dist/lib/index.js +80 -73
  166. package/dist/lib/theme.css +39 -54
  167. package/package.json +12 -3
@@ -4,28 +4,28 @@ var b = {
4
4
  "data-ac-ds": "",
5
5
  "data-testid": "ac-tabs"
6
6
  }, x = {
7
- role: "tablist",
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
- }, S = {
10
7
  key: 0,
11
8
  role: "tabpanel",
12
9
  class: "pt-6"
13
- }, C = /*@__PURE__*/ s({
10
+ }, S = /*@__PURE__*/ s({
14
11
  __name: "AcTabs",
15
- props: /*@__PURE__*/ l({ items: {} }, {
12
+ props: /*@__PURE__*/ l({
13
+ items: {},
14
+ variant: { default: "soft" }
15
+ }, {
16
16
  modelValue: { default: "" },
17
17
  modelModifiers: {}
18
18
  }),
19
19
  emits: ["update:modelValue"],
20
20
  setup(s) {
21
- let l = s, C = _(s, "modelValue"), w = c()?.appContext, T = w?.components.RouterLink, E = w?.config.globalProperties.$router, D = t(() => {
22
- if (!E) return "";
23
- let e = E.currentRoute.value.path, t = "", n = -1;
21
+ let l = s, S = _(s, "modelValue"), C = c()?.appContext, w = C?.components.RouterLink, T = C?.config.globalProperties.$router, E = t(() => {
22
+ if (!T) return "";
23
+ let e = T.currentRoute.value.path, t = "", n = -1;
24
24
  for (let r of l.items) {
25
25
  if (r.to === void 0 || r.disabled) continue;
26
26
  let i;
27
27
  try {
28
- i = E.resolve(r.to).path;
28
+ i = T.resolve(r.to).path;
29
29
  } catch {
30
30
  continue;
31
31
  }
@@ -35,38 +35,53 @@ var b = {
35
35
  }
36
36
  return t;
37
37
  });
38
- v(D, (e) => e && (C.value = e), { immediate: !0 });
39
- function O(e) {
40
- return e.to !== void 0 && T && !e.disabled ? T : e.href || typeof e.to == "string" ? "a" : "button";
38
+ v(E, (e) => e && (S.value = e), { immediate: !0 });
39
+ function D(e) {
40
+ return e.to !== void 0 && w && !e.disabled ? w : e.href || typeof e.to == "string" ? "a" : "button";
41
41
  }
42
- function k(e) {
43
- let t = O(e), n = { "data-testid": e.testid };
44
- return t === T ? n.to = e.to : t === "a" ? e.disabled ? n["aria-disabled"] = "true" : n.href = e.href ?? e.to : (n.type = "button", n.disabled = e.disabled || void 0), n;
42
+ function O(e) {
43
+ let t = D(e), n = { "data-testid": e.testid };
44
+ return t === w ? n.to = e.to : t === "a" ? e.disabled ? n["aria-disabled"] = "true" : n.href = e.href ?? e.to : (n.type = "button", n.disabled = e.disabled || void 0), n;
45
45
  }
46
- function A(e, t) {
46
+ function k(e, t) {
47
47
  if (e.disabled) {
48
48
  t.preventDefault();
49
49
  return;
50
50
  }
51
- C.value = e.key;
51
+ S.value = e.key;
52
+ }
53
+ function A(e) {
54
+ let t = S.value === e.key;
55
+ return l.variant === "soft" ? ["rounded-t-8 px-3 py-2", t ? "border-primary bg-primary/4 text-primary-strong" : "border-transparent text-muted hover:bg-accent/60 hover:text-heading"] : ["pt-1 pb-3", t ? "border-primary text-primary-strong" : "border-transparent text-muted hover:border-border hover:text-heading"];
52
56
  }
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), {
57
+ return (t, c) => (f(), i("div", b, [a("div", {
58
+ role: "tablist",
59
+ class: d(["flex border-b border-border px-1 text-base font-medium", s.variant === "soft" ? "flex-wrap gap-1" : "gap-6 overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"])
60
+ }, [(f(!0), i(e, null, p(s.items, (e) => (f(), n(h(D(e)), u({ key: e.key }, { ref_for: !0 }, O(e), {
54
61
  role: "tab",
55
- "aria-selected": C.value === e.key,
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
- onClick: (t) => A(e, t)
62
+ "aria-selected": S.value === e.key,
63
+ class: ["relative inline-flex shrink-0 cursor-pointer items-center gap-2 border-b-2 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", A(e)],
64
+ onClick: (t) => k(e, t)
58
65
  }), {
59
- default: y(() => [o(g(e.label) + " ", 1), e.count === void 0 ? r("", !0) : (f(), i("span", {
60
- key: 0,
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
- }, g(e.count), 3))]),
66
+ default: y(() => [
67
+ e.icon ? (f(), n(h(e.icon), {
68
+ key: 0,
69
+ class: "-mr-0.5 size-3.5 shrink-0",
70
+ "aria-hidden": "true"
71
+ })) : r("", !0),
72
+ o(" " + g(e.label) + " ", 1),
73
+ e.count === void 0 ? r("", !0) : (f(), i("span", {
74
+ key: 1,
75
+ 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", S.value === e.key ? "bg-primary/10 text-primary-strong" : "bg-surface-sunken text-muted"])
76
+ }, g(e.count), 3))
77
+ ]),
63
78
  _: 2
64
79
  }, 1040, [
65
80
  "aria-selected",
66
81
  "class",
67
82
  "onClick"
68
- ]))), 128))]), t.$slots.default ? (f(), i("div", S, [m(t.$slots, "default", { active: C.value })])) : r("", !0)]));
83
+ ]))), 128))], 2), t.$slots.default ? (f(), i("div", x, [m(t.$slots, "default", { active: S.value })])) : r("", !0)]));
69
84
  }
70
85
  });
71
86
  //#endregion
72
- export { C as default };
87
+ export { S as default };
@@ -27,9 +27,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
27
27
  label: string;
28
28
  color: Tone | "neutral";
29
29
  rounded: boolean;
30
- removable: boolean;
31
30
  keyLabel: string;
32
31
  valueLabel: string;
32
+ removable: boolean;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
35
35
  declare const _default: typeof __VLS_export;
@@ -3,15 +3,15 @@ export interface Props {
3
3
  label: string;
4
4
  /** Native `name` attribute of the text input. */
5
5
  name?: string;
6
- /** Example value shown in the empty input, e.g. "e.g. 10.0.0.0/16". */
6
+ /** Example value shown in the empty input, e.g. "e.g. 10.0.0.0/16". Defaults to "Add item and press Enter". */
7
7
  placeholder?: string;
8
8
  /** Help text between the label and the field. */
9
9
  hint?: string;
10
10
  /** Error text under the field. Turns the border red and sets `aria-invalid`. A rejected value's own message shows first. */
11
11
  errorMsg?: string;
12
- /** `small` 36px or `normal` 40px tall when empty; the field grows as values wrap. */
12
+ /** Field height: `small` 36px or `normal` 42px. Values show as chips under it. */
13
13
  size?: "small" | "normal";
14
- /** Most values allowed. The count shows under the field and adding more shows an error. */
14
+ /** Most values allowed. A “N / max items” count shows under the values, amber from 80% and red at the limit; adding more shows an error. */
15
15
  maxItems?: number;
16
16
  /** Lets the same value be added twice. Off by default: a repeat shows “… is already added”. */
17
17
  allowDuplicates?: boolean;
@@ -23,13 +23,13 @@ export interface Props {
23
23
  showClear?: boolean;
24
24
  /** Adds the typed text when the input loses focus, so a value isn't lost when people click Save. */
25
25
  addOnBlur?: boolean;
26
- /** Shows values and the input in the monospace font, for IPs, CIDRs and resource names. */
26
+ /** Shows the chips and the input in the monospace font, for IPs, CIDRs and resource names. */
27
27
  mono?: boolean;
28
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
29
  required?: boolean;
30
30
  /** Disables the field. Was `is-disabled` in cloud-ui. */
31
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. */
32
+ /** Shows the input on a muted fill and the chips without remove buttons. Was `is-read-only` in cloud-ui. */
33
33
  readonly?: boolean;
34
34
  }
35
35
  type __VLS_Props = Props;
@@ -1,18 +1,14 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, nextTick as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, useAttrs as _, useId as ee, useModel as te, vModelText as ne, watch as re, withDirectives as ie, withModifiers as ae } from "vue";
2
- import { CircleAlert as oe, Plus as se, X as v } 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, mergeModels as s, mergeProps as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, vModelText as y, watch as ee, withDirectives as te, withModifiers as ne } from "vue";
2
+ import { Plus as re, X as b } from "@lucide/vue";
3
3
  //#region src/lib/components/AcTagInput.vue?vue&type=script&setup=true&lang.ts
4
- var ce = ["for"], y = {
4
+ var ie = ["for"], x = {
5
5
  key: 0,
6
6
  class: "font-normal text-muted"
7
- }, b = {
7
+ }, ae = {
8
8
  key: 1,
9
9
  class: "text-danger",
10
10
  "aria-hidden": "true"
11
- }, x = ["aria-label"], S = ["title"], le = [
12
- "aria-label",
13
- "onClick",
14
- "onKeydown"
15
- ], C = [
11
+ }, S = [
16
12
  "id",
17
13
  "name",
18
14
  "placeholder",
@@ -21,19 +17,25 @@ var ce = ["for"], y = {
21
17
  "aria-invalid",
22
18
  "aria-required",
23
19
  "aria-describedby"
24
- ], ue = {
25
- key: 0,
26
- class: "flex shrink-0 items-center gap-0.5 text-muted"
27
- }, w = ["aria-label", "title"], T = {
28
- key: 1,
29
- class: "mt-1.5 flex items-start gap-3"
30
- }, E = {
20
+ ], C = [
21
+ "disabled",
22
+ "aria-label",
23
+ "title"
24
+ ], oe = ["aria-label"], se = ["title"], ce = [
25
+ "aria-label",
26
+ "title",
27
+ "onClick",
28
+ "onKeydown"
29
+ ], le = {
30
+ key: 3,
31
+ class: "mt-2 flex items-center justify-between gap-3 text-xs text-muted tabular-nums"
32
+ }, w = { key: 0 }, T = {
31
33
  class: "sr-only",
32
34
  "aria-live": "polite"
33
- }, D = /*@__PURE__*/ s({
35
+ }, E = /*@__PURE__*/ o({
34
36
  inheritAttrs: !1,
35
37
  __name: "AcTagInput",
36
- props: /*@__PURE__*/ c({
38
+ props: /*@__PURE__*/ s({
37
39
  label: {},
38
40
  name: { default: "" },
39
41
  placeholder: { default: "" },
@@ -81,34 +83,34 @@ var ce = ["for"], y = {
81
83
  modelValue: { default: () => [] },
82
84
  modelModifiers: {}
83
85
  }),
84
- emits: /*@__PURE__*/ c([
86
+ emits: /*@__PURE__*/ s([
85
87
  "add",
86
88
  "remove",
87
89
  "clear"
88
90
  ], ["update:modelValue"]),
89
- setup(s, { expose: c, emit: D }) {
90
- let O = s, k = te(s, "modelValue"), A = D, j = /[\s,;]+/, de = /[,\n]+/, M = ee(), N = `${M}-hint`, P = `${M}-msg`, F = `${M}-count`, I = `${M}-help`, L = _(), R = t(() => ({
91
- class: L.class,
92
- style: L.style
93
- })), z = t(() => {
94
- let { class: e, style: t, ...n } = L;
91
+ setup(o, { expose: s, emit: E }) {
92
+ let D = o, O = v(o, "modelValue"), k = E, A = /[\s,;]+/, ue = /[,\n]+/, j = _(), M = `${j}-hint`, N = `${j}-msg`, P = `${j}-count`, F = `${j}-help`, I = g(), L = t(() => ({
93
+ class: I.class,
94
+ style: I.style
95
+ })), R = t(() => {
96
+ let { class: e, style: t, ...n } = I;
95
97
  return n;
96
- }), B = p(null), V = p(null), H = p(""), U = p(""), W = p(!1), G = p(""), K = t(() => k.value ?? []), q = t(() => !O.disabled && !O.readonly), fe = t(() => O.maxItems !== void 0 && K.value.length >= O.maxItems), J = t(() => U.value || O.errorMsg), pe = t(() => [
97
- O.hint && N,
98
- J.value && P,
99
- O.maxItems !== void 0 && F,
100
- q.value && I
101
- ].filter(Boolean).join(" ") || void 0), me = t(() => K.value.length || !q.value ? "" : O.placeholder);
98
+ }), z = f(null), B = f(null), V = f(""), H = f(""), U = f(!1), W = f(""), G = t(() => O.value ?? []), K = t(() => !D.disabled && !D.readonly), q = t(() => D.maxItems !== void 0 && G.value.length >= D.maxItems), de = t(() => D.maxItems !== void 0 && G.value.length >= D.maxItems * .8), J = t(() => H.value || D.errorMsg), fe = t(() => [
99
+ D.hint && M,
100
+ J.value && N,
101
+ D.maxItems !== void 0 && P,
102
+ K.value && F
103
+ ].filter(Boolean).join(" ") || void 0), pe = t(() => K.value ? q.value ? `Maximum ${D.maxItems} items reached` : D.placeholder || "Add item and press Enter" : ""), me = t(() => K.value && !q.value && !!V.value.trim());
102
104
  function Y(e) {
103
- G.value = "", u(() => G.value = e);
105
+ W.value = "", l(() => W.value = e);
104
106
  }
105
107
  function he(e, t) {
106
- return O.maxItems !== void 0 && t.length >= O.maxItems ? `You can add up to ${O.maxItems} ${O.maxItems === 1 ? "value" : "values"}. Remove one first.` : !O.allowDuplicates && t.includes(e) ? `“${e}” is already added.` : O.validate?.(e, t) || "";
108
+ return D.maxItems !== void 0 && t.length >= D.maxItems ? `You can add up to ${D.maxItems} ${D.maxItems === 1 ? "value" : "values"}. Remove one first.` : !D.allowDuplicates && t.includes(e) ? `“${e}” is already added.` : D.validate?.(e, t) || "";
107
109
  }
108
110
  function X(e, t) {
109
- let n = [...K.value], r = [], i = [], a = "";
111
+ let n = [...G.value], r = [], i = [], a = "";
110
112
  for (let o of e.split(t)) {
111
- let e = O.transform(o);
113
+ let e = D.transform(o);
112
114
  if (!e) continue;
113
115
  let t = he(e, n);
114
116
  if (t) {
@@ -117,175 +119,171 @@ var ce = ["for"], y = {
117
119
  }
118
120
  n.push(e), r.push(e);
119
121
  }
120
- return r.length && (k.value = n, r.forEach((e) => A("add", e)), Y(r.length === 1 ? `Added ${r[0]}.` : `Added ${r.length} values.`)), H.value = i.join(", "), u(() => U.value = a), i.length > 0;
122
+ return r.length && (O.value = n, r.forEach((e) => k("add", e)), Y(r.length === 1 ? `Added ${r[0]}.` : `Added ${r.length} values.`)), V.value = i.join(", "), l(() => H.value = a), i.length > 0;
121
123
  }
122
124
  function Z() {
123
- return !q.value || !H.value.trim() ? !1 : X(H.value, de);
125
+ return !K.value || !V.value.trim() ? !1 : X(V.value, ue);
124
126
  }
125
127
  function Q(e, t = !0) {
126
- if (!q.value) return;
127
- let n = K.value[e];
128
+ if (!K.value) return;
129
+ let n = G.value[e];
128
130
  if (n === void 0) return;
129
- let r = K.value.filter((t, n) => n !== e);
130
- k.value = r, W.value = !1, U.value = "", A("remove", n, e), Y(`Removed ${n}.`), t && u(() => {
131
+ let r = G.value.filter((t, n) => n !== e);
132
+ O.value = r, U.value = !1, H.value = "", k("remove", n, e), Y(`Removed ${n}.`), t && l(() => {
131
133
  let t = $();
132
- (t[Math.min(e, t.length - 1)] ?? B.value)?.focus();
134
+ (t[Math.min(e, t.length - 1)] ?? z.value)?.focus();
133
135
  });
134
136
  }
135
137
  function ge() {
136
- q.value && K.value.length && (k.value = [], W.value = !1, A("clear"), Y("Removed every value."), B.value?.focus());
138
+ K.value && G.value.length && (O.value = [], U.value = !1, k("clear"), Y("Removed every value."), z.value?.focus());
137
139
  }
138
140
  function $() {
139
- return Array.from(V.value?.querySelectorAll("[data-remove]") ?? []);
141
+ return Array.from(B.value?.querySelectorAll("[data-remove]") ?? []);
140
142
  }
141
143
  function _e(e) {
142
- if (!q.value || e.isComposing) return;
144
+ if (!K.value || e.isComposing) return;
143
145
  let t = e.target, n = t.selectionStart === 0 && t.selectionEnd === 0;
144
- e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Tab" && !e.shiftKey && H.value.trim() ? Z() : e.key === "Backspace" && !H.value && K.value.length ? (e.preventDefault(), W.value ? Q(K.value.length - 1, !1) : (W.value = !0, Y(`${K.value[K.value.length - 1]} selected. Press Backspace again to remove it.`))) : e.key === "ArrowLeft" && n && K.value.length ? (e.preventDefault(), W.value = !1, $().at(-1)?.focus()) : e.key === "Escape" && (H.value || U.value) ? (e.preventDefault(), H.value = "", U.value = "") : W.value = !1;
146
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Tab" && !e.shiftKey && V.value.trim() ? Z() : e.key === "Backspace" && !V.value && G.value.length ? (e.preventDefault(), U.value ? Q(G.value.length - 1, !1) : (U.value = !0, Y(`${G.value[G.value.length - 1]} selected. Press Backspace again to remove it.`))) : e.key === "ArrowLeft" && n && G.value.length ? (e.preventDefault(), U.value = !1, $().at(-1)?.focus()) : e.key === "Escape" && (V.value || H.value) ? (e.preventDefault(), V.value = "", H.value = "") : U.value = !1;
145
147
  }
146
148
  function ve(e, t) {
147
149
  let n = $();
148
- e.key === "Backspace" || e.key === "Delete" ? (e.preventDefault(), Q(t)) : e.key === "ArrowLeft" ? (e.preventDefault(), n[Math.max(t - 1, 0)]?.focus()) : e.key === "ArrowRight" ? (e.preventDefault(), (n[t + 1] ?? B.value)?.focus()) : e.key === "Home" ? (e.preventDefault(), n[0]?.focus()) : e.key === "End" && (e.preventDefault(), B.value?.focus());
150
+ e.key === "Backspace" || e.key === "Delete" ? (e.preventDefault(), Q(t)) : e.key === "ArrowLeft" ? (e.preventDefault(), n[Math.max(t - 1, 0)]?.focus()) : e.key === "ArrowRight" ? (e.preventDefault(), (n[t + 1] ?? z.value)?.focus()) : e.key === "Home" ? (e.preventDefault(), n[0]?.focus()) : e.key === "End" && (e.preventDefault(), z.value?.focus());
149
151
  }
150
152
  function ye(e) {
151
- if (!q.value) return;
153
+ if (!K.value) return;
152
154
  let t = e.clipboardData?.getData("text") ?? "";
153
- if (!j.test(t.trim())) return;
155
+ if (!A.test(t.trim())) return;
154
156
  e.preventDefault();
155
- let n = B.value, r = n?.selectionStart ?? H.value.length, i = n?.selectionEnd ?? H.value.length;
156
- X(H.value.slice(0, r) + t + H.value.slice(i), j);
157
+ let n = z.value, r = n?.selectionStart ?? V.value.length, i = n?.selectionEnd ?? V.value.length;
158
+ X(V.value.slice(0, r) + t + V.value.slice(i), A);
157
159
  }
158
160
  function be() {
159
- W.value = !1, O.addOnBlur && Z();
161
+ U.value = !1, D.addOnBlur && Z();
160
162
  }
161
163
  function xe(e) {
162
- e.target.closest("button") || B.value?.focus();
164
+ D.disabled || e.target.closest("button") || z.value?.focus();
163
165
  }
164
- return re(H, () => {
165
- U.value = "", W.value = !1;
166
- }), c({
167
- focus: () => B.value?.focus(),
166
+ return ee(V, () => {
167
+ H.value = "", U.value = !1;
168
+ }), s({
169
+ focus: () => z.value?.focus(),
168
170
  commit: () => !Z()
169
- }), (t, c) => (f(), r("div", l(R.value, {
170
- class: ["w-full", s.disabled && "opacity-50"],
171
+ }), (t, s) => (d(), r("div", c(L.value, {
172
+ class: ["w-full", o.disabled && "opacity-50"],
171
173
  "data-ac-ds": "",
172
174
  "data-testid": "ac-tag-input"
173
175
  }), [
174
176
  i("label", {
175
- for: g(M),
177
+ for: h(j),
176
178
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
177
179
  }, [
178
- i("span", null, h(s.label), 1),
179
- s.readonly ? (f(), r("span", y, "(read only)")) : n("", !0),
180
- s.required ? (f(), r("span", b, "*")) : n("", !0)
181
- ], 8, ce),
182
- s.hint ? (f(), r("p", {
180
+ i("span", null, m(o.label), 1),
181
+ o.readonly ? (d(), r("span", x, "(read only)")) : n("", !0),
182
+ o.required ? (d(), r("span", ae, "*")) : n("", !0)
183
+ ], 8, ie),
184
+ o.hint ? (d(), r("p", {
183
185
  key: 0,
184
- id: N,
186
+ id: M,
185
187
  class: "mb-2 text-base text-muted"
186
- }, h(s.hint), 1)) : n("", !0),
188
+ }, m(o.hint), 1)) : n("", !0),
187
189
  i("div", {
188
- class: d(["flex w-full flex-wrap items-center gap-1.5 rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
189
- s.size === "small" ? "min-h-9 py-[5px] pr-1.5 pl-3" : "min-h-10 py-[7px] pr-2 pl-4",
190
- s.readonly ? "bg-surface-muted" : "bg-background",
191
- s.disabled ? "cursor-not-allowed" : "cursor-text",
192
- J.value ? "border-danger/60 focus-within:border-danger focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus-within:focus-ring", !s.disabled && "hover:border-accent-active"]
190
+ class: u(["flex w-full items-center rounded-10 border transition-[border-color,box-shadow,background-color] duration-200", [
191
+ o.size === "small" ? "h-9" : "h-10.5",
192
+ o.readonly ? "bg-surface-muted" : "bg-background",
193
+ o.disabled ? "cursor-not-allowed" : "cursor-text",
194
+ J.value ? "border-danger/50 focus-within:border-danger focus-within:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]" : ["border-border focus-within:focus-ring", !o.disabled && "hover:border-accent-active"]
193
195
  ]]),
194
196
  onClick: xe
195
- }, [K.value.length ? (f(), r("ul", {
196
- key: 0,
197
- ref_key: "list",
198
- ref: V,
199
- role: "list",
200
- "aria-label": s.label,
201
- class: "contents"
202
- }, [(f(!0), r(e, null, m(K.value, (e, t) => (f(), r("li", {
203
- key: `${t}-${e}`,
204
- class: d(["inline-flex h-6 max-w-full min-w-0 items-center gap-1 rounded-10 text-xs text-heading transition-colors duration-150", [
205
- s.mono && "font-mono",
206
- q.value ? "pr-0.5 pl-2.5" : "px-2.5",
207
- W.value && t === K.value.length - 1 ? "bg-accent-active ring-2 ring-ring" : "bg-accent"
208
- ]]),
209
- "data-testid": "ac-tag-input-chip"
210
- }, [i("span", {
211
- class: "truncate",
212
- title: e
213
- }, h(e), 9, S), q.value ? (f(), r("button", {
214
- key: 0,
215
- type: "button",
216
- "data-remove": "",
217
- class: "inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
218
- "aria-label": `Remove ${e}`,
219
- onClick: (e) => Q(t),
220
- onKeydown: (e) => ve(e, t)
221
- }, [o(g(v), {
222
- class: "size-3.5",
223
- "aria-hidden": "true"
224
- })], 40, le)) : n("", !0)], 2))), 128))], 8, x)) : n("", !0), i("div", { class: d(s.readonly && K.value.length ? "contents" : "flex min-w-[64px] flex-1 items-center gap-1") }, [ie(i("input", l({
225
- id: g(M),
197
+ }, [te(i("input", c({
198
+ id: h(j),
226
199
  ref_key: "input",
227
- ref: B
228
- }, z.value, {
229
- "onUpdate:modelValue": c[0] ||= (e) => H.value = e,
200
+ ref: z
201
+ }, R.value, {
202
+ "onUpdate:modelValue": s[0] ||= (e) => V.value = e,
230
203
  type: "text",
231
- name: s.name,
232
- placeholder: me.value,
233
- disabled: s.disabled,
234
- readonly: s.readonly,
204
+ name: o.name,
205
+ placeholder: pe.value,
206
+ disabled: o.disabled,
207
+ readonly: o.readonly,
235
208
  "aria-invalid": !!J.value || void 0,
236
- "aria-required": s.required || void 0,
237
- "aria-describedby": pe.value,
209
+ "aria-required": o.required || void 0,
210
+ "aria-describedby": fe.value,
238
211
  autocomplete: "off",
239
212
  autocapitalize: "off",
240
213
  spellcheck: "false",
241
- class: ["h-6 min-w-0 flex-1 bg-transparent text-base font-normal text-heading outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [s.mono && "font-mono", s.readonly && K.value.length && "sr-only"]],
214
+ class: ["h-full min-w-0 flex-1 rounded-10 bg-transparent pr-2 text-base font-normal text-heading outline-none placeholder:text-muted/80 disabled:cursor-not-allowed", [o.mono && "font-mono", o.size === "small" ? "pl-4" : "pl-5"]],
242
215
  onKeydown: _e,
243
216
  onPaste: ye,
244
217
  onBlur: be
245
- }), null, 16, C), [[ne, H.value]]), q.value && (H.value.trim() || s.showClear && K.value.length) ? (f(), r("span", ue, [H.value.trim() ? (f(), r("button", {
218
+ }), null, 16, S), [[y, V.value]]), i("span", { class: u(["flex shrink-0 items-center text-heading", o.size === "small" ? "mr-1" : "mr-3"]) }, [K.value && o.showClear && G.value.length ? (d(), r("button", {
246
219
  key: 0,
247
220
  type: "button",
248
- class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
249
- "aria-label": `Add ${H.value.trim()}`,
250
- title: `Add “${H.value.trim()}”`,
221
+ class: u(["inline-flex cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none", o.size === "small" ? "size-7" : "size-8"]),
222
+ "aria-label": "Clear all values",
223
+ title: "Clear all items",
224
+ onClick: ge
225
+ }, [a(h(b), {
226
+ class: "size-4",
227
+ "aria-hidden": "true"
228
+ })], 2)) : n("", !0), i("button", {
229
+ type: "button",
230
+ class: u(["inline-flex items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none enabled:cursor-pointer enabled:hover:bg-surface-sunken disabled:cursor-not-allowed disabled:opacity-40", o.size === "small" ? "size-7" : "size-8"]),
231
+ disabled: !me.value,
232
+ "aria-label": V.value.trim() ? `Add ${V.value.trim()}` : "Add item",
233
+ title: V.value.trim() ? `Add “${V.value.trim()}”` : "Add item",
251
234
  tabindex: "-1",
252
- onMousedown: c[1] ||= ae(() => {}, ["prevent"]),
235
+ onMousedown: s[1] ||= ne(() => {}, ["prevent"]),
253
236
  onClick: Z
254
- }, [o(g(se), {
237
+ }, [a(h(re), {
255
238
  class: "size-4",
256
239
  "aria-hidden": "true"
257
- })], 40, w)) : n("", !0), s.showClear && K.value.length ? (f(), r("button", {
240
+ })], 42, C)], 2)], 2),
241
+ J.value ? (d(), r("p", {
258
242
  key: 1,
243
+ id: N,
244
+ class: "mt-1 text-base text-danger-strong",
245
+ role: "alert"
246
+ }, m(J.value), 1)) : n("", !0),
247
+ G.value.length ? (d(), r("ul", {
248
+ key: 2,
249
+ ref_key: "list",
250
+ ref: B,
251
+ role: "list",
252
+ "aria-label": o.label,
253
+ class: "mt-3 flex w-full flex-wrap gap-2"
254
+ }, [(d(!0), r(e, null, p(G.value, (e, t) => (d(), r("li", {
255
+ key: `${t}-${e}`,
256
+ class: u(["inline-flex h-8 max-w-full min-w-0 items-center justify-between gap-2 rounded-10 border px-3 text-base text-heading transition-all duration-300 hover:shadow-sm motion-reduce:transition-none", [o.mono && "font-mono", U.value && t === G.value.length - 1 ? "border-primary bg-accent-active ring-2 ring-ring" : "border-border bg-background"]]),
257
+ "data-testid": "ac-tag-input-chip"
258
+ }, [i("span", {
259
+ class: "truncate",
260
+ title: e
261
+ }, m(e), 9, se), K.value ? (d(), r("button", {
262
+ key: 0,
259
263
  type: "button",
260
- class: "inline-flex size-6 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-accent-hover hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
261
- "aria-label": "Clear all values",
262
- title: "Clear all",
263
- onClick: ge
264
- }, [o(g(v), {
264
+ "data-remove": "",
265
+ class: "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
266
+ "aria-label": `Remove ${e}`,
267
+ title: `Remove ${e}`,
268
+ onClick: (e) => Q(t),
269
+ onKeydown: (e) => ve(e, t)
270
+ }, [a(h(b), {
265
271
  class: "size-4",
266
272
  "aria-hidden": "true"
267
- })])) : n("", !0)])) : n("", !0)], 2)], 2),
268
- J.value || s.maxItems !== void 0 ? (f(), r("div", T, [J.value ? (f(), r("p", {
269
- key: 0,
270
- id: P,
271
- class: "flex min-w-0 flex-1 items-center gap-1.5 text-base text-danger-strong",
272
- role: "alert"
273
- }, [o(g(oe), {
274
- class: "size-4 shrink-0",
275
- "aria-hidden": "true"
276
- }), a(" " + h(J.value), 1)])) : n("", !0), s.maxItems === void 0 ? n("", !0) : (f(), r("p", {
273
+ })], 40, ce)) : n("", !0)], 2))), 128))], 8, oe)) : n("", !0),
274
+ G.value.length || o.maxItems !== void 0 ? (d(), r("div", le, [G.value.length ? (d(), r("span", w, m(G.value.length) + " " + m(G.value.length === 1 ? "item" : "items"), 1)) : n("", !0), o.maxItems === void 0 ? n("", !0) : (d(), r("span", {
277
275
  key: 1,
276
+ id: P,
277
+ class: u(["ml-auto", q.value ? "text-danger-strong" : de.value && "text-warning-strong"])
278
+ }, m(G.value.length) + " / " + m(o.maxItems) + " items ", 3))])) : n("", !0),
279
+ K.value ? (d(), r("p", {
280
+ key: 4,
278
281
  id: F,
279
- class: d(["ml-auto shrink-0 text-xs leading-5 tabular-nums", fe.value ? "font-medium text-heading" : "text-muted"])
280
- }, h(K.value.length) + " of " + h(s.maxItems) + " added ", 3))])) : n("", !0),
281
- q.value ? (f(), r("p", {
282
- key: 2,
283
- id: I,
284
282
  class: "sr-only"
285
283
  }, "Press Enter or comma to add a value. Backspace in the empty input removes the last one.")) : n("", !0),
286
- i("p", E, h(G.value), 1)
284
+ i("p", T, m(W.value), 1)
287
285
  ], 16));
288
286
  }
289
287
  });
290
288
  //#endregion
291
- export { D as default };
289
+ export { E as default };
@@ -3,7 +3,7 @@ export interface Props {
3
3
  label: string;
4
4
  /** Native `name` attribute. */
5
5
  name?: string;
6
- /** Visible height in lines. With `autoResize` it's the starting (minimum) height. */
6
+ /** Visible height in lines. Unset, the field is 160px tall (about 6 lines). With `autoResize` it's the starting (minimum) height. */
7
7
  rows?: number;
8
8
  /** Grows the field with its content instead of showing a scrollbar. */
9
9
  autoResize?: boolean;