@jonmilner/ui 0.10.2 → 0.11.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.
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
2
- @keyframes hkhd8a{to{opacity:.25}}@layer components.button{.hkhd80{border-width:var(--space-1);border-style:solid}.hkhd80[aria-disabled=true]{background-color:var(--color-bg-muted);border-color:var(--color-border-strong);color:var(--color-fg-muted);border-style:dashed}.hkhd80:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent));box-shadow:inset 0 0 0 var(--space-1) currentColor}.hkhd82{border-color:#0000}.hkhd83{border-color:var(--color-border-strong)}.hkhd84{border-color:#0000}.hkhd88{justify-items:center}.hkhd89{grid-area:1/1}.hkhd80[aria-busy=true] .hkhd89{opacity:0}.hkhd8b{grid-area:1/1}.hkhd8c{animation-name:hkhd8a;animation-duration:var(--duration-slow);animation-timing-function:var(--easing-standard);animation-iteration-count:infinite;animation-direction:alternate}.hkhd8c:nth-child(2){animation-delay:calc(var(--duration-slow) / 3)}.hkhd8c:nth-child(3){animation-delay:calc(var(--duration-slow) * 2 / 3)}@media (hover:hover){.hkhd80:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}}@media (forced-colors:active){.hkhd80{forced-color-adjust:none}.hkhd80:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:none}.hkhd80[aria-disabled=true]{color:graytext;border-color:graytext}.hkhd80:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{background-image:none}.hkhd84{--color-danger:var(--color-accent-fill);--color-danger-fg:var(--color-accent-fill-fg)}}@media (prefers-reduced-motion:reduce){.hkhd8c{animation-name:none}}}
2
+ @keyframes hkhd8c{to{opacity:.25}}@layer components.button{.hkhd80{--_5qoq940:transparent;--_5qoq941:40%;--_5qoq942:var(--space-12);border-width:var(--space-1);border-style:solid}.hkhd80[aria-disabled=true]{background-color:var(--color-bg-muted);border-color:var(--color-border-strong);color:var(--color-fg-muted);border-style:dashed}.hkhd80:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent));box-shadow:inset 0 0 0 var(--space-1) currentColor, 0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.hkhd80:not([aria-disabled=true]):not([aria-busy=true]):focus-visible{--_5qoq941:70%;--_5qoq942:var(--space-20)}.hkhd82{--_5qoq940:var(--color-accent-fill);border-color:#0000}.hkhd83{--_5qoq940:var(--color-accent);border-color:var(--color-accent)}.hkhd84{border-color:#0000}.hkhd85{--_5qoq940:var(--color-danger);border-color:#0000}.hkhd89{text-transform:uppercase}.hkhd8a{justify-items:center}.hkhd8b{grid-area:1/1}.hkhd80[aria-busy=true] .hkhd8b{opacity:0}.hkhd8d{grid-area:1/1}.hkhd8e{animation-name:hkhd8c;animation-duration:var(--duration-slow);animation-timing-function:var(--easing-standard);animation-iteration-count:infinite;animation-direction:alternate}.hkhd8e:nth-child(2){animation-delay:calc(var(--duration-slow) / 3)}.hkhd8e:nth-child(3){animation-delay:calc(var(--duration-slow) * 2 / 3)}@media (hover:hover){.hkhd80:not([aria-disabled=true]):not([aria-busy=true]):hover{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}}@media (forced-colors:active){.hkhd80{forced-color-adjust:none}.hkhd80:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:none}.hkhd80[aria-disabled=true]{color:graytext;border-color:graytext}.hkhd80:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{box-shadow:inset 0 0 0 var(--space-1) currentColor;background-image:none}.hkhd84{border-color:var(--color-border-strong)}.hkhd85{--color-danger:var(--color-accent-fill);--color-danger-fg:var(--color-accent-fill-fg)}}@media (prefers-reduced-motion:reduce){.hkhd8e{animation-name:none}}}@layer reset{.hkhd80{box-shadow:0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.hkhd80[aria-disabled=true]{box-shadow:none}@media (forced-colors:active){.hkhd80{box-shadow:none}}}
@@ -10,16 +10,17 @@ var t = "hkhd80", n = e({
10
10
  variant: {
11
11
  primary: "hkhd82",
12
12
  secondary: "hkhd83",
13
- danger: "hkhd84"
13
+ ghost: "hkhd84",
14
+ danger: "hkhd85"
14
15
  },
15
16
  size: {
16
- sm: "hkhd85",
17
- med: "hkhd86",
18
- lg: "hkhd87"
17
+ sm: "hkhd86",
18
+ med: "hkhd87",
19
+ lg: "hkhd88"
19
20
  }
20
21
  },
21
22
  defaultVariants: {},
22
23
  compoundVariants: []
23
- }), r = "hkhd88", i = "hkhd89", a = "hkhd8b", o = "hkhd8c";
24
+ }), r = "hkhd89", i = "hkhd8a", a = "hkhd8b", o = "hkhd8d", s = "hkhd8e";
24
25
  //#endregion
25
- export { n as button, i as content, o as dot, t as root, a as spinner, r as stack };
26
+ export { n as button, a as content, s as dot, r as label, t as root, o as spinner, i as stack };
@@ -9,7 +9,7 @@ export type ButtonOwnProps = {
9
9
  iconStart?: ComponentType<IconProps>;
10
10
  loading?: boolean;
11
11
  size?: "sm" | "med" | "lg";
12
- variant?: "primary" | "secondary" | "danger";
12
+ variant?: "primary" | "secondary" | "ghost" | "danger";
13
13
  };
14
14
  export type ButtonProps<T extends ElementType = "button"> = PolymorphicProps<T, StyleProps & ButtonOwnProps & Omit<ClickableOwnProps, "busy">, "busy" | "aria-disabled" | "aria-busy">;
15
15
  export declare function Button<T extends ElementType = "button">({ variant, size, loading: loadingProp, iconStart: IconStart, iconEnd: IconEnd, minBlockSize, paddingBlock, paddingInline, gap, borderRadius, backgroundColor, color, className, children, "aria-busy": ariaBusy, ...props }: ButtonProps<T> & {
@@ -29,7 +29,7 @@ var g = {
29
29
  gap: "8"
30
30
  }
31
31
  };
32
- function _({ variant: s = "secondary", size: _ = "med", loading: v = !1, iconStart: y, iconEnd: b, minBlockSize: x = g[_].minBlockSize, paddingBlock: S = g[_].paddingBlock, paddingInline: C = g[_].paddingInline, gap: w = g[_].gap, borderRadius: T = "med", backgroundColor: E = i[s].backgroundColor, color: D = i[s].color, className: O, children: k, "aria-busy": A, ...j }) {
32
+ function _({ variant: s = "secondary", size: _ = "med", loading: v = !1, iconStart: y, iconEnd: b, minBlockSize: x = g[_].minBlockSize, paddingBlock: S = g[_].paddingBlock, paddingInline: C = g[_].paddingInline, gap: w = g[_].gap, borderRadius: T = "full", backgroundColor: E = i[s].backgroundColor, color: D = i[s].color, className: O, children: k, "aria-busy": A, ...j }) {
33
33
  let M = v || String(A) === "true", N = j, P = c[_];
34
34
  return /* @__PURE__ */ m(n, {
35
35
  ...N,
@@ -59,34 +59,34 @@ function _({ variant: s = "secondary", size: _ = "med", loading: v = !1, iconSta
59
59
  y && /* @__PURE__ */ m(y, { size: P }),
60
60
  k != null && k !== !1 && k !== "" && /* @__PURE__ */ m(l, {
61
61
  as: "span",
62
- className: "_1gwwloa2",
62
+ className: e("hkhd89", "_1gwwloa2"),
63
63
  font: "label",
64
64
  size: P,
65
- weight: "medium",
65
+ weight: "bold",
66
66
  children: k
67
67
  }),
68
68
  b && /* @__PURE__ */ m(b, { size: P })
69
69
  ]
70
70
  }), M && /* @__PURE__ */ h(r, {
71
- className: "hkhd8b",
71
+ className: "hkhd8d",
72
72
  fill: "currentColor",
73
73
  size: P,
74
74
  stroke: "none",
75
75
  children: [
76
76
  /* @__PURE__ */ m("circle", {
77
- className: "hkhd8c",
77
+ className: "hkhd8e",
78
78
  cx: "5",
79
79
  cy: "12",
80
80
  r: "2"
81
81
  }),
82
82
  /* @__PURE__ */ m("circle", {
83
- className: "hkhd8c",
83
+ className: "hkhd8e",
84
84
  cx: "12",
85
85
  cy: "12",
86
86
  r: "2"
87
87
  }),
88
88
  /* @__PURE__ */ m("circle", {
89
- className: "hkhd8c",
89
+ className: "hkhd8e",
90
90
  cx: "19",
91
91
  cy: "12",
92
92
  r: "2"
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
2
- @layer components.icon-button{.n2fy8x0{border-width:var(--space-1);border-style:solid}.n2fy8x0[aria-disabled=true]{background-color:var(--color-bg-muted);border-color:var(--color-border-strong);color:var(--color-fg-muted);border-style:dashed}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent));box-shadow:inset 0 0 0 var(--space-1) currentColor}.n2fy8x2{border-color:#0000}.n2fy8x3{border-color:var(--color-border-strong)}@media (hover:hover){.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}}@media (forced-colors:active){.n2fy8x0{forced-color-adjust:none}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:none}.n2fy8x0[aria-disabled=true]{color:graytext;border-color:graytext}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{background-image:none}}}
2
+ @layer components.icon-button{.n2fy8x0{--_5qoq940:transparent;--_5qoq941:40%;--_5qoq942:var(--space-12);border-width:var(--space-1);border-style:solid}.n2fy8x0[aria-disabled=true]{background-color:var(--color-bg-muted);border-color:var(--color-border-strong);color:var(--color-fg-muted);border-style:dashed}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent));box-shadow:inset 0 0 0 var(--space-1) currentColor, 0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):focus-visible{--_5qoq941:70%;--_5qoq942:var(--space-20)}.n2fy8x2{--_5qoq940:var(--color-accent-fill);border-color:#0000}.n2fy8x3{--_5qoq940:var(--color-accent);border-color:var(--color-accent)}.n2fy8x4{border-color:#0000}@media (hover:hover){.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):hover{--_5qoq941:70%;--_5qoq942:var(--space-20);background-image:linear-gradient(color-mix(in srgb, var(--color-fg) 15%, transparent), color-mix(in srgb, var(--color-fg) 15%, transparent))}}@media (forced-colors:active){.n2fy8x0{forced-color-adjust:none}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true]):hover{background-image:none}.n2fy8x0[aria-disabled=true]{color:graytext;border-color:graytext}.n2fy8x0:not([aria-disabled=true]):not([aria-busy=true])[aria-expanded=true]{box-shadow:inset 0 0 0 var(--space-1) currentColor;background-image:none}.n2fy8x4{border-color:var(--color-border-strong)}}}@layer reset{.n2fy8x0{box-shadow:0 0 var(--_5qoq942) color-mix(in srgb, var(--_5qoq940) var(--_5qoq941), transparent)}.n2fy8x0[aria-disabled=true]{box-shadow:none}@media (forced-colors:active){.n2fy8x0{box-shadow:none}}}
@@ -9,12 +9,13 @@ var t = "n2fy8x0", n = e({
9
9
  variantClassNames: {
10
10
  variant: {
11
11
  primary: "n2fy8x2",
12
- secondary: "n2fy8x3"
12
+ secondary: "n2fy8x3",
13
+ ghost: "n2fy8x4"
13
14
  },
14
15
  size: {
15
- sm: "n2fy8x4",
16
- med: "n2fy8x5",
17
- lg: "n2fy8x6"
16
+ sm: "n2fy8x5",
17
+ med: "n2fy8x6",
18
+ lg: "n2fy8x7"
18
19
  }
19
20
  },
20
21
  defaultVariants: {},
@@ -8,7 +8,7 @@ export type IconButtonOwnProps = {
8
8
  icon: ComponentType<IconProps>;
9
9
  label: string;
10
10
  size?: "sm" | "med" | "lg";
11
- variant?: "primary" | "secondary";
11
+ variant?: "primary" | "secondary" | "ghost";
12
12
  };
13
13
  export type IconButtonProps<T extends ElementType = "button"> = PolymorphicProps<T, StyleProps & IconButtonOwnProps & Omit<ClickableOwnProps, "busy">, "busy" | "aria-disabled" | "aria-busy" | "aria-label" | "aria-labelledby" | "children">;
14
14
  export declare function IconButton<T extends ElementType = "button">({ label, icon: IconComponent, variant, size, minInlineSize, minBlockSize, borderRadius, backgroundColor, color, className, ...props }: IconButtonProps<T>): import("react").JSX.Element;
@@ -5,7 +5,7 @@ import { controlHeight as r, controlText as i } from "../styles/control-size.mjs
5
5
  import { iconButton as a, root as o } from "./IconButton.css.mjs";
6
6
  import { jsx as s } from "react/jsx-runtime";
7
7
  //#region src/IconButton/index.tsx
8
- function c({ label: c, icon: l, variant: u = "secondary", size: d = "med", minInlineSize: f = r[d], minBlockSize: p = r[d], borderRadius: m = "med", backgroundColor: h = n[u].backgroundColor, color: g = n[u].color, className: _, ...v }) {
8
+ function c({ label: c, icon: l, variant: u = "secondary", size: d = "med", minInlineSize: f = r[d], minBlockSize: p = r[d], borderRadius: m = "full", backgroundColor: h = n[u].backgroundColor, color: g = n[u].color, className: _, ...v }) {
9
9
  return /* @__PURE__ */ s(t, {
10
10
  ...v,
11
11
  "aria-label": c,
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
2
- @layer components.multiselect{._1seauxl0{text-align:start;justify-content:stretch}:where(._1seauxl0) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(._1seauxl0) ._1gwwloa1{min-inline-size:0}:where(._1seauxl0) ._1gwwloa2{flex:auto;min-inline-size:0}._1seauxl1{min-inline-size:0;display:block}._1seauxl1[data-placeholder]{color:var(--color-fg-muted)}._1seauxl2{min-inline-size:0;display:grid}._1seauxl3{grid-area:1/1}._1seauxl3[aria-hidden=true]{visibility:hidden}._1seauxl4{grid-area:1/1}._1seauxl5{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}._1seauxl5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl5[data-starting-style],._1seauxl5[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl6{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}._1seauxl6[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl6[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl7{visibility:hidden;flex-shrink:0}._1seauxl6[aria-selected=true] ._1seauxl7{visibility:visible}@media (forced-colors:active){._1seauxl6[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl6[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}._1seauxl6[aria-disabled=true]{color:graytext}}}
2
+ @layer components.multiselect{._1seauxl0{--_5qoq940:transparent;text-align:start;border-color:var(--color-border-strong);justify-content:stretch}:where(._1seauxl0) ._1gwwloa0{flex:auto;justify-items:stretch;min-inline-size:0}:where(._1seauxl0) ._1gwwloa1{min-inline-size:0}:where(._1seauxl0) ._1gwwloa2{text-transform:none;min-inline-size:0;font-weight:var(--font-weight-medium);flex:auto}._1seauxl1{min-inline-size:0;display:block}._1seauxl1[data-placeholder]{color:var(--color-fg-muted)}._1seauxl2{min-inline-size:0;display:grid}._1seauxl3{grid-area:1/1}._1seauxl3[aria-hidden=true]{visibility:hidden}._1seauxl4{grid-area:1/1}._1seauxl5{border:var(--space-1) solid var(--color-border);min-inline-size:var(--anchor-width);max-block-size:var(--available-height);transform-origin:var(--transform-origin);transition:opacity var(--duration-fast) var(--easing-standard), scale var(--duration-fast) var(--easing-enter);overflow-y:auto}._1seauxl5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1seauxl5[data-starting-style],._1seauxl5[data-ending-style]{opacity:0;scale:calc(1 - var(--scale-med))}._1seauxl6{cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}._1seauxl6:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:calc(-1 * var(--space-2))}._1seauxl6[data-highlighted]{background-color:light-dark(var(--color-bg-muted),color-mix(in srgb, var(--color-fg) 10%, var(--color-bg-raised)))}._1seauxl6[aria-disabled=true]{color:var(--color-fg-muted);cursor:not-allowed}._1seauxl7{visibility:hidden;flex-shrink:0}._1seauxl6[aria-selected=true] ._1seauxl7{visibility:visible}@media (forced-colors:active){._1seauxl0[aria-disabled=true]{border-color:graytext}._1seauxl6[data-highlighted]{forced-color-adjust:none;color:highlighttext;background-color:highlight}._1seauxl6[data-highlighted]:focus-visible{color:canvastext;background-color:canvas}._1seauxl6[aria-disabled=true]{color:graytext}}}
@@ -18,6 +18,9 @@ function T({ options: e, placeholder: t, countLabel: n, disabled: r, size: a })
18
18
  render: i({
19
19
  variant: "secondary",
20
20
  size: a,
21
+ backgroundColor: "bg",
22
+ borderRadius: "med",
23
+ color: "fg",
21
24
  iconEnd: l,
22
25
  className: p,
23
26
  children: /* @__PURE__ */ S(w.Value, {
@@ -1,2 +1,2 @@
1
1
  @layer tokens, reset, atoms.base, atoms.sm, atoms.med, atoms.lg, atoms.xl, components.box, components.checkbox, components.clickable, components.icon, components.icon-button, components.inline, components.stack, components.text, components.avatar, components.badge, components.button, components.chip, components.field, components.color-field, components.heading, components.dialog, components.alert-dialog, components.menu, components.multiselect, components.search-field, components.tabs, components.tag, components.text-field, components.toast, components.visually-hidden;
2
- @layer components.search-field{._1cj8r6g0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1cj8r6g2{grid-template-columns:var(--space-6) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g3{grid-template-columns:var(--space-8) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g4{grid-template-columns:var(--space-12) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g5{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);grid-area:1/1/auto/-1;padding-block:0}._1cj8r6g5::placeholder{color:var(--color-fg-muted);opacity:1}._1cj8r6g5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1cj8r6g5:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._1cj8r6g5[aria-invalid=true]{border-color:var(--color-danger)}._1cj8r6g5::-webkit-search-cancel-button{appearance:none}._1cj8r6g5::-webkit-search-decoration{appearance:none}._1cj8r6g6{block-size:var(--size-xs);padding-inline-start:calc(var(--space-6) + var(--space-8) + var(--font-size-xs));padding-inline-end:calc(var(--size-xs) + var(--space-4))}._1cj8r6g7{block-size:var(--size-sm);padding-inline-start:calc(var(--space-8) + var(--space-8) + var(--font-size-sm));padding-inline-end:calc(var(--size-xs) + var(--space-4))}._1cj8r6g8{block-size:var(--size-med);padding-inline-start:calc(var(--space-12) + var(--space-8) + var(--font-size-med));padding-inline-end:calc(var(--size-sm) + var(--space-4))}._1cj8r6g9{pointer-events:none;color:var(--color-fg-muted);grid-area:1/2}._1cj8r6ga{background-clip:padding-box;border-color:#0000;grid-area:1/4}@media (pointer:coarse){._1cj8r6g5{font-size:var(--font-size-med)}}@media (forced-colors:active){._1cj8r6g5:disabled{color:graytext;border-color:graytext}}}
2
+ @layer components.search-field{._1cj8r6g0{clip-path:inset(50%);white-space:nowrap;border:0;block-size:1px;inline-size:1px;margin:0;padding:0;position:absolute;overflow:hidden}._1cj8r6g2{grid-template-columns:var(--space-6) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g3{grid-template-columns:var(--space-8) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g4{grid-template-columns:var(--space-12) auto minmax(0, 1fr) auto var(--space-4)}._1cj8r6g5{appearance:none;border-width:var(--space-1);border-style:solid;border-color:var(--color-border-strong);border-radius:var(--radius-med);background-color:var(--color-bg);inline-size:100%;min-inline-size:0;color:var(--color-fg);grid-area:1/1/auto/-1;padding-block:0}._1cj8r6g5::placeholder{color:var(--color-fg-muted);opacity:1}._1cj8r6g5:focus-visible{outline:var(--space-2) solid var(--color-focus);outline-offset:var(--space-2)}._1cj8r6g5:disabled{background-color:var(--color-bg-muted);color:var(--color-fg-muted);cursor:not-allowed;border-style:dashed}._1cj8r6g5[aria-invalid=true]{border-color:var(--color-danger)}._1cj8r6g5::-webkit-search-cancel-button{appearance:none}._1cj8r6g5::-webkit-search-decoration{appearance:none}._1cj8r6g6{block-size:var(--size-xs);padding-inline-start:calc(var(--space-6) + var(--space-8) + var(--font-size-xs));padding-inline-end:calc(var(--size-xs) + var(--space-4))}._1cj8r6g7{block-size:var(--size-sm);padding-inline-start:calc(var(--space-8) + var(--space-8) + var(--font-size-sm));padding-inline-end:calc(var(--size-xs) + var(--space-4))}._1cj8r6g8{block-size:var(--size-med);padding-inline-start:calc(var(--space-12) + var(--space-8) + var(--font-size-med));padding-inline-end:calc(var(--size-sm) + var(--space-4))}._1cj8r6g9{pointer-events:none;color:var(--color-fg-muted);grid-area:1/2}._1cj8r6ga{background-clip:padding-box;grid-area:1/4}@media (pointer:coarse){._1cj8r6g5{font-size:var(--font-size-med)}}@media (forced-colors:active){._1cj8r6g5:disabled{color:graytext;border-color:graytext}._1cj8r6ga{border-color:#0000}}}
@@ -56,7 +56,8 @@ function h({ value: h, defaultValue: g, onValueChange: _, placeholder: v, size:
56
56
  onClick: () => {
57
57
  j(""), D.current?.focus();
58
58
  },
59
- size: m[y]
59
+ size: m[y],
60
+ variant: "ghost"
60
61
  })
61
62
  ]
62
63
  });
@@ -60,4 +60,4 @@ function d(e) {
60
60
  });
61
61
  }
62
62
  //#endregion
63
- export { d as checkContrast, o as contrastPairs, l as contrastRatio };
63
+ export { d as checkContrast, o as contrastPairs, l as contrastRatio, r as surfaces };
@@ -1,30 +1,30 @@
1
1
  import { fills as e } from "../styles/button-fills.mjs";
2
- import { contrastRatio as t } from "./contrast.mjs";
3
- import { highlightFill as n, highlightText as r } from "../styles/highlight.mjs";
4
- import { hoverFill as i } from "../styles/hover-tint.mjs";
2
+ import { contrastRatio as t, surfaces as n } from "./contrast.mjs";
3
+ import { highlightFill as r, highlightText as i } from "../styles/highlight.mjs";
4
+ import { hoverFill as a } from "../styles/hover-tint.mjs";
5
5
  //#region src/contrast/mixes.ts
6
- var a = [
6
+ var o = [
7
7
  {
8
8
  name: "Menu highlight",
9
- fill: n,
10
- text: r,
9
+ fill: r,
10
+ text: i,
11
11
  min: 4.5
12
12
  },
13
- ...Object.entries(e).map(([e, { backgroundColor: t, color: n }]) => ({
14
- name: `${e} Button hover`,
15
- fill: (e) => i(e.fg, e[t]),
16
- text: [n],
13
+ ...Object.entries(e).flatMap(([e, { backgroundColor: t, color: r }]) => (t ? [t] : n).map((n) => ({
14
+ name: t ? `${e} Button hover` : `${e} Button hover on ${n}`,
15
+ fill: (e) => a(e.fg, e[n]),
16
+ text: [r],
17
17
  min: 4.5
18
- })),
18
+ }))),
19
19
  {
20
20
  name: "pressed Chip hover",
21
- fill: (e) => i(e.fg, e.accent),
21
+ fill: (e) => a(e.fg, e.accent),
22
22
  text: ["accentFg"],
23
23
  min: 4.5
24
24
  }
25
25
  ];
26
- function o(e) {
27
- return ["light", "dark"].flatMap((n) => a.flatMap(({ name: r, fill: i, text: a, min: o }) => {
26
+ function s(e) {
27
+ return ["light", "dark"].flatMap((n) => o.flatMap(({ name: r, fill: i, text: a, min: o }) => {
28
28
  let s = i(e.color);
29
29
  return a.flatMap((i) => {
30
30
  let a = t(e.color[i], s, n);
@@ -39,4 +39,4 @@ function o(e) {
39
39
  }));
40
40
  }
41
41
  //#endregion
42
- export { o as checkMixes, a as contrastMixes };
42
+ export { s as checkMixes, o as contrastMixes };
@@ -109,6 +109,6 @@ Generated from the TypeScript types.
109
109
  | `id` | `string` | no | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot `triggerId` prop). |
110
110
  | `payload` | `unknown` | no | A payload to pass to the dialog when it is opened. |
111
111
  | `size` | `"lg" \| "med" \| "sm"` | no | |
112
- | `variant` | `"primary" \| "secondary"` | no | |
112
+ | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
113
113
 
114
114
  Also accepts the style props (see `manifest.json` `styleProps`).
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- The labelled action: a `<button type="button">` with the house look, or a link styled as one with `as="a"` (or a router's link). Three variants (`primary`, `secondary`, `danger`), three sizes (`sm`, `med`, `lg`, 24, 32 and 40 px high, ADR 0124), a `loading` state that keeps its width, and icon slots before and after the label. It is built on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` / `aria-busy` states that block activation while the button stays focusable.
5
+ The labelled action: a `<button type="button">` with the house look, or a link styled as one with `as="a"` (or a router's link). Four variants (`primary`, `secondary`, `ghost`, `danger`), three sizes (`sm`, `med`, `lg`, 24, 32 and 40 px high, ADR 0124), a `loading` state that keeps its width, and icon slots before and after the label. It is a pill (`full` radius) with a bold uppercase label and a soft glow in its variant's color (ADR 0131). It is built on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` / `aria-busy` states that block activation while the button stays focusable.
6
6
 
7
7
  ## When to use
8
8
 
@@ -19,14 +19,17 @@ The labelled action: a `<button type="button">` with the house look, or a link s
19
19
  ## Rules
20
20
 
21
21
  - `primary` marks the one action a view or dialog exists for; everything else is `secondary`, the default. One primary per group. Its fill is `accentFill` with `accentFillFg` text (ADR 0119): light text on a solid accent in both modes, 4.5:1 at rest and on hover.
22
+ - `secondary` is a `bgMuted` fill with `fg` text inside an `accent` ring, glowing in the accent.
23
+ - `ghost` is the tertiary action: no fill, no border, no glow, only the hover tint. Use it beside a `secondary` for the least important action ("Skip", "Clear"), or inside another control that already frames it. Its text sits on the surface behind it, so place it on `bg`, `bgMuted` or `bgRaised`.
22
24
  - `danger` (`dangerFg` on `danger`, ADR 0060) replaces `primary` when that action destroys data or cannot be undone, such as a confirm dialog's "Delete project". It takes `primary`'s place, so a group has one `primary` or one `danger`, not both. The label names the consequence ("Delete project", not "OK"): under forced colors `danger` looks like `primary`, so the word carries the meaning, not the color. Confirm before an irreversible action runs; `danger` does not.
23
25
  - Sizes are `sm`, `med` (default) and `lg`, never `md`. `sm`, `med` and `lg` are 24, 32 and 40px high; the label and the icons take the `fontSize` step one below the `size` (`xs`, `sm`, `med`: 12, 14 and 16px).
24
26
  - `loading` renders `aria-busy="true"`, blocks clicks, Enter and Space, and swaps the label for three pulsing dots in the same space: the width never changes, and the label stays the accessible name. A label narrower than the dots (one character, such as a page number) widens by a few pixels; give such buttons a fixed `minInlineSize`. Announce the outcome elsewhere (a toast or a status message); `aria-busy` alone is not announced.
25
27
  - `disabled` renders `aria-disabled="true"` and a dashed border, never the native `disabled`: the button stays focusable and announced. Say why it is disabled nearby when it is not obvious.
26
28
  - `iconStart` and `iconEnd` take an icon component (a generated `ArrowRightIcon`, or a component that renders `Icon`), not an element: Button renders it at its text size. The icons are decorative; the label names the button.
27
- - Children are the label, rendered inside `Text`; pass a string, not your own `Text` or `Icon`.
28
- - Fill (`backgroundColor`), text color (`color`), height (`minBlockSize`), `paddingBlock` (which keeps a wrapped label off the border), `paddingInline`, `borderRadius` and `gap` (between icons and label) are default style props: pass one to change it. Hover tints whatever the fill is (not under forced colors, where hover keeps only the pointer cue); the disabled look is component CSS keyed off `aria-disabled`, so it wins over a custom fill. A custom fill needs a text color that passes 4.5:1 on it.
29
- - With `aria-expanded="true"` (a Menu or Dialog trigger while its popup is open, or your own disclosure button), a live button holds the hover tint and draws a 1px inset ring in its text color: a shape cue, kept under forced colors, that takes no layout space (ADR 0063). While open, the ring replaces a custom `boxShadow`.
29
+ - Children are the label, rendered inside bold `Text`; pass a string, not your own `Text` or `Icon`. The label is uppercased in CSS only, so write it in sentence case: the DOM text, and so Testing Library queries such as `getByRole`, keep that case. Chromium's accessibility tree exposes the uppercase text, so a screen reader there may spell out a short label such as "OK"; prefer a word.
30
+ - Fill (`backgroundColor`), text color (`color`), height (`minBlockSize`), `paddingBlock` (which keeps a wrapped label off the border), `paddingInline`, `borderRadius` (`full`) and `gap` (between icons and label) are default style props: pass one to change it. Hover tints whatever the fill is (not under forced colors, where hover keeps only the pointer cue); the disabled look is component CSS keyed off `aria-disabled`, so it wins over a custom fill. A custom fill needs a text color that passes 4.5:1 on it.
31
+ - The glow is soft at rest and stronger on hover, on keyboard focus and while open; a disabled button has none. It is a `box-shadow` below the style props, so a `boxShadow` prop replaces it.
32
+ - With `aria-expanded="true"` (a Menu or Dialog trigger while its popup is open, or your own disclosure button), a live button holds the hover tint and draws a 1px inset ring in its text color, inside the strong glow: a shape cue, kept under forced colors, that takes no layout space (ADR 0063). While open, the ring and glow replace a custom `boxShadow`.
30
33
  - `type="submit"` for a form's submit button; otherwise it is `type="button"`.
31
34
  - Server-safe: Button has no hooks; `Clickable` inside it is the client boundary.
32
35
 
@@ -74,7 +77,7 @@ The labelled action: a `<button type="button">` with the house look, or a link s
74
77
 
75
78
  - A button that goes somewhere is a link (`as="a"` with `href`); one that does something is a button.
76
79
  - Disabled and loading buttons stay in the tab order, so keyboard and screen reader users find them; Enter and Space do nothing while either is set. The blocked click still bubbles to an ancestor's `onClick` (see Clickable's Rules).
77
- - State is never color alone: disabled adds a dashed border, loading shows the dots. Under forced colors the button keeps its system colors (`LinkText` fill for `primary` and `danger`, a `CanvasText` border for `secondary`) and a disabled one is `GrayText`. Hover draws no tint there, so the system pairs keep their contrast.
80
+ - State is never color alone: disabled adds a dashed border, loading shows the dots. Under forced colors the button keeps its system colors (`LinkText` fill for `primary` and `danger`, a `LinkText` border for `secondary`, a `CanvasText` border for `ghost`) and a disabled one is `GrayText`. Hover draws no tint and the glow is gone there, so the system pairs keep their contrast.
78
81
  - Under reduced motion the dots hold still.
79
82
  - Text on every variant passes 4.5:1 at rest and on hover in light and dark modes.
80
83
 
@@ -93,6 +96,6 @@ Generated from the TypeScript types.
93
96
  | `iconStart` | `ComponentType` | no | |
94
97
  | `loading` | `boolean` | no | |
95
98
  | `size` | `"lg" \| "med" \| "sm"` | no | |
96
- | `variant` | `"danger" \| "primary" \| "secondary"` | no | |
99
+ | `variant` | `"danger" \| "ghost" \| "primary" \| "secondary"` | no | |
97
100
 
98
101
  Also accepts every `<button>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
@@ -136,7 +136,7 @@ Also accepts the style props (see `manifest.json` `styleProps`).
136
136
  | `iconEnd` | `ComponentType` | no | |
137
137
  | `iconStart` | `ComponentType` | no | |
138
138
  | `size` | `"lg" \| "med" \| "sm"` | no | |
139
- | `variant` | `"primary" \| "secondary"` | no | |
139
+ | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
140
140
 
141
141
  Also accepts the style props (see `manifest.json` `styleProps`).
142
142
 
@@ -162,6 +162,6 @@ Also accepts the style props (see `manifest.json` `styleProps`).
162
162
  | `id` | `string` | no | ID of the trigger. In addition to being forwarded to the rendered element, it is also used to specify the active trigger for the dialog in controlled mode (with the DialogRoot `triggerId` prop). |
163
163
  | `payload` | `unknown` | no | A payload to pass to the dialog when it is opened. |
164
164
  | `size` | `"lg" \| "med" \| "sm"` | no | |
165
- | `variant` | `"primary" \| "secondary"` | no | |
165
+ | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
166
166
 
167
167
  Also accepts the style props (see `manifest.json` `styleProps`).
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- A compact button whose only visible content is an icon, for an action the icon makes plain: close, edit, refresh. A required `label` names it for assistive technology (`aria-label`); the icon is decorative. It is a `<button type="button">` on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` that blocks activation while the button stays focusable. Two variants from Button's fills (`primary`, `secondary`) and three square sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
5
+ A compact button whose only visible content is an icon, for an action the icon makes plain: close, edit, refresh. A required `label` names it for assistive technology (`aria-label`); the icon is decorative. It is a `<button type="button">` on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` that blocks activation while the button stays focusable. Three variants from Button's fills (`primary`, `secondary`, `ghost`), each a circle with Button's glow (ADR 0131), and three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
6
6
 
7
7
  ## When to use
8
8
 
@@ -20,11 +20,11 @@ A compact button whose only visible content is an icon, for an action the icon m
20
20
 
21
21
  - `label` is required and is the accessible name: say what the button does ("Close dialog", "Refresh results"), not what the icon shows ("X", "Arrows"). Never pass an empty string: the button would have no name. `aria-label`, `aria-labelledby` and children are not props; a raw one is ignored.
22
22
  - `icon` takes an icon component (a generated `XIcon`, or a component that renders `Icon`), not an element: IconButton renders it at the `fontSize` step one below its `size` (12, 14 and 16px at `sm`, `med`, `lg`), as Button's icons, `aria-hidden`.
23
- - `variant`: `secondary` (default) for most actions; `primary` for the one action a view or dialog exists for. There is no `danger` in v0.1: a destructive action deserves a labelled `Button`.
24
- - `size`: `sm`, `med` (default) or `lg`, never `md`. Each is a square of Button's height of the same name (24, 32 and 40px), so an IconButton lines up with a Button beside it.
23
+ - `variant`: `secondary` (default) for most actions; `primary` for the one action a view or dialog exists for; `ghost`, with no fill, border or glow, for a quiet action or one inside a control that already frames it (SearchField's clear button). There is no `danger` in v0.1: a destructive action deserves a labelled `Button`.
24
+ - `size`: `sm`, `med` (default) or `lg`, never `md`. Each is a circle as wide as Button's height of the same name (24, 32 and 40px), so an IconButton lines up with a Button beside it.
25
25
  - `disabled` renders `aria-disabled="true"` and a dashed border, never the native `disabled`. There is no `loading` and no tooltip in v0.1.
26
26
  - With `aria-expanded="true"`, as a Dialog trigger sets it, it holds the hover tint and an inset ring while the popup is open, as Button does.
27
- - Fill (`backgroundColor`), text color (`color`), width (`minInlineSize`), height (`minBlockSize`) and `borderRadius` are default style props: pass one to change it. Change width and height together to keep the square. Hover tints whatever the fill is; a custom fill needs an icon color that passes 3:1 on it (4.5:1 to match Button).
27
+ - Fill (`backgroundColor`), text color (`color`), width (`minInlineSize`), height (`minBlockSize`) and `borderRadius` (`full`) are default style props: pass one to change it. Change width and height together to keep the circle. The glow gives way to a `boxShadow` prop, as on Button. Hover tints whatever the fill is; a custom fill needs an icon color that passes 3:1 on it (4.5:1 to match Button).
28
28
  - `as="a"` with `href` for an icon-only link.
29
29
  - Server-safe: IconButton has no hooks; `Clickable` inside it is the client boundary.
30
30
 
@@ -63,7 +63,7 @@ A compact button whose only visible content is an icon, for an action the icon m
63
63
  - The `label` is announced as the button's name; the icon is hidden from assistive technology.
64
64
  - The label is not shown on hover or focus. Sighted users who don't recognise the icon get no text, so keep IconButton to widely understood icons.
65
65
  - A disabled IconButton stays in the tab order, and Enter and Space do nothing; the blocked click still bubbles to an ancestor's `onClick` (see Clickable's Rules). State is never color alone: disabled adds a dashed border.
66
- - Every size is at least 24 by 24 CSS px (WCAG 2.2 target size); the icon on each variant passes 4.5:1 at rest and on hover in light and dark modes. Under forced colors it keeps Button's system colors.
66
+ - Every size is at least 24 by 24 CSS px (WCAG 2.2 target size); the icon on each variant passes 4.5:1 at rest and on hover in light and dark modes. Under forced colors it keeps Button's system colors, `ghost`'s `CanvasText` border included, and drops the glow.
67
67
 
68
68
  ## Props
69
69
 
@@ -78,6 +78,6 @@ Generated from the TypeScript types.
78
78
  | `icon` | `ComponentType` | yes | |
79
79
  | `label` | `string` | yes | |
80
80
  | `size` | `"lg" \| "med" \| "sm"` | no | |
81
- | `variant` | `"primary" \| "secondary"` | no | |
81
+ | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
82
82
 
83
83
  Also accepts every `<button>` attribute (change the element with `as`) and the style props (see `manifest.json` `styleProps`).
package/dist/docs/Menu.md CHANGED
@@ -250,6 +250,6 @@ Also accepts the style props (see `manifest.json` `styleProps`).
250
250
  | `openOnHover` | `boolean` | no | Whether the menu should also open when the trigger is hovered. |
251
251
  | `payload` | `unknown` | no | A payload to pass to the menu when it is opened. |
252
252
  | `size` | `"lg" \| "med" \| "sm"` | no | |
253
- | `variant` | `"primary" \| "secondary"` | no | |
253
+ | `variant` | `"ghost" \| "primary" \| "secondary"` | no | |
254
254
 
255
255
  Also accepts the style props (see `manifest.json` `styleProps`).
@@ -8,7 +8,7 @@
8
8
  - [Avatar](Avatar.md): Identifies a person, project or account by one or two letters in a circle, on a colour of the consumer's choosing or a neutral fill. A `span` with `role="img"`, named by `label`, around a `Text` in the `label` font. It is never focusable.
9
9
  - [Badge](Badge.md): A static label that states the status of, or a short fact about, the thing beside it: "Draft", "Failed", "Beta". A `span` with a fill from the color roles around a `Text` in the `label` font. It has no role and is never focusable.
10
10
  - [Box](Box.md): The base element every component builds on: one element, chosen with `as`, styled with style props. Style props are the token-backed classes from `@layer atoms`: layout (`display`, flex, `gap`, logical padding, margin and sizing), color roles, `borderRadius`, `boxShadow`, `position`, `zIndex`, `overflow` and `textAlign`.
11
- - [Button](Button.md): The labelled action: a `<button type="button">` with the house look, or a link styled as one with `as="a"` (or a router's link). Three variants (`primary`, `secondary`, `danger`), three sizes (`sm`, `med`, `lg`, 24, 32 and 40 px high, ADR 0124), a `loading` state that keeps its width, and icon slots before and after the label. It is built on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` / `aria-busy` states that block activation while the button stays focusable.
11
+ - [Button](Button.md): The labelled action: a `<button type="button">` with the house look, or a link styled as one with `as="a"` (or a router's link). Four variants (`primary`, `secondary`, `ghost`, `danger`), three sizes (`sm`, `med`, `lg`, 24, 32 and 40 px high, ADR 0124), a `loading` state that keeps its width, and icon slots before and after the label. It is a pill (`full` radius) with a bold uppercase label and a soft glow in its variant's color (ADR 0131). It is built on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` / `aria-busy` states that block activation while the button stays focusable.
12
12
  - [Checkbox](Checkbox.md): A two-state choice, with a third mixed state for a "select all" over a partly selected list. Built on Base UI `Checkbox` (ADR 0003, 0046): a `span` with `role="checkbox"` and `aria-checked`, plus a hidden `<input type="checkbox">` that submits with the form. The span is a 24 by 24 CSS px target (WCAG 2.2) with the shared focus ring; the 16px box inside fills and shows a tick when checked, a dash when mixed. It composes `Field` for its label, description and error (ADR 0026).
13
13
  - [Chip](Chip.md): A toggle that filters content or picks an option: "Unread", "Starred", "Medium". A `<button>` with `aria-pressed` on `Clickable`, built on Base UI `Toggle`; `ChipGroup` is a Base UI `ToggleGroup` of chips that share one state. If it changes state when clicked, it's a chip.
14
14
  - [Clickable](Clickable.md): The low-level base for everything a user presses: a `<button type="button">` by default, or a link with `as="a"` (or a router's link component). It brings the shared focus ring, a 24 by 24 CSS px minimum target (WCAG 2.2), `disabled` and `busy` states as ARIA attributes, and no look of its own: the button and link chrome is stripped. `Button`, `IconButton` and link components are built on it.
@@ -17,7 +17,7 @@
17
17
  - [Field](Field.md): Wires one form control to its label, description and error: ids, `htmlFor`, `aria-describedby` and `aria-invalid`. It is input-agnostic: the control inside is Base UI's `Field.Control` or a Base UI control (Checkbox, Combobox), and Base UI does the wiring. The parts are `Field` (the root, a flex column), `Field.Label`, `Field.Description` and `Field.Error`. Built on Base UI `Field` (ADR 0003, 0026, 0046); `@base-ui/react` is a peer dependency, so the app's Base UI controls and Field share one copy of its contexts.
18
18
  - [Heading](Heading.md): Section and page headings. A `Text` with heading defaults: the `heading` font role, `semibold`, `sm` leading, and balanced line wrapping. The level (`as`) and the look (`size`) are separate, so the outline stays right whatever the design calls for.
19
19
  - [Icon](Icon.md): The base for every icon: an `<svg>` on a 24-unit grid that draws its children with round 2-unit strokes in `currentColor`. Generated icons from `@jonmilner/ui/icons` (`ArrowRightIcon`, …) wrap it and take the same props, less `children` and `viewBox`. `size` takes a `fontSize` step, so an icon matches the `Text` beside it; `color` takes a color role.
20
- - [IconButton](IconButton.md): A compact button whose only visible content is an icon, for an action the icon makes plain: close, edit, refresh. A required `label` names it for assistive technology (`aria-label`); the icon is decorative. It is a `<button type="button">` on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` that blocks activation while the button stays focusable. Two variants from Button's fills (`primary`, `secondary`) and three square sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
20
+ - [IconButton](IconButton.md): A compact button whose only visible content is an icon, for an action the icon makes plain: close, edit, refresh. A required `label` names it for assistive technology (`aria-label`); the icon is decorative. It is a `<button type="button">` on `Clickable`, so it has the shared focus ring, the 24px minimum target and `aria-disabled` that blocks activation while the button stays focusable. Three variants from Button's fills (`primary`, `secondary`, `ghost`), each a circle with Button's glow (ADR 0131), and three sizes at Button's heights (`sm`, `med`, `lg`: 24, 32 and 40 px, ADR 0124).
21
21
  - [Inline](Inline.md): A horizontal row of children that wraps onto new lines, with even space between them on both axes. `Inline` is a `Box` with `display="flex"`, `flexDirection="row"`, `flexWrap="wrap"` and `alignItems="center"` as default style props, spaced by a required `gap`. Children render as they are: no wrapper per child.
22
22
  - [Menu](Menu.md): A list of actions that opens from a button: a row's "Edit, Duplicate, Delete", a toolbar's overflow. It may mix in links ("Open invoice", "Download PDF") as `Menu.LinkItem`, real anchors that keep the browser's link behavior. Built on Base UI's Menu, which owns the keyboard and focus: arrow keys, Home and End move through the items, typing jumps to a matching item, Esc and an outside click close it, and focus returns to the trigger. The parts add the look: a raised surface with a border and shadow, a highlighted item, a zoom-and-fade that is a plain fade under reduced motion.
23
23
  - [MultiSelect](MultiSelect.md): A form field for picking any number of values from a list too long to show at once. A trigger styled as Button's secondary look opens a listbox of options; each selected option shows a check mark, and the trigger summarises the selection as the joined labels, or a count ("3 selected") once the labels would not fit. Built on Base UI's `Select` in multiple mode (ADR 0003), which owns the keyboard and focus: arrow keys, Home and End move through the options, typing jumps to a match, Esc and an outside click close it, and focus returns to the trigger. It composes `Field` for its label, description and error (ADR 0026).
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.10.2",
4
+ "version": "0.11.0",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -116,9 +116,10 @@
116
116
  },
117
117
  {
118
118
  "name": "variant",
119
- "type": "\"primary\" | \"secondary\"",
119
+ "type": "\"ghost\" | \"primary\" | \"secondary\"",
120
120
  "required": false,
121
121
  "values": [
122
+ "ghost",
122
123
  "primary",
123
124
  "secondary"
124
125
  ]
@@ -256,10 +257,11 @@
256
257
  },
257
258
  {
258
259
  "name": "variant",
259
- "type": "\"danger\" | \"primary\" | \"secondary\"",
260
+ "type": "\"danger\" | \"ghost\" | \"primary\" | \"secondary\"",
260
261
  "required": false,
261
262
  "values": [
262
263
  "danger",
264
+ "ghost",
263
265
  "primary",
264
266
  "secondary"
265
267
  ]
@@ -597,9 +599,10 @@
597
599
  },
598
600
  {
599
601
  "name": "variant",
600
- "type": "\"primary\" | \"secondary\"",
602
+ "type": "\"ghost\" | \"primary\" | \"secondary\"",
601
603
  "required": false,
602
604
  "values": [
605
+ "ghost",
603
606
  "primary",
604
607
  "secondary"
605
608
  ]
@@ -688,9 +691,10 @@
688
691
  },
689
692
  {
690
693
  "name": "variant",
691
- "type": "\"primary\" | \"secondary\"",
694
+ "type": "\"ghost\" | \"primary\" | \"secondary\"",
692
695
  "required": false,
693
696
  "values": [
697
+ "ghost",
694
698
  "primary",
695
699
  "secondary"
696
700
  ]
@@ -1170,9 +1174,10 @@
1170
1174
  },
1171
1175
  {
1172
1176
  "name": "variant",
1173
- "type": "\"primary\" | \"secondary\"",
1177
+ "type": "\"ghost\" | \"primary\" | \"secondary\"",
1174
1178
  "required": false,
1175
1179
  "values": [
1180
+ "ghost",
1176
1181
  "primary",
1177
1182
  "secondary"
1178
1183
  ]
@@ -1579,9 +1584,10 @@
1579
1584
  },
1580
1585
  {
1581
1586
  "name": "variant",
1582
- "type": "\"primary\" | \"secondary\"",
1587
+ "type": "\"ghost\" | \"primary\" | \"secondary\"",
1583
1588
  "required": false,
1584
1589
  "values": [
1590
+ "ghost",
1585
1591
  "primary",
1586
1592
  "secondary"
1587
1593
  ]
@@ -0,0 +1,32 @@
1
+ # 0.11.0
2
+
3
+ Button and IconButton are restyled (decision 0131): Button is a pill (`borderRadius` `full`, was `med`) and IconButton a circle; every variant but `ghost` has a glow in its own color; `secondary` is a `bgMuted` fill with an `accent` border (was `bg` with `borderStrong`); Button's label is bold and uppercase (was medium, in source case); and a new `ghost` variant, with no fill, border or glow, joins both. No prop was removed or renamed, so the upgrade compiles as is; the steps below are only for screens that should keep the old look or relied on it, and for custom brands, which `defineTheme` now checks against the new hover mixes.
4
+
5
+ ## Find
6
+
7
+ In the app's source (`*.tsx`):
8
+
9
+ 1. A Button that should keep square corners: regex `<Button\b` (a multi-line tag needs a multiline search); the same for `<IconButton\b`.
10
+ 2. A `boxShadow` on a Button or IconButton, which now replaces the glow: regex `<(Button|IconButton)\b[^>]*\bboxShadow=`.
11
+ 3. A low-emphasis action written as `secondary` that should read quieter, such as a toolbar's or a card's minor actions: regex `variant="secondary"`.
12
+ 4. A custom brand: regex `defineTheme\(`. `defineTheme` now also checks `secondary`'s hover on `bgMuted` and `ghost`'s hover on `bg`, `bgMuted` and `bgRaised`, and throws in development when one fails WCAG AA.
13
+ 5. Code or tests that read a Button's rendered text in upper case, or a test expecting `secondary`'s old `bg` fill or `borderStrong` border: regex `toUpperCase\(\)|borderStrong` near Button's name.
14
+
15
+ ## Replace
16
+
17
+ ```tsx
18
+ // before: square corners were the default
19
+ <Button>Save</Button>
20
+ <IconButton icon={XIcon} label="Close" />
21
+ <Button variant="secondary">Dismiss</Button>
22
+ // after: keep the old corners, or move a minor action to ghost
23
+ <Button borderRadius="med">Save</Button>
24
+ <IconButton borderRadius="med" icon={XIcon} label="Close" />
25
+ <Button variant="ghost">Dismiss</Button>
26
+ ```
27
+
28
+ Keep label strings in sentence case; uppercase comes from CSS and the DOM text keeps the source case, so tests that query by role and name need no change. Chromium's accessibility tree exposes the uppercase text, so a screen reader there may spell out a short label such as "OK"; prefer a word over an abbreviation. A `boxShadow` from step 2 now replaces the glow on purpose; drop it to get the glow back. While a Menu or Dialog the button opens is open, the open ring and glow replace that `boxShadow`, as the ring alone did before. For a brand from step 4 that now throws, darken `fg` or lighten the failing surface until the error clears.
29
+
30
+ ## Verify
31
+
32
+ `pnpm typecheck` passes (no prop changed type), each custom brand loads without a `defineTheme` contrast error, and the app's visual tests show only the intended new Button and IconButton look: pills and circles, the glow, `secondary`'s darker fill and accent ring, and uppercase bold labels.
@@ -5,7 +5,11 @@ var e = {
5
5
  color: "accentFillFg"
6
6
  },
7
7
  secondary: {
8
- backgroundColor: "bg",
8
+ backgroundColor: "bgMuted",
9
+ color: "fg"
10
+ },
11
+ ghost: {
12
+ backgroundColor: void 0,
9
13
  color: "fg"
10
14
  },
11
15
  danger: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonmilner/ui",
3
- "version": "0.10.2",
3
+ "version": "0.11.0",
4
4
  "files": [
5
5
  "dist",
6
6
  "THIRD_PARTY_NOTICES.md"