@ac-design/design-system 2.7.0 → 2.9.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 (37) hide show
  1. package/dist/lib/compat.css +70 -10
  2. package/dist/lib/components/AcAccordionItem.vue.d.ts +9 -0
  3. package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +64 -52
  4. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +2 -2
  5. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +46 -43
  6. package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +3 -3
  7. package/dist/lib/components/AcColorInput.vue.d.ts +4 -0
  8. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +12 -2
  9. package/dist/lib/components/AcDatePicker.vue.d.ts +3 -0
  10. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +12 -2
  11. package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +1 -1
  12. package/dist/lib/components/AcInput.vue.d.ts +2 -0
  13. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +18 -8
  14. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +12 -8
  15. package/dist/lib/components/AcMonthPicker.vue.d.ts +3 -0
  16. package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +12 -2
  17. package/dist/lib/components/AcNumberInput.vue.d.ts +3 -0
  18. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +11 -1
  19. package/dist/lib/components/AcSectionContent.vue.d.ts +1 -1
  20. package/dist/lib/components/AcSelect.vue.d.ts +3 -0
  21. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +241 -218
  22. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +11 -7
  23. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  24. package/dist/lib/components/AcSidebar.vue.d.ts +1 -1
  25. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +1 -1
  26. package/dist/lib/components/AcSteps.vue.d.ts +3 -0
  27. package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +33 -29
  28. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +1 -1
  29. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +83 -72
  30. package/dist/lib/components/AcTextarea.vue.d.ts +3 -0
  31. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +11 -1
  32. package/dist/lib/components/AcTimePicker.vue.d.ts +3 -0
  33. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +12 -2
  34. package/dist/lib/components/AcToaster.vue.d.ts +3 -0
  35. package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +71 -68
  36. package/dist/lib/theme.css +36 -0
  37. package/package.json +1 -1
@@ -112,6 +112,16 @@ var be = ["for"], xe = { key: 0 }, Se = {
112
112
  __name: "AcDatePicker",
113
113
  props: /*@__PURE__*/ te({
114
114
  label: { default: "" },
115
+ labelClass: {
116
+ type: [
117
+ Boolean,
118
+ null,
119
+ String,
120
+ Object,
121
+ Array
122
+ ],
123
+ default: void 0
124
+ },
115
125
  placeholder: { default: "" },
116
126
  mode: { default: "date" },
117
127
  range: {
@@ -844,13 +854,13 @@ var be = ["for"], xe = { key: 0 }, Se = {
844
854
  key: 0,
845
855
  id: vt,
846
856
  for: d.inline ? void 0 : `${v(x)}-trigger`,
847
- class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
857
+ class: p(["mb-2 flex items-center gap-1 text-base font-medium text-heading", d.labelClass])
848
858
  }, [
849
859
  oe(e.$slots, "label-icon"),
850
860
  d.label ? (m(), c("span", xe, _(d.label), 1)) : s("", !0),
851
861
  oe(e.$slots, "label-extra"),
852
862
  d.required ? (m(), c("span", Se, "*")) : s("", !0)
853
- ], 8, be)) : s("", !0),
863
+ ], 10, be)) : s("", !0),
854
864
  d.hint ? (m(), c("p", {
855
865
  key: 1,
856
866
  id: St,
@@ -43,7 +43,7 @@ var b = {
43
43
  style: u(c.sticky ? { top: c.top } : void 0),
44
44
  "data-ac-ds": "",
45
45
  "data-testid": "ac-header"
46
- }, [j.value && t.$slots.breadcrumb ? (d(), i("div", b, [f(t.$slots, "breadcrumb")])) : r("", !0), a("div", { class: l(j.value && "relative isolate overflow-hidden rounded-16 border border-border bg-surface px-5 py-5 shadow-xs sm:px-7 sm:py-6") }, [j.value ? (d(), i(e, { key: 0 }, [
46
+ }, [j.value && t.$slots.breadcrumb ? (d(), i("div", b, [f(t.$slots, "breadcrumb")])) : r("", !0), a("div", { class: l(j.value && "relative isolate overflow-clip rounded-16 border border-border bg-surface px-5 py-5 shadow-xs sm:px-7 sm:py-6") }, [j.value ? (d(), i(e, { key: 0 }, [
47
47
  D[1] ||= a("div", {
48
48
  class: "absolute inset-0 -z-10 bg-linear-to-br from-primary/10 via-primary/3 to-transparent",
49
49
  "aria-hidden": "true"
@@ -2,6 +2,8 @@ import type { Component, HTMLAttributes } from "vue";
2
2
  export interface Props {
3
3
  /** Label above the field. Pass `placeholder` for an example value inside it. Without a label, pass `aria-label`; the placeholder is the accessible name otherwise. */
4
4
  label?: string;
5
+ /** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
6
+ labelClass?: HTMLAttributes["class"];
5
7
  /** Native `name` attribute. */
6
8
  name?: string;
7
9
  /** Example value shown inside the empty field. */
@@ -28,6 +28,16 @@ var x = ["for"], S = { key: 0 }, C = ["id"], w = { class: "flex" }, re = [
28
28
  __name: "AcInput",
29
29
  props: /*@__PURE__*/ s({
30
30
  label: { default: "" },
31
+ labelClass: {
32
+ type: [
33
+ Boolean,
34
+ null,
35
+ String,
36
+ Object,
37
+ Array
38
+ ],
39
+ default: void 0
40
+ },
31
41
  name: { default: "" },
32
42
  placeholder: { default: void 0 },
33
43
  autocomplete: { default: void 0 },
@@ -194,12 +204,12 @@ var x = ["for"], S = { key: 0 }, C = ["id"], w = { class: "flex" }, re = [
194
204
  normal: "pr-4",
195
205
  large: "pr-5"
196
206
  }, me = {
197
- xs: "mr-2",
198
- xsmall: "mr-3",
199
- small: "mr-3",
200
- medium: "mr-3",
201
- normal: "mr-4",
202
- large: "mr-5"
207
+ xs: "mr-0.5 size-6 rounded-6",
208
+ xsmall: "mr-1.5 size-7 rounded-8",
209
+ small: "mr-1.5 size-7 rounded-8",
210
+ medium: "mr-1.5 size-7 rounded-8",
211
+ normal: "mr-3 size-7 rounded-8",
212
+ large: "mr-4 size-8 rounded-8"
203
213
  }, he = {
204
214
  xs: "size-3",
205
215
  xsmall: "size-4",
@@ -267,7 +277,7 @@ var x = ["for"], S = { key: 0 }, C = ["id"], w = { class: "flex" }, re = [
267
277
  U.value ? (u(), i("label", {
268
278
  key: 0,
269
279
  for: h(P),
270
- class: l(["mb-2 flex items-center text-base font-medium text-heading", !o.flushLabelSlots && "gap-1"])
280
+ class: l(["mb-2 flex items-center text-base font-medium text-heading", [!o.flushLabelSlots && "gap-1", o.labelClass]])
271
281
  }, [
272
282
  f(t.$slots, "label-icon"),
273
283
  o.label ? (u(), i("span", S, m(o.label), 1)) : r("", !0),
@@ -340,7 +350,7 @@ var x = ["for"], S = { key: 0 }, C = ["id"], w = { class: "flex" }, re = [
340
350
  o.type === "password" ? (u(), i("button", {
341
351
  key: 3,
342
352
  type: "button",
343
- class: l(["relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-4 text-muted transition-colors hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-wait", me[Z.value]]),
353
+ class: l(["relative inline-flex shrink-0 cursor-pointer items-center justify-center text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-wait disabled:hover:bg-transparent", me[Z.value]]),
344
354
  disabled: q.value,
345
355
  "aria-label": M.value ? "Hide value" : "Show value",
346
356
  "aria-pressed": M.value,
@@ -68,6 +68,10 @@ var w = [
68
68
  B.closable && (V.value = !1, H("close"));
69
69
  }
70
70
  function Z(e) {
71
+ let t = e.currentTarget;
72
+ e.clientX >= t.getBoundingClientRect().left + t.clientWidth || (e.preventDefault(), B.closeOnOutsideClick && X());
73
+ }
74
+ function Q(e) {
71
75
  if (e.key === "Escape") {
72
76
  if (e.defaultPrevented) return;
73
77
  e.stopPropagation(), X();
@@ -78,7 +82,7 @@ var w = [
78
82
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
79
83
  }
80
84
  }
81
- function Q(e) {
85
+ function $(e) {
82
86
  let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
83
87
  if (t.dataset.acModals = String(Math.max(n, 0)), e && n === 1) {
84
88
  let e = window.innerWidth - document.documentElement.clientWidth;
@@ -89,16 +93,16 @@ var w = [
89
93
  }
90
94
  return b(V, async (e, t) => {
91
95
  if (e) {
92
- J = document.activeElement, Y = !0, Q(!0), await u();
96
+ J = document.activeElement, Y = !0, $(!0), await u();
93
97
  let e = q.value?.querySelector("[autofocus]");
94
98
  ((e && (e.matches(z) ? e : e.querySelector(z))) ?? q.value?.querySelector(U) ?? q.value)?.focus();
95
- } else t && Y && (Y = !1, Q(!1), J?.focus?.());
99
+ } else t && Y && (Y = !1, $(!1), J?.isConnected && J.focus());
96
100
  }, { immediate: !0 }), f(() => {
97
- Y && (Y = !1, Q(!1), J?.isConnected && J.focus());
101
+ Y && (Y = !1, $(!1), J?.isConnected && J.focus());
98
102
  }), (l, u) => (p(), r(t, { to: "body" }, [s(n, {
99
103
  "enter-active-class": "transition-opacity duration-200 ease-out",
100
104
  "enter-from-class": "opacity-0",
101
- "leave-active-class": "transition-opacity duration-150 ease-in",
105
+ "leave-active-class": "pointer-events-none transition-opacity duration-150 ease-in",
102
106
  "leave-to-class": "opacity-0"
103
107
  }, {
104
108
  default: x(() => [V.value ? (p(), a("div", {
@@ -106,11 +110,11 @@ var w = [
106
110
  class: "fixed inset-0 z-[80] overflow-y-auto bg-black/50",
107
111
  "data-ac-ds": "",
108
112
  "data-testid": "ac-modal",
109
- onKeydown: Z,
110
- onMousedown: u[1] ||= S((e) => c.closeOnOutsideClick && X(), ["self"])
113
+ onKeydown: Q,
114
+ onMousedown: S(Z, ["self"])
111
115
  }, [o("div", {
112
116
  class: "flex min-h-full items-start justify-center p-4 sm:items-center sm:p-8",
113
- onMousedown: u[0] ||= S((e) => c.closeOnOutsideClick && X(), ["self"])
117
+ onMousedown: S(Z, ["self"])
114
118
  }, [o("div", {
115
119
  ref_key: "panel",
116
120
  ref: q,
@@ -8,6 +8,8 @@ export interface MonthPickerPreset {
8
8
  export interface Props {
9
9
  /** Label above the field. Doubles as the accessible name of the trigger and the popover. */
10
10
  label?: string;
11
+ /** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
12
+ labelClass?: HTMLAttributes["class"];
11
13
  /** Text shown in the field while there's no value. Defaults to "Choose month" (or "Choose months" with `range`). */
12
14
  placeholder?: string;
13
15
  /** Pick a start and an end month; `v-model` becomes `[start, end]`, swapped so start ≤ end. */
@@ -81,6 +83,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
81
83
  placeholder: string;
82
84
  errorMsg: string;
83
85
  range: boolean;
86
+ labelClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
84
87
  clearable: boolean;
85
88
  presets: MonthPickerPreset[];
86
89
  locale: string;
@@ -54,6 +54,16 @@ var he = ["for"], ge = { key: 0 }, _e = {
54
54
  __name: "AcMonthPicker",
55
55
  props: /*@__PURE__*/ ee({
56
56
  label: { default: "" },
57
+ labelClass: {
58
+ type: [
59
+ Boolean,
60
+ null,
61
+ String,
62
+ Object,
63
+ Array
64
+ ],
65
+ default: void 0
66
+ },
57
67
  placeholder: { default: "" },
58
68
  range: {
59
69
  type: Boolean,
@@ -384,13 +394,13 @@ var he = ["for"], ge = { key: 0 }, _e = {
384
394
  key: 0,
385
395
  id: Ve,
386
396
  for: u.inline ? void 0 : `${v(C)}-trigger`,
387
- class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
397
+ class: p(["mb-2 flex items-center gap-1 text-base font-medium text-heading", u.labelClass])
388
398
  }, [
389
399
  re(e.$slots, "label-icon"),
390
400
  u.label ? (m(), s("span", ge, _(u.label), 1)) : o("", !0),
391
401
  re(e.$slots, "label-extra"),
392
402
  u.required ? (m(), s("span", _e, "*")) : o("", !0)
393
- ], 8, he)) : o("", !0),
403
+ ], 10, he)) : o("", !0),
394
404
  u.hint ? (m(), s("p", {
395
405
  key: 1,
396
406
  id: We,
@@ -1,6 +1,9 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  export interface Props<K extends "null" | "undefined" = "null"> {
2
3
  /** Label above the field. Without one, pass `aria-label` so the field still has a name. */
3
4
  label?: string;
5
+ /** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
6
+ labelClass?: HTMLAttributes["class"];
4
7
  /** Native `name` attribute. */
5
8
  name?: string;
6
9
  /** Text shown inside the empty field, e.g. "Enter number". */
@@ -21,6 +21,16 @@ var oe = ["for"], g = { key: 0 }, _ = ["id"], se = { class: "flex items-center g
21
21
  __name: "AcNumberInput",
22
22
  props: /*@__PURE__*/ o({
23
23
  label: { default: "" },
24
+ labelClass: {
25
+ type: [
26
+ Boolean,
27
+ null,
28
+ String,
29
+ Object,
30
+ Array
31
+ ],
32
+ default: void 0
33
+ },
24
34
  name: { default: "" },
25
35
  placeholder: { default: void 0 },
26
36
  min: { default: void 0 },
@@ -213,7 +223,7 @@ var oe = ["for"], g = { key: 0 }, _ = ["id"], se = { class: "flex items-center g
213
223
  pe.value ? (l(), n("label", {
214
224
  key: 0,
215
225
  for: p(S),
216
- class: c(["mb-2 flex items-center text-base font-medium text-heading", !a.flushLabelSlots && "gap-1"])
226
+ class: c(["mb-2 flex items-center text-base font-medium text-heading", [!a.flushLabelSlots && "gap-1", a.labelClass]])
217
227
  }, [
218
228
  d(e.$slots, "label-icon"),
219
229
  a.label ? (l(), n("span", g, f(a.label), 1)) : t("", !0),
@@ -38,11 +38,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
38
38
  onBack?: (() => any) | undefined;
39
39
  }>, {
40
40
  title: string;
41
+ collapsible: boolean;
41
42
  tone: "default" | "danger";
42
43
  subtitle: string;
43
44
  padded: boolean;
44
45
  plain: boolean;
45
- collapsible: boolean;
46
46
  backButton: boolean;
47
47
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
48
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  import type { SelectOption } from "./types";
2
3
  export interface Props<T> {
3
4
  /** The choices: `{ value, label, description?, disabled?, group? }`. */
@@ -6,6 +7,8 @@ export interface Props<T> {
6
7
  by?: string | ((a: T, b: T) => boolean);
7
8
  /** Label above the field. Also the accessible name of the select. */
8
9
  label?: string;
10
+ /** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
11
+ labelClass?: HTMLAttributes["class"];
9
12
  /** Text shown in the field while nothing is selected, e.g. "Select a version". */
10
13
  placeholder?: string;
11
14
  /** Allow several values; `v-model` becomes an array. */