@ac-design/design-system 2.2.1 → 2.4.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 (77) hide show
  1. package/dist/lib/compat.css +421 -0
  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 +25 -13
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +122 -71
  8. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  9. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  10. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  11. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  12. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  13. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  14. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  15. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  16. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  17. package/dist/lib/components/AcColorInput.vue.d.ts +4 -4
  18. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  19. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  20. package/dist/lib/components/AcDatePicker.vue.d.ts +41 -10
  21. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +554 -446
  22. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  24. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  25. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  27. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  28. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  29. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  30. package/dist/lib/components/AcInput.vue.d.ts +86 -44
  31. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +319 -86
  32. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  33. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  34. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  35. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  36. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  37. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  38. package/dist/lib/components/AcModal.vue.d.ts +1 -1
  39. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  40. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  41. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  42. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  43. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  44. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  45. package/dist/lib/components/AcRadioCard.js +5 -0
  46. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  47. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  48. package/dist/lib/components/AcSelect.vue.d.ts +46 -6
  49. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +309 -197
  50. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  51. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  52. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  53. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  54. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  55. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  56. package/dist/lib/components/AcTable.vue.d.ts +50 -5
  57. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +257 -129
  58. package/dist/lib/components/AcTagInput.vue.d.ts +23 -4
  59. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  60. package/dist/lib/components/AcTaintInput.js +5 -0
  61. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  62. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  63. package/dist/lib/components/AcTextarea.vue.d.ts +64 -4
  64. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +159 -68
  65. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  66. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  67. package/dist/lib/components/AcTimePicker.vue.d.ts +36 -11
  68. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +232 -168
  69. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  70. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  71. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
  72. package/dist/lib/components/index.d.ts +2 -0
  73. package/dist/lib/components/types.d.ts +2 -0
  74. package/dist/lib/composables/useToast.d.ts +2 -2
  75. package/dist/lib/index.d.ts +2 -1
  76. package/dist/lib/index.js +51 -49
  77. package/package.json +1 -1
@@ -63,6 +63,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
63
63
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
64
64
  }>, {
65
65
  label: string;
66
+ align: "start" | "end";
66
67
  currentApp: "console" | "db" | "platform" | "id" | "billing" | "selfhost" | "learn" | "grafana" | "observe" | (string & {});
67
68
  baseUrl: string;
68
69
  activeOrganization: string;
@@ -71,7 +72,6 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
71
72
  isOfflineInstaller: boolean;
72
73
  apps: AppSwitcherApp[];
73
74
  hideCurrent: boolean;
74
- align: "start" | "end";
75
75
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
76
76
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
77
77
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,6 @@
1
- import e from "./AcLogo.js";
2
- import t from "./AcNavbarItem.js";
3
- import { fixedFrame as n } from "./fixedFrame.js";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import t from "./AcLogo.js";
3
+ import n from "./AcNavbarItem.js";
4
4
  import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as ee, openBlock as _, ref as v, renderList as te, renderSlot as ne, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as re, useModel as ie, watch as ae, withCtx as oe } from "vue";
5
5
  import { ChartLine as se, Check as ce, Database as le, GraduationCap as ue, Grip as de, Receipt as fe, Server as pe, ServerCog as me, Telescope as he } from "@lucide/vue";
6
6
  //#region src/lib/components/AcAppSwitcher.vue?vue&type=script&setup=true&lang.ts
@@ -163,11 +163,11 @@ var ge = {
163
163
  t.length && t[Math.max(0, Math.min(e, t.length - 1))].focus();
164
164
  }
165
165
  function X() {
166
- let e = q();
167
- if (!e || !V.value) return;
168
- let t = e.getBoundingClientRect(), r = n(), { offsetWidth: i, offsetHeight: a } = V.value, o = r.bottom - t.bottom - 6 - 8, s = t.top - r.top - 6 - 8, c = o < a && s > o, l = (j.align === "end" ? t.right - i : t.left) - r.left;
166
+ let t = q();
167
+ if (!t || !V.value) return;
168
+ let n = t.getBoundingClientRect(), r = e(), { offsetWidth: i, offsetHeight: a } = V.value, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = (j.align === "end" ? n.right - i : n.left) - r.left;
169
169
  U.value = !c, H.value = {
170
- [c ? "bottom" : "top"]: `${c ? r.bottom - t.top + 6 : t.bottom + 6 - r.top}px`,
170
+ [c ? "bottom" : "top"]: `${c ? r.bottom - n.top + 6 : n.bottom + 6 - r.top}px`,
171
171
  left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
172
172
  maxHeight: `${Math.max(c ? s : o, 160)}px`
173
173
  };
@@ -217,7 +217,7 @@ var ge = {
217
217
  await m(), X();
218
218
  let t = J(), n = G.value.findIndex(K);
219
219
  Y(n >= 0 && t[n] ? n : 0);
220
- }), ee(() => $(!1)), (n, o) => (_(), l("div", ge, [d(t, {
220
+ }), ee(() => $(!1)), (e, o) => (_(), l("div", ge, [d(n, {
221
221
  ref_key: "trigger",
222
222
  ref: B,
223
223
  label: f.label,
@@ -260,41 +260,41 @@ var ge = {
260
260
  id: z,
261
261
  class: "px-3 pt-2 pb-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
262
262
  }, b(f.label), 1),
263
- u("ul", _e, [(_(!0), l(r, null, te(G.value, (t) => (_(), l("li", { key: t.name }, [u("a", {
264
- href: t.url,
263
+ u("ul", _e, [(_(!0), l(r, null, te(G.value, (e) => (_(), l("li", { key: e.name }, [u("a", {
264
+ href: e.url,
265
265
  "data-app-tile": "",
266
- "aria-current": K(t) ? "page" : void 0,
267
- title: t.subtitle || void 0,
266
+ "aria-current": K(e) ? "page" : void 0,
267
+ title: e.subtitle || void 0,
268
268
  class: "group relative flex h-full flex-col items-center gap-2 rounded-8 px-1.5 pt-3 pb-2.5 text-center no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-[current=page]:bg-accent",
269
269
  "data-ac-ds": "",
270
270
  "data-testid": "ac-app-switcher-app",
271
- onClick: (e) => De(t)
271
+ onClick: (t) => De(e)
272
272
  }, [
273
273
  u("span", {
274
- class: h(["relative inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-10 ring-1 transition-transform duration-200 ring-inset motion-safe:group-hover:-translate-y-px", t.iconUrl || t.name === O && !t.icon ? "bg-surface ring-border" : be[t.color ?? "slate"]]),
274
+ class: h(["relative inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-10 ring-1 transition-transform duration-200 ring-inset motion-safe:group-hover:-translate-y-px", e.iconUrl || e.name === O && !e.icon ? "bg-surface ring-border" : be[e.color ?? "slate"]]),
275
275
  "aria-hidden": "true"
276
- }, [t.iconUrl ? (_(), l("img", {
276
+ }, [e.iconUrl ? (_(), l("img", {
277
277
  key: 0,
278
- src: t.iconUrl,
278
+ src: e.iconUrl,
279
279
  alt: "",
280
280
  class: "size-7 object-contain"
281
- }, null, 8, S)) : t.icon ? (_(), s(y(t.icon), {
281
+ }, null, 8, S)) : e.icon ? (_(), s(y(e.icon), {
282
282
  key: 1,
283
283
  class: "size-5"
284
- })) : t.name === O ? (_(), s(e, {
284
+ })) : e.name === O ? (_(), s(t, {
285
285
  key: 2,
286
286
  variant: "mark",
287
287
  size: 28,
288
288
  label: ""
289
- })) : (_(), l("span", C, b(t.title.charAt(0)), 1))], 2),
290
- u("span", w, b(t.title), 1),
291
- t.subtitle ? (_(), l("span", T, b(t.subtitle), 1)) : c("", !0),
292
- K(t) ? (_(), l("span", E, [d(x(ce), {
289
+ })) : (_(), l("span", C, b(e.title.charAt(0)), 1))], 2),
290
+ u("span", w, b(e.title), 1),
291
+ e.subtitle ? (_(), l("span", T, b(e.subtitle), 1)) : c("", !0),
292
+ K(e) ? (_(), l("span", E, [d(x(ce), {
293
293
  class: "size-2.5",
294
294
  "stroke-width": 3
295
295
  })])) : c("", !0)
296
296
  ], 8, ve)]))), 128))]),
297
- n.$slots.footer ? (_(), l("div", D, [ne(n.$slots, "footer", { close: Z })])) : c("", !0)
297
+ e.$slots.footer ? (_(), l("div", D, [ne(e.$slots, "footer", { close: Z })])) : c("", !0)
298
298
  ], 38)) : c("", !0)]),
299
299
  _: 3
300
300
  })]))]));
@@ -20,9 +20,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
20
20
  title: string;
21
21
  description: string;
22
22
  height: number;
23
- loading: boolean;
24
23
  animation: boolean;
25
24
  tooltip: boolean;
25
+ loading: boolean;
26
26
  emptyText: string;
27
27
  lineWidth: number;
28
28
  stacked: boolean;
@@ -21,9 +21,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
21
21
  height: number;
22
22
  orientation: "vertical" | "horizontal";
23
23
  radius: number;
24
- loading: boolean;
25
24
  animation: boolean;
26
25
  tooltip: boolean;
26
+ loading: boolean;
27
27
  emptyText: string;
28
28
  stacked: boolean;
29
29
  renderer: "canvas" | "svg";
@@ -2,17 +2,17 @@ import type { Tone, Variant } from "./types";
2
2
  export interface Props {
3
3
  /** Text label. You can also pass content through the default slot. */
4
4
  title?: string;
5
- /** Colour of the button. `white` and `ghost` are neutral styles for secondary actions. */
6
- color?: Tone | "white" | "ghost";
7
- /** `solid` fill, `light` tinted fill (12% of the colour), `outlined` border on the page background, or `link`: coloured text with no box that underlines on hover, e.g. "Go to Health". */
8
- variant?: Variant | "link";
9
- /** Height and padding: `xs` 28px, `small` 36px, `normal` 42px (the field height, so a button lines up with an input), `medium` 42px with 16px text and 44px from 768px (cloud-ui's default `lg`). */
10
- size?: "xs" | "small" | "normal" | "medium";
11
- /** A round, square button for a single icon: 28px at `xs`, 32px at `small`, 36px at `normal`, 44px at `medium`. Put the icon in the `icon` or default slot; `title` becomes the accessible name, or add an `aria-label`. */
5
+ /** Colour of the button. `neutral` is a grey or near-black button that takes every `variant`; `white` and `ghost` are fixed neutral styles (the same as `neutral` with `outlined` and `ghost`). */
6
+ color?: Tone | "neutral" | "white" | "ghost";
7
+ /** `solid` fill, `light` tinted fill (12% of the colour), `subtle` a fainter 6% tint, `outlined` border on the page background, `ghost` no fill until hover, or `link`: coloured text with no box that underlines on hover, e.g. "Go to Health". */
8
+ variant?: Variant | "subtle" | "ghost" | "link";
9
+ /** Height and padding: `xs` 28px, `small` 36px, `normal` 42px (the field height, so a button lines up with an input), `medium` 42px with 16px text and 44px from 768px (cloud-ui's default `lg`), `xlarge` 48px with 16px text and 52px with 18px text from 768px (cloud-ui's `xl`). */
10
+ size?: "xs" | "small" | "normal" | "medium" | "xlarge";
11
+ /** A round, square button for a single icon: 28px at `xs`, 32px at `small`, 36px at `normal`, 44px at `medium`, 56px at `xlarge`. Put the icon in the `icon` or default slot; `title` becomes the accessible name, or add an `aria-label`. */
12
12
  iconOnly?: boolean;
13
13
  /** Shows a spinner before the label and blocks clicks. */
14
14
  loading?: boolean;
15
- /** Disables the button (50% opacity, no click events). */
15
+ /** Disables the button: 50% opacity, no clicks, and no hover colour. With `hint` it keeps hover so the hint still shows, with a not-allowed cursor. */
16
16
  disabled?: boolean;
17
17
  /** Native button type. Use `submit` inside forms. */
18
18
  type?: "button" | "submit" | "reset";
@@ -20,11 +20,19 @@ export interface Props {
20
20
  href?: string;
21
21
  /** Fully rounded pill corners at every size and variant, e.g. an empty state's "Get started". */
22
22
  rounded?: boolean;
23
+ /** With `variant="link"`, keeps the height, padding and corners of `size`, so a text link lines up with the buttons next to it. */
24
+ boxed?: boolean;
25
+ /** Native hover hint (the `title` attribute). Use it when the label comes from the default slot; the `title` prop is the visible label. */
26
+ hint?: string;
27
+ /** Shows this text in an `AcTooltip` above the button on hover and keyboard focus, e.g. "Delete VPC" on an icon-only button. An icon-only button without `title` also takes it as its accessible name. Old `tooltip-text`. */
28
+ tooltip?: string;
29
+ /** Stretches the button to the full width of its container. */
30
+ block?: boolean;
23
31
  }
24
32
  type __VLS_Slots = {
25
- /** Button content, after the icon and `title`. */
33
+ /** Button content, after the icon and `title`. An icon here is 16px unless it has its own size class, e.g. `size-5`. */
26
34
  default?: () => unknown;
27
- /** A 16px icon before the label (an inline SVG or icon component). */
35
+ /** A 16px icon before the label (an inline SVG or icon component). A size class on the icon, e.g. `size-3.5`, wins. */
28
36
  icon?: () => unknown;
29
37
  /** A 16px icon after the label, e.g. an arrow or chevron. */
30
38
  "icon-right"?: () => unknown;
@@ -34,16 +42,20 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
34
42
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
35
43
  onClick?: ((e: MouseEvent) => any) | undefined;
36
44
  }>, {
37
- variant: Variant | "link";
45
+ variant: Variant | "subtle" | "ghost" | "link";
38
46
  type: "button" | "submit" | "reset";
39
47
  title: string;
40
48
  disabled: boolean;
41
- color: Tone | "white" | "ghost";
49
+ color: Tone | "neutral" | "white" | "ghost";
42
50
  href: string;
43
- size: "xs" | "small" | "normal" | "medium";
51
+ size: "xs" | "small" | "normal" | "medium" | "xlarge";
52
+ tooltip: string;
44
53
  iconOnly: boolean;
45
54
  loading: boolean;
46
55
  rounded: boolean;
56
+ boxed: boolean;
57
+ hint: string;
58
+ block: boolean;
47
59
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
60
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
49
61
  declare const _default: typeof __VLS_export;
@@ -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 = /*@__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: "" },
@@ -25,45 +27,73 @@ var f = /*@__PURE__*/ a({
25
27
  rounded: {
26
28
  type: Boolean,
27
29
  default: !1
30
+ },
31
+ boxed: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ hint: { default: void 0 },
36
+ tooltip: { default: "" },
37
+ block: {
38
+ type: Boolean,
39
+ default: !1
28
40
  }
29
41
  },
30
42
  emits: ["click"],
31
- setup(a, { emit: f }) {
32
- let p = a, m = f, h = {
43
+ setup(o, { emit: v }) {
44
+ let y = o, b = v, x = {
33
45
  primary: {
34
46
  solid: "border-transparent bg-primary text-white shadow-button hover:bg-primary-hover hover:shadow-sm",
35
47
  light: "border-transparent bg-primary/12 text-primary-strong hover:bg-primary/18",
36
- outlined: "border-primary/35 bg-background text-primary-strong hover:bg-primary/10"
48
+ subtle: "border-transparent bg-primary/6 text-primary-strong hover:bg-primary/12",
49
+ outlined: "border-primary/35 bg-background text-primary-strong hover:bg-primary/10",
50
+ ghost: "border-transparent bg-transparent text-primary-strong hover:bg-primary/10"
37
51
  },
38
52
  info: {
39
53
  solid: "border-transparent bg-info text-white shadow-button hover:bg-info-hover hover:shadow-sm",
40
54
  light: "border-transparent bg-info/12 text-info-strong hover:bg-info/18",
41
- outlined: "border-info/40 bg-background text-info-strong hover:bg-info/10"
55
+ subtle: "border-transparent bg-info/6 text-info-strong hover:bg-info/12",
56
+ outlined: "border-info/40 bg-background text-info-strong hover:bg-info/10",
57
+ ghost: "border-transparent bg-transparent text-info-strong hover:bg-info/10"
42
58
  },
43
59
  success: {
44
60
  solid: "border-transparent bg-success text-white shadow-button hover:bg-success-hover hover:shadow-sm",
45
61
  light: "border-transparent bg-success/12 text-success-strong hover:bg-success/18",
46
- outlined: "border-success/40 bg-background text-success-strong hover:bg-success/10"
62
+ subtle: "border-transparent bg-success/6 text-success-strong hover:bg-success/12",
63
+ outlined: "border-success/40 bg-background text-success-strong hover:bg-success/10",
64
+ ghost: "border-transparent bg-transparent text-success-strong hover:bg-success/10"
47
65
  },
48
66
  warning: {
49
67
  solid: "border-transparent bg-warning text-on-warning shadow-button hover:bg-warning-hover hover:shadow-sm",
50
68
  light: "border-transparent bg-warning/12 text-warning-strong hover:bg-warning/18",
51
- outlined: "border-warning/45 bg-background text-warning-strong hover:bg-warning/10"
69
+ subtle: "border-transparent bg-warning/6 text-warning-strong hover:bg-warning/12",
70
+ outlined: "border-warning/45 bg-background text-warning-strong hover:bg-warning/10",
71
+ ghost: "border-transparent bg-transparent text-warning-strong hover:bg-warning/10"
52
72
  },
53
73
  danger: {
54
74
  solid: "border-transparent bg-red-50 text-white shadow-button hover:bg-red-40 hover:shadow-sm",
55
75
  light: "border-transparent bg-danger/12 text-danger-strong hover:bg-danger/18",
56
- outlined: "border-danger/40 bg-background text-danger-strong hover:bg-danger/10"
76
+ subtle: "border-transparent bg-danger/6 text-danger-strong hover:bg-danger/12",
77
+ outlined: "border-danger/40 bg-background text-danger-strong hover:bg-danger/10",
78
+ ghost: "border-transparent bg-transparent text-danger-strong hover:bg-danger/10"
79
+ },
80
+ neutral: {
81
+ solid: "border-transparent bg-body text-background shadow-button hover:bg-body/90 hover:shadow-sm",
82
+ light: "border-transparent bg-surface-sunken text-heading hover:bg-accent-hover",
83
+ subtle: "border-transparent bg-surface-sunken/70 text-heading hover:bg-surface-sunken",
84
+ outlined: "border-border bg-background text-heading hover:bg-surface-sunken/70",
85
+ ghost: "border-transparent bg-transparent text-heading hover:bg-surface-sunken"
57
86
  }
58
- }, g = {
87
+ }, S = {
59
88
  primary: "text-primary-strong",
60
89
  info: "text-info-strong",
61
90
  success: "text-success-strong",
62
91
  warning: "text-warning-strong",
63
92
  danger: "text-danger-strong",
93
+ neutral: "text-muted hover:text-heading",
64
94
  white: "text-muted hover:text-heading",
65
95
  ghost: "text-muted hover:text-heading"
66
- }, _ = t(() => p.variant === "link"), v = t(() => p.variant === "link" ? g[p.color] : p.color === "white" ? "border-border bg-background text-heading hover:bg-surface-sunken/70" : p.color === "ghost" ? "border-transparent bg-transparent text-heading hover:bg-surface-sunken" : h[p.color][p.variant]), y = {
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 = {
67
97
  xs: {
68
98
  base: "h-7 gap-1.5 px-2 text-xs",
69
99
  icon: "size-7 text-xs"
@@ -79,71 +109,92 @@ var f = /*@__PURE__*/ a({
79
109
  medium: {
80
110
  base: "h-10.5 gap-2 px-5 text-base md:h-11 md:text-lg",
81
111
  icon: "size-11 text-lg"
112
+ },
113
+ xlarge: {
114
+ base: "h-12 gap-2 px-6 text-lg md:h-13 md:text-xl",
115
+ icon: "size-14 text-xl"
82
116
  }
83
- }, b = {
84
- xs: "gap-1 text-xs [&_svg]:size-3.5",
85
- small: "gap-1 text-base [&_svg]:size-4",
86
- normal: "gap-1 text-base [&_svg]:size-4",
87
- medium: "gap-1 text-base md:text-lg [&_svg]:size-4"
88
- }, x = t(() => {
89
- if (_.value) return [b[p.size], p.rounded ? "rounded-full" : "rounded-4"];
90
- let e = y[p.size];
91
- return p.iconOnly ? [`${e.icon} rounded-full`, "[&_svg]:size-4"] : [
117
+ }, D = {
118
+ xs: "gap-1 text-xs [:where(&)_svg]:size-3.5",
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`, _] : [
92
127
  e.base,
93
- p.rounded ? "rounded-full" : "rounded-10",
94
- "[&_svg]:size-4"
128
+ y.rounded ? "rounded-full" : "rounded-10",
129
+ _
95
130
  ];
96
- }), S = t(() => _.value ? "group/ac-button 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"), C = (e) => {
97
- !p.disabled && !p.loading && m("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);
98
141
  };
99
- return (t, f) => (s(), n(l(a.href ? "a" : "button"), {
100
- href: a.href && !a.disabled ? a.href : void 0,
101
- type: a.href ? void 0 : a.type,
102
- disabled: !a.href && a.disabled || void 0,
103
- "aria-disabled": a.href && a.disabled || void 0,
104
- "aria-busy": a.loading || void 0,
105
- 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", [
106
- S.value,
107
- v.value,
108
- "focus-visible:ring-ring",
109
- x.value,
110
- a.loading && "pointer-events-none"
111
- ]]),
112
- "data-ac-ds": "",
113
- "data-testid": "ac-button",
114
- onClick: C
115
- }, {
116
- default: d(() => [
117
- a.loading ? (s(), n(e, {
118
- key: 0,
119
- class: o(!a.iconOnly && !_.value && "-ml-0.5"),
120
- label: ""
121
- }, null, 8, ["class"])) : t.$slots.icon ? (s(), i("span", {
122
- key: 1,
123
- class: o([!a.iconOnly && !_.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
124
- "aria-hidden": "true"
125
- }, [c(t.$slots, "icon")], 2)) : r("", !0),
126
- a.title ? (s(), i("span", {
127
- key: 2,
128
- class: o(a.iconOnly && "sr-only")
129
- }, u(a.title), 3)) : r("", !0),
130
- a.iconOnly && a.loading ? r("", !0) : c(t.$slots, "default", {}, void 0, void 0, 3),
131
- t.$slots["icon-right"] ? (s(), i("span", {
132
- key: 4,
133
- class: o(["inline-flex shrink-0 items-center justify-center", _.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"]),
134
- "aria-hidden": "true"
135
- }, [c(t.$slots, "icon-right")], 2)) : r("", !0)
136
- ]),
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
+ ]))]),
137
195
  _: 3
138
- }, 8, [
139
- "href",
140
- "type",
141
- "disabled",
142
- "aria-disabled",
143
- "aria-busy",
144
- "class"
145
- ]));
196
+ }, 16));
146
197
  }
147
198
  });
148
199
  //#endregion
149
- export { f as default };
200
+ export { v as default };
@@ -1,6 +1,6 @@
1
1
  import type { Component } from "vue";
2
2
  export interface Props {
3
- /** Header title. The header renders with a title, an `icon`, or the `actions` or `badges` slot. */
3
+ /** Header title. The header renders with a title, a description, an `icon`, or the `actions`, `badges` or `description` slot. */
4
4
  title?: string;
5
5
  /** Small line under the title. */
6
6
  subtitle?: string;
@@ -16,8 +16,12 @@ export interface Props {
16
16
  variant?: "default" | "muted" | "dashed" | "danger";
17
17
  /** Tints the header icon tile, the `accent` wash and the watermark: `primary` (green), `blue`, `violet`, `red` or `amber`. */
18
18
  color?: "primary" | "blue" | "violet" | "red" | "amber";
19
- /** `normal` header with a 16px title and a divider; `small` a compact header with a 28px icon tile, a 14px title and no divider, like cloud-ui's section cards. */
20
- headerSize?: "normal" | "small";
19
+ /** `normal` header with a 16px title and a divider; `small` a compact header with a 28px icon tile, a 14px title and no divider, like cloud-ui's section cards; `bar` a compact single-line bar (10px top and bottom, centred) with a divider over the body, for dense detail pages (cloud-ui's `headerSize="sm"`). */
20
+ headerSize?: "normal" | "small" | "bar";
21
+ /** Heading level of the title, so the card fits the page outline, e.g. `h2` for a top-level section. */
22
+ titleTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
23
+ /** A plain card: no header or footer, the padding on the card itself, and the default slot straight inside it, so classes on the card such as `flex items-center`, `grid`, `space-y-4` or `divide-y` lay out your content. Padding comes from `padding` (24px by default; `padded=false` removes it); a background class on the card replaces the variant's fill. */
24
+ bare?: boolean;
21
25
  /** Hover look for a card that acts as a link or button: a pointer, a primary-tinted edge and a light wash. */
22
26
  hoverable?: boolean;
23
27
  /** Rests the card on a faint shadow that deepens on hover; with `hoverable` the card also lifts 2px. */
@@ -32,7 +36,7 @@ type __VLS_Slots = {
32
36
  default?: () => unknown;
33
37
  /** Buttons on the right of the header. */
34
38
  actions?: () => unknown;
35
- /** Replaces the `icon` tile's content, e.g. a logo image. */
39
+ /** Replaces the `icon` tile's content, e.g. a logo image. An unsized SVG icon here is 16px (14px with `header-size="small"`), and with `accent` it's also the watermark. */
36
40
  icon?: () => unknown;
37
41
  /** Replaces the line under the title, e.g. text with a link. */
38
42
  description?: () => unknown;
@@ -50,7 +54,9 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
50
54
  subtitle: string;
51
55
  padded: boolean;
52
56
  padding: "none" | "xs" | "sm" | "md" | "lg";
53
- headerSize: "normal" | "small";
57
+ headerSize: "normal" | "small" | "bar";
58
+ titleTag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
59
+ bare: boolean;
54
60
  hoverable: boolean;
55
61
  shadow: boolean;
56
62
  accent: boolean;