@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
@@ -316,6 +316,10 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
316
316
  display: none !important;
317
317
  }
318
318
  @layer ac-compat {
319
+ .\@container\/steps:where([data-ac-ds], [data-ac-ds] *) {
320
+ container-type: inline-size !important;
321
+ container-name: steps !important;
322
+ }
319
323
  .\@container:where([data-ac-ds], [data-ac-ds] *) {
320
324
  container-type: inline-size !important;
321
325
  }
@@ -357,6 +361,9 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
357
361
  .relative:where([data-ac-ds], [data-ac-ds] *) {
358
362
  position: relative !important;
359
363
  }
364
+ .static:where([data-ac-ds], [data-ac-ds] *) {
365
+ position: static !important;
366
+ }
360
367
  .sticky:where([data-ac-ds], [data-ac-ds] *) {
361
368
  position: sticky !important;
362
369
  }
@@ -411,8 +418,8 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
411
418
  .top-10:where([data-ac-ds], [data-ac-ds] *) {
412
419
  top: calc(var(--spacing) * 10) !important;
413
420
  }
414
- .top-20:where([data-ac-ds], [data-ac-ds] *) {
415
- top: calc(var(--spacing) * 20) !important;
421
+ .top-\[var\(--ac-toaster-offset\,80px\)\]:where([data-ac-ds], [data-ac-ds] *) {
422
+ top: var(--ac-toaster-offset,80px) !important;
416
423
  }
417
424
  .top-full:where([data-ac-ds], [data-ac-ds] *) {
418
425
  top: 100% !important;
@@ -468,8 +475,8 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
468
475
  .bottom-3:where([data-ac-ds], [data-ac-ds] *) {
469
476
  bottom: calc(var(--spacing) * 3) !important;
470
477
  }
471
- .bottom-5:where([data-ac-ds], [data-ac-ds] *) {
472
- bottom: calc(var(--spacing) * 5) !important;
478
+ .bottom-\[var\(--ac-toaster-offset\,20px\)\]:where([data-ac-ds], [data-ac-ds] *) {
479
+ bottom: var(--ac-toaster-offset,20px) !important;
473
480
  }
474
481
  .bottom-full:where([data-ac-ds], [data-ac-ds] *) {
475
482
  bottom: 100% !important;
@@ -579,6 +586,9 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
579
586
  margin-inline: auto !important;
580
587
  padding-inline: calc(var(--spacing) * 4) !important;
581
588
  }
589
+ .-mx-1:where([data-ac-ds], [data-ac-ds] *) {
590
+ margin-inline: calc(var(--spacing) * -1) !important;
591
+ }
582
592
  .-mx-2:where([data-ac-ds], [data-ac-ds] *) {
583
593
  margin-inline: calc(var(--spacing) * -2) !important;
584
594
  }
@@ -666,24 +676,21 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
666
676
  .-mr-2:where([data-ac-ds], [data-ac-ds] *) {
667
677
  margin-right: calc(var(--spacing) * -2) !important;
668
678
  }
679
+ .mr-0\.5:where([data-ac-ds], [data-ac-ds] *) {
680
+ margin-right: calc(var(--spacing) * 0.5) !important;
681
+ }
669
682
  .mr-1:where([data-ac-ds], [data-ac-ds] *) {
670
683
  margin-right: var(--spacing) !important;
671
684
  }
672
685
  .mr-1\.5:where([data-ac-ds], [data-ac-ds] *) {
673
686
  margin-right: calc(var(--spacing) * 1.5) !important;
674
687
  }
675
- .mr-2:where([data-ac-ds], [data-ac-ds] *) {
676
- margin-right: calc(var(--spacing) * 2) !important;
677
- }
678
688
  .mr-3:where([data-ac-ds], [data-ac-ds] *) {
679
689
  margin-right: calc(var(--spacing) * 3) !important;
680
690
  }
681
691
  .mr-4:where([data-ac-ds], [data-ac-ds] *) {
682
692
  margin-right: calc(var(--spacing) * 4) !important;
683
693
  }
684
- .mr-5:where([data-ac-ds], [data-ac-ds] *) {
685
- margin-right: calc(var(--spacing) * 5) !important;
686
- }
687
694
  .mb-1:where([data-ac-ds], [data-ac-ds] *) {
688
695
  margin-bottom: var(--spacing) !important;
689
696
  }
@@ -1829,6 +1836,9 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
1829
1836
  .overflow-auto:where([data-ac-ds], [data-ac-ds] *) {
1830
1837
  overflow: auto !important;
1831
1838
  }
1839
+ .overflow-clip:where([data-ac-ds], [data-ac-ds] *) {
1840
+ overflow: clip !important;
1841
+ }
1832
1842
  .overflow-hidden:where([data-ac-ds], [data-ac-ds] *) {
1833
1843
  overflow: hidden !important;
1834
1844
  }
@@ -3678,6 +3688,14 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
3678
3688
  --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05)) !important;
3679
3689
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
3680
3690
  }
3691
+ .ac-focus-inset:focus-visible:where([data-ac-ds], [data-ac-ds] *) {
3692
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;
3693
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
3694
+ --tw-ring-color: var(--color-ring) !important;
3695
+ --tw-outline-style: none !important;
3696
+ outline-style: none !important;
3697
+ --tw-ring-inset: inset !important;
3698
+ }
3681
3699
  .ring:where([data-ac-ds], [data-ac-ds] *) {
3682
3700
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;
3683
3701
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow) !important;
@@ -3913,6 +3931,16 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
3913
3931
  -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,) !important;
3914
3932
  backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,) !important;
3915
3933
  }
3934
+ .ac-transition-colors:where([data-ac-ds], [data-ac-ds] *) {
3935
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to !important;
3936
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;
3937
+ transition-duration: var(--tw-duration, var(--default-transition-duration)) !important;
3938
+ --tw-duration: 200ms !important;
3939
+ transition-duration: 200ms !important;
3940
+ @media (prefers-reduced-motion: reduce) {
3941
+ transition-property: none !important;
3942
+ }
3943
+ }
3916
3944
  .transition:where([data-ac-ds], [data-ac-ds] *) {
3917
3945
  transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events !important;
3918
3946
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)) !important;
@@ -5351,6 +5379,9 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
5351
5379
  .sm\:shrink-0:where([data-ac-ds], [data-ac-ds] *) {
5352
5380
  flex-shrink: 0 !important;
5353
5381
  }
5382
+ .sm\:basis-\[160px\]:where([data-ac-ds], [data-ac-ds] *) {
5383
+ flex-basis: 160px !important;
5384
+ }
5354
5385
  .sm\:-translate-x-1\/2:where([data-ac-ds], [data-ac-ds] *) {
5355
5386
  --tw-translate-x: calc(calc(1 / 2 * 100%) * -1) !important;
5356
5387
  translate: var(--tw-translate-x) var(--tw-translate-y) !important;
@@ -5572,6 +5603,19 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
5572
5603
  display: none !important;
5573
5604
  }
5574
5605
  }
5606
+ @container steps (width < 480px) {
5607
+ .\@max-\[480px\]\/steps\:sr-only:where([data-ac-ds], [data-ac-ds] *) {
5608
+ position: absolute !important;
5609
+ width: 1px !important;
5610
+ height: 1px !important;
5611
+ padding: 0 !important;
5612
+ margin: -1px !important;
5613
+ overflow: hidden !important;
5614
+ clip-path: inset(50%) !important;
5615
+ white-space: nowrap !important;
5616
+ border-width: 0 !important;
5617
+ }
5618
+ }
5575
5619
  @container (width < 448px) {
5576
5620
  .\@max-md\:-mt-1:where([data-ac-ds], [data-ac-ds] *) {
5577
5621
  margin-top: calc(var(--spacing) * -1) !important;
@@ -5601,6 +5645,19 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
5601
5645
  padding-left: calc(var(--spacing) * 12) !important;
5602
5646
  }
5603
5647
  }
5648
+ @container (width >= 401px) {
5649
+ .\@min-\[401px\]\:sr-only:where([data-ac-ds], [data-ac-ds] *) {
5650
+ position: absolute !important;
5651
+ width: 1px !important;
5652
+ height: 1px !important;
5653
+ padding: 0 !important;
5654
+ margin: -1px !important;
5655
+ overflow: hidden !important;
5656
+ clip-path: inset(50%) !important;
5657
+ white-space: nowrap !important;
5658
+ border-width: 0 !important;
5659
+ }
5660
+ }
5604
5661
  @container (width >= 512px) {
5605
5662
  .\@lg\:w-2\/5:where([data-ac-ds], [data-ac-ds] *) {
5606
5663
  width: calc(2 / 5 * 100%) !important;
@@ -5909,6 +5966,9 @@ button:is([data-ac-ds], [data-ac-ds] *), input:where([type="button"], [type="res
5909
5966
  .\[\&\>svg\]\:text-muted > svg:where([data-ac-ds], [data-ac-ds] *) {
5910
5967
  color: var(--color-muted) !important;
5911
5968
  }
5969
+ :where(.\[\:where\(\&\)\]\:w-full):where([data-ac-ds], [data-ac-ds] *) {
5970
+ width: 100% !important;
5971
+ }
5912
5972
  :where(.\[\:where\(\&\)\]\:bg-danger\/5):where([data-ac-ds], [data-ac-ds] *) {
5913
5973
  background-color: color-mix(in srgb, #ef4444 5%, transparent) !important;
5914
5974
  @supports (color: color-mix(in lab, red, red)) {
@@ -9,6 +9,12 @@ export interface Props {
9
9
  disabled?: boolean;
10
10
  /** Heading level of the title. Defaults to the parent AcAccordion's, or 3. */
11
11
  headingLevel?: 2 | 3 | 4 | 5 | 6;
12
+ /** Turn off for a section that always shows its content: the header is plain text, with no chevron, and `open` is ignored. */
13
+ collapsible?: boolean;
14
+ /** Frame of an item on its own (inside an AcAccordion the parent's applies): `separated` its own card, `bordered` no frame with card padding, for a container that draws the border, `flush` no frame or side padding. */
15
+ variant?: "bordered" | "separated" | "flush";
16
+ /** Attributes for the header button (the header row when not `collapsible`), e.g. `{ 'data-testid': 'section-heading' }` for tests. */
17
+ headerAttrs?: Record<string, unknown>;
12
18
  }
13
19
  type __VLS_Props = Props;
14
20
  type __VLS_Slots = {
@@ -35,11 +41,14 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
35
41
  onToggle?: ((open: boolean) => any) | undefined;
36
42
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
37
43
  }>, {
44
+ variant: "bordered" | "separated" | "flush";
38
45
  headingLevel: 2 | 3 | 4 | 5 | 6;
39
46
  title: string;
40
47
  value: string;
41
48
  description: string;
42
49
  disabled: boolean;
50
+ collapsible: boolean;
51
+ headerAttrs: Record<string, unknown>;
43
52
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
53
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
54
  declare const _default: typeof __VLS_export;
@@ -1,12 +1,7 @@
1
- import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, unref as m, useId as h, useModel as g, watch as _, withCtx as v } from "vue";
2
- import { ChevronDown as y, ChevronRight as b } from "@lucide/vue";
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, inject as s, mergeModels as c, mergeProps as l, normalizeClass as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useId as g, useModel as _, watch as v, withCtx as y } from "vue";
2
+ import { ChevronDown as b, ChevronRight as x } from "@lucide/vue";
3
3
  //#region src/lib/components/AcAccordionItem.vue?vue&type=script&setup=true&lang.ts
4
- var x = [
5
- "id",
6
- "aria-expanded",
7
- "aria-controls",
8
- "disabled"
9
- ], S = {
4
+ var S = {
10
5
  key: 1,
11
6
  class: "inline-flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary-strong [&_svg]:size-4",
12
7
  "aria-hidden": "true"
@@ -17,7 +12,7 @@ var x = [
17
12
  "id",
18
13
  "aria-labelledby",
19
14
  "inert"
20
- ], D = /*@__PURE__*/ o({
15
+ ], D = "cursor-pointer ac-transition-colors ac-focus-inset disabled:cursor-not-allowed disabled:opacity-50", O = /*@__PURE__*/ o({
21
16
  __name: "AcAccordionItem",
22
17
  props: /*@__PURE__*/ c({
23
18
  value: { default: void 0 },
@@ -27,7 +22,13 @@ var x = [
27
22
  type: Boolean,
28
23
  default: !1
29
24
  },
30
- headingLevel: { default: void 0 }
25
+ headingLevel: { default: void 0 },
26
+ collapsible: {
27
+ type: Boolean,
28
+ default: !0
29
+ },
30
+ variant: { default: void 0 },
31
+ headerAttrs: { default: void 0 }
31
32
  }, {
32
33
  open: {
33
34
  type: Boolean,
@@ -37,54 +38,65 @@ var x = [
37
38
  }),
38
39
  emits: /*@__PURE__*/ c(["toggle"], ["update:open"]),
39
40
  setup(o, { emit: c }) {
40
- let D = o, O = g(o, "open"), k = c, A = s("ac-accordion", null), j = h(), M = e(() => D.value ?? j), N = e(() => A ? A.isOpen(M.value) : O.value), P = e(() => D.headingLevel ?? A?.headingLevel.value ?? 3), F = e(() => A?.variant.value ?? "separated");
41
- function I() {
42
- if (D.disabled) return;
43
- let e = !N.value;
44
- A ? A.toggle(M.value) : O.value = e, k("toggle", e);
41
+ let O = o, k = _(o, "open"), A = c, j = s("ac-accordion", null), M = g(), N = e(() => O.value ?? M), P = e(() => !O.collapsible || (j ? j.isOpen(N.value) : k.value)), F = e(() => O.headingLevel ?? j?.headingLevel.value ?? 3), I = e(() => j?.variant.value ?? O.variant ?? "separated");
42
+ function L() {
43
+ if (O.disabled || !O.collapsible) return;
44
+ let e = !P.value;
45
+ j ? j.toggle(N.value) : k.value = e, A("toggle", e);
45
46
  }
46
- return _(N, (e) => {
47
- A && (O.value = e);
48
- }), (e, s) => (u(), r("div", {
49
- class: l([F.value === "separated" && "overflow-hidden rounded-14 border border-border bg-surface", e.$slots.actions && "@container"]),
47
+ let R = e(() => O.collapsible ? {
48
+ type: "button",
49
+ "data-accordion-trigger": "",
50
+ "aria-expanded": P.value,
51
+ "aria-controls": `${M}-panel`,
52
+ disabled: O.disabled
53
+ } : {});
54
+ return v(P, (e) => {
55
+ j && (k.value = e);
56
+ }), (e, s) => (d(), r("div", {
57
+ class: u([I.value === "separated" && "overflow-clip rounded-14 border border-border bg-surface", e.$slots.actions && "@container"]),
50
58
  "data-ac-ds": "",
51
59
  "data-testid": "ac-accordion-item"
52
- }, [i("div", { class: l(["flex items-center", e.$slots.actions && "transition-colors duration-200 @max-md:flex-wrap has-[[data-accordion-trigger]:enabled:hover]:bg-accent-hover/60"]) }, [(u(), t(f(`h${P.value}`), { class: "m-0 min-w-0 flex-1 text-base leading-5 font-normal tracking-normal @max-md:basis-full" }, {
53
- default: v(() => [i("button", {
54
- id: `${m(j)}-trigger`,
55
- type: "button",
56
- "data-accordion-trigger": "",
57
- "aria-expanded": N.value,
58
- "aria-controls": `${m(j)}-panel`,
59
- disabled: o.disabled,
60
- class: l(["flex w-full cursor-pointer items-center gap-3 text-left transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:cursor-not-allowed disabled:opacity-50", [F.value === "flush" ? "px-1 py-3" : "px-5 py-4", !o.disabled && !e.$slots.actions && "hover:bg-accent-hover/60"]]),
61
- onClick: I
62
- }, [
63
- e.$slots.actions ? (u(), t(m(b), {
64
- key: 0,
65
- class: l(["size-4 shrink-0 text-muted transition-transform duration-200 ease-out-soft motion-reduce:transition-none", N.value && "rotate-90 text-heading"]),
66
- "aria-hidden": "true"
67
- }, null, 8, ["class"])) : n("", !0),
68
- e.$slots.icon ? (u(), r("span", S, [d(e.$slots, "icon")])) : n("", !0),
69
- i("span", C, [i("span", w, [d(e.$slots, "title", {}, () => [a(p(o.title), 1)])]), o.description || e.$slots.description ? (u(), r("span", T, [d(e.$slots, "description", {}, () => [a(p(o.description), 1)])])) : n("", !0)]),
70
- e.$slots.actions ? n("", !0) : (u(), t(m(y), {
71
- key: 2,
72
- class: l(["size-4 shrink-0 text-muted transition-transform duration-200 ease-out-soft motion-reduce:transition-none", N.value && "rotate-180 text-heading"]),
73
- "aria-hidden": "true"
74
- }, null, 8, ["class"]))
75
- ], 10, x)]),
60
+ }, [i("div", { class: u(["flex items-center", e.$slots.actions && "transition-colors duration-200 @max-md:flex-wrap has-[[data-accordion-trigger]:enabled:hover]:bg-accent-hover/60"]) }, [(d(), t(p(`h${F.value}`), { class: "m-0 min-w-0 flex-1 text-base leading-5 font-normal tracking-normal @max-md:basis-full" }, {
61
+ default: y(() => [(d(), t(p(o.collapsible ? "button" : "span"), l({ id: `${h(M)}-trigger` }, {
62
+ ...R.value,
63
+ ...o.headerAttrs
64
+ }, {
65
+ class: ["flex w-full items-center gap-3 text-left", [
66
+ I.value === "flush" ? "px-1 py-3" : "px-5 py-4",
67
+ o.collapsible && D,
68
+ o.collapsible && !o.disabled && !e.$slots.actions && "hover:bg-accent-hover/60"
69
+ ]],
70
+ onClick: L
71
+ }), {
72
+ default: y(() => [
73
+ o.collapsible && e.$slots.actions ? (d(), t(h(x), {
74
+ key: 0,
75
+ class: u(["size-4 shrink-0 text-muted transition-transform duration-200 ease-out-soft motion-reduce:transition-none", P.value && "rotate-90 text-heading"]),
76
+ "aria-hidden": "true"
77
+ }, null, 8, ["class"])) : n("", !0),
78
+ e.$slots.icon ? (d(), r("span", S, [f(e.$slots, "icon")])) : n("", !0),
79
+ i("span", C, [i("span", w, [f(e.$slots, "title", {}, () => [a(m(o.title), 1)])]), o.description || e.$slots.description ? (d(), r("span", T, [f(e.$slots, "description", {}, () => [a(m(o.description), 1)])])) : n("", !0)]),
80
+ o.collapsible && !e.$slots.actions ? (d(), t(h(b), {
81
+ key: 2,
82
+ class: u(["size-4 shrink-0 text-muted transition-transform duration-200 ease-out-soft motion-reduce:transition-none", P.value && "rotate-180 text-heading"]),
83
+ "aria-hidden": "true"
84
+ }, null, 8, ["class"])) : n("", !0)
85
+ ]),
86
+ _: 3
87
+ }, 16, ["id", "class"]))]),
76
88
  _: 3
77
- })), e.$slots.actions ? (u(), r("div", {
89
+ })), e.$slots.actions ? (d(), r("div", {
78
90
  key: 0,
79
- class: l(["flex shrink-0 flex-wrap items-center gap-1.5 @max-md:w-full", F.value === "flush" ? "pr-1 @max-md:-mt-1 @max-md:pb-3 @max-md:pl-8" : "pr-5 @max-md:-mt-2 @max-md:pb-4 @max-md:pl-12"])
80
- }, [d(e.$slots, "actions")], 2)) : n("", !0)], 2), i("div", { class: l(["grid transition-[grid-template-rows] duration-200 ease-out-soft motion-reduce:transition-none", N.value ? "grid-rows-[1fr]" : "grid-rows-[0fr]"]) }, [i("div", {
81
- id: `${m(j)}-panel`,
91
+ class: u(["flex shrink-0 flex-wrap items-center gap-1.5 @max-md:w-full", I.value === "flush" ? "pr-1 @max-md:-mt-1 @max-md:pb-3 @max-md:pl-8" : "pr-5 @max-md:-mt-2 @max-md:pb-4 @max-md:pl-12"])
92
+ }, [f(e.$slots, "actions")], 2)) : n("", !0)], 2), i("div", { class: u(["grid transition-[grid-template-rows] duration-200 ease-out-soft motion-reduce:transition-none", P.value ? "grid-rows-[1fr]" : "grid-rows-[0fr]"]) }, [i("div", {
93
+ id: `${h(M)}-panel`,
82
94
  role: "region",
83
- "aria-labelledby": `${m(j)}-trigger`,
84
- inert: !N.value || void 0,
85
- class: "min-h-0 overflow-hidden"
86
- }, [i("div", { class: l(["pt-0.5 text-base text-body", F.value === "flush" ? "px-1 pb-4" : "px-5 pb-5"]) }, [d(e.$slots, "default")], 2)], 8, E)], 2)], 2));
95
+ "aria-labelledby": `${h(M)}-trigger`,
96
+ inert: !P.value || void 0,
97
+ class: "min-h-0 overflow-clip"
98
+ }, [i("div", { class: u(["pt-0.5 text-base text-body", I.value === "flush" ? "px-1 pb-4" : "px-5 pb-5"]) }, [f(e.$slots, "default")], 2)], 8, E)], 2)], 2));
87
99
  }
88
100
  });
89
101
  //#endregion
90
- export { D as default };
102
+ export { O as default };
@@ -12,7 +12,7 @@ var g = {
12
12
  class: "mt-0.5 text-xs leading-4 text-muted"
13
13
  }, b = {
14
14
  key: 1,
15
- class: "flex max-w-full min-w-0 shrink-0 flex-wrap items-center gap-2"
15
+ class: "flex max-w-full min-w-0 shrink-0 flex-wrap items-center gap-2 sm:flex-nowrap"
16
16
  }, x = /*@__PURE__*/ c({
17
17
  __name: "AcCard",
18
18
  props: {
@@ -203,7 +203,7 @@ var g = {
203
203
  key: 1,
204
204
  class: l(["absolute -top-4 -right-4 [&_svg]:size-24!", M.value.watermark])
205
205
  }, [d(e.$slots, "icon")], 2))])) : i("", !0),
206
- o("div", { class: l(["flex min-w-0 flex-1 basis-[220px] items-center", A.value ? "gap-2.5" : "gap-3"]) }, [c.icon || e.$slots.icon ? (u(), a("span", {
206
+ o("div", { class: l(["flex min-w-0 flex-1 basis-[220px] items-center sm:basis-[160px]", A.value ? "gap-2.5" : "gap-3"]) }, [c.icon || e.$slots.icon ? (u(), a("span", {
207
207
  key: 0,
208
208
  class: l(["flex shrink-0 items-center justify-center", [
209
209
  M.value.tile,
@@ -6,30 +6,30 @@ var E = { class: "flex flex-col gap-3" }, D = ["for"], O = [
6
6
  "name",
7
7
  "value",
8
8
  "disabled"
9
- ], k = { class: "flex min-w-0 flex-col gap-1" }, A = { class: "font-normal" }, j = {
9
+ ], k = { class: "font-normal" }, A = {
10
10
  key: 0,
11
11
  class: "text-xs text-muted"
12
- }, M = {
12
+ }, j = {
13
13
  key: 0,
14
14
  class: "mt-1 text-base text-danger-strong",
15
15
  role: "alert"
16
- }, N = [
16
+ }, M = [
17
17
  "name",
18
18
  "checked",
19
19
  "indeterminate",
20
20
  "disabled",
21
21
  "aria-invalid",
22
22
  "aria-describedby"
23
- ], P = {
23
+ ], N = {
24
24
  key: 0,
25
- class: "flex min-w-0 flex-col gap-1"
26
- }, F = { key: 0 }, I = {
25
+ class: "font-medium"
26
+ }, P = {
27
27
  key: 1,
28
28
  class: "font-medium"
29
- }, L = {
29
+ }, F = {
30
30
  key: 2,
31
31
  class: "text-xs text-muted"
32
- }, R = ["id"], z = /*@__PURE__*/ o({
32
+ }, I = ["id"], L = /*@__PURE__*/ o({
33
33
  inheritAttrs: !1,
34
34
  __name: "AcCheckBox",
35
35
  props: /*@__PURE__*/ s({
@@ -58,75 +58,78 @@ var E = { class: "flex flex-col gap-3" }, D = ["for"], O = [
58
58
  }),
59
59
  emits: ["update:modelValue", "update:checked"],
60
60
  setup(o) {
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 : {
61
+ let s = o, L = y(o, "modelValue"), R = y(o, "checked"), z = b(), B = v(), V = _(), H = f(null), U = t(() => s.size === "small"), W = t(() => s.indeterminate && !R.value), G = t(() => s.options ? V : {
62
+ class: V.class,
63
+ style: V.style
64
+ }), K = t(() => {
65
+ let { class: e, style: t, ...n } = V;
66
+ return s.label || z.label || n["aria-label"] || n["aria-labelledby"] ? n : {
67
67
  "aria-label": "Select",
68
68
  ...n
69
69
  };
70
- }), Y = t(() => G.value ? "size-[18px]" : "size-6"), X = t(() => [
70
+ }), q = t(() => !!(s.label || z.label || s.description)), J = t(() => U.value ? "size-[18px]" : "size-6"), Y = t(() => [
71
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);
72
+ J.value,
73
+ U.value ? "bg-background" : "bg-transparent"
74
+ ]), X = t(() => ["pointer-events-none absolute inset-0 m-auto text-white opacity-0 transition-opacity duration-150 motion-reduce:transition-none", U.value ? "size-3.5" : "size-5"]), Z = t(() => U.value ? "" : "pt-0.5"), Q = t(() => U.value ? "mt-px" : ""), $ = t(() => ["cursor-not-allowed", U.value ? "opacity-40" : "opacity-50"]);
75
+ async function ee(e) {
76
+ R.value = e.target.checked, await l(), H.value && (H.value.checked = R.value, H.value.indeterminate = W.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
- }, q.value), [i("div", E, [(d(!0), r(e, null, p(o.options, (e, t) => (d(), r("label", {
82
+ }, G.value), [i("div", E, [(d(!0), r(e, null, p(o.options, (e, t) => (d(), r("label", {
83
83
  key: e.label,
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,
84
+ for: `${g(B)}-${t}`,
85
+ class: u(["group inline-flex w-fit cursor-pointer items-start text-base font-normal text-heading select-none", [e.disabled && $.value, U.value ? "gap-2.5" : "gap-3"]])
86
+ }, [i("span", { class: u(["relative inline-flex shrink-0", [J.value, Q.value]]) }, [S(i("input", {
87
+ id: `${g(B)}-${t}`,
88
+ "onUpdate:modelValue": s[0] ||= (e) => L.value = e,
89
89
  type: "checkbox",
90
90
  name: o.name,
91
91
  value: e.value,
92
92
  disabled: e.disabled,
93
- class: u(X.value)
94
- }, null, 10, O), [[x, z.value]]), a(g(w), {
95
- class: u([Z.value, "peer-checked:opacity-100"]),
93
+ class: u(Y.value)
94
+ }, null, 10, O), [[x, L.value]]), a(g(w), {
95
+ class: u([X.value, "peer-checked:opacity-100"]),
96
96
  "aria-hidden": "true"
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({
97
+ }, null, 8, ["class"])], 2), i("span", { class: u(["flex min-w-0 flex-col gap-1", Z.value]) }, [i("span", k, h(e.label), 1), e.description ? (d(), r("span", A, h(e.description), 1)) : n("", !0)], 2)], 10, D))), 128))]), o.errorMsg ? (d(), r("p", j, 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
- }, 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]) }, [
102
+ }, G.value, { onClick: s[1] ||= C(() => {}, ["stop"]) }), [i("label", { class: u(["group inline-flex w-fit cursor-pointer items-start text-base font-normal text-heading select-none", [o.disabled && $.value, U.value ? "gap-2.5" : "gap-3"]]) }, [i("span", { class: u(["relative inline-flex shrink-0", [J.value, q.value && Q.value]]) }, [
103
103
  i("input", c({
104
104
  ref_key: "single",
105
- ref: W,
105
+ ref: H,
106
106
  type: "checkbox",
107
107
  name: o.name,
108
- checked: B.value,
109
- indeterminate: K.value,
108
+ checked: R.value,
109
+ indeterminate: W.value,
110
110
  disabled: o.disabled,
111
111
  "aria-invalid": o.errorMsg ? !0 : void 0,
112
- "aria-describedby": o.errorMsg ? `${g(H)}-error` : void 0,
113
- class: X.value
114
- }, J.value, { onChange: $ }), null, 16, N),
112
+ "aria-describedby": o.errorMsg ? `${g(B)}-error` : void 0,
113
+ class: Y.value
114
+ }, K.value, { onChange: ee }), null, 16, M),
115
115
  a(g(w), {
116
- class: u([Z.value, "peer-checked:opacity-100"]),
116
+ class: u([X.value, "peer-checked:opacity-100"]),
117
117
  "aria-hidden": "true"
118
118
  }, null, 8, ["class"]),
119
119
  a(g(T), {
120
- class: u([Z.value, "peer-indeterminate:opacity-100"]),
120
+ class: u([X.value, "peer-indeterminate:opacity-100"]),
121
121
  "aria-hidden": "true"
122
122
  }, null, 8, ["class"])
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", {
123
+ ], 2), q.value ? (d(), r("span", {
124
+ key: 0,
125
+ class: u(["flex min-w-0 flex-col gap-1", Z.value])
126
+ }, [t.$slots.label ? (d(), r("span", N, [m(t.$slots, "label")])) : o.label ? (d(), r("span", P, h(o.label), 1)) : n("", !0), o.description ? (d(), r("span", F, h(o.description), 1)) : n("", !0)], 2)) : n("", !0)], 2), o.errorMsg ? (d(), r("p", {
124
127
  key: 0,
125
- id: `${g(H)}-error`,
128
+ id: `${g(B)}-error`,
126
129
  class: "mt-1 text-base text-danger-strong",
127
130
  role: "alert"
128
- }, h(o.errorMsg), 9, R)) : n("", !0)], 16));
131
+ }, h(o.errorMsg), 9, I)) : n("", !0)], 16));
129
132
  }
130
133
  });
131
134
  //#endregion
132
- export { z as default };
135
+ export { L as default };
@@ -66,8 +66,8 @@ var w = {
66
66
  return (n, _) => (d(), a("div", w, [o("div", { class: u(c.cards ? ["grid gap-3", !L.value && "sm:grid-cols-2"] : c.row ? "flex flex-row flex-wrap gap-x-6 gap-y-3" : "flex flex-col gap-3") }, [(d(!0), a(e, null, f(c.options, (e, f) => (d(), r(m(L.value ? "div" : "label"), {
67
67
  key: e.label,
68
68
  for: L.value ? void 0 : `${g(I)}-${f}`,
69
- class: u(["group flex cursor-pointer gap-3 text-base text-heading select-none", [
70
- c.cards ? "relative items-start rounded-14 border border-border bg-surface p-3 transition-[border-color,background-color,box-shadow] duration-200 ease-out has-checked:border-primary has-checked:bg-primary/5 has-checked:shadow-[inset_0_0_0_1px_var(--color-primary)] has-focus-visible:ring-2 has-focus-visible:ring-ring has-focus-visible:ring-offset-2 has-focus-visible:ring-offset-background motion-reduce:transition-none" : L.value ? "relative items-center" : "w-fit items-center",
69
+ class: u(["group flex cursor-pointer gap-3 text-base font-normal text-heading select-none", [
70
+ c.cards ? "relative items-start rounded-14 border border-border bg-surface px-4 py-3 transition-[border-color,background-color,box-shadow] duration-200 ease-out has-checked:border-primary has-checked:bg-primary/5 has-checked:shadow-[inset_0_0_0_1px_var(--color-primary)] has-focus-visible:ring-2 has-focus-visible:ring-ring has-focus-visible:ring-offset-2 has-focus-visible:ring-offset-background motion-reduce:transition-none" : L.value ? "relative items-center" : "w-fit items-center",
71
71
  e.disabled && ["cursor-not-allowed", c.cards ? "opacity-60" : "opacity-50"],
72
72
  L.value && "flex-wrap",
73
73
  c.cards && !e.disabled && "hover:border-primary/40 hover:bg-accent-hover has-checked:hover:border-primary has-checked:hover:bg-primary/5"
@@ -77,7 +77,7 @@ var w = {
77
77
  (d(), r(m(L.value ? "label" : "span"), {
78
78
  for: L.value ? `${g(I)}-${f}` : void 0,
79
79
  class: u(L.value ? [
80
- "flex min-w-0 flex-1 basis-[240px] gap-3 after:absolute after:inset-0",
80
+ "flex min-w-0 flex-1 basis-[240px] gap-3 font-normal after:absolute after:inset-0",
81
81
  c.cards ? "items-start" : "items-center",
82
82
  e.disabled ? "cursor-not-allowed" : "cursor-pointer"
83
83
  ] : "contents")
@@ -1,3 +1,4 @@
1
+ import type { HTMLAttributes } from "vue";
1
2
  export interface ColorPreset {
2
3
  /** Hex colour, `#rgb` or `#rrggbb`. */
3
4
  value: string;
@@ -7,6 +8,8 @@ export interface ColorPreset {
7
8
  export interface Props {
8
9
  /** Label above the field. Without one, pass `aria-label` so the field still has a name. */
9
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"];
10
13
  /** Native `name` attribute of the hex field. */
11
14
  name?: string;
12
15
  /** Quick-pick swatches under the field: hex strings or `{ value, label }`. */
@@ -50,6 +53,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
50
53
  hint: string;
51
54
  readonly: boolean;
52
55
  errorMsg: string;
56
+ labelClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
53
57
  presets: (string | ColorPreset)[];
54
58
  swatchOnly: boolean;
55
59
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -40,6 +40,16 @@ var b = ["for"], x = {
40
40
  __name: "AcColorInput",
41
41
  props: /*@__PURE__*/ o({
42
42
  label: { default: "" },
43
+ labelClass: {
44
+ type: [
45
+ Boolean,
46
+ null,
47
+ String,
48
+ Object,
49
+ Array
50
+ ],
51
+ default: void 0
52
+ },
43
53
  name: { default: "" },
44
54
  presets: { default: () => [] },
45
55
  required: {
@@ -124,12 +134,12 @@ var b = ["for"], x = {
124
134
  a.label ? (u(), r("label", {
125
135
  key: 0,
126
136
  for: a.swatchOnly ? `${m(P)}-picker` : m(P),
127
- class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
137
+ class: c(["mb-2 flex items-center gap-1 text-base font-medium text-heading", a.labelClass])
128
138
  }, [
129
139
  i("span", null, p(a.label), 1),
130
140
  a.readonly ? (u(), r("span", x, "(read only)")) : n("", !0),
131
141
  a.required ? (u(), r("span", S, "*")) : n("", !0)
132
- ], 8, b)) : n("", !0),
142
+ ], 10, b)) : n("", !0),
133
143
  a.hint ? (u(), r("p", {
134
144
  key: 1,
135
145
  id: `${m(P)}-hint`,
@@ -10,6 +10,8 @@ export interface DatePickerPreset {
10
10
  export interface Props {
11
11
  /** Label above the field. Doubles as the accessible name of the trigger and the popover. */
12
12
  label?: string;
13
+ /** 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. */
14
+ labelClass?: HTMLAttributes["class"];
13
15
  /** Text shown in the field while there's no value. Defaults to "Choose date" (or "Choose duration"). */
14
16
  placeholder?: string;
15
17
  /** `date` for a calendar day (`YYYY-MM-DD`), `datetime` for an instant with hours and minutes (UTC ISO 8601), or `duration` for a Go/Kubernetes duration such as `26h30m`. */
@@ -94,6 +96,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
94
96
  placeholder: string;
95
97
  errorMsg: string;
96
98
  range: boolean;
99
+ labelClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
97
100
  clearable: boolean;
98
101
  presets: DatePickerPreset[];
99
102
  locale: string;