@ac-design/design-system 2.2.0 → 2.3.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 (54) hide show
  1. package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +89 -88
  2. package/dist/lib/compat.css +210 -0
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
  4. package/dist/lib/components/AcButton.vue.d.ts +18 -12
  5. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
  6. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  7. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  8. package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
  9. package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
  10. package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
  11. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
  12. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
  13. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  14. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
  15. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  16. package/dist/lib/components/AcInput.vue.d.ts +28 -7
  17. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
  18. package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
  19. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  20. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  21. package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
  22. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  23. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  24. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
  25. package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
  26. package/dist/lib/components/AcRadioCard.js +5 -0
  27. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  28. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  29. package/dist/lib/components/AcSelect.vue.d.ts +12 -1
  30. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
  31. package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
  32. package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
  33. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  34. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  35. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  36. package/dist/lib/components/AcSlider.vue.d.ts +1 -1
  37. package/dist/lib/components/AcTable.vue.d.ts +13 -1
  38. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
  39. package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
  40. package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
  41. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
  42. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  43. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  44. package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
  45. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
  46. package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
  47. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  48. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
  49. package/dist/lib/components/fixedFrame.d.ts +11 -0
  50. package/dist/lib/components/fixedFrame.js +24 -0
  51. package/dist/lib/components/index.d.ts +1 -0
  52. package/dist/lib/components/types.d.ts +2 -0
  53. package/dist/lib/index.js +34 -33
  54. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import e from "./AcLogo.js";
2
2
  import t from "./AcNavbarItem.js";
3
- import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as ee, openBlock as g, ref as _, renderList as v, renderSlot as te, resolveDynamicComponent as ne, toDisplayString as y, unref as b, useId as re, useModel as ie, watch as ae, withCtx as oe } from "vue";
3
+ import { fixedFrame as n } from "./fixedFrame.js";
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";
4
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";
5
6
  //#region src/lib/components/AcAppSwitcher.vue?vue&type=script&setup=true&lang.ts
6
7
  var ge = {
@@ -15,22 +16,22 @@ var ge = {
15
16
  "aria-current",
16
17
  "title",
17
18
  "onClick"
18
- ], x = ["src"], S = {
19
+ ], S = ["src"], C = {
19
20
  key: 3,
20
21
  class: "text-lg font-semibold"
21
- }, C = { class: "w-full truncate text-xs font-medium text-heading" }, w = {
22
+ }, w = { class: "w-full truncate text-xs font-medium text-heading" }, T = {
22
23
  key: 0,
23
24
  class: "sr-only"
24
- }, T = {
25
+ }, E = {
25
26
  key: 1,
26
27
  class: "absolute top-1.5 right-1.5 inline-flex size-4 items-center justify-center rounded-full bg-primary text-white",
27
28
  "aria-hidden": "true"
28
- }, E = {
29
+ }, D = {
29
30
  key: 0,
30
31
  class: "mt-2 border-t border-border pt-2"
31
- }, D = "id", O = 3, k = 6, A = /*@__PURE__*/ d({
32
+ }, O = "id", k = 3, A = 6, j = /*@__PURE__*/ f({
32
33
  __name: "AcAppSwitcher",
33
- props: /*@__PURE__*/ f({
34
+ props: /*@__PURE__*/ p({
34
35
  currentApp: { default: "platform" },
35
36
  baseUrl: { default: "https://appscode.com" },
36
37
  activeOrganization: { default: "" },
@@ -54,11 +55,11 @@ var ge = {
54
55
  },
55
56
  openModifiers: {}
56
57
  }),
57
- emits: /*@__PURE__*/ f(["select"], ["update:open"]),
58
- setup(d, { emit: f }) {
59
- let A = d, j = ie(d, "open"), M = f, N = [
58
+ emits: /*@__PURE__*/ p(["select"], ["update:open"]),
59
+ setup(f, { emit: p }) {
60
+ let j = f, M = ie(f, "open"), N = p, P = [
60
61
  {
61
- name: D,
62
+ name: O,
62
63
  title: "Platform",
63
64
  port: "8080",
64
65
  subtitle: "Manage your platform & accounts"
@@ -111,14 +112,14 @@ var ge = {
111
112
  icon: ue,
112
113
  color: "red"
113
114
  }
114
- ], P = {
115
+ ], F = {
115
116
  name: "console",
116
117
  title: "Console",
117
118
  port: "5990",
118
119
  subtitle: "Manage your kubernetes clusters",
119
120
  icon: pe,
120
121
  color: "blue"
121
- }, F = [
122
+ }, ye = [
122
123
  "https://appscode.ninja",
123
124
  "https://appscode.com",
124
125
  "http://bb.test:8080"
@@ -126,7 +127,7 @@ var ge = {
126
127
  "billing",
127
128
  "selfhost",
128
129
  "learn"
129
- ], ye = {
130
+ ], be = {
130
131
  primary: "bg-primary/10 text-primary-strong ring-primary/25",
131
132
  blue: "bg-info/10 text-info-strong ring-info/25",
132
133
  green: "bg-success/10 text-success-strong ring-success/25",
@@ -134,15 +135,15 @@ var ge = {
134
135
  purple: "bg-pending/10 text-pending-strong ring-pending/25",
135
136
  red: "bg-danger/10 text-danger-strong ring-danger/25",
136
137
  slate: "bg-surface-sunken text-muted ring-border"
137
- }, L = re(), R = `${L}-panel`, z = `${L}-heading`, B = _(null), V = _(null), H = _({}), U = _(!0), W = a(() => A.currentApp === "platform" ? D : A.currentApp), be = a(() => !F.includes(A.baseUrl)), xe = a(() => {
138
- let e = [...N];
139
- return A.activeOrgType !== O && e.splice(1, 0, P), e.filter((e) => !be.value || !I.includes(e.name) || e.name === "billing" && A.isOfflineInstaller && A.activeOrgType === k);
140
- }), G = a(() => (A.apps ?? xe.value).filter((e) => !A.hideCurrent || e.name !== W.value).map((e) => ({
138
+ }, L = re(), R = `${L}-panel`, z = `${L}-heading`, B = v(null), V = v(null), H = v({}), U = v(!0), W = o(() => j.currentApp === "platform" ? O : j.currentApp), xe = o(() => !ye.includes(j.baseUrl)), Se = o(() => {
139
+ let e = [...P];
140
+ return j.activeOrgType !== k && e.splice(1, 0, F), e.filter((e) => !xe.value || !I.includes(e.name) || e.name === "billing" && j.isOfflineInstaller && j.activeOrgType === A);
141
+ }), G = o(() => (j.apps ?? Se.value).filter((e) => !j.hideCurrent || e.name !== W.value).map((e) => ({
141
142
  ...e,
142
- url: e.url ?? Se(e)
143
+ url: e.url ?? Ce(e)
143
144
  })));
144
- function Se(e) {
145
- return A.baseUrl.includes("bb.test") ? `http://bb.test:${e.port}/${e.name}/` : A.baseUrl.includes("localhost") ? `http://localhost:${e.port}/${e.name}/` : `${A.baseUrl}/${e.name}/`;
145
+ function Ce(e) {
146
+ return j.baseUrl.includes("bb.test") ? `http://bb.test:${e.port}/${e.name}/` : j.baseUrl.includes("localhost") ? `http://localhost:${e.port}/${e.name}/` : `${j.baseUrl}/${e.name}/`;
146
147
  }
147
148
  function K(e) {
148
149
  return e.name === W.value;
@@ -153,7 +154,7 @@ var ge = {
153
154
  function J() {
154
155
  return [...V.value?.querySelectorAll("[data-app-tile]") ?? []];
155
156
  }
156
- function Ce(e) {
157
+ function we(e) {
157
158
  let t = e[0]?.offsetTop, n = e.filter((e) => e.offsetTop === t).length;
158
159
  return Math.max(n, 1);
159
160
  }
@@ -164,43 +165,43 @@ var ge = {
164
165
  function X() {
165
166
  let e = q();
166
167
  if (!e || !V.value) return;
167
- let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = V.value, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = A.align === "end" ? t.right - n : t.left;
168
- U.value = !o, H.value = {
169
- [o ? "bottom" : "top"]: `${o ? window.innerHeight - t.top + 6 : t.bottom + 6}px`,
170
- left: `${Math.max(8, Math.min(s, window.innerWidth - n - 8))}px`,
171
- maxHeight: `${Math.max(o ? a : i, 160)}px`
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;
169
+ U.value = !c, H.value = {
170
+ [c ? "bottom" : "top"]: `${c ? r.bottom - t.top + 6 : t.bottom + 6 - r.top}px`,
171
+ left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
172
+ maxHeight: `${Math.max(c ? s : o, 160)}px`
172
173
  };
173
174
  }
174
175
  function Z(e = !0) {
175
- j.value && (j.value = !1, e && q()?.focus());
176
- }
177
- function we() {
178
- j.value ? Z() : j.value = !0;
176
+ M.value && (M.value = !1, e && q()?.focus());
179
177
  }
180
178
  function Te() {
181
- let e = [`gorg=${encodeURIComponent(A.activeOrganization)}`, "path=/"];
182
- A.rootDomain && e.push(`domain=${A.rootDomain}`), document.cookie = e.join("; ");
179
+ M.value ? Z() : M.value = !0;
183
180
  }
184
- function Ee(e) {
185
- e.name === "grafana" && Te(), M("select", e);
181
+ function Ee() {
182
+ let e = [`gorg=${encodeURIComponent(j.activeOrganization)}`, "path=/"];
183
+ j.rootDomain && e.push(`domain=${j.rootDomain}`), document.cookie = e.join("; ");
186
184
  }
187
185
  function De(e) {
188
- e.key !== "ArrowDown" || j.value || (e.preventDefault(), j.value = !0);
186
+ e.name === "grafana" && Ee(), N("select", e);
189
187
  }
190
188
  function Oe(e) {
191
- let t = J(), n = t.indexOf(document.activeElement), r = Ce(t), i = {
189
+ e.key !== "ArrowDown" || M.value || (e.preventDefault(), M.value = !0);
190
+ }
191
+ function ke(e) {
192
+ let t = J(), n = t.indexOf(document.activeElement), r = we(t), i = {
192
193
  ArrowRight: 1,
193
194
  ArrowLeft: -1,
194
195
  ArrowDown: r,
195
196
  ArrowUp: -r
196
197
  };
197
- e.key in i && n >= 0 ? (e.preventDefault(), Y(n + i[e.key])) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Y(e.key === "Home" ? 0 : t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && ke(e);
198
+ e.key in i && n >= 0 ? (e.preventDefault(), Y(n + i[e.key])) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Y(e.key === "Home" ? 0 : t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && Ae(e);
198
199
  }
199
- function ke(e) {
200
+ function Ae(e) {
200
201
  let t = [...V.value?.querySelectorAll("a[href], button:not([disabled])") ?? []], n = t[0], r = t[t.length - 1];
201
202
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), Z()) : !e.shiftKey && document.activeElement === r && Z();
202
203
  }
203
- function Ae(e) {
204
+ function je(e) {
204
205
  let t = e.target;
205
206
  q()?.contains(t) || V.value?.contains(t) || Z(!1);
206
207
  }
@@ -209,57 +210,57 @@ var ge = {
209
210
  }
210
211
  function $(e) {
211
212
  let t = e ? "addEventListener" : "removeEventListener";
212
- document[t]("pointerdown", Ae, !0), window[t]("scroll", Q, !0), window[t]("resize", Q);
213
+ document[t]("pointerdown", je, !0), window[t]("scroll", Q, !0), window[t]("resize", Q);
213
214
  }
214
- return ae(j, async (e) => {
215
+ return ae(M, async (e) => {
215
216
  if ($(e), !e) return;
216
- await p(), X();
217
+ await m(), X();
217
218
  let t = J(), n = G.value.findIndex(K);
218
219
  Y(n >= 0 && t[n] ? n : 0);
219
- }), ee(() => $(!1)), (a, f) => (g(), c("div", ge, [u(t, {
220
+ }), ee(() => $(!1)), (n, o) => (_(), l("div", ge, [d(t, {
220
221
  ref_key: "trigger",
221
222
  ref: B,
222
- label: d.label,
223
- icon: b(de),
223
+ label: f.label,
224
+ icon: x(de),
224
225
  "icon-only": "",
225
226
  "aria-haspopup": "dialog",
226
- "aria-expanded": j.value,
227
- "aria-controls": j.value ? R : void 0,
228
- class: m(j.value && "bg-surface-sunken text-heading"),
227
+ "aria-expanded": M.value,
228
+ "aria-controls": M.value ? R : void 0,
229
+ class: h(M.value && "bg-surface-sunken text-heading"),
229
230
  "data-ac-ds": "",
230
231
  "data-testid": "ac-app-switcher-trigger",
231
- onClick: we,
232
- onKeydown: De
232
+ onClick: Te,
233
+ onKeydown: Oe
233
234
  }, null, 8, [
234
235
  "label",
235
236
  "icon",
236
237
  "aria-expanded",
237
238
  "aria-controls",
238
239
  "class"
239
- ]), (g(), o(r, { to: "body" }, [u(i, {
240
+ ]), (_(), s(i, { to: "body" }, [d(a, {
240
241
  "enter-active-class": "transition duration-150 ease-out",
241
242
  "enter-from-class": "opacity-0 motion-safe:scale-95",
242
243
  "leave-active-class": "transition duration-100 ease-in",
243
244
  "leave-to-class": "opacity-0"
244
245
  }, {
245
- default: oe(() => [j.value ? (g(), c("div", {
246
+ default: oe(() => [M.value ? (_(), l("div", {
246
247
  key: 0,
247
248
  id: R,
248
249
  ref_key: "panel",
249
250
  ref: V,
250
251
  role: "dialog",
251
252
  "aria-labelledby": z,
252
- class: m(["ac-scrollbar fixed z-[90] flex w-[calc(340px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg", U.value ? "origin-top-right" : "origin-bottom-right"]),
253
- style: h(H.value),
253
+ class: h(["ac-scrollbar fixed z-[90] flex w-[calc(340px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg", U.value ? "origin-top-right" : "origin-bottom-right"]),
254
+ style: g(H.value),
254
255
  "data-ac-ds": "",
255
256
  "data-testid": "ac-app-switcher-panel",
256
- onKeydown: Oe
257
+ onKeydown: ke
257
258
  }, [
258
- l("p", {
259
+ u("p", {
259
260
  id: z,
260
261
  class: "px-3 pt-2 pb-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
261
- }, y(d.label), 1),
262
- l("ul", _e, [(g(!0), c(n, null, v(G.value, (t) => (g(), c("li", { key: t.name }, [l("a", {
262
+ }, b(f.label), 1),
263
+ u("ul", _e, [(_(!0), l(r, null, te(G.value, (t) => (_(), l("li", { key: t.name }, [u("a", {
263
264
  href: t.url,
264
265
  "data-app-tile": "",
265
266
  "aria-current": K(t) ? "page" : void 0,
@@ -267,37 +268,37 @@ var ge = {
267
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",
268
269
  "data-ac-ds": "",
269
270
  "data-testid": "ac-app-switcher-app",
270
- onClick: (e) => Ee(t)
271
+ onClick: (e) => De(t)
271
272
  }, [
272
- l("span", {
273
- class: m(["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 === D && !t.icon ? "bg-surface ring-border" : ye[t.color ?? "slate"]]),
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
275
  "aria-hidden": "true"
275
- }, [t.iconUrl ? (g(), c("img", {
276
+ }, [t.iconUrl ? (_(), l("img", {
276
277
  key: 0,
277
278
  src: t.iconUrl,
278
279
  alt: "",
279
280
  class: "size-7 object-contain"
280
- }, null, 8, x)) : t.icon ? (g(), o(ne(t.icon), {
281
+ }, null, 8, S)) : t.icon ? (_(), s(y(t.icon), {
281
282
  key: 1,
282
283
  class: "size-5"
283
- })) : t.name === D ? (g(), o(e, {
284
+ })) : t.name === O ? (_(), s(e, {
284
285
  key: 2,
285
286
  variant: "mark",
286
287
  size: 28,
287
288
  label: ""
288
- })) : (g(), c("span", S, y(t.title.charAt(0)), 1))], 2),
289
- l("span", C, y(t.title), 1),
290
- t.subtitle ? (g(), c("span", w, y(t.subtitle), 1)) : s("", !0),
291
- K(t) ? (g(), c("span", T, [u(b(ce), {
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), {
292
293
  class: "size-2.5",
293
294
  "stroke-width": 3
294
- })])) : s("", !0)
295
+ })])) : c("", !0)
295
296
  ], 8, ve)]))), 128))]),
296
- a.$slots.footer ? (g(), c("div", E, [te(a.$slots, "footer", { close: Z })])) : s("", !0)
297
- ], 38)) : s("", !0)]),
297
+ n.$slots.footer ? (_(), l("div", D, [ne(n.$slots, "footer", { close: Z })])) : c("", !0)
298
+ ], 38)) : c("", !0)]),
298
299
  _: 3
299
300
  })]))]));
300
301
  }
301
302
  });
302
303
  //#endregion
303
- export { A as default };
304
+ export { j as default };
@@ -2,13 +2,13 @@ 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;
@@ -20,11 +20,15 @@ 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;
23
27
  }
24
28
  type __VLS_Slots = {
25
- /** Button content, after the icon and `title`. */
29
+ /** Button content, after the icon and `title`. An icon here is 16px unless it has its own size class, e.g. `size-5`. */
26
30
  default?: () => unknown;
27
- /** A 16px icon before the label (an inline SVG or icon component). */
31
+ /** 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
32
  icon?: () => unknown;
29
33
  /** A 16px icon after the label, e.g. an arrow or chevron. */
30
34
  "icon-right"?: () => unknown;
@@ -34,16 +38,18 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
34
38
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
35
39
  onClick?: ((e: MouseEvent) => any) | undefined;
36
40
  }>, {
37
- variant: Variant | "link";
41
+ variant: Variant | "subtle" | "ghost" | "link";
38
42
  type: "button" | "submit" | "reset";
39
43
  title: string;
40
44
  disabled: boolean;
41
- color: Tone | "white" | "ghost";
45
+ color: Tone | "neutral" | "white" | "ghost";
42
46
  href: string;
43
- size: "xs" | "small" | "normal" | "medium";
47
+ size: "xs" | "small" | "normal" | "medium" | "xlarge";
44
48
  iconOnly: boolean;
45
49
  loading: boolean;
46
50
  rounded: boolean;
51
+ boxed: boolean;
52
+ hint: string;
47
53
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
48
54
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
49
55
  declare const _default: typeof __VLS_export;
@@ -1,7 +1,7 @@
1
1
  import e from "./AcSpinner.js";
2
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";
3
3
  //#region src/lib/components/AcButton.vue?vue&type=script&setup=true&lang.ts
4
- var f = /*@__PURE__*/ a({
4
+ var f = "[:where(&)_svg]:size-4", p = /*@__PURE__*/ a({
5
5
  __name: "AcButton",
6
6
  props: {
7
7
  title: { default: "" },
@@ -25,45 +25,68 @@ var f = /*@__PURE__*/ a({
25
25
  rounded: {
26
26
  type: Boolean,
27
27
  default: !1
28
- }
28
+ },
29
+ boxed: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ hint: { default: void 0 }
29
34
  },
30
35
  emits: ["click"],
31
- setup(a, { emit: f }) {
32
- let p = a, m = f, h = {
36
+ setup(a, { emit: p }) {
37
+ let m = a, h = p, g = {
33
38
  primary: {
34
39
  solid: "border-transparent bg-primary text-white shadow-button hover:bg-primary-hover hover:shadow-sm",
35
40
  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"
41
+ subtle: "border-transparent bg-primary/6 text-primary-strong hover:bg-primary/12",
42
+ outlined: "border-primary/35 bg-background text-primary-strong hover:bg-primary/10",
43
+ ghost: "border-transparent bg-transparent text-primary-strong hover:bg-primary/10"
37
44
  },
38
45
  info: {
39
46
  solid: "border-transparent bg-info text-white shadow-button hover:bg-info-hover hover:shadow-sm",
40
47
  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"
48
+ subtle: "border-transparent bg-info/6 text-info-strong hover:bg-info/12",
49
+ outlined: "border-info/40 bg-background text-info-strong hover:bg-info/10",
50
+ ghost: "border-transparent bg-transparent text-info-strong hover:bg-info/10"
42
51
  },
43
52
  success: {
44
53
  solid: "border-transparent bg-success text-white shadow-button hover:bg-success-hover hover:shadow-sm",
45
54
  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"
55
+ subtle: "border-transparent bg-success/6 text-success-strong hover:bg-success/12",
56
+ outlined: "border-success/40 bg-background text-success-strong hover:bg-success/10",
57
+ ghost: "border-transparent bg-transparent text-success-strong hover:bg-success/10"
47
58
  },
48
59
  warning: {
49
60
  solid: "border-transparent bg-warning text-on-warning shadow-button hover:bg-warning-hover hover:shadow-sm",
50
61
  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"
62
+ subtle: "border-transparent bg-warning/6 text-warning-strong hover:bg-warning/12",
63
+ outlined: "border-warning/45 bg-background text-warning-strong hover:bg-warning/10",
64
+ ghost: "border-transparent bg-transparent text-warning-strong hover:bg-warning/10"
52
65
  },
53
66
  danger: {
54
67
  solid: "border-transparent bg-red-50 text-white shadow-button hover:bg-red-40 hover:shadow-sm",
55
68
  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"
69
+ subtle: "border-transparent bg-danger/6 text-danger-strong hover:bg-danger/12",
70
+ outlined: "border-danger/40 bg-background text-danger-strong hover:bg-danger/10",
71
+ ghost: "border-transparent bg-transparent text-danger-strong hover:bg-danger/10"
72
+ },
73
+ neutral: {
74
+ solid: "border-transparent bg-body text-background shadow-button hover:bg-body/90 hover:shadow-sm",
75
+ light: "border-transparent bg-surface-sunken text-heading hover:bg-accent-hover",
76
+ subtle: "border-transparent bg-surface-sunken/70 text-heading hover:bg-surface-sunken",
77
+ outlined: "border-border bg-background text-heading hover:bg-surface-sunken/70",
78
+ ghost: "border-transparent bg-transparent text-heading hover:bg-surface-sunken"
57
79
  }
58
- }, g = {
80
+ }, _ = {
59
81
  primary: "text-primary-strong",
60
82
  info: "text-info-strong",
61
83
  success: "text-success-strong",
62
84
  warning: "text-warning-strong",
63
85
  danger: "text-danger-strong",
86
+ neutral: "text-muted hover:text-heading",
64
87
  white: "text-muted hover:text-heading",
65
88
  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 = {
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 = {
67
90
  xs: {
68
91
  base: "h-7 gap-1.5 px-2 text-xs",
69
92
  icon: "size-7 text-xs"
@@ -79,22 +102,27 @@ var f = /*@__PURE__*/ a({
79
102
  medium: {
80
103
  base: "h-10.5 gap-2 px-5 text-base md:h-11 md:text-lg",
81
104
  icon: "size-11 text-lg"
105
+ },
106
+ xlarge: {
107
+ base: "h-12 gap-2 px-6 text-lg md:h-13 md:text-xl",
108
+ icon: "size-14 text-xl"
82
109
  }
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"] : [
110
+ }, S = {
111
+ 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] : [
92
120
  e.base,
93
- p.rounded ? "rounded-full" : "rounded-10",
94
- "[&_svg]:size-4"
121
+ m.rounded ? "rounded-full" : "rounded-10",
122
+ f
95
123
  ];
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);
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);
98
126
  };
99
127
  return (t, f) => (s(), n(l(a.href ? "a" : "button"), {
100
128
  href: a.href && !a.disabled ? a.href : void 0,
@@ -102,25 +130,26 @@ var f = /*@__PURE__*/ a({
102
130
  disabled: !a.href && a.disabled || void 0,
103
131
  "aria-disabled": a.href && a.disabled || void 0,
104
132
  "aria-busy": a.loading || void 0,
133
+ title: a.hint || void 0,
105
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", [
106
- S.value,
107
- v.value,
135
+ w.value,
136
+ b.value,
108
137
  "focus-visible:ring-ring",
109
- x.value,
138
+ C.value,
110
139
  a.loading && "pointer-events-none"
111
140
  ]]),
112
141
  "data-ac-ds": "",
113
142
  "data-testid": "ac-button",
114
- onClick: C
143
+ onClick: T
115
144
  }, {
116
145
  default: d(() => [
117
146
  a.loading ? (s(), n(e, {
118
147
  key: 0,
119
- class: o(!a.iconOnly && !_.value && "-ml-0.5"),
148
+ class: o(!a.iconOnly && !y.value && "-ml-0.5"),
120
149
  label: ""
121
150
  }, null, 8, ["class"])) : t.$slots.icon ? (s(), i("span", {
122
151
  key: 1,
123
- class: o([!a.iconOnly && !_.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
152
+ class: o([!a.iconOnly && !y.value && "-ml-0.5", "inline-flex shrink-0 items-center justify-center"]),
124
153
  "aria-hidden": "true"
125
154
  }, [c(t.$slots, "icon")], 2)) : r("", !0),
126
155
  a.title ? (s(), i("span", {
@@ -130,7 +159,7 @@ var f = /*@__PURE__*/ a({
130
159
  a.iconOnly && a.loading ? r("", !0) : c(t.$slots, "default", {}, void 0, void 0, 3),
131
160
  t.$slots["icon-right"] ? (s(), i("span", {
132
161
  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"]),
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"]),
134
163
  "aria-hidden": "true"
135
164
  }, [c(t.$slots, "icon-right")], 2)) : r("", !0)
136
165
  ]),
@@ -141,9 +170,10 @@ var f = /*@__PURE__*/ a({
141
170
  "disabled",
142
171
  "aria-disabled",
143
172
  "aria-busy",
173
+ "title",
144
174
  "class"
145
175
  ]));
146
176
  }
147
177
  });
148
178
  //#endregion
149
- export { f as default };
179
+ export { p 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;