@stackone/malachite 2.122.0 → 2.123.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.
package/COMPONENTS.md CHANGED
@@ -53,7 +53,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
53
53
  - **`LoadingBar`** — Indeterminate full-width loading line; the variant colour sweeps across a pale track for work of unknown duration. Toggle `active` rather than unmounting, so the reserved height prevents layout shift. _Key props:_ `active`, `LoadingBarVariant` (`default` | `warning` | `error`), `LoadingBarSize` (`small` | `medium` | `large`), `aria-label`, `aria-labelledby`, `className`, `style`.
54
54
  - **`LoadingScreen`** — The whole viewport while an app has nothing to show yet: the StackOne wordmark over a bar scanning back and forth, on the sunken page background, in either theme. It matches the screen unified-cloud paints before its bundle loads, so a page handing over to it, or from it, reads as one wait (an IdP page a sign-out passes through, say). Fixed to the viewport; render it as the page, not inside a card. Reduced motion stops the scan at full width. For loading inside a page use `LoadingBar` or `Skeleton`. _Key props:_ `aria-label` (default "Loading"), `aria-labelledby`, `className`.
55
55
  - **`ToastProvider`** — Transient top-centre toasts for the outcome of an action. Wrap the app once in `ToastProvider` and call `useToast().show({ message, variant })` anywhere beneath it. Corners match a medium button. Each toast auto-dismisses, pauses while hovered and dismisses on click; at most three show at once. Toasts are announced through always-mounted live regions (`status` for success, `alert` for error), and the pills themselves are hidden from assistive tech and never take focus, so they cannot fight a dialog's focus trap. The host mounts on the first toast and joins the top layer, so toasts paint above elevated side panels. _Key props:_ `ToastProvider`: `children`, `duration` (ms, default 3000). `useToast()` → `show({ message, variant })`, `ToastVariant` (`success` | `error`, default `success`).
56
- - **`Spinner`** — Loading spinner.
56
+ - **`Spinner`** — Loading spinner, decorative unless labelled: an `aria-label` or `aria-labelledby` makes it a busy `progressbar`, as `LoadingBar` and `LoadingScreen` are. `fillViewport` centres it in a viewport-sized box, for a page with nothing else on it that keeps its own background; for an app-level splash use `LoadingScreen`. _Key props:_ `size` (`xxxsmall` to `large`, default `medium`), `aria-label`, `aria-labelledby`, `fillViewport`, `className`, `style`.
57
57
  - **`Skeleton`** — Loading placeholders. Includes `Skeleton.Avatar` and `Skeleton.Input`. The shimmer stops under `prefers-reduced-motion`, leaving the plain placeholder.
58
58
  - **`Tooltip`** — Hover/focus tooltip; also works on disabled controls (see CLAUDE.md). It describes its trigger once shown, so `describesTrigger={false}` where the same sentence is already on screen and referenced — otherwise a screen reader reads it twice. _Key props:_ `text`, `placement`, `delay`, `maxWidth`, `shouldShow`, `triggerAs`, `describesTrigger`, `isShrinkable`, `fill`, `wrapChildren`, `suppressed` (holds the tooltip back, e.g. while the popup its trigger opens is up), `showOnFocus` (false where script can move focus onto the trigger, e.g. an option a panel focuses on open), `focusableTrigger` (makes a trigger that cannot take focus — text, a static `Tag` — a tab stop, so the tooltip is not mouse-only; not for focusable children).
59
59
  - **`TruncatedTooltip`** — Shows a tooltip only when its text is truncated.
@@ -6,7 +6,7 @@ import Jt from "./CustomIcons/CaretDownIcon.js";
6
6
  import ae from "./CustomIcons/CloseIcon.js";
7
7
  import { FieldMessage as we } from "./FieldMessage.js";
8
8
  import It from "./LoadingInput.js";
9
- import Se from "./Spinner.js";
9
+ import { Spinner as Se } from "./Spinner.js";
10
10
  import { Tag as Te } from "./Tag.js";
11
11
  import Pt from "./Tooltip.js";
12
12
  import Ee from "./Typography/MarkdownBlock.js";
@@ -8,7 +8,7 @@ import St from "./CustomIcons/FilterIcon.js";
8
8
  import Ze from "./CustomIcons/SearchIcon.js";
9
9
  import { FilterSearchPanel as Nt } from "./FilterSearchPanel.js";
10
10
  import { Popover as Et } from "./Popover.js";
11
- import Pe from "./Spinner.js";
11
+ import { Spinner as Pe } from "./Spinner.js";
12
12
  import { CONTROL_TEXT_SIZE_CLASS as ce, CONTROL_TEXT_SIZE as $t } from "./controlTextSize.js";
13
13
  import { controlWidthStyle as Rt } from "./controlWidth.js";
14
14
  import { getTriggerVisual as Ct, DROPDOWN_TRIGGER_ATTR as It } from "./dropdownTriggerStyle.js";
@@ -8,7 +8,7 @@ import Lt from "./CustomIcons/SearchIcon.js";
8
8
  import { FieldMessage as Ot } from "./FieldMessage.js";
9
9
  import { FormItem as Nt } from "./FormItem.js";
10
10
  import Ge from "./LoadingInput.js";
11
- import At from "./Spinner.js";
11
+ import { Spinner as At } from "./Spinner.js";
12
12
  import { Tag as Mt } from "./Tag.js";
13
13
  import ze from "./Tooltip.js";
14
14
  import { getDeepActiveNode as Ke } from "./activeElement.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as E, jsx as d } from "react/jsx-runtime";
2
2
  import { useId as wt, useState as T, useRef as b, useCallback as H, useLayoutEffect as k, useEffect as yt, useInsertionEffect as vt } from "react";
3
3
  import { createPortal as St } from "react-dom";
4
- import Et from "./Spinner.js";
4
+ import { Spinner as Et } from "./Spinner.js";
5
5
  import { CONTROL_TEXT_SIZE as W, CONTROL_TEXT_SIZE_CLASS as rt } from "./controlTextSize.js";
6
6
  import { pushEscapeLayer as Tt } from "./escapeLayers.js";
7
7
  import { ensureMultiSelectPanelStyles as kt } from "./optionRowStyles.js";
@@ -1,5 +1,5 @@
1
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
- const l = (e) => {
1
+ import { jsx as r, jsxs as x } from "react/jsx-runtime";
2
+ const h = (e) => {
3
3
  switch (e) {
4
4
  case "xxxsmall":
5
5
  return "w-3.5 h-3.5";
@@ -22,7 +22,7 @@ const l = (e) => {
22
22
  default:
23
23
  return "w-48 h-48";
24
24
  }
25
- }, i = (e) => {
25
+ }, d = (e) => {
26
26
  switch (e) {
27
27
  case "xxxsmall":
28
28
  return "min-h-[14px]";
@@ -39,17 +39,28 @@ const l = (e) => {
39
39
  default:
40
40
  return "min-h-[200px]";
41
41
  }
42
- }, o = ({ size: e = "medium", className: s = "", style: t = {} }) => {
43
- const a = l(e), n = i(e);
42
+ }, w = ({
43
+ size: e = "medium",
44
+ "aria-label": s,
45
+ "aria-labelledby": t,
46
+ fillViewport: n = !1,
47
+ className: o = "",
48
+ style: l = {}
49
+ }) => {
50
+ const m = h(e), u = n ? "" : d(e), a = (s == null ? void 0 : s.trim()) || void 0, c = (t == null ? void 0 : t.trim()) || void 0, i = !!(a || c);
44
51
  return /* @__PURE__ */ r(
45
52
  "div",
46
53
  {
47
- className: `flex items-center justify-center ${n} ${s}`,
48
- style: t,
49
- children: /* @__PURE__ */ c(
54
+ className: `flex items-center justify-center ${u} ${o}`,
55
+ style: n ? { minHeight: "100dvh", width: "100%", ...l } : l,
56
+ role: i ? "progressbar" : void 0,
57
+ "aria-busy": i || void 0,
58
+ "aria-label": a,
59
+ "aria-labelledby": c,
60
+ children: /* @__PURE__ */ x(
50
61
  "svg",
51
62
  {
52
- className: `animate-spin motion-reduce:animate-none ${a}`,
63
+ className: `animate-spin motion-reduce:animate-none ${m}`,
53
64
  xmlns: "http://www.w3.org/2000/svg",
54
65
  fill: "none",
55
66
  viewBox: "0 0 24 24",
@@ -81,6 +92,7 @@ const l = (e) => {
81
92
  );
82
93
  };
83
94
  export {
84
- o as default
95
+ w as Spinner,
96
+ w as default
85
97
  };
86
98
  //# sourceMappingURL=Spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","sources":["../../src/components/Spinner.tsx"],"sourcesContent":["import React from 'react';\n\ninterface SpinnerProps {\n size?: 'xxxsmall' | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large';\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst getSizeClasses = (size: SpinnerProps['size']) => {\n switch (size) {\n case 'xxxsmall':\n return 'w-3.5 h-3.5'; // 14px\n case 'xxsmall':\n return 'w-6 h-6'; // 24px (close to 25px)\n case 'xsmall':\n return 'w-12 h-12'; // 48px (close to 50px)\n case 'small':\n return 'w-24 h-24'; // 96px (close to 100px)\n case 'medium':\n return 'w-48 h-48'; // 192px (close to 200px)\n case 'large':\n return 'w-96 h-96'; // 384px (close to 400px)\n default:\n return 'w-48 h-48'; // 192px default\n }\n};\n\nconst getContainerSize = (size: SpinnerProps['size']) => {\n switch (size) {\n case 'xxxsmall':\n return 'min-h-[14px]';\n case 'xxsmall':\n return 'min-h-[25px]';\n case 'xsmall':\n return 'min-h-[50px]';\n case 'small':\n return 'min-h-[100px]';\n case 'medium':\n return 'min-h-[200px]';\n case 'large':\n return 'min-h-[400px]';\n default:\n return 'min-h-[200px]';\n }\n};\n\nconst Spinner: React.FC<SpinnerProps> = ({ size = 'medium', className = '', style = {} }) => {\n const sizeClasses = getSizeClasses(size);\n const containerSizeClasses = getContainerSize(size);\n\n return (\n <div\n className={`flex items-center justify-center ${containerSizeClasses} ${className}`}\n style={style}\n >\n {/* Looping motion can cause nausea and dizziness for users with vestibular\n disorders, and a spinner loops with nothing to look away from. Under reduced\n motion the arc gives way to the full ring: still plainly busy, and a complete\n circle rather than an arc frozen mid-turn, which would read as a stalled\n animation. Same trade as LoadingBar's solid full-width line. */}\n <svg\n className={`animate-spin motion-reduce:animate-none ${sizeClasses}`}\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n style={{ color: 'var(--malachite-text-dimmed)' }}\n >\n <circle\n className=\"opacity-25 motion-reduce:opacity-100\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75 motion-reduce:opacity-0\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n </div>\n );\n};\n\nexport default Spinner;\n"],"names":["getSizeClasses","size","getContainerSize","Spinner","className","style","sizeClasses","containerSizeClasses","jsx","jsxs"],"mappings":";AAQA,MAAMA,IAAiB,CAACC,MAA+B;AACnD,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aA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1
+ {"version":3,"file":"Spinner.js","sources":["../../src/components/Spinner.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface SpinnerProps {\n size?: 'xxxsmall' | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large';\n /** Names the wait: the spinner becomes a busy progressbar, as LoadingBar is. Without this or `aria-labelledby`, it stays decorative. */\n 'aria-label'?: string;\n /** Names the wait from visible text; assistive tech prefers it over `aria-label`. */\n 'aria-labelledby'?: string;\n /** Fills the viewport's height, so a page that is only waiting shows the spinner in its middle. */\n fillViewport?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst getSizeClasses = (size: SpinnerProps['size']) => {\n switch (size) {\n case 'xxxsmall':\n return 'w-3.5 h-3.5'; // 14px\n case 'xxsmall':\n return 'w-6 h-6'; // 24px (close to 25px)\n case 'xsmall':\n return 'w-12 h-12'; // 48px (close to 50px)\n case 'small':\n return 'w-24 h-24'; // 96px (close to 100px)\n case 'medium':\n return 'w-48 h-48'; // 192px (close to 200px)\n case 'large':\n return 'w-96 h-96'; // 384px (close to 400px)\n default:\n return 'w-48 h-48'; // 192px default\n }\n};\n\nconst getContainerSize = (size: SpinnerProps['size']) => {\n switch (size) {\n case 'xxxsmall':\n return 'min-h-[14px]';\n case 'xxsmall':\n return 'min-h-[25px]';\n case 'xsmall':\n return 'min-h-[50px]';\n case 'small':\n return 'min-h-[100px]';\n case 'medium':\n return 'min-h-[200px]';\n case 'large':\n return 'min-h-[400px]';\n default:\n return 'min-h-[200px]';\n }\n};\n\nconst Spinner: React.FC<SpinnerProps> = ({\n size = 'medium',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n fillViewport = false,\n className = '',\n style = {},\n}) => {\n const sizeClasses = getSizeClasses(size);\n const containerSizeClasses = fillViewport ? '' : getContainerSize(size);\n const label = ariaLabel?.trim() || undefined;\n const labelledBy = ariaLabelledBy?.trim() || undefined;\n const labelled = Boolean(label || labelledBy);\n\n return (\n <div\n className={`flex items-center justify-center ${containerSizeClasses} ${className}`}\n style={fillViewport ? { minHeight: '100dvh', width: '100%', ...style } : style}\n role={labelled ? 'progressbar' : undefined}\n aria-busy={labelled || undefined}\n aria-label={label}\n aria-labelledby={labelledBy}\n >\n {/* Looping motion can cause nausea and dizziness for users with vestibular\n disorders, and a spinner loops with nothing to look away from. Under reduced\n motion the arc gives way to the full ring: still plainly busy, and a complete\n circle rather than an arc frozen mid-turn, which would read as a stalled\n animation. Same trade as LoadingBar's solid full-width line. */}\n <svg\n className={`animate-spin motion-reduce:animate-none ${sizeClasses}`}\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n style={{ color: 'var(--malachite-text-dimmed)' }}\n >\n <circle\n className=\"opacity-25 motion-reduce:opacity-100\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75 motion-reduce:opacity-0\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n </div>\n );\n};\n\nexport default Spinner;\nexport { Spinner };\n"],"names":["getSizeClasses","size","getContainerSize","Spinner","ariaLabel","ariaLabelledBy","fillViewport","className","style","sizeClasses","containerSizeClasses","label","labelledBy","labelled","jsx","jsxs"],"mappings":";AAcA,MAAMA,IAAiB,CAACC,MAA+B;AACnD,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA,IACX,KAAK;AACD,aAAO;AAAA;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAAmB,CAACD,MAA+B;AACrD,UAAQA,G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gBAAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,WAAU;AAAA,gBACV,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YAAA;AAAA,UACN;AAAA,QAAA;AAAA,MAAA;AAAA,IACJ;AAAA,EAAA;AAGZ;"}
@@ -3,7 +3,7 @@ import u from "./CustomIcons/CheckCircleFilled.js";
3
3
  import x from "./CustomIcons/ErrorCircleFilled.js";
4
4
  import g from "./CustomIcons/InfoCircleFilled.js";
5
5
  import f from "./CustomIcons/WarningCircleFilled.js";
6
- import h from "./Spinner.js";
6
+ import { Spinner as h } from "./Spinner.js";
7
7
  const b = {
8
8
  success: "bg-[var(--malachite-alert-success-background)] text-[var(--malachite-alert-success-foreground)] supports-[color:color-mix(in_srgb,red,red)]:text-[color-mix(in_srgb,var(--malachite-alert-success-foreground)_70%,var(--malachite-text-primary))]",
9
9
  neutral: "bg-[var(--malachite-alert-info-background)] text-[var(--malachite-alert-info-foreground)]",
@@ -1,28 +1,28 @@
1
1
  import { jsx as o, jsxs as E } from "react/jsx-runtime";
2
- import pe, { useRef as D, useEffect as he } from "react";
3
- import { DisclosureArrow as ge } from "./DisclosureArrow.js";
4
- import { paintOnChild as xe } from "./asChild.js";
5
- import { ROW_HOVER as ee } from "./chromeStyles.js";
6
- import { FOCUS_RING_INSET as re, FOCUS_RING_INSET_OVERLAY_HIDDEN as ve } from "./focusRing.js";
7
- import { resolveRel as M } from "./linkRel.js";
8
- import { isRenderableNode as Q } from "./renderableNode.js";
9
- import { safeHref as Ee } from "./safeHref.js";
10
- import { FOREGROUND_RESET as we, SELECTED_TEXT_CONTEXT as Ce, SELECTED_ROW_ACCENT as Ne, SELECTED_ROW_FOREGROUND as Re, SELECTED_ROW_BACKGROUND as Z } from "./selectedRow.js";
11
- const Se = {
2
+ import me, { useRef as I, useEffect as pe } from "react";
3
+ import { DisclosureArrow as he } from "./DisclosureArrow.js";
4
+ import { paintOnChild as ge } from "./asChild.js";
5
+ import { ROW_HOVER as Z } from "./chromeStyles.js";
6
+ import { FOCUS_RING_INSET as ee, FOCUS_RING_INSET_OVERLAY_HIDDEN as xe } from "./focusRing.js";
7
+ import { resolveRel as J } from "./linkRel.js";
8
+ import { isRenderableNode as M } from "./renderableNode.js";
9
+ import { safeHref as ve } from "./safeHref.js";
10
+ import { FOREGROUND_RESET as Ee, SELECTED_TEXT_CONTEXT as we, SELECTED_ROW_ACCENT as Ce, SELECTED_ROW_FOREGROUND as Ne, SELECTED_ROW_BACKGROUND as Q } from "./selectedRow.js";
11
+ const Re = {
12
12
  none: "",
13
13
  // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.
14
14
  compact: "px-[16px] py-[8px]"
15
- }, ye = {
15
+ }, Se = {
16
16
  default: "",
17
17
  muted: "bg-[var(--malachite-card-dimmed-background)]",
18
18
  success: "bg-[var(--malachite-tag-success-background,rgba(0,175,102,0.1))]",
19
19
  warning: "bg-[var(--malachite-tag-warning-background,rgba(150,88,10,0.1))]",
20
20
  error: "bg-[var(--malachite-tag-error-background,rgba(196,62,62,0.1))]"
21
- }, _e = {
21
+ }, ye = {
22
22
  success: "var(--malachite-tag-success-foreground, rgb(2, 122, 66))",
23
23
  warning: "var(--malachite-tag-warning-foreground, rgb(150, 88, 10))",
24
24
  error: "var(--malachite-tag-error-foreground, rgb(196, 62, 62))"
25
- }, ke = "opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100", Oe = (r) => {
25
+ }, _e = "opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100", ke = (r) => {
26
26
  var s;
27
27
  const n = r.getRootNode(), e = ((s = n.getSelection) == null ? void 0 : s.call(n)) ?? r.ownerDocument.getSelection();
28
28
  if (!e || e.isCollapsed)
@@ -31,7 +31,7 @@ const Se = {
31
31
  if (e.getRangeAt(l).intersectsNode(r))
32
32
  return !0;
33
33
  return !1;
34
- }, Te = (r) => new r.constructor("click", r), Ae = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)", ae = (r) => {
34
+ }, Oe = (r) => new r.constructor("click", r), Te = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)", re = (r) => {
35
35
  const {
36
36
  children: n,
37
37
  divider: t = !1,
@@ -47,47 +47,47 @@ const Se = {
47
47
  onClick: i,
48
48
  href: y,
49
49
  target: R,
50
- rel: I,
50
+ rel: $,
51
51
  trailing: P,
52
52
  revealTrailing: B,
53
53
  leading: _,
54
54
  dimmed: F,
55
55
  role: b
56
- } = c ? {} : r, h = Ee(y), U = c ? void 0 : r["aria-label"], j = c ? void 0 : r["aria-labelledby"], oe = c ? void 0 : r.tabIndex, G = !!(i || h), ne = e && (G || c) ? "" : s ? ee : "", ie = u !== "default", le = ye[u], W = !c && Q(P), k = Se[w], ce = k ? "" : "p-0", H = [
56
+ } = c ? {} : r, h = ve(y), U = c ? void 0 : r["aria-label"], j = c ? void 0 : r["aria-labelledby"], te = c ? void 0 : r.tabIndex, G = !!(i || h), oe = e && (G || c) ? "" : s ? Z : "", ne = u !== "default", ie = Se[u], W = !c && M(P), k = Re[w], le = k ? "" : "p-0", H = [
57
57
  "w-full text-left border-0",
58
- le,
58
+ ie,
59
59
  t ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
60
- ne
60
+ oe
61
61
  ].filter(Boolean).join(" "), X = [
62
62
  "appearance-none",
63
- ie ? "" : "bg-transparent",
63
+ ne ? "" : "bg-transparent",
64
64
  e ? "" : "cursor-pointer"
65
- ], V = (a) => [H, ...a, k, p].filter(Boolean).join(" "), se = d ? d !== "announce" : b !== "checkbox", de = d !== "tint", m = W && !!i && !h && !e, z = D(null), K = D(null), g = D(!1), ue = (a) => {
65
+ ], V = (a) => [H, ...a, k, p].filter(Boolean).join(" "), ce = d ? d !== "announce" : b !== "checkbox", se = d !== "tint", m = W && !!i && !h && !e, z = I(null), K = I(null), g = I(!1), de = (a) => {
66
66
  g.current = a.target !== a.currentTarget;
67
- }, fe = (a) => {
67
+ }, ue = (a) => {
68
68
  g.current || (g.current = a.target !== a.currentTarget);
69
69
  };
70
- he(() => {
70
+ pe(() => {
71
71
  const a = z.current;
72
72
  if (!m || !a)
73
73
  return;
74
74
  const N = (v) => {
75
75
  const L = g.current;
76
76
  g.current = !1;
77
- const $ = K.current;
78
- !$ || v.target !== a || L || v.detail <= 1 && !v.shiftKey && Oe(a) || (v.stopPropagation(), $.focus({ preventScroll: !0 }), $.dispatchEvent(Te(v)));
77
+ const D = K.current;
78
+ !D || v.target !== a || L || v.detail <= 1 && !v.shiftKey && ke(a) || (v.stopPropagation(), D.focus({ preventScroll: !0 }), D.dispatchEvent(Oe(v)));
79
79
  };
80
80
  return a.addEventListener("click", N), () => a.removeEventListener("click", N);
81
81
  }, [m]);
82
- const be = l === !0 && se ? {
83
- backgroundImage: `linear-gradient(${Z}, ${Z})`,
84
- color: Re,
85
- ...de ? { boxShadow: `inset 2px 0 0 ${Ne}` } : {},
86
- ...Ce
87
- } : {}, O = _e[u], C = { ...O ? {
82
+ const fe = l === !0 && ce ? {
83
+ backgroundImage: `linear-gradient(${Q}, ${Q})`,
84
+ color: Ne,
85
+ ...se ? { boxShadow: `inset 2px 0 0 ${Ce}` } : {},
86
+ ...we
87
+ } : {}, O = ye[u], C = { ...O ? {
88
88
  color: O,
89
89
  "--malachite-ctx-text-primary": O
90
- } : {}, ...be, ...f }, T = b === "checkbox" && l === "mixed" ? "mixed" : b === "radio" || b === "checkbox" ? l === !0 : void 0, Y = T === void 0 && l === !0 ? !0 : void 0, q = {
90
+ } : {}, ...fe, ...f }, T = b === "checkbox" && l === "mixed" ? "mixed" : b === "radio" || b === "checkbox" ? l === !0 : void 0, Y = T === void 0 && l === !0 ? !0 : void 0, q = {
91
91
  role: b,
92
92
  "aria-checked": T,
93
93
  "aria-current": Y,
@@ -96,16 +96,16 @@ const Se = {
96
96
  "aria-disabled": b && e ? !0 : void 0
97
97
  };
98
98
  if (c)
99
- return xe(n, V([]), C);
99
+ return ge(n, V([]), C);
100
100
  const S = {
101
101
  role: b,
102
- tabIndex: oe,
102
+ tabIndex: te,
103
103
  "aria-checked": T,
104
104
  "aria-current": Y,
105
105
  "aria-label": U,
106
106
  "aria-labelledby": j
107
- }, me = Q(_), J = _ !== void 0 || F !== void 0, x = J ? /* @__PURE__ */ E("span", { className: "flex w-full min-w-0 items-center gap-[12px]", children: [
108
- me && /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center", children: _ }),
107
+ }, be = M(_), x = _ !== void 0 || F !== void 0 ? /* @__PURE__ */ E("span", { className: "flex w-full min-w-0 items-center gap-[12px]", children: [
108
+ be && /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center", children: _ }),
109
109
  /* @__PURE__ */ o(
110
110
  "span",
111
111
  {
@@ -120,7 +120,7 @@ const Se = {
120
120
  {
121
121
  "aria-hidden": "true",
122
122
  "data-malachite-row-ring": "",
123
- className: ve
123
+ className: xe
124
124
  }
125
125
  ), N = [
126
126
  ...X,
@@ -130,7 +130,7 @@ const Se = {
130
130
  {
131
131
  href: h,
132
132
  target: R,
133
- rel: M(I, R),
133
+ rel: J($, R),
134
134
  onClick: i,
135
135
  className: `${N} no-underline text-inherit`,
136
136
  "data-malachite-row-control": "",
@@ -172,14 +172,14 @@ const Se = {
172
172
  "data-disabled": e ? "" : void 0,
173
173
  ref: z,
174
174
  role: m ? "presentation" : void 0,
175
- onPointerDownCapture: m ? ue : void 0,
176
- onPointerUpCapture: m ? fe : void 0,
175
+ onPointerDownCapture: m ? de : void 0,
176
+ onPointerUpCapture: m ? ue : void 0,
177
177
  children: [
178
178
  L,
179
179
  /* @__PURE__ */ o(
180
180
  "div",
181
181
  {
182
- className: `shrink-0 flex items-center ${m ? "cursor-default" : ""} ${B ? ke : ""}`,
182
+ className: `shrink-0 flex items-center ${m ? "cursor-default" : ""} ${B ? _e : ""}`,
183
183
  "data-malachite-row-slot": "",
184
184
  children: P
185
185
  }
@@ -189,16 +189,16 @@ const Se = {
189
189
  );
190
190
  }
191
191
  const A = V(
192
- G ? [...X, ce, re] : []
192
+ G ? [...X, le, ee] : []
193
193
  );
194
194
  return h && !e ? /* @__PURE__ */ o(
195
195
  "a",
196
196
  {
197
197
  href: h,
198
198
  target: R,
199
- rel: M(I, R),
199
+ rel: J($, R),
200
200
  onClick: i,
201
- className: `${A} no-underline text-inherit ${J ? "block" : ""}`,
201
+ className: `${A} block no-underline text-inherit`,
202
202
  style: C,
203
203
  ...S,
204
204
  children: x
@@ -215,7 +215,7 @@ const Se = {
215
215
  children: x
216
216
  }
217
217
  ) : /* @__PURE__ */ o("div", { className: A, style: C, ...q, children: x });
218
- }, Le = ({ children: r, className: n = "", style: t }) => /* @__PURE__ */ o("div", { className: n, style: t, onClick: (e) => e.stopPropagation(), children: r }), Ke = 39, $e = Object.assign(
218
+ }, Ae = ({ children: r, className: n = "", style: t }) => /* @__PURE__ */ o("div", { className: n, style: t, onClick: (e) => e.stopPropagation(), children: r }), Ke = 39, Le = Object.assign(
219
219
  ({
220
220
  header: r,
221
221
  children: n,
@@ -229,12 +229,12 @@ const Se = {
229
229
  className: p = "",
230
230
  style: f
231
231
  }) => {
232
- const c = pe.useId(), i = e ? () => e(!t) : void 0;
232
+ const c = me.useId(), i = e ? () => e(!t) : void 0;
233
233
  return (
234
234
  // The hover is the header's, not the row's: the row holds the open body too, which is
235
235
  // not a target, and tinting it washes out everything in it.
236
236
  /* @__PURE__ */ E(
237
- ae,
237
+ re,
238
238
  {
239
239
  divider: d,
240
240
  tone: u,
@@ -245,7 +245,7 @@ const Se = {
245
245
  /* @__PURE__ */ E(
246
246
  "div",
247
247
  {
248
- className: `group flex items-center w-full ${ee} ${i ? "cursor-pointer" : ""} ${s && t ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
248
+ className: `group flex items-center w-full ${Z} ${i ? "cursor-pointer" : ""} ${s && t ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
249
249
  style: s && t ? { top: l } : void 0,
250
250
  onClick: i,
251
251
  role: "presentation",
@@ -254,14 +254,14 @@ const Se = {
254
254
  "button",
255
255
  {
256
256
  type: "button",
257
- className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${re}`,
257
+ className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${ee}`,
258
258
  "aria-expanded": t,
259
259
  "aria-controls": c,
260
260
  "aria-label": w,
261
261
  onClick: (y) => {
262
262
  y.stopPropagation(), i();
263
263
  },
264
- children: /* @__PURE__ */ o(ge, { expanded: t })
264
+ children: /* @__PURE__ */ o(he, { expanded: t })
265
265
  }
266
266
  ) }),
267
267
  r
@@ -274,11 +274,11 @@ const Se = {
274
274
  )
275
275
  );
276
276
  },
277
- { Controls: Le }
277
+ { Controls: Ae }
278
278
  ), De = {
279
279
  default: "bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]",
280
280
  highlight: "bg-[var(--malachite-card-warm-background,rgb(244,242,240))]"
281
- }, Ie = "relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']", te = (({
281
+ }, Ie = "relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']", ae = (({
282
282
  children: r,
283
283
  padding: n = !1,
284
284
  overflow: t = "hidden",
@@ -296,9 +296,9 @@ const Se = {
296
296
  {
297
297
  className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${f ? "overflow-visible" : t === "clip" ? "overflow-clip" : t === "visible" ? "overflow-visible" : "overflow-hidden"} ${De[e]} ${n ? "py-3 px-4" : ""} ${f ? Ie : ""} ${w}`,
298
298
  style: {
299
- ...s ? { boxShadow: Ae } : {},
299
+ ...s ? { boxShadow: Te } : {},
300
300
  ...f ? { clipPath: "inset(0 round var(--malachite-radius-xxl, 14px))" } : {},
301
- ...we,
301
+ ...Ee,
302
302
  ...p
303
303
  },
304
304
  role: l,
@@ -308,13 +308,13 @@ const Se = {
308
308
  }
309
309
  );
310
310
  });
311
- te.Row = ae;
312
- te.ExpandableRow = $e;
311
+ ae.Row = re;
312
+ ae.ExpandableRow = Le;
313
313
  export {
314
314
  Ke as EXPANDABLE_ROW_LEAD_PX,
315
- te as Surface,
316
- $e as SurfaceExpandableRow,
317
- ae as SurfaceRow,
318
- te as default
315
+ ae as Surface,
316
+ Le as SurfaceExpandableRow,
317
+ re as SurfaceRow,
318
+ ae as default
319
319
  };
320
320
  //# sourceMappingURL=Surface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { ROW_HOVER } from './chromeStyles';\nimport { FOCUS_RING_INSET, FOCUS_RING_INSET_OVERLAY_HIDDEN } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport type SurfaceTone = 'default' | 'highlight';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely. A flat, default-tone `clip` card clips at its border.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n /**\n * `false` drops the elevation shadow, for a card that sits flat on its ground.\n * Default: `true`, or `false` with `tone=\"highlight\"`.\n */\n shadow?: boolean;\n /**\n * `highlight` paints the warm ground with no border and no shadow, for a static block that\n * stands out from the page, such as a hero or a guide's section header. Its ground is too\n * close to `Surface.Row`'s hover for clickable rows inside it.\n */\n tone?: SurfaceTone;\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `tint` paints it\n * without the accent bar, for a menu whose choice is already marked inside the row;\n * `announce` leaves the visual to a control inside the row and only sets the ARIA state.\n * Defaults to `announce` under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'tint' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success`, `warning` and `error` are for a row that\n * carries an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'warning' | 'error';\n /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n /** `false` leaves the hover to something inside the row. */\n hover?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\n // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** The row's indicator, before the children. With this or `dimmed`, pass one child. */\n leading?: React.ReactNode;\n /** Fades the children, not `leading` or `trailing`. */\n dimmed?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background,rgba(0,175,102,0.1))]',\n warning: 'bg-[var(--malachite-tag-warning-background,rgba(150,88,10,0.1))]',\n error: 'bg-[var(--malachite-tag-error-background,rgba(196,62,62,0.1))]',\n};\n\n/**\n * The text an outcome tone carries with it, through the same context channel a selected row\n * uses, so `Typography` inside the row follows the tint instead of staying near-black on it.\n * `color` as well, for row content that is not Typography.\n *\n * Only the outcome tones. `muted` dims its subject rather than recolouring it, and its\n * foreground is the ordinary one.\n */\nconst TONE_FOREGROUNDS: Partial<Record<NonNullable<SurfaceRowProps['tone']>, string>> = {\n success: 'var(--malachite-tag-success-foreground, rgb(2, 122, 66))',\n warning: 'var(--malachite-tag-warning-foreground, rgb(150, 88, 10))',\n error: 'var(--malachite-tag-error-foreground, rgb(196, 62, 62))',\n};\n\nexport interface SurfaceRowAsChildProps extends SurfaceRowChromeProps {\n asChild: true;\n children: React.ReactElement;\n}\n\nexport type AnySurfaceRowProps = SurfaceRowProps | SurfaceRowAsChildProps;\n\n// Not `group-hover` or `group-has-[:focus-visible]`: WebKit never applies the first (its\n// `@media (hover: hover)` nested in the group selector) nor the second inside a shadow root,\n// so the control stayed hidden in Safari. An open menu takes focus out of the row into a\n// portal, and would otherwise lose its trigger.\nconst REVEALED_ON_INTERACTION =\n 'opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100';\n\nconst selectsTextIn = (row: Element): boolean => {\n const root = row.getRootNode();\n const ownSelection = (root as Partial<Pick<Document, 'getSelection'>>).getSelection?.();\n const selection = ownSelection ?? row.ownerDocument.getSelection();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n for (let index = 0; index < selection.rangeCount; index += 1) {\n if (selection.getRangeAt(index).intersectsNode(row)) {\n return true;\n }\n }\n return false;\n};\n\nconst forwardedClick = (event: MouseEvent): MouseEvent =>\n new (event.constructor as typeof MouseEvent)('click', event);\n\nconst TRIPLE_SHADOW =\n '0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n hover: hoverable = true,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n leading,\n dimmed,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover = disabled && (interactive || asChild) ? '' : hoverable ? ROW_HOVER : '';\n\n // A class, not an inline colour, which would outrank the hover utility. It replaces the\n // button reset's `bg-transparent` rather than joining it: same specificity, so the winner\n // would be whichever Tailwind emitted last.\n const tinted = tone !== 'default';\n const toneClass = TONE_CLASSES[tone];\n\n const hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlReset = [\n 'appearance-none',\n tinted ? '' : 'bg-transparent',\n disabled ? '' : 'cursor-pointer',\n ];\n const rowClasses = (control: string[]) =>\n [chromeClasses, ...control, insetClass, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection !== 'announce' : role !== 'checkbox';\n const accent = selection !== 'tint';\n\n const forwards = hasTrailing && Boolean(onClick) && !href && !disabled;\n const rowRef = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLButtonElement>(null);\n const pressLeftPadding = useRef(false);\n const startPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current = event.target !== event.currentTarget;\n };\n const trackPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current ||= event.target !== event.currentTarget;\n };\n useEffect(() => {\n const row = rowRef.current;\n if (!forwards || !row) {\n return undefined;\n }\n const forwardPaddingClick = (event: MouseEvent) => {\n const leftPadding = pressLeftPadding.current;\n pressLeftPadding.current = false;\n const control = controlRef.current;\n if (\n !control ||\n event.target !== row ||\n leftPadding ||\n (event.detail <= 1 && !event.shiftKey && selectsTextIn(row))\n ) {\n return;\n }\n event.stopPropagation();\n control.focus({ preventScroll: true });\n control.dispatchEvent(forwardedClick(event));\n };\n row.addEventListener('click', forwardPaddingClick);\n return () => row.removeEventListener('click', forwardPaddingClick);\n }, [forwards]);\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n ...(accent ? { boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}` } : {}),\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, rowClasses([]), rowStyle);\n }\n\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n const controlAria = {\n role,\n tabIndex,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n };\n\n const hasLeading = isRenderableNode(leading);\n const boxed = leading !== undefined || dimmed !== undefined;\n const content = boxed ? (\n <span className=\"flex w-full min-w-0 items-center gap-[12px]\">\n {hasLeading && <span className=\"shrink-0 flex items-center\">{leading}</span>}\n <span\n className={`grid flex-1 min-w-0 grid-cols-[minmax(0,1fr)] transition-opacity ${dimmed ? 'opacity-60' : ''}`}\n >\n {children}\n </span>\n </span>\n ) : (\n children\n );\n\n if (hasTrailing) {\n const focusRing = disabled ? null : (\n <span\n aria-hidden=\"true\"\n data-malachite-row-ring=\"\"\n className={FOCUS_RING_INSET_OVERLAY_HIDDEN}\n />\n );\n const rowControlClasses = [\n ...controlReset,\n 'outline-none border-0 p-0 flex-1 min-w-0 text-left',\n ]\n .filter(Boolean)\n .join(' ');\n const anchor = Boolean(href) && !disabled;\n const control = anchor ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${rowControlClasses} no-underline text-inherit`}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </a>\n ) : onClick ? (\n <button\n ref={controlRef}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={rowControlClasses}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </button>\n ) : (\n <div className=\"flex-1 min-w-0\" data-malachite-row-control=\"\" {...rowFallbackAria}>\n {content}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'relative flex items-center',\n forwards ? 'cursor-pointer' : '',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n data-malachite-row=\"\"\n data-disabled={disabled ? '' : undefined}\n ref={rowRef}\n role={forwards ? 'presentation' : undefined}\n onPointerDownCapture={forwards ? startPress : undefined}\n onPointerUpCapture={forwards ? trackPress : undefined}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${forwards ? 'cursor-default' : ''} ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n data-malachite-row-slot=\"\"\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n const classes = rowClasses(\n interactive ? [...controlReset, controlPadding, FOCUS_RING_INSET] : [],\n );\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} no-underline text-inherit ${boxed ? 'block' : ''}`}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {content}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n // The hover is the header's, not the row's: the row holds the open body too, which is\n // not a target, and tinting it washes out everything in it.\n <SurfaceRow\n divider={divider}\n tone={tone}\n hover={false}\n className={className}\n style={style}\n >\n {/* `group` so the arrow takes its hover state from the whole header line. */}\n <div\n className={`group flex items-center w-full ${ROW_HOVER} ${\n toggle ? 'cursor-pointer' : ''\n } ${\n sticky && expanded\n ? 'sticky z-[1] bg-[var(--malachite-card-background)]'\n : ''\n }`}\n style={sticky && expanded ? { top: stickyTopOffset } : undefined}\n // Presentational: the arrow below is the keyboard control, and this only\n // widens the pointer target.\n onClick={toggle}\n role=\"presentation\"\n >\n {/* Reserved whether or not this row opens, so a list stays in one column.\n The inset and gap match Accordion's header. */}\n <span className=\"shrink-0 flex items-center pl-[16px] pr-[12px]\">\n {toggle && (\n <button\n type=\"button\"\n className={`appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${FOCUS_RING_INSET}`}\n aria-expanded={expanded}\n aria-controls={bodyId}\n aria-label={ariaLabel}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n >\n <DisclosureArrow expanded={expanded} />\n </button>\n )}\n </span>\n {header}\n </div>\n {expanded && <div id={bodyId}>{children}</div>}\n </SurfaceRow>\n );\n },\n { Controls: ExpandableRowControls },\n);\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<AnySurfaceRowProps>;\n ExpandableRow: typeof SurfaceExpandableRow;\n}\n\nconst SURFACE_TONE_CLASSES: Record<SurfaceTone, string> = {\n default:\n 'bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]',\n highlight: 'bg-[var(--malachite-card-warm-background,rgb(244,242,240))]',\n};\n\nconst FLAT_CLIP_RING =\n \"relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']\";\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n tone = 'default',\n shadow = tone !== 'highlight',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const clipsToBorder = overflow === 'clip' && !shadow && tone === 'default';\n const overflowClass = clipsToBorder\n ? 'overflow-visible'\n : overflow === 'clip'\n ? 'overflow-clip'\n : overflow === 'visible'\n ? 'overflow-visible'\n : 'overflow-hidden';\n return (\n <div\n className={`w-full rounded-[var(--malachite-radius-xxl,14px)] ${overflowClass} ${SURFACE_TONE_CLASSES[tone]} ${padding ? 'py-3 px-4' : ''} ${clipsToBorder ? FLAT_CLIP_RING : ''} ${className}`}\n style={{\n ...(shadow ? { boxShadow: TRIPLE_SHADOW } : {}),\n ...(clipsToBorder\n ? { clipPath: 'inset(0 round var(--malachite-radius-xxl, 14px))' }\n : {}),\n ...FOREGROUND_RESET,\n ...style,\n }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","selectsTextIn","row","root","selection","_a","index","forwardedClick","event","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","hoverable","selected","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","leading","dimmed","role","href","safeHref","ariaLabel","ariaLabelledBy","tabIndex","interactive","hover","ROW_HOVER","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlReset","rowClasses","control","paints","accent","forwards","rowRef","useRef","controlRef","pressLeftPadding","startPress","trackPress","useEffect","forwardPaddingClick","leftPadding","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","controlAria","hasLeading","boxed","content","jsxs","jsx","focusRing","FOCUS_RING_INSET_OVERLAY_HIDDEN","rowControlClasses","resolveRel","classes","FOCUS_RING_INSET","ExpandableRowControls","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","SURFACE_TONE_CLASSES","FLAT_CLIP_RING","Surface","padding","overflow","shadow","clipsToBorder","FOREGROUND_RESET"],"mappings":";;;;;;;;;;AA6EA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA;AAAA,EAEN,SAAS;AACb,GAyCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KAAgB,CAACC,MAA0B;;AAC7C,QAAMC,IAAOD,EAAI,YAAA,GAEXE,MADgBC,IAAAF,EAAiD,iBAAjD,gBAAAE,EAAA,KAAAF,OACYD,EAAI,cAAc,aAAA;AACpD,MAAI,CAACE,KAAaA,EAAU;AACxB,WAAO;AAEX,WAASE,IAAQ,GAAGA,IAAQF,EAAU,YAAYE,KAAS;AACvD,QAAIF,EAAU,WAAWE,CAAK,EAAE,eAAeJ,CAAG;AAC9C,aAAO;AAGf,SAAO;AACX,GAEMK,KAAiB,CAACC,MACpB,IAAKA,EAAM,YAAkC,SAASA,CAAK,GAEzDC,KACF,yGASEC,KAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,OAAOC,IAAY;AAAA,IACnB,UAAAC;AAAA,IACA,WAAAZ;AAAA,IACA,MAAAa,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,EAAA,IACAT,GACEU,IAAUV,EAAM,YAAY,IAC5B;AAAA,IACF,SAAAW;AAAA,IACA,MAAMC;AAAA,IACN,QAAAC;AAAA,IACA,KAAAC;AAA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MAAoB;AAEhB,QAAMkF,IAAgBF,MAAa,UAAU,CAACC,KAAUpF,MAAS;AAQjE,SACI,gBAAA4D;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,qDATGyB,IAChB,qBACAF,MAAa,SACX,kBACAA,MAAa,YACX,qBACA,iBAG2E,IAAIJ,GAAqB/E,CAAI,CAAC,IAAIkF,IAAU,cAAc,EAAE,IAAIG,IAAgBL,KAAiB,EAAE,IAAI9E,CAAS;AAAA,MAC7L,OAAO;AAAA,QACH,GAAIkF,IAAS,EAAE,WAAW5F,GAAA,IAAkB,CAAA;AAAA,QAC5C,GAAI6F,IACE,EAAE,UAAU,mDAAA,IACZ,CAAA;AAAA,QACN,GAAGC;AAAA,QACH,GAAGnF;AAAA,MAAA;AAAA,MAEP,MAAAU;AAAA,MACA,cAAYG;AAAA,MACZ,mBAAiBC;AAAA,MAEhB,UAAAtB;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAsF,GAAQ,MAAMxF;AACdwF,GAAQ,gBAAgBZ;"}
1
+ {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { ROW_HOVER } from './chromeStyles';\nimport { FOCUS_RING_INSET, FOCUS_RING_INSET_OVERLAY_HIDDEN } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport type SurfaceTone = 'default' | 'highlight';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely. A flat, default-tone `clip` card clips at its border.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n /**\n * `false` drops the elevation shadow, for a card that sits flat on its ground.\n * Default: `true`, or `false` with `tone=\"highlight\"`.\n */\n shadow?: boolean;\n /**\n * `highlight` paints the warm ground with no border and no shadow, for a static block that\n * stands out from the page, such as a hero or a guide's section header. Its ground is too\n * close to `Surface.Row`'s hover for clickable rows inside it.\n */\n tone?: SurfaceTone;\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `tint` paints it\n * without the accent bar, for a menu whose choice is already marked inside the row;\n * `announce` leaves the visual to a control inside the row and only sets the ARIA state.\n * Defaults to `announce` under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'tint' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success`, `warning` and `error` are for a row that\n * carries an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'warning' | 'error';\n /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n /** `false` leaves the hover to something inside the row. */\n hover?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\n // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** The row's indicator, before the children. With this or `dimmed`, pass one child. */\n leading?: React.ReactNode;\n /** Fades the children, not `leading` or `trailing`. */\n dimmed?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background,rgba(0,175,102,0.1))]',\n warning: 'bg-[var(--malachite-tag-warning-background,rgba(150,88,10,0.1))]',\n error: 'bg-[var(--malachite-tag-error-background,rgba(196,62,62,0.1))]',\n};\n\n/**\n * The text an outcome tone carries with it, through the same context channel a selected row\n * uses, so `Typography` inside the row follows the tint instead of staying near-black on it.\n * `color` as well, for row content that is not Typography.\n *\n * Only the outcome tones. `muted` dims its subject rather than recolouring it, and its\n * foreground is the ordinary one.\n */\nconst TONE_FOREGROUNDS: Partial<Record<NonNullable<SurfaceRowProps['tone']>, string>> = {\n success: 'var(--malachite-tag-success-foreground, rgb(2, 122, 66))',\n warning: 'var(--malachite-tag-warning-foreground, rgb(150, 88, 10))',\n error: 'var(--malachite-tag-error-foreground, rgb(196, 62, 62))',\n};\n\nexport interface SurfaceRowAsChildProps extends SurfaceRowChromeProps {\n asChild: true;\n children: React.ReactElement;\n}\n\nexport type AnySurfaceRowProps = SurfaceRowProps | SurfaceRowAsChildProps;\n\n// Not `group-hover` or `group-has-[:focus-visible]`: WebKit never applies the first (its\n// `@media (hover: hover)` nested in the group selector) nor the second inside a shadow root,\n// so the control stayed hidden in Safari. An open menu takes focus out of the row into a\n// portal, and would otherwise lose its trigger.\nconst REVEALED_ON_INTERACTION =\n 'opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100';\n\nconst selectsTextIn = (row: Element): boolean => {\n const root = row.getRootNode();\n const ownSelection = (root as Partial<Pick<Document, 'getSelection'>>).getSelection?.();\n const selection = ownSelection ?? row.ownerDocument.getSelection();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n for (let index = 0; index < selection.rangeCount; index += 1) {\n if (selection.getRangeAt(index).intersectsNode(row)) {\n return true;\n }\n }\n return false;\n};\n\nconst forwardedClick = (event: MouseEvent): MouseEvent =>\n new (event.constructor as typeof MouseEvent)('click', event);\n\nconst TRIPLE_SHADOW =\n '0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n hover: hoverable = true,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n leading,\n dimmed,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover = disabled && (interactive || asChild) ? '' : hoverable ? ROW_HOVER : '';\n\n // A class, not an inline colour, which would outrank the hover utility. It replaces the\n // button reset's `bg-transparent` rather than joining it: same specificity, so the winner\n // would be whichever Tailwind emitted last.\n const tinted = tone !== 'default';\n const toneClass = TONE_CLASSES[tone];\n\n const hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlReset = [\n 'appearance-none',\n tinted ? '' : 'bg-transparent',\n disabled ? '' : 'cursor-pointer',\n ];\n const rowClasses = (control: string[]) =>\n [chromeClasses, ...control, insetClass, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection !== 'announce' : role !== 'checkbox';\n const accent = selection !== 'tint';\n\n const forwards = hasTrailing && Boolean(onClick) && !href && !disabled;\n const rowRef = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLButtonElement>(null);\n const pressLeftPadding = useRef(false);\n const startPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current = event.target !== event.currentTarget;\n };\n const trackPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current ||= event.target !== event.currentTarget;\n };\n useEffect(() => {\n const row = rowRef.current;\n if (!forwards || !row) {\n return undefined;\n }\n const forwardPaddingClick = (event: MouseEvent) => {\n const leftPadding = pressLeftPadding.current;\n pressLeftPadding.current = false;\n const control = controlRef.current;\n if (\n !control ||\n event.target !== row ||\n leftPadding ||\n (event.detail <= 1 && !event.shiftKey && selectsTextIn(row))\n ) {\n return;\n }\n event.stopPropagation();\n control.focus({ preventScroll: true });\n control.dispatchEvent(forwardedClick(event));\n };\n row.addEventListener('click', forwardPaddingClick);\n return () => row.removeEventListener('click', forwardPaddingClick);\n }, [forwards]);\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n ...(accent ? { boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}` } : {}),\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, rowClasses([]), rowStyle);\n }\n\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n const controlAria = {\n role,\n tabIndex,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n };\n\n const hasLeading = isRenderableNode(leading);\n const boxed = leading !== undefined || dimmed !== undefined;\n const content = boxed ? (\n <span className=\"flex w-full min-w-0 items-center gap-[12px]\">\n {hasLeading && <span className=\"shrink-0 flex items-center\">{leading}</span>}\n <span\n className={`grid flex-1 min-w-0 grid-cols-[minmax(0,1fr)] transition-opacity ${dimmed ? 'opacity-60' : ''}`}\n >\n {children}\n </span>\n </span>\n ) : (\n children\n );\n\n if (hasTrailing) {\n const focusRing = disabled ? null : (\n <span\n aria-hidden=\"true\"\n data-malachite-row-ring=\"\"\n className={FOCUS_RING_INSET_OVERLAY_HIDDEN}\n />\n );\n const rowControlClasses = [\n ...controlReset,\n 'outline-none border-0 p-0 flex-1 min-w-0 text-left',\n ]\n .filter(Boolean)\n .join(' ');\n const anchor = Boolean(href) && !disabled;\n const control = anchor ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${rowControlClasses} no-underline text-inherit`}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </a>\n ) : onClick ? (\n <button\n ref={controlRef}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={rowControlClasses}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </button>\n ) : (\n <div className=\"flex-1 min-w-0\" data-malachite-row-control=\"\" {...rowFallbackAria}>\n {content}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'relative flex items-center',\n forwards ? 'cursor-pointer' : '',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n data-malachite-row=\"\"\n data-disabled={disabled ? '' : undefined}\n ref={rowRef}\n role={forwards ? 'presentation' : undefined}\n onPointerDownCapture={forwards ? startPress : undefined}\n onPointerUpCapture={forwards ? trackPress : undefined}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${forwards ? 'cursor-default' : ''} ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n data-malachite-row-slot=\"\"\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n const classes = rowClasses(\n interactive ? [...controlReset, controlPadding, FOCUS_RING_INSET] : [],\n );\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} block no-underline text-inherit`}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {content}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n // The hover is the header's, not the row's: the row holds the open body too, which is\n // not a target, and tinting it washes out everything in it.\n <SurfaceRow\n divider={divider}\n tone={tone}\n hover={false}\n className={className}\n style={style}\n >\n {/* `group` so the arrow takes its hover state from the whole header line. */}\n <div\n className={`group flex items-center w-full ${ROW_HOVER} ${\n toggle ? 'cursor-pointer' : ''\n } ${\n sticky && expanded\n ? 'sticky z-[1] bg-[var(--malachite-card-background)]'\n : ''\n }`}\n style={sticky && expanded ? { top: stickyTopOffset } : undefined}\n // Presentational: the arrow below is the keyboard control, and this only\n // widens the pointer target.\n onClick={toggle}\n role=\"presentation\"\n >\n {/* Reserved whether or not this row opens, so a list stays in one column.\n The inset and gap match Accordion's header. */}\n <span className=\"shrink-0 flex items-center pl-[16px] pr-[12px]\">\n {toggle && (\n <button\n type=\"button\"\n className={`appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${FOCUS_RING_INSET}`}\n aria-expanded={expanded}\n aria-controls={bodyId}\n aria-label={ariaLabel}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n >\n <DisclosureArrow expanded={expanded} />\n </button>\n )}\n </span>\n {header}\n </div>\n {expanded && <div id={bodyId}>{children}</div>}\n </SurfaceRow>\n );\n },\n { Controls: ExpandableRowControls },\n);\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<AnySurfaceRowProps>;\n ExpandableRow: typeof SurfaceExpandableRow;\n}\n\nconst SURFACE_TONE_CLASSES: Record<SurfaceTone, string> = {\n default:\n 'bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]',\n highlight: 'bg-[var(--malachite-card-warm-background,rgb(244,242,240))]',\n};\n\nconst FLAT_CLIP_RING =\n \"relative after:pointer-events-none after:absolute after:-inset-px after:z-[9] after:rounded-[inherit] after:border after:border-solid after:[border-color:inherit] after:content-['']\";\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n tone = 'default',\n shadow = tone !== 'highlight',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const clipsToBorder = overflow === 'clip' && !shadow && tone === 'default';\n const overflowClass = clipsToBorder\n ? 'overflow-visible'\n : overflow === 'clip'\n ? 'overflow-clip'\n : overflow === 'visible'\n ? 'overflow-visible'\n : 'overflow-hidden';\n return (\n <div\n className={`w-full rounded-[var(--malachite-radius-xxl,14px)] ${overflowClass} ${SURFACE_TONE_CLASSES[tone]} ${padding ? 'py-3 px-4' : ''} ${clipsToBorder ? FLAT_CLIP_RING : ''} ${className}`}\n style={{\n ...(shadow ? { boxShadow: TRIPLE_SHADOW } : {}),\n ...(clipsToBorder\n ? { clipPath: 'inset(0 round var(--malachite-radius-xxl, 14px))' }\n : {}),\n ...FOREGROUND_RESET,\n ...style,\n }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","selectsTextIn","row","root","selection","_a","index","forwardedClick","event","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","hoverable","selected","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","leading","dimmed","role","href","safeHref","ariaLabel","ariaLabelledBy","tabIndex","interactive","hover","ROW_HOVER","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlReset","rowClasses","control","paints","accent","forwards","rowRef","useRef","controlRef","pressLeftPadding","startPress","trackPress","useEffect","forwardPaddingClick","leftPadding","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","controlAria","hasLeading","content","jsxs","jsx","focusRing","FOCUS_RING_INSET_OVERLAY_HIDDEN","rowControlClasses","resolveRel","classes","FOCUS_RING_INSET","ExpandableRowControls","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","SURFACE_TONE_CLASSES","FLAT_CLIP_RING","Surface","padding","overflow","shadow","clipsToBorder","FOREGROUND_RESET"],"mappings":";;;;;;;;;;AA6EA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA;AAAA,EAEN,SAAS;AACb,GAyCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KAAgB,CAACC,MAA0B;;AAC7C,QAAMC,IAAOD,EAAI,YAAA,GAEXE,MADgBC,IAAAF,EAAiD,iBAAjD,gBAAAE,EAAA,KAAAF,OACYD,EAAI,cAAc,aAAA;AACpD,MAAI,CAACE,KAAaA,EAAU;AACxB,WAAO;AAEX,WAASE,IAAQ,GAAGA,IAAQF,EAAU,YAAYE,KAAS;AACvD,QAAIF,EAAU,WAAWE,CAAK,EAAE,eAAeJ,CAAG;AAC9C,aAAO;AAGf,SAAO;AACX,GAEMK,KAAiB,CAACC,MACpB,IAAKA,EAAM,YAAkC,SAASA,CAAK,GAEzDC,KACF,yGASEC,KAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,OAAOC,IAAY;AAAA,IACnB,UAAAC;AAAA,IACA,WAAAZ;AAAA,IACA,MAAAa,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,WAAAC,IAAY;AAAA,IACZ,OAAAC;AAAA,EAAA,IACAT,GACEU,IAAUV,EA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,EACnB,WAAAf,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAoB;AAEhB,QAAMiF,IAAgBF,MAAa,UAAU,CAACC,KAAUnF,MAAS;AAQjE,SACI,gBAAA2D;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,qDATGyB,IAChB,qBACAF,MAAa,SACX,kBACAA,MAAa,YACX,qBACA,iBAG2E,IAAIJ,GAAqB9E,CAAI,CAAC,IAAIiF,IAAU,cAAc,EAAE,IAAIG,IAAgBL,KAAiB,EAAE,IAAI7E,CAAS;AAAA,MAC7L,OAAO;AAAA,QACH,GAAIiF,IAAS,EAAE,WAAW3F,GAAA,IAAkB,CAAA;AAAA,QAC5C,GAAI4F,IACE,EAAE,UAAU,mDAAA,IACZ,CAAA;AAAA,QACN,GAAGC;AAAA,QACH,GAAGlF;AAAA,MAAA;AAAA,MAEP,MAAAU;AAAA,MACA,cAAYG;AAAA,MACZ,mBAAiBC;AAAA,MAEhB,UAAAtB;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAqF,GAAQ,MAAMvF;AACduF,GAAQ,gBAAgBZ;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as i, jsxs as C } from "react/jsx-runtime";
2
2
  import { useState as N, useRef as Dt, useId as kt, useLayoutEffect as Ct, useMemo as rt } from "react";
3
- import Nt from "../Spinner.js";
3
+ import { Spinner as Nt } from "../Spinner.js";
4
4
  import { FOCUS_RING as Pt } from "../focusRing.js";
5
5
  import Et from "./TimeBarChartAxes.js";
6
6
  import St from "./TimeBarChartBars.js";
package/dist/index.d.ts CHANGED
@@ -5759,8 +5759,14 @@ export declare const SparkleIcon: React.FC<IconProps_110>;
5759
5759
 
5760
5760
  export declare const Spinner: default_2.FC<SpinnerProps>;
5761
5761
 
5762
- declare interface SpinnerProps {
5762
+ export declare interface SpinnerProps {
5763
5763
  size?: 'xxxsmall' | 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large';
5764
+ /** Names the wait: the spinner becomes a busy progressbar, as LoadingBar is. Without this or `aria-labelledby`, it stays decorative. */
5765
+ 'aria-label'?: string;
5766
+ /** Names the wait from visible text; assistive tech prefers it over `aria-label`. */
5767
+ 'aria-labelledby'?: string;
5768
+ /** Fills the viewport's height, so a page that is only waiting shows the spinner in its middle. */
5769
+ fillViewport?: boolean;
5764
5770
  className?: string;
5765
5771
  style?: default_2.CSSProperties;
5766
5772
  }
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ import { StepList as Je } from "./components/StepList.js";
72
72
  import { ChoiceGroup as Ye } from "./components/ChoiceGroup.js";
73
73
  import { LinkCard as qe } from "./components/LinkCard.js";
74
74
  import { ResourceCard as $e } from "./components/ResourceCard.js";
75
- import { default as er } from "./components/Spinner.js";
75
+ import { Spinner as er } from "./components/Spinner.js";
76
76
  import { NumberTag as tr } from "./components/NumberTag.js";
77
77
  import { Tag as fr } from "./components/Tag.js";
78
78
  import { default as mr } from "./components/Tabs.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/malachite",
3
- "version": "2.122.0",
3
+ "version": "2.123.0",
4
4
  "description": "StackOne's themeable React component library — Shadow DOM isolated, scoped Tailwind, theme-token driven.",
5
5
  "license": "MIT",
6
6
  "author": "StackOne",