@stackone/malachite 2.24.2 → 2.25.1

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,56 +1,67 @@
1
- import { jsx as o, jsxs as _ } from "react/jsx-runtime";
2
- import { FOCUS_RING_INSET as C } from "./focusRing.js";
3
- import { isRenderableNode as O } from "./renderableNode.js";
4
- import { FOREGROUND_RESET as $, SELECTED_TEXT_CONTEXT as k, SELECTED_ROW_ACCENT as D, SELECTED_ROW_FOREGROUND as j, SELECTED_ROW_BACKGROUND as S } from "./selectedRow.js";
5
- const A = "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)", F = ({
1
+ import { jsx as o, jsxs as C } from "react/jsx-runtime";
2
+ import { FOCUS_RING_INSET as $ } from "./focusRing.js";
3
+ import { isRenderableNode as k } from "./renderableNode.js";
4
+ import { FOREGROUND_RESET as D, SELECTED_TEXT_CONTEXT as j, SELECTED_ROW_ACCENT as F, SELECTED_ROW_FOREGROUND as A, SELECTED_ROW_BACKGROUND as y } from "./selectedRow.js";
5
+ const G = {
6
+ default: "",
7
+ muted: "bg-[var(--malachite-card-dimmed-background)]",
8
+ success: "bg-[var(--malachite-tag-success-background)]",
9
+ error: "bg-[var(--malachite-tag-error-background)]"
10
+ }, U = {
11
+ success: "var(--malachite-tag-success-foreground)",
12
+ error: "var(--malachite-tag-error-foreground)"
13
+ }, I = "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)", W = ({
6
14
  children: t,
7
- divider: m = !1,
15
+ divider: p = !1,
8
16
  disabled: a = !1,
9
17
  onClick: e,
10
18
  href: l,
11
- selected: s,
19
+ selected: c,
12
20
  selection: b,
13
21
  trailing: u,
14
- tone: h = "default",
22
+ tone: m = "default",
15
23
  role: r,
16
24
  "aria-label": n,
17
- "aria-labelledby": c,
25
+ "aria-labelledby": i,
18
26
  className: E = "",
19
- style: g
27
+ style: R
20
28
  }) => {
21
- const p = !!(e || l), R = a && p ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", N = h === "muted", w = [
29
+ const f = !!(e || l), w = a && f ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", O = m !== "default", S = [
22
30
  "w-full text-left border-0",
23
- N ? "bg-[var(--malachite-card-dimmed-background)]" : "",
24
- m ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
25
- R
26
- ].filter(Boolean).join(" "), f = [
27
- p ? `appearance-none ${N ? "" : "bg-transparent"} p-0 ${C}` : "",
28
- p && !a ? "cursor-pointer" : ""
29
- ].filter(Boolean).join(" "), v = [w, f, E].filter(Boolean).join(" "), x = { ...s && (b ? b === "highlight" : r !== "checkbox") ? {
30
- backgroundImage: `linear-gradient(${S}, ${S})`,
31
- color: j,
32
- boxShadow: `inset 2px 0 0 ${D}`,
33
- ...k
34
- } : {}, ...g }, i = r === "radio" || r === "checkbox" ? !!s : void 0, d = i === void 0 && s ? !0 : void 0, y = {
31
+ G[m],
32
+ p ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
33
+ w
34
+ ].filter(Boolean).join(" "), v = [
35
+ f ? `appearance-none ${O ? "" : "bg-transparent"} p-0 ${$}` : "",
36
+ f && !a ? "cursor-pointer" : ""
37
+ ].filter(Boolean).join(" "), h = [S, v, E].filter(Boolean).join(" "), T = c && (b ? b === "highlight" : r !== "checkbox") ? {
38
+ backgroundImage: `linear-gradient(${y}, ${y})`,
39
+ color: A,
40
+ boxShadow: `inset 2px 0 0 ${F}`,
41
+ ...j
42
+ } : {}, g = U[m], x = { ...g ? {
43
+ color: g,
44
+ "--malachite-ctx-text-primary": g
45
+ } : {}, ...T, ...R }, s = r === "radio" || r === "checkbox" ? !!c : void 0, d = s === void 0 && c ? !0 : void 0, N = {
35
46
  role: r,
36
- "aria-checked": i,
47
+ "aria-checked": s,
37
48
  "aria-current": d,
38
49
  "aria-label": n,
39
- "aria-labelledby": c,
50
+ "aria-labelledby": i,
40
51
  "aria-disabled": r && a ? !0 : void 0
41
52
  };
42
- if (O(u)) {
43
- const T = l && !a ? /* @__PURE__ */ o(
53
+ if (k(u)) {
54
+ const _ = l && !a ? /* @__PURE__ */ o(
44
55
  "a",
45
56
  {
46
57
  href: l,
47
58
  onClick: e,
48
- className: `${f} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
59
+ className: `${v} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
49
60
  role: r,
50
- "aria-checked": i,
61
+ "aria-checked": s,
51
62
  "aria-current": d,
52
63
  "aria-label": n,
53
- "aria-labelledby": c,
64
+ "aria-labelledby": i,
54
65
  children: t
55
66
  }
56
67
  ) : e ? /* @__PURE__ */ o(
@@ -59,26 +70,26 @@ const A = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0
59
70
  type: "button",
60
71
  onClick: e,
61
72
  disabled: a,
62
- className: `${f} border-0 flex-1 min-w-0 text-left`,
73
+ className: `${v} border-0 flex-1 min-w-0 text-left`,
63
74
  role: r,
64
- "aria-checked": i,
75
+ "aria-checked": s,
65
76
  "aria-current": d,
66
77
  "aria-label": n,
67
- "aria-labelledby": c,
78
+ "aria-labelledby": i,
68
79
  children: t
69
80
  }
70
81
  ) : (
71
82
  // The set goes here, not on the wrapper: `radio` and `checkbox` make their
72
83
  // descendants presentational, which would bury a control in the trailing slot.
73
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...y, children: t })
84
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...N, children: t })
74
85
  );
75
- return /* @__PURE__ */ _(
86
+ return /* @__PURE__ */ C(
76
87
  "div",
77
88
  {
78
- className: [w, "flex items-center", E].filter(Boolean).join(" "),
89
+ className: [S, "flex items-center", E].filter(Boolean).join(" "),
79
90
  style: x,
80
91
  children: [
81
- T,
92
+ _,
82
93
  /* @__PURE__ */ o("div", { className: "shrink-0 flex items-center", children: u })
83
94
  ]
84
95
  }
@@ -89,13 +100,13 @@ const A = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0
89
100
  {
90
101
  href: l,
91
102
  onClick: e,
92
- className: `${v} no-underline text-inherit`,
103
+ className: `${h} no-underline text-inherit`,
93
104
  style: x,
94
105
  role: r,
95
- "aria-checked": i,
106
+ "aria-checked": s,
96
107
  "aria-current": d,
97
108
  "aria-label": n,
98
- "aria-labelledby": c,
109
+ "aria-labelledby": i,
99
110
  children: t
100
111
  }
101
112
  ) : e ? /* @__PURE__ */ o(
@@ -104,40 +115,40 @@ const A = "0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0
104
115
  type: "button",
105
116
  onClick: e,
106
117
  disabled: a,
107
- className: v,
118
+ className: h,
108
119
  style: x,
109
120
  role: r,
110
- "aria-checked": i,
121
+ "aria-checked": s,
111
122
  "aria-current": d,
112
123
  "aria-label": n,
113
- "aria-labelledby": c,
124
+ "aria-labelledby": i,
114
125
  children: t
115
126
  }
116
- ) : /* @__PURE__ */ o("div", { className: v, style: x, ...y, children: t });
117
- }, G = ({
127
+ ) : /* @__PURE__ */ o("div", { className: h, style: x, ...N, children: t });
128
+ }, B = ({
118
129
  children: t,
119
- padding: m = !1,
130
+ padding: p = !1,
120
131
  overflow: a = "hidden",
121
132
  role: e,
122
133
  "aria-label": l,
123
- "aria-labelledby": s,
134
+ "aria-labelledby": c,
124
135
  className: b = "",
125
136
  style: u
126
137
  }) => /* @__PURE__ */ o(
127
138
  "div",
128
139
  {
129
- className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${a === "clip" ? "overflow-clip" : a === "visible" ? "overflow-visible" : "overflow-hidden"} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${m ? "py-3 px-4" : ""} ${b}`,
130
- style: { boxShadow: A, ...$, ...u },
140
+ className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${a === "clip" ? "overflow-clip" : a === "visible" ? "overflow-visible" : "overflow-hidden"} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${p ? "py-3 px-4" : ""} ${b}`,
141
+ style: { boxShadow: I, ...D, ...u },
131
142
  role: e,
132
143
  "aria-label": l,
133
- "aria-labelledby": s,
144
+ "aria-labelledby": c,
134
145
  children: t
135
146
  }
136
147
  );
137
- G.Row = F;
148
+ B.Row = W;
138
149
  export {
139
- G as Surface,
140
- F as SurfaceRow,
141
- G as default
150
+ B as Surface,
151
+ W as SurfaceRow,
152
+ B as default
142
153
  };
143
154
  //# sourceMappingURL=Surface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\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 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.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport interface SurfaceRowProps {\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 /**\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 /** 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. */\n selected?: boolean;\n /** How a `selected` row shows it. `highlight` paints the treatment; `announce` leaves the\n * visual to a control inside the row and only sets the ARIA state. Defaults to `announce`\n * under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'announce';\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /** `muted` tints a row whose subject is inactive — not disabled: it stays interactive. */\n tone?: 'default' | 'muted';\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 className?: string;\n style?: React.CSSProperties;\n}\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<SurfaceRowProps> = ({\n children,\n divider = false,\n disabled = false,\n onClick,\n href,\n selected,\n selection,\n trailing,\n tone = 'default',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}) => {\n const interactive = Boolean(onClick || href);\n const hover =\n disabled && interactive\n ? ''\n : 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]';\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 muted = tone === 'muted';\n const toneClass = muted ? 'bg-[var(--malachite-card-dimmed-background)]' : '';\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 controlClasses = [\n interactive\n ? `appearance-none ${muted ? '' : 'bg-transparent'} p-0 ${FOCUS_RING_INSET}`\n : '',\n interactive && !disabled ? 'cursor-pointer' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const classes = [chromeClasses, controlClasses, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection === 'highlight' : role !== 'checkbox';\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 && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}`,\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const rowStyle = { ...selectedStyle, ...style };\n\n const ariaChecked = role === 'radio' || role === 'checkbox' ? Boolean(selected) : 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 : 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 (isRenderableNode(trailing)) {\n const control =\n href && !disabled ? (\n <a\n href={href}\n onClick={onClick}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left no-underline text-inherit`}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </a>\n ) : onClick ? (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left`}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\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 <div className=\"flex-1 min-w-0\" {...rowFallbackAria}>\n {children}\n </div>\n );\n\n return (\n <div\n className={[chromeClasses, 'flex items-center', className]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n >\n {control}\n <div className=\"shrink-0 flex items-center\">{trailing}</div>\n </div>\n );\n }\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n onClick={onClick}\n className={`${classes} no-underline text-inherit`}\n style={rowStyle}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\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 role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {children}\n </div>\n );\n};\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<SurfaceRowProps>;\n}\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\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 overflowClass =\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} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${padding ? 'py-3 px-4' : ''} ${className}`}\n style={{ boxShadow: TRIPLE_SHADOW, ...FOREGROUND_RESET, ...style }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow };\n"],"names":["TRIPLE_SHADOW","SurfaceRow","children","divider","disabled","onClick","href","selected","selection","trailing","tone","role","ariaLabel","ariaLabelledBy","className","style","interactive","hover","muted","chromeClasses","controlClasses","FOCUS_RING_INSET","classes","rowStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","ariaChecked","ariaCurrent","rowFallbackAria","isRenderableNode","control","jsx","jsxs","Surface","padding","overflow","FOREGROUND_RESET"],"mappings":";;;;AAgEA,MAAMA,IACF,yGASEC,IAAwC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC;AAAA,EACA,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAM;AACF,QAAMC,IAAc,GAAQX,KAAWC,IACjCW,IACFb,KAAYY,IACN,KACA,6EAKJE,IAAQR,MAAS,SAGjBS,IAAgB;AAAA,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AAA+B,EAAC,SAAI,WAAWX,GAAS,OAAOC,GAAW,GAAGO,GACzC,UAAA5B,GACL;AAER,GAMMiC,IAAW,CAAC;AAAA,EACd,UAAAjC;AAAA,EACA,SAAAkC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,MAAA1B;AAAA,EACA,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MASQ,gBAAAkB;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qDAPfI,MAAa,SACP,kBACAA,MAAa,YACX,qBACA,iBAGyE,oGAAoGD,IAAU,cAAc,EAAE,IAAItB,CAAS;AAAA,IACxN,OAAO,EAAE,WAAWd,GAAe,GAAGsC,GAAkB,GAAGvB,EAAA;AAAA,IAC3D,MAAAJ;AAAA,IACA,cAAYC;AAAA,IACZ,mBAAiBC;AAAA,IAEhB,UAAAX;AAAA,EAAA;AAAA;AAKbiC,EAAQ,MAAMlC;"}
1
+ {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\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 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.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport interface SurfaceRowProps {\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 /**\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 /** 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. */\n selected?: boolean;\n /** How a `selected` row shows it. `highlight` paints the treatment; `announce` leaves the\n * visual to a control inside the row and only sets the ARIA state. Defaults to `announce`\n * under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'announce';\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\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` and `error` are for a row that carries\n * an outcome, where the result belongs to the whole line rather than to one cell in it.\n */\n tone?: 'default' | 'muted' | 'success' | 'error';\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 className?: string;\n style?: React.CSSProperties;\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)]',\n error: 'bg-[var(--malachite-tag-error-background)]',\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)',\n error: 'var(--malachite-tag-error-foreground)',\n};\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<SurfaceRowProps> = ({\n children,\n divider = false,\n disabled = false,\n onClick,\n href,\n selected,\n selection,\n trailing,\n tone = 'default',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}) => {\n const interactive = Boolean(onClick || href);\n const hover =\n disabled && interactive\n ? ''\n : 'transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]';\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 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 controlClasses = [\n interactive\n ? `appearance-none ${tinted ? '' : 'bg-transparent'} p-0 ${FOCUS_RING_INSET}`\n : '',\n interactive && !disabled ? 'cursor-pointer' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const classes = [chromeClasses, controlClasses, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection === 'highlight' : role !== 'checkbox';\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 && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n 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 const ariaChecked = role === 'radio' || role === 'checkbox' ? Boolean(selected) : 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 : 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 (isRenderableNode(trailing)) {\n const control =\n href && !disabled ? (\n <a\n href={href}\n onClick={onClick}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left no-underline text-inherit`}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </a>\n ) : onClick ? (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={`${controlClasses} border-0 flex-1 min-w-0 text-left`}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\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 <div className=\"flex-1 min-w-0\" {...rowFallbackAria}>\n {children}\n </div>\n );\n\n return (\n <div\n className={[chromeClasses, 'flex items-center', className]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n >\n {control}\n <div className=\"shrink-0 flex items-center\">{trailing}</div>\n </div>\n );\n }\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n onClick={onClick}\n className={`${classes} no-underline text-inherit`}\n style={rowStyle}\n role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\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 role={role}\n aria-checked={ariaChecked}\n aria-current={ariaCurrent}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {children}\n </div>\n );\n};\n\ninterface SurfaceComponent extends React.FC<SurfaceProps> {\n Row: React.FC<SurfaceRowProps>;\n}\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\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 overflowClass =\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} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${padding ? 'py-3 px-4' : ''} ${className}`}\n style={{ boxShadow: TRIPLE_SHADOW, ...FOREGROUND_RESET, ...style }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow };\n"],"names":["TONE_CLASSES","TONE_FOREGROUNDS","TRIPLE_SHADOW","SurfaceRow","children","divider","disabled","onClick","href","selected","selection","trailing","tone","role","ariaLabel","ariaLabelledBy","className","style","interactive","hover","tinted","chromeClasses","controlClasses","FOCUS_RING_INSET","classes","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","isRenderableNode","control","jsx","jsxs","Surface","padding","overflow","FOREGROUND_RESET"],"mappings":";;;;AAwEA,MAAMA,IAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,IAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAEMC,IACF,yGASEC,IAAwC,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,MAAAC;AAAA,EACA,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAM;AACF,QAAMC,IAAc,GAAQX,KAAWC,IACjCW,IACFb,KAAYY,IACN,KACA,6EAKJE,IAASR,MAAS,WAGlBS,IAAgB;AAAA,IAClB;AAAA,IAHcrB,EAAaY,CAAI;AAAA,IAK/BP,IAAU,gEAAgE;AAAA,IAC1Ec;AAAA,EAAA,EAEC,O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X;AAAA,IAAA;AAAA,EAAA,IAMT,gBAAAiC,EAAC,SAAI,WAAWb,GAAS,OAAOO,GAAW,GAAGG,GACzC,UAAA9B,GACL;AAER,GAMMmC,IAAW,CAAC;AAAA,EACd,UAAAnC;AAAA,EACA,SAAAoC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,MAAA5B;AAAA,EACA,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MASQ,gBAAAoB;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qDAPfI,MAAa,SACP,kBACAA,MAAa,YACX,qBACA,iBAGyE,oGAAoGD,IAAU,cAAc,EAAE,IAAIxB,CAAS;AAAA,IACxN,OAAO,EAAE,WAAWd,GAAe,GAAGwC,GAAkB,GAAGzB,EAAA;AAAA,IAC3D,MAAAJ;AAAA,IACA,cAAYC;AAAA,IACZ,mBAAiBC;AAAA,IAEhB,UAAAX;AAAA,EAAA;AAAA;AAKbmC,EAAQ,MAAMpC;"}
package/dist/index.d.ts CHANGED
@@ -15,10 +15,12 @@ declare interface AccordionBaseProps {
15
15
  className?: string;
16
16
  children?: default_2.ReactNode;
17
17
  /**
18
- * Visual style. `default` is the flat list row (arrow leading, row dividers,
19
- * hover background). `sunken` draws the section as a sunken card (dimmed
20
- * rounded container, arrow pinned right, no dividers/hover) — used for stacked
21
- * detail sections in side panels and detail pages (see `CollapsibleSection`).
18
+ * Visual style. `default` is the flat list row (row dividers, hover background).
19
+ * `sunken` draws the section as a sunken card (dimmed rounded container, no
20
+ * dividers/hover) — used for stacked detail sections in side panels and detail
21
+ * pages (see `CollapsibleSection`). Both lead with the arrow: it is the affordance
22
+ * that says the section opens, and a reader scanning a stack of them finds it in
23
+ * one column rather than at whatever width each header happens to end.
22
24
  */
23
25
  variant?: 'default' | 'sunken';
24
26
  /**
@@ -4001,8 +4003,12 @@ export declare interface SurfaceRowProps {
4001
4003
  selection?: 'highlight' | 'announce';
4002
4004
  /** Content pinned right, outside the row button, so it may hold its own control. */
4003
4005
  trailing?: default_2.ReactNode;
4004
- /** `muted` tints a row whose subject is inactive — not disabled: it stays interactive. */
4005
- tone?: 'default' | 'muted';
4006
+ /**
4007
+ * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —
4008
+ * not disabled: it stays interactive. `success` and `error` are for a row that carries
4009
+ * an outcome, where the result belongs to the whole line rather than to one cell in it.
4010
+ */
4011
+ tone?: 'default' | 'muted' | 'success' | 'error';
4006
4012
  /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */
4007
4013
  role?: default_2.AriaRole;
4008
4014
  'aria-label'?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/malachite",
3
- "version": "2.24.2",
3
+ "version": "2.25.1",
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",