@ac-design/design-system 2.3.0 → 2.4.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 (63) hide show
  1. package/dist/lib/compat.css +211 -6
  2. package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
  4. package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
  5. package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
  6. package/dist/lib/components/AcButton.vue.d.ts +7 -1
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +90 -69
  8. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  9. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  10. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  11. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  12. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  13. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  14. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  15. package/dist/lib/components/AcColorInput.vue.d.ts +3 -3
  16. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  17. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  18. package/dist/lib/components/AcDatePicker.vue.d.ts +14 -7
  19. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +417 -372
  20. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  21. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  22. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  24. package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +27 -30
  25. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  27. package/dist/lib/components/AcInput.vue.d.ts +75 -54
  28. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +253 -89
  29. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  30. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  31. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  32. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  33. package/dist/lib/components/AcModal.vue.d.ts +2 -2
  34. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +4 -4
  35. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  36. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  37. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  38. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  39. package/dist/lib/components/AcRadioCard.vue.d.ts +2 -2
  40. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +1 -1
  41. package/dist/lib/components/AcSelect.vue.d.ts +35 -6
  42. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +272 -176
  43. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  44. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +2 -2
  45. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  46. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  47. package/dist/lib/components/AcTable.vue.d.ts +37 -4
  48. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +239 -131
  49. package/dist/lib/components/AcTagInput.vue.d.ts +22 -3
  50. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  51. package/dist/lib/components/AcTaintInput.js +5 -0
  52. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  53. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  54. package/dist/lib/components/AcTextarea.vue.d.ts +38 -4
  55. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +113 -53
  56. package/dist/lib/components/AcTimePicker.vue.d.ts +15 -8
  57. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +102 -70
  58. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  59. package/dist/lib/components/index.d.ts +1 -0
  60. package/dist/lib/composables/useToast.d.ts +2 -2
  61. package/dist/lib/index.d.ts +2 -1
  62. package/dist/lib/index.js +31 -30
  63. package/package.json +1 -1
@@ -1,7 +1,9 @@
1
1
  import e from "./AcSpinner.js";
2
- import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l, toDisplayString as u, withCtx as d } from "vue";
2
+ import t from "./AcTooltip.js";
3
+ import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, defineComponent as o, guardReactiveProps as s, mergeProps as c, normalizeClass as l, normalizeProps as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, useAttrs as h, withCtx as g } from "vue";
3
4
  //#region src/lib/components/AcButton.vue?vue&type=script&setup=true&lang.ts
4
- var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
5
+ var _ = "[:where(&)_svg]:size-4", v = /*@__PURE__*/ o({
6
+ inheritAttrs: !1,
5
7
  __name: "AcButton",
6
8
  props: {
7
9
  title: { default: "" },
@@ -30,11 +32,16 @@ var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
30
32
  type: Boolean,
31
33
  default: !1
32
34
  },
33
- hint: { default: void 0 }
35
+ hint: { default: void 0 },
36
+ tooltip: { default: "" },
37
+ block: {
38
+ type: Boolean,
39
+ default: !1
40
+ }
34
41
  },
35
42
  emits: ["click"],
36
- setup(a, { emit: p }) {
37
- let m = a, h = p, g = {
43
+ setup(o, { emit: v }) {
44
+ let y = o, b = v, x = {
38
45
  primary: {
39
46
  solid: "border-transparent bg-primary text-white shadow-button hover:bg-primary-hover hover:shadow-sm",
40
47
  light: "border-transparent bg-primary/12 text-primary-strong hover:bg-primary/18",
@@ -77,7 +84,7 @@ var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
77
84
  outlined: "border-border bg-background text-heading hover:bg-surface-sunken/70",
78
85
  ghost: "border-transparent bg-transparent text-heading hover:bg-surface-sunken"
79
86
  }
80
- }, _ = {
87
+ }, S = {
81
88
  primary: "text-primary-strong",
82
89
  info: "text-info-strong",
83
90
  success: "text-success-strong",
@@ -86,7 +93,7 @@ var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
86
93
  neutral: "text-muted hover:text-heading",
87
94
  white: "text-muted hover:text-heading",
88
95
  ghost: "text-muted hover:text-heading"
89
- }, v = t(() => m.variant === "link"), y = t(() => v.value && !m.boxed), b = t(() => m.variant === "link" ? _[m.color] : m.color === "white" ? g.neutral.outlined : m.color === "ghost" ? g.neutral.ghost : g[m.color][m.variant]), x = {
96
+ }, C = n(() => y.variant === "link"), w = n(() => C.value && !y.boxed), T = n(() => y.variant === "link" ? S[y.color] : y.color === "white" ? x.neutral.outlined : y.color === "ghost" ? x.neutral.ghost : x[y.color][y.variant]), E = {
90
97
  xs: {
91
98
  base: "h-7 gap-1.5 px-2 text-xs",
92
99
  icon: "size-7 text-xs"
@@ -107,73 +114,87 @@ var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
107
114
  base: "h-12 gap-2 px-6 text-lg md:h-13 md:text-xl",
108
115
  icon: "size-14 text-xl"
109
116
  }
110
- }, S = {
117
+ }, D = {
111
118
  xs: "gap-1 text-xs [:where(&)_svg]:size-3.5",
112
- small: `gap-1 text-base ${f}`,
113
- normal: `gap-1 text-base ${f}`,
114
- medium: `gap-1 text-base md:text-lg ${f}`,
115
- xlarge: `gap-1 text-lg md:text-xl ${f}`
116
- }, C = t(() => {
117
- if (y.value) return [S[m.size], m.rounded ? "rounded-full" : "rounded-4"];
118
- let e = x[m.size];
119
- return m.iconOnly ? [`${e.icon} rounded-full`, f] : [
119
+ small: `gap-1 text-base ${_}`,
120
+ normal: `gap-1 text-base ${_}`,
121
+ medium: `gap-1 text-base md:text-lg ${_}`,
122
+ xlarge: `gap-1 text-lg md:text-xl ${_}`
123
+ }, O = n(() => {
124
+ if (w.value) return [D[y.size], y.rounded ? "rounded-full" : "rounded-4"];
125
+ let e = E[y.size];
126
+ return y.iconOnly ? [`${e.icon} rounded-full`, _] : [
120
127
  e.base,
121
- m.rounded ? "rounded-full" : "rounded-10",
122
- f
128
+ y.rounded ? "rounded-full" : "rounded-10",
129
+ _
123
130
  ];
124
- }), w = t(() => y.value ? "group/ac-button underline-offset-4 hover:underline" : v.value ? "group/ac-button justify-center border border-transparent underline-offset-4 hover:underline" : "justify-center border active:translate-y-px disabled:shadow-none disabled:active:translate-y-0 motion-reduce:active:translate-y-0"), T = (e) => {
125
- !m.disabled && !m.loading && h("click", e);
131
+ }), k = n(() => w.value ? "group/ac-button underline-offset-4 hover:underline" : C.value ? "group/ac-button justify-center border border-transparent underline-offset-4 hover:underline" : "justify-center border active:translate-y-px disabled:shadow-none disabled:active:translate-y-0 motion-reduce:active:translate-y-0"), A = h(), j = (e, { slots: t }) => t.default?.(), M = n(() => y.tooltip ? {
132
+ content: y.tooltip,
133
+ class: [A.class, y.block && "w-full"],
134
+ style: A.style
135
+ } : {}), N = n(() => {
136
+ if (!y.tooltip) return A;
137
+ let { class: e, style: t, ...n } = A;
138
+ return n;
139
+ }), P = (e) => {
140
+ !y.disabled && !y.loading && b("click", e);
126
141
  };
127
- return (t, f) => (s(), n(l(a.href ? "a" : "button"), {
128
- href: a.href && !a.disabled ? a.href : void 0,
129
- type: a.href ? void 0 : a.type,
130
- disabled: !a.href && a.disabled || void 0,
131
- "aria-disabled": a.href && a.disabled || void 0,
132
- "aria-busy": a.loading || void 0,
133
- title: a.hint || void 0,
134
- class: o(["relative inline-flex cursor-pointer items-center font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform] duration-200 select-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50", [
135
- w.value,
136
- b.value,
137
- "focus-visible:ring-ring",
138
- C.value,
139
- a.loading && "pointer-events-none"
140
- ]]),
141
- "data-ac-ds": "",
142
- "data-testid": "ac-button",
143
- onClick: T
144
- }, {
145
- default: d(() => [
146
- a.loading ? (s(), n(e, {
147
- key: 0,
148
- class: o(!a.iconOnly && !y.value && "-ml-0.5"),
149
- label: ""
150
- }, null, 8, ["class"])) : t.$slots.icon ? (s(), i("span", {
151
- key: 1,
152
- class: o([!a.iconOnly && !y.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
153
- "aria-hidden": "true"
154
- }, [c(t.$slots, "icon")], 2)) : r("", !0),
155
- a.title ? (s(), i("span", {
156
- key: 2,
157
- class: o(a.iconOnly && "sr-only")
158
- }, u(a.title), 3)) : r("", !0),
159
- a.iconOnly && a.loading ? r("", !0) : c(t.$slots, "default", {}, void 0, void 0, 3),
160
- t.$slots["icon-right"] ? (s(), i("span", {
161
- key: 4,
162
- class: o(["inline-flex shrink-0 items-center justify-center", v.value ? "transition-transform duration-200 group-hover/ac-button:translate-x-0.5 motion-reduce:transition-none motion-reduce:group-hover/ac-button:translate-x-0" : "-mr-0.5"]),
163
- "aria-hidden": "true"
164
- }, [c(t.$slots, "icon-right")], 2)) : r("", !0)
165
- ]),
142
+ return (n, h) => (d(), r(p(o.tooltip ? t : j), u(s(M.value)), {
143
+ default: g(() => [(d(), r(p(o.href ? "a" : "button"), c({
144
+ "aria-label": o.iconOnly && !o.title && o.tooltip ? o.tooltip : void 0,
145
+ href: o.href && !o.disabled ? o.href : void 0,
146
+ type: o.href ? void 0 : o.type,
147
+ disabled: !o.href && o.disabled || void 0,
148
+ "aria-disabled": o.href && o.disabled || void 0,
149
+ "aria-busy": o.loading || void 0,
150
+ title: o.hint || void 0,
151
+ class: ["relative inline-flex cursor-pointer items-center font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,transform] duration-200 select-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50", [
152
+ k.value,
153
+ T.value,
154
+ "focus-visible:ring-ring",
155
+ O.value,
156
+ o.loading && "pointer-events-none",
157
+ !o.hint && "disabled:pointer-events-none",
158
+ o.block && "w-full"
159
+ ]],
160
+ "data-ac-ds": "",
161
+ "data-testid": "ac-button"
162
+ }, N.value, { onClick: P }), {
163
+ default: g(() => [
164
+ o.loading ? (d(), r(e, {
165
+ key: 0,
166
+ class: l(!o.iconOnly && !w.value && "-ml-0.5"),
167
+ label: ""
168
+ }, null, 8, ["class"])) : n.$slots.icon ? (d(), a("span", {
169
+ key: 1,
170
+ class: l([!o.iconOnly && !w.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
171
+ "aria-hidden": "true"
172
+ }, [f(n.$slots, "icon")], 2)) : i("", !0),
173
+ o.title ? (d(), a("span", {
174
+ key: 2,
175
+ class: l(o.iconOnly && "sr-only")
176
+ }, m(o.title), 3)) : i("", !0),
177
+ o.iconOnly && o.loading ? i("", !0) : f(n.$slots, "default", {}, void 0, void 0, 3),
178
+ n.$slots["icon-right"] ? (d(), a("span", {
179
+ key: 4,
180
+ class: l(["inline-flex shrink-0 items-center justify-center", C.value ? "transition-transform duration-200 group-hover/ac-button:translate-x-0.5 motion-reduce:transition-none motion-reduce:group-hover/ac-button:translate-x-0" : "-mr-0.5"]),
181
+ "aria-hidden": "true"
182
+ }, [f(n.$slots, "icon-right")], 2)) : i("", !0)
183
+ ]),
184
+ _: 3
185
+ }, 16, [
186
+ "aria-label",
187
+ "href",
188
+ "type",
189
+ "disabled",
190
+ "aria-disabled",
191
+ "aria-busy",
192
+ "title",
193
+ "class"
194
+ ]))]),
166
195
  _: 3
167
- }, 8, [
168
- "href",
169
- "type",
170
- "disabled",
171
- "aria-disabled",
172
- "aria-busy",
173
- "title",
174
- "class"
175
- ]));
196
+ }, 16));
176
197
  }
177
198
  });
178
199
  //#endregion
179
- export { p as default };
200
+ export { v as default };
@@ -126,12 +126,12 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
126
126
  icon: string;
127
127
  color: string;
128
128
  href: string;
129
- loading: boolean;
130
129
  align: "left" | "center" | "right";
131
- maxItems: number;
132
- plain: boolean;
133
130
  maxWidth: string;
134
131
  tooltip: string;
132
+ loading: boolean;
133
+ maxItems: number;
134
+ plain: boolean;
135
135
  column: ResourceColumn;
136
136
  emptyText: string;
137
137
  cell: ResourceCell;
@@ -1,8 +1,8 @@
1
- import { statusMeta as e } from "./status.js";
2
- import t from "./AcBadge.js";
3
- import n from "./AcModal.js";
4
- import r from "./AcSkeleton.js";
5
- import i from "./AcTooltip.js";
1
+ import e from "./AcTooltip.js";
2
+ import { statusMeta as t } from "./status.js";
3
+ import n from "./AcBadge.js";
4
+ import r from "./AcModal.js";
5
+ import i from "./AcSkeleton.js";
6
6
  import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as ee, defineAsyncComponent as te, defineComponent as f, getCurrentInstance as ne, h as re, mergeProps as p, nextTick as ie, normalizeClass as m, normalizeStyle as ae, onBeforeUnmount as oe, onMounted as se, openBlock as h, ref as g, renderList as ce, resolveDynamicComponent as _, toDisplayString as v, unref as y, watch as b, withCtx as x, withModifiers as S } from "vue";
7
7
  import { Braces as le, Check as ue, LoaderCircle as de, Minus as fe, Tag as pe } from "@lucide/vue";
8
8
  //#region src/lib/components/AcCellValue.vue?vue&type=script&setup=true&lang.ts
@@ -112,7 +112,7 @@ var A = /*@__PURE__*/ f({
112
112
  timeStyle: "long"
113
113
  }), je = te({
114
114
  loader: () => import("../editor/index.js").then((e) => e.AcCodeEditor),
115
- loadingComponent: () => re(r, {
115
+ loadingComponent: () => re(i, {
116
116
  shape: "editor",
117
117
  height: "240px"
118
118
  }),
@@ -127,7 +127,7 @@ var A = /*@__PURE__*/ f({
127
127
  } : B.value === "a" ? { href: z.value } : { to: z.value } : null), H = o(() => {
128
128
  let e = (w.color || w.cell?.color || "").trim().split(/\s+/)[0].replace(/^is-/, "");
129
129
  return e ? D[e] ?? "default" : void 0;
130
- }), U = o(() => G.value === "status" ? e(String(F.value)) : null), W = o(() => !!U.value?.transient), Le = o(() => H.value ? H.value : U.value ? W.value ? "primary" : U.value.tone : null), Re = o(() => !H.value && !!U.value?.hollow), G = o(() => {
130
+ }), U = o(() => G.value === "status" ? t(String(F.value)) : null), W = o(() => !!U.value?.transient), Le = o(() => H.value ? H.value : U.value ? W.value ? "primary" : U.value.tone : null), Re = o(() => !H.value && !!U.value?.hollow), G = o(() => {
131
131
  let e = F.value;
132
132
  if (Ke(e)) return "empty";
133
133
  if (w.color || w.cell?.color) return "status";
@@ -229,7 +229,7 @@ var A = /*@__PURE__*/ f({
229
229
  G.value === "date" && Te();
230
230
  }), oe(() => {
231
231
  G.value === "date" && E(), j.value && k(j.value);
232
- }), (e, o) => (h(), l("span", {
232
+ }), (t, o) => (h(), l("span", {
233
233
  class: m(["max-w-full min-w-0 items-center gap-1.5 align-middle", [
234
234
  R.value ? "flex w-full" : "inline-flex",
235
235
  R.value === "center" && "justify-center",
@@ -238,7 +238,7 @@ var A = /*@__PURE__*/ f({
238
238
  ]]),
239
239
  "data-ac-ds": "",
240
240
  "data-testid": "ac-cell-value"
241
- }, [f.loading ? (h(), s(r, {
241
+ }, [f.loading ? (h(), s(i, {
242
242
  key: 0,
243
243
  width: "96px"
244
244
  })) : (h(), l(a, { key: 1 }, [
@@ -263,7 +263,7 @@ var A = /*@__PURE__*/ f({
263
263
  key: 1,
264
264
  class: m(["size-1.5 shrink-0 rounded-full", Re.value ? "border border-muted bg-transparent" : Q.value[0]]),
265
265
  "aria-hidden": "true"
266
- }, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(t, {
266
+ }, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(n, {
267
267
  key: 1,
268
268
  status: String(F.value),
269
269
  label: q.value,
@@ -278,7 +278,7 @@ var A = /*@__PURE__*/ f({
278
278
  "rounded"
279
279
  ]))]),
280
280
  _: 1
281
- }, 16, ["class"])) : G.value === "status" ? (h(), s(i, {
281
+ }, 16, ["class"])) : G.value === "status" ? (h(), s(e, {
282
282
  key: 3,
283
283
  content: L.value
284
284
  }, {
@@ -296,7 +296,7 @@ var A = /*@__PURE__*/ f({
296
296
  key: 1,
297
297
  class: m(["size-1.5 shrink-0 rounded-full", Re.value ? "border border-muted bg-transparent" : Q.value[0]]),
298
298
  "aria-hidden": "true"
299
- }, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(t, {
299
+ }, null, 2)), d(v(q.value), 1)], 2)) : (h(), s(n, {
300
300
  key: 1,
301
301
  status: String(F.value),
302
302
  label: q.value,
@@ -319,7 +319,7 @@ var A = /*@__PURE__*/ f({
319
319
  key: 1,
320
320
  class: "size-3.5 text-muted",
321
321
  "aria-hidden": "true"
322
- })), u("span", { class: m(!$(F.value) && "text-muted") }, v(q.value), 3)])) : G.value === "date" ? (h(), s(i, {
322
+ })), u("span", { class: m(!$(F.value) && "text-muted") }, v(q.value), 3)])) : G.value === "date" ? (h(), s(e, {
323
323
  key: 5,
324
324
  content: J.value
325
325
  }, {
@@ -340,16 +340,16 @@ var A = /*@__PURE__*/ f({
340
340
  key: 6,
341
341
  class: m(["flex w-max min-w-0 items-center gap-2", M.value ? "flex-wrap" : "flex-nowrap"]),
342
342
  style: ae({ maxWidth: f.maxWidth })
343
- }, [(h(!0), l(a, null, ce(Ve.value, (e, t) => (h(), s(i, {
344
- key: `${e.text}-${t}`,
345
- content: e.text.length > 28 && !M.value ? e.text : "",
343
+ }, [(h(!0), l(a, null, ce(Ve.value, (t, n) => (h(), s(e, {
344
+ key: `${t.text}-${n}`,
345
+ content: t.text.length > 28 && !M.value ? t.text : "",
346
346
  class: m(!M.value && "max-w-48 min-w-0")
347
347
  }, {
348
348
  default: x(() => [u("span", be, [G.value === "labels" ? (h(), s(y(pe), {
349
349
  key: 0,
350
350
  class: "size-3 shrink-0",
351
351
  "aria-hidden": "true"
352
- })) : c("", !0), u("span", xe, v(e.text), 1)])]),
352
+ })) : c("", !0), u("span", xe, v(t.text), 1)])]),
353
353
  _: 2
354
354
  }, 1032, ["content", "class"]))), 128)), X.value > 0 ? (h(), l("button", {
355
355
  key: 0,
@@ -358,7 +358,7 @@ var A = /*@__PURE__*/ f({
358
358
  "aria-expanded": M.value,
359
359
  "aria-label": M.value ? `Show fewer ${Ge.value}` : `Show ${X.value} more ${Ge.value}`,
360
360
  onClick: o[2] ||= S((e) => M.value = !M.value, ["stop"])
361
- }, v(M.value ? "Show less" : `+${X.value} more`), 9, Se)) : c("", !0)], 6)) : (h(), s(i, {
361
+ }, v(M.value ? "Show less" : `+${X.value} more`), 9, Se)) : c("", !0)], 6)) : (h(), s(e, {
362
362
  key: 7,
363
363
  content: ze.value,
364
364
  class: "min-w-0"
@@ -386,7 +386,7 @@ var A = /*@__PURE__*/ f({
386
386
  }, v(q.value), 15, Ce))]),
387
387
  _: 1
388
388
  }, 8, ["content"])),
389
- He.value ? (h(), s(i, {
389
+ He.value ? (h(), s(e, {
390
390
  key: 8,
391
391
  content: "View as JSON"
392
392
  }, {
@@ -402,7 +402,7 @@ var A = /*@__PURE__*/ f({
402
402
  })], 8, we)]),
403
403
  _: 1
404
404
  })) : c("", !0),
405
- N.value ? (h(), s(n, {
405
+ N.value ? (h(), s(r, {
406
406
  key: 9,
407
407
  open: P.value,
408
408
  "onUpdate:open": o[4] ||= (e) => P.value = e,
@@ -31,7 +31,10 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
31
31
  } ? P : {});
32
32
  expose: (exposed: {}) => void;
33
33
  attrs: any;
34
- slots: {};
34
+ slots: {
35
+ /** Single checkbox: rich content beside the box in place of `label`, e.g. an icon and text. It's the checkbox's accessible name. */
36
+ label?: () => unknown;
37
+ };
35
38
  emit: ((event: "update:modelValue", value: T[]) => void) & ((event: "update:checked", value: boolean) => void);
36
39
  }>) => import("vue").VNode & {
37
40
  __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
@@ -1,35 +1,35 @@
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, vModelCheckbox as y, withDirectives as b, withModifiers as x } from "vue";
2
- import { Check as S, Minus as C } 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, renderSlot as m, toDisplayString as h, unref as g, useAttrs as _, useId as v, useModel as y, useSlots as b, vModelCheckbox as x, withDirectives as S, withModifiers as C } from "vue";
2
+ import { Check as w, Minus as T } from "@lucide/vue";
3
3
  //#region src/lib/components/AcCheckBox.vue?vue&type=script&setup=true&lang.ts
4
- var w = { class: "flex flex-col gap-3" }, T = ["for"], E = [
4
+ var E = { class: "flex flex-col gap-3" }, D = ["for"], O = [
5
5
  "id",
6
6
  "name",
7
7
  "value",
8
8
  "disabled"
9
- ], D = { class: "flex min-w-0 flex-col gap-1" }, O = { class: "font-medium" }, k = {
9
+ ], k = { class: "flex min-w-0 flex-col gap-1" }, A = { class: "font-medium" }, j = {
10
10
  key: 0,
11
11
  class: "text-xs text-muted"
12
- }, A = {
12
+ }, M = {
13
13
  key: 0,
14
14
  class: "mt-1 text-base text-danger-strong",
15
15
  role: "alert"
16
- }, j = [
16
+ }, N = [
17
17
  "name",
18
18
  "checked",
19
19
  "indeterminate",
20
20
  "disabled",
21
21
  "aria-invalid",
22
22
  "aria-describedby"
23
- ], M = {
23
+ ], P = {
24
24
  key: 0,
25
25
  class: "flex min-w-0 flex-col gap-1"
26
- }, N = {
27
- key: 0,
28
- class: "font-medium"
29
- }, P = {
26
+ }, F = { key: 0 }, I = {
30
27
  key: 1,
28
+ class: "font-medium"
29
+ }, L = {
30
+ key: 2,
31
31
  class: "text-xs text-muted"
32
- }, F = ["id"], I = /*@__PURE__*/ o({
32
+ }, R = ["id"], z = /*@__PURE__*/ o({
33
33
  inheritAttrs: !1,
34
34
  __name: "AcCheckBox",
35
35
  props: /*@__PURE__*/ s({
@@ -58,75 +58,75 @@ var w = { class: "flex flex-col gap-3" }, T = ["for"], E = [
58
58
  }),
59
59
  emits: ["update:modelValue", "update:checked"],
60
60
  setup(o) {
61
- let s = o, I = v(o, "modelValue"), L = v(o, "checked"), R = _(), z = g(), B = f(null), V = t(() => s.size === "small"), H = t(() => s.indeterminate && !L.value), U = t(() => s.options ? z : {
62
- class: z.class,
63
- style: z.style
64
- }), W = t(() => {
65
- let { class: e, style: t, ...n } = z;
66
- return s.label || n["aria-label"] || n["aria-labelledby"] ? n : {
61
+ let s = o, z = y(o, "modelValue"), B = y(o, "checked"), V = b(), H = v(), U = _(), W = f(null), G = t(() => s.size === "small"), K = t(() => s.indeterminate && !B.value), q = t(() => s.options ? U : {
62
+ class: U.class,
63
+ style: U.style
64
+ }), J = t(() => {
65
+ let { class: e, style: t, ...n } = U;
66
+ return s.label || V.label || n["aria-label"] || n["aria-labelledby"] ? n : {
67
67
  "aria-label": "Select",
68
68
  ...n
69
69
  };
70
- }), G = t(() => V.value ? "size-[18px]" : "size-6"), K = t(() => [
71
- "peer cursor-pointer appearance-none rounded-4 border border-muted/70 transition-colors duration-200 group-hover:enabled:not-checked:not-indeterminate: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:bg-surface-sunken",
72
- G.value,
73
- V.value ? "bg-background" : "bg-transparent"
74
- ]), q = t(() => ["pointer-events-none absolute inset-0 m-auto text-white opacity-0 transition-opacity duration-150 motion-reduce:transition-none", V.value ? "size-3.5" : "size-5"]), J = t(() => ["cursor-not-allowed", V.value ? "opacity-40" : "opacity-50"]);
75
- async function Y(e) {
76
- L.value = e.target.checked, await l(), B.value && (B.value.checked = L.value, B.value.indeterminate = H.value);
70
+ }), Y = t(() => G.value ? "size-[18px]" : "size-6"), X = t(() => [
71
+ "peer cursor-pointer appearance-none rounded-4 border border-muted/70 transition-colors duration-200 group-hover:enabled:not-checked:not-indeterminate: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:not-checked:not-indeterminate:bg-surface-sunken",
72
+ Y.value,
73
+ G.value ? "bg-background" : "bg-transparent"
74
+ ]), Z = t(() => ["pointer-events-none absolute inset-0 m-auto text-white opacity-0 transition-opacity duration-150 motion-reduce:transition-none", G.value ? "size-3.5" : "size-5"]), Q = t(() => ["cursor-not-allowed", G.value ? "opacity-40" : "opacity-50"]);
75
+ async function $(e) {
76
+ B.value = e.target.checked, await l(), W.value && (W.value.checked = B.value, W.value.indeterminate = K.value);
77
77
  }
78
78
  return (t, s) => o.options ? (d(), r("div", c({
79
79
  key: 0,
80
80
  "data-ac-ds": "",
81
81
  "data-testid": "ac-checkbox"
82
- }, U.value), [i("div", w, [(d(!0), r(e, null, p(o.options, (e, t) => (d(), r("label", {
82
+ }, q.value), [i("div", E, [(d(!0), r(e, null, p(o.options, (e, t) => (d(), r("label", {
83
83
  key: e.label,
84
- for: `${h(R)}-${t}`,
85
- class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [e.disabled && J.value, V.value ? "gap-2.5" : "gap-3"]])
86
- }, [i("span", { class: u(["relative inline-flex shrink-0", G.value]) }, [b(i("input", {
87
- id: `${h(R)}-${t}`,
88
- "onUpdate:modelValue": s[0] ||= (e) => I.value = e,
84
+ for: `${g(H)}-${t}`,
85
+ class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [e.disabled && Q.value, G.value ? "gap-2.5" : "gap-3"]])
86
+ }, [i("span", { class: u(["relative inline-flex shrink-0", Y.value]) }, [S(i("input", {
87
+ id: `${g(H)}-${t}`,
88
+ "onUpdate:modelValue": s[0] ||= (e) => z.value = e,
89
89
  type: "checkbox",
90
90
  name: o.name,
91
91
  value: e.value,
92
92
  disabled: e.disabled,
93
- class: u(K.value)
94
- }, null, 10, E), [[y, I.value]]), a(h(S), {
95
- class: u([q.value, "peer-checked:opacity-100"]),
93
+ class: u(X.value)
94
+ }, null, 10, O), [[x, z.value]]), a(g(w), {
95
+ class: u([Z.value, "peer-checked:opacity-100"]),
96
96
  "aria-hidden": "true"
97
- }, null, 8, ["class"])], 2), i("span", D, [i("span", O, m(e.label), 1), e.description ? (d(), r("span", k, m(e.description), 1)) : n("", !0)])], 10, T))), 128))]), o.errorMsg ? (d(), r("p", A, m(o.errorMsg), 1)) : n("", !0)], 16)) : (d(), r("div", c({
97
+ }, null, 8, ["class"])], 2), i("span", k, [i("span", A, h(e.label), 1), e.description ? (d(), r("span", j, h(e.description), 1)) : n("", !0)])], 10, D))), 128))]), o.errorMsg ? (d(), r("p", M, h(o.errorMsg), 1)) : n("", !0)], 16)) : (d(), r("div", c({
98
98
  key: 1,
99
99
  class: "inline-flex flex-col",
100
100
  "data-ac-ds": "",
101
101
  "data-testid": "ac-checkbox"
102
- }, U.value, { onClick: s[1] ||= x(() => {}, ["stop"]) }), [i("label", { class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [o.disabled && J.value, V.value ? "gap-2.5" : "gap-3"]]) }, [i("span", { class: u(["relative inline-flex shrink-0", G.value]) }, [
102
+ }, q.value, { onClick: s[1] ||= C(() => {}, ["stop"]) }), [i("label", { class: u(["group inline-flex w-fit cursor-pointer items-start text-base text-heading select-none", [o.disabled && Q.value, G.value ? "gap-2.5" : "gap-3"]]) }, [i("span", { class: u(["relative inline-flex shrink-0", Y.value]) }, [
103
103
  i("input", c({
104
104
  ref_key: "single",
105
- ref: B,
105
+ ref: W,
106
106
  type: "checkbox",
107
107
  name: o.name,
108
- checked: L.value,
109
- indeterminate: H.value,
108
+ checked: B.value,
109
+ indeterminate: K.value,
110
110
  disabled: o.disabled,
111
111
  "aria-invalid": o.errorMsg ? !0 : void 0,
112
- "aria-describedby": o.errorMsg ? `${h(R)}-error` : void 0,
113
- class: K.value
114
- }, W.value, { onChange: Y }), null, 16, j),
115
- a(h(S), {
116
- class: u([q.value, "peer-checked:opacity-100"]),
112
+ "aria-describedby": o.errorMsg ? `${g(H)}-error` : void 0,
113
+ class: X.value
114
+ }, J.value, { onChange: $ }), null, 16, N),
115
+ a(g(w), {
116
+ class: u([Z.value, "peer-checked:opacity-100"]),
117
117
  "aria-hidden": "true"
118
118
  }, null, 8, ["class"]),
119
- a(h(C), {
120
- class: u([q.value, "peer-indeterminate:opacity-100"]),
119
+ a(g(T), {
120
+ class: u([Z.value, "peer-indeterminate:opacity-100"]),
121
121
  "aria-hidden": "true"
122
122
  }, null, 8, ["class"])
123
- ], 2), o.label || o.description ? (d(), r("span", M, [o.label ? (d(), r("span", N, m(o.label), 1)) : n("", !0), o.description ? (d(), r("span", P, m(o.description), 1)) : n("", !0)])) : n("", !0)], 2), o.errorMsg ? (d(), r("p", {
123
+ ], 2), o.label || t.$slots.label || o.description ? (d(), r("span", P, [t.$slots.label ? (d(), r("span", F, [m(t.$slots, "label")])) : o.label ? (d(), r("span", I, h(o.label), 1)) : n("", !0), o.description ? (d(), r("span", L, h(o.description), 1)) : n("", !0)])) : n("", !0)], 2), o.errorMsg ? (d(), r("p", {
124
124
  key: 0,
125
- id: `${h(R)}-error`,
125
+ id: `${g(H)}-error`,
126
126
  class: "mt-1 text-base text-danger-strong",
127
127
  role: "alert"
128
- }, m(o.errorMsg), 9, F)) : n("", !0)], 16));
128
+ }, h(o.errorMsg), 9, R)) : n("", !0)], 16));
129
129
  }
130
130
  });
131
131
  //#endregion
132
- export { I as default };
132
+ export { z as default };
@@ -30,8 +30,8 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
30
30
  max: number;
31
31
  size: "small" | "normal" | "large" | number;
32
32
  strokeWidth: number;
33
- indeterminate: boolean;
34
33
  showLabel: boolean;
34
+ indeterminate: boolean;
35
35
  valueText: string;
36
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
37
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -31,6 +31,14 @@ export interface Props {
31
31
  label?: string;
32
32
  /** Draws the border and rounded corners. Turn off inside a card or modal body that has its own. */
33
33
  bordered?: boolean;
34
+ /** Shows `label` above the editor as a form field label, as cloud-ui's editor field. */
35
+ showLabel?: boolean;
36
+ /** Adds a red asterisk after the shown label and sets `aria-required`. */
37
+ required?: boolean;
38
+ /** Error text under the editor, e.g. "Paste a kubeconfig". Sets `aria-invalid` on the text area. */
39
+ errorMsg?: string;
40
+ /** Lists each problem under the editor, with a button that jumps to it. Turn off for cloud-ui's look, where the underlines and gutter marks are the only sign. */
41
+ showProblems?: boolean;
34
42
  }
35
43
  type __VLS_Props = Props;
36
44
  type __VLS_Slots = {
@@ -63,6 +71,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
63
71
  "onUpdate:view"?: ((value: "edit" | "changes") => any) | undefined;
64
72
  }>, {
65
73
  bordered: boolean;
74
+ required: boolean;
66
75
  label: string;
67
76
  title: string;
68
77
  height: string;
@@ -77,6 +86,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
77
86
  placeholder: string;
78
87
  copyable: boolean;
79
88
  diffLayout: "unified" | "split";
89
+ showLabel: boolean;
90
+ errorMsg: string;
91
+ showProblems: boolean;
80
92
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
81
93
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
82
94
  declare const _default: typeof __VLS_export;