@stackone/malachite 2.70.0 → 2.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,227 +1,232 @@
1
- import { jsx as o, jsxs as k } from "react/jsx-runtime";
2
- import P from "react";
3
- import { paintOnChild as U } from "./asChild.js";
4
- import { DisclosureArrow as W } from "./DisclosureArrow.js";
5
- import { FOCUS_RING_INSET as A } from "./focusRing.js";
6
- import { resolveRel as $ } from "./linkRel.js";
7
- import { safeHref as X } from "./safeHref.js";
8
- import { isRenderableNode as H } from "./renderableNode.js";
9
- import { FOREGROUND_RESET as z, SELECTED_TEXT_CONTEXT as K, SELECTED_ROW_ACCENT as V, SELECTED_ROW_FOREGROUND as q, SELECTED_ROW_BACKGROUND as D } from "./selectedRow.js";
10
- const J = {
1
+ import { jsx as o, jsxs as _ } from "react/jsx-runtime";
2
+ import z from "react";
3
+ import { paintOnChild as K } from "./asChild.js";
4
+ import { DisclosureArrow as V } from "./DisclosureArrow.js";
5
+ import { FOCUS_RING_INSET as B } from "./focusRing.js";
6
+ import { resolveRel as L } from "./linkRel.js";
7
+ import { safeHref as q } from "./safeHref.js";
8
+ import { isRenderableNode as J } from "./renderableNode.js";
9
+ import { FOREGROUND_RESET as M, SELECTED_TEXT_CONTEXT as Q, SELECTED_ROW_ACCENT as Y, SELECTED_ROW_FOREGROUND as Z, SELECTED_ROW_BACKGROUND as I } from "./selectedRow.js";
10
+ const ee = {
11
+ none: "",
12
+ compact: "px-[16px] py-[8px]"
13
+ }, ae = {
11
14
  default: "",
12
15
  muted: "bg-[var(--malachite-card-dimmed-background)]",
13
16
  success: "bg-[var(--malachite-tag-success-background)]",
14
17
  error: "bg-[var(--malachite-tag-error-background)]"
15
- }, M = {
18
+ }, re = {
16
19
  success: "var(--malachite-tag-success-foreground)",
17
20
  error: "var(--malachite-tag-error-foreground)"
18
- }, Q = "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", Y = "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)", L = (t) => {
21
+ }, oe = "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", 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)", j = (t) => {
19
22
  const {
20
23
  children: a,
21
24
  divider: r = !1,
22
25
  disabled: e = !1,
23
- selected: i,
24
- selection: b,
26
+ selected: n,
27
+ selection: d,
25
28
  tone: s = "default",
26
- className: u = "",
27
- style: g
28
- } = t, d = t.asChild === !0, {
29
- onClick: n,
30
- href: E,
31
- target: c,
32
- rel: y,
33
- trailing: S,
34
- revealTrailing: _,
35
- role: l
36
- } = d ? {} : t, p = X(E), f = d ? void 0 : t["aria-label"], h = d ? void 0 : t["aria-labelledby"], N = !!(n || p), I = e && (N || d) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", j = s !== "default", O = [
29
+ inset: m = "none",
30
+ className: f = "",
31
+ style: C
32
+ } = t, c = t.asChild === !0, {
33
+ onClick: l,
34
+ href: b,
35
+ target: u,
36
+ rel: O,
37
+ trailing: T,
38
+ revealTrailing: $,
39
+ role: i
40
+ } = c ? {} : t, h = q(b), x = c ? void 0 : t["aria-label"], v = c ? void 0 : t["aria-labelledby"], N = !!(l || h), P = e && (N || c) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", G = s !== "default", U = ae[s], w = !c && J(T), S = ee[m], W = S && !w ? "" : "p-0", D = [
37
41
  "w-full text-left border-0",
38
- J[s],
42
+ U,
39
43
  r ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
40
- I
41
- ].filter(Boolean).join(" "), w = [
42
- N ? `appearance-none ${j ? "" : "bg-transparent"} p-0 ${A}` : "",
44
+ P
45
+ ].filter(Boolean).join(" "), R = [
46
+ N ? `appearance-none ${G ? "" : "bg-transparent"} ${W} ${B}` : "",
43
47
  N && !e ? "cursor-pointer" : ""
44
- ].filter(Boolean).join(" "), C = [O, w, u].filter(Boolean).join(" "), F = i === !0 && (b ? b === "highlight" : l !== "checkbox") ? {
45
- backgroundImage: `linear-gradient(${D}, ${D})`,
46
- color: q,
47
- boxShadow: `inset 2px 0 0 ${V}`,
48
- ...K
49
- } : {}, R = M[s], x = { ...R ? {
50
- color: R,
51
- "--malachite-ctx-text-primary": R
52
- } : {}, ...F, ...g }, m = l === "checkbox" && i === "mixed" ? "mixed" : l === "radio" || l === "checkbox" ? i === !0 : void 0, v = m === void 0 && i === !0 ? !0 : void 0, T = {
53
- role: l,
54
- "aria-checked": m,
55
- "aria-current": v,
56
- "aria-label": f,
57
- "aria-labelledby": h,
58
- "aria-disabled": l && e ? !0 : void 0
48
+ ].filter(Boolean).join(" "), y = [D, R, w ? "" : S, f].filter(Boolean).join(" "), X = n === !0 && (d ? d === "highlight" : i !== "checkbox") ? {
49
+ backgroundImage: `linear-gradient(${I}, ${I})`,
50
+ color: Z,
51
+ boxShadow: `inset 2px 0 0 ${Y}`,
52
+ ...Q
53
+ } : {}, k = re[s], g = { ...k ? {
54
+ color: k,
55
+ "--malachite-ctx-text-primary": k
56
+ } : {}, ...X, ...C }, p = i === "checkbox" && n === "mixed" ? "mixed" : i === "radio" || i === "checkbox" ? n === !0 : void 0, E = p === void 0 && n === !0 ? !0 : void 0, A = {
57
+ role: i,
58
+ "aria-checked": p,
59
+ "aria-current": E,
60
+ "aria-label": x,
61
+ "aria-labelledby": v,
62
+ "aria-disabled": i && e ? !0 : void 0
59
63
  };
60
- if (d)
61
- return U(a, C, x);
62
- if (H(S)) {
63
- const G = p && !e ? /* @__PURE__ */ o(
64
+ if (c)
65
+ return K(a, y, g);
66
+ if (w) {
67
+ const H = h && !e ? /* @__PURE__ */ o(
64
68
  "a",
65
69
  {
66
- href: p,
67
- target: c,
68
- rel: $(y, c),
69
- onClick: n,
70
- className: `${w} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
71
- role: l,
72
- "aria-checked": m,
73
- "aria-current": v,
74
- "aria-label": f,
75
- "aria-labelledby": h,
70
+ href: h,
71
+ target: u,
72
+ rel: L(O, u),
73
+ onClick: l,
74
+ className: `${R} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
75
+ role: i,
76
+ "aria-checked": p,
77
+ "aria-current": E,
78
+ "aria-label": x,
79
+ "aria-labelledby": v,
76
80
  children: a
77
81
  }
78
- ) : n ? /* @__PURE__ */ o(
82
+ ) : l ? /* @__PURE__ */ o(
79
83
  "button",
80
84
  {
81
85
  type: "button",
82
- onClick: n,
86
+ onClick: l,
83
87
  disabled: e,
84
- className: `${w} border-0 flex-1 min-w-0 text-left`,
85
- role: l,
86
- "aria-checked": m,
87
- "aria-current": v,
88
- "aria-label": f,
89
- "aria-labelledby": h,
88
+ className: `${R} border-0 flex-1 min-w-0 text-left`,
89
+ role: i,
90
+ "aria-checked": p,
91
+ "aria-current": E,
92
+ "aria-label": x,
93
+ "aria-labelledby": v,
90
94
  children: a
91
95
  }
92
96
  ) : (
93
97
  // The set goes here, not on the wrapper: `radio` and `checkbox` make their
94
98
  // descendants presentational, which would bury a control in the trailing slot.
95
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...T, children: a })
99
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", ...A, children: a })
96
100
  );
97
- return /* @__PURE__ */ k(
101
+ return /* @__PURE__ */ _(
98
102
  "div",
99
103
  {
100
104
  className: [
101
- O,
105
+ D,
102
106
  "flex items-center",
103
- _ ? "group/row" : "",
104
- u
107
+ S,
108
+ $ ? "group/row" : "",
109
+ f
105
110
  ].filter(Boolean).join(" "),
106
- style: x,
111
+ style: g,
107
112
  children: [
108
- G,
113
+ H,
109
114
  /* @__PURE__ */ o(
110
115
  "div",
111
116
  {
112
- className: `shrink-0 flex items-center ${_ ? Q : ""}`,
113
- children: S
117
+ className: `shrink-0 flex items-center ${$ ? oe : ""}`,
118
+ children: T
114
119
  }
115
120
  )
116
121
  ]
117
122
  }
118
123
  );
119
124
  }
120
- return p && !e ? /* @__PURE__ */ o(
125
+ return h && !e ? /* @__PURE__ */ o(
121
126
  "a",
122
127
  {
123
- href: p,
124
- target: c,
125
- rel: $(y, c),
126
- onClick: n,
127
- className: `${C} no-underline text-inherit`,
128
- style: x,
129
- role: l,
130
- "aria-checked": m,
131
- "aria-current": v,
132
- "aria-label": f,
133
- "aria-labelledby": h,
128
+ href: h,
129
+ target: u,
130
+ rel: L(O, u),
131
+ onClick: l,
132
+ className: `${y} no-underline text-inherit`,
133
+ style: g,
134
+ role: i,
135
+ "aria-checked": p,
136
+ "aria-current": E,
137
+ "aria-label": x,
138
+ "aria-labelledby": v,
134
139
  children: a
135
140
  }
136
- ) : n ? /* @__PURE__ */ o(
141
+ ) : l ? /* @__PURE__ */ o(
137
142
  "button",
138
143
  {
139
144
  type: "button",
140
- onClick: n,
145
+ onClick: l,
141
146
  disabled: e,
142
- className: C,
143
- style: x,
144
- role: l,
145
- "aria-checked": m,
146
- "aria-current": v,
147
- "aria-label": f,
148
- "aria-labelledby": h,
147
+ className: y,
148
+ style: g,
149
+ role: i,
150
+ "aria-checked": p,
151
+ "aria-current": E,
152
+ "aria-label": x,
153
+ "aria-labelledby": v,
149
154
  children: a
150
155
  }
151
- ) : /* @__PURE__ */ o("div", { className: C, style: x, ...T, children: a });
152
- }, Z = ({ children: t, className: a = "", style: r }) => /* @__PURE__ */ o("div", { className: a, style: r, onClick: (e) => e.stopPropagation(), children: t }), me = 39, ee = Object.assign(
156
+ ) : /* @__PURE__ */ o("div", { className: y, style: g, ...A, children: a });
157
+ }, le = ({ children: t, className: a = "", style: r }) => /* @__PURE__ */ o("div", { className: a, style: r, onClick: (e) => e.stopPropagation(), children: t }), ve = 39, ie = Object.assign(
153
158
  ({
154
159
  header: t,
155
160
  children: a,
156
161
  expanded: r,
157
162
  onToggle: e,
158
- sticky: i = !1,
159
- stickyTopOffset: b = 0,
163
+ sticky: n = !1,
164
+ stickyTopOffset: d = 0,
160
165
  divider: s = !1,
161
- tone: u = "default",
162
- "aria-label": g,
163
- className: d = "",
164
- style: n
166
+ tone: m = "default",
167
+ "aria-label": f,
168
+ className: C = "",
169
+ style: c
165
170
  }) => {
166
- const E = P.useId(), c = e ? () => e(!r) : void 0;
167
- return /* @__PURE__ */ k(L, { divider: s, tone: u, className: d, style: n, children: [
168
- /* @__PURE__ */ k(
171
+ const l = z.useId(), b = e ? () => e(!r) : void 0;
172
+ return /* @__PURE__ */ _(j, { divider: s, tone: m, className: C, style: c, children: [
173
+ /* @__PURE__ */ _(
169
174
  "div",
170
175
  {
171
- className: `group flex items-center w-full ${c ? "cursor-pointer" : ""} ${i && r ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
172
- style: i && r ? { top: b } : void 0,
173
- onClick: c,
176
+ className: `group flex items-center w-full ${b ? "cursor-pointer" : ""} ${n && r ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
177
+ style: n && r ? { top: d } : void 0,
178
+ onClick: b,
174
179
  role: "presentation",
175
180
  children: [
176
- /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center pl-[16px] pr-[12px]", children: c && /* @__PURE__ */ o(
181
+ /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center pl-[16px] pr-[12px]", children: b && /* @__PURE__ */ o(
177
182
  "button",
178
183
  {
179
184
  type: "button",
180
- className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${A}`,
185
+ className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${B}`,
181
186
  "aria-expanded": r,
182
- "aria-controls": E,
183
- "aria-label": g,
184
- onClick: (y) => {
185
- y.stopPropagation(), c();
187
+ "aria-controls": l,
188
+ "aria-label": f,
189
+ onClick: (u) => {
190
+ u.stopPropagation(), b();
186
191
  },
187
- children: /* @__PURE__ */ o(W, { expanded: r })
192
+ children: /* @__PURE__ */ o(V, { expanded: r })
188
193
  }
189
194
  ) }),
190
195
  t
191
196
  ]
192
197
  }
193
198
  ),
194
- r && /* @__PURE__ */ o("div", { id: E, children: a })
199
+ r && /* @__PURE__ */ o("div", { id: l, children: a })
195
200
  ] });
196
201
  },
197
- { Controls: Z }
198
- ), B = ({
202
+ { Controls: le }
203
+ ), F = ({
199
204
  children: t,
200
205
  padding: a = !1,
201
206
  overflow: r = "hidden",
202
207
  role: e,
203
- "aria-label": i,
204
- "aria-labelledby": b,
208
+ "aria-label": n,
209
+ "aria-labelledby": d,
205
210
  className: s = "",
206
- style: u
211
+ style: m
207
212
  }) => /* @__PURE__ */ o(
208
213
  "div",
209
214
  {
210
215
  className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${r === "clip" ? "overflow-clip" : r === "visible" ? "overflow-visible" : "overflow-hidden"} bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)] ${a ? "py-3 px-4" : ""} ${s}`,
211
- style: { boxShadow: Y, ...z, ...u },
216
+ style: { boxShadow: te, ...M, ...m },
212
217
  role: e,
213
- "aria-label": i,
214
- "aria-labelledby": b,
218
+ "aria-label": n,
219
+ "aria-labelledby": d,
215
220
  children: t
216
221
  }
217
222
  );
218
- B.Row = L;
219
- B.ExpandableRow = ee;
223
+ F.Row = j;
224
+ F.ExpandableRow = ie;
220
225
  export {
221
- me as EXPANDABLE_ROW_LEAD_PX,
222
- B as Surface,
223
- ee as SurfaceExpandableRow,
224
- L as SurfaceRow,
225
- B as default
226
+ ve as EXPANDABLE_ROW_LEAD_PX,
227
+ F as Surface,
228
+ ie as SurfaceExpandableRow,
229
+ j as SurfaceRow,
230
+ F as default
226
231
  };
227
232
  //# sourceMappingURL=Surface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport { paintOnChild } from './asChild';\nimport DisclosureArrow from './DisclosureArrow';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\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\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; `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 /**\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 className?: string;\n style?: React.CSSProperties;\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 /** 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}\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\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 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 selected,\n selection,\n tone = 'default',\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 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 interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover =\n disabled && (interactive || asChild)\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 === true && 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 // 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, classes, rowStyle);\n }\n\n if (isRenderableNode(trailing)) {\n const control =\n href && !disabled ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\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={[\n chromeClasses,\n 'flex items-center',\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n >\n {trailing}\n </div>\n </div>\n );\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`}\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\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 <SurfaceRow divider={divider} tone={tone} className={className} style={style}>\n {/* `group` so the arrow takes its hover state from the whole row. */}\n <div\n className={`group flex items-center w-full ${toggle ? 'cursor-pointer' : ''} ${\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 = (({\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;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","selected","selection","tone","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","role","href","safeHref","ariaLabel","ariaLabelledBy","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","paintOnChild","isRenderableNode","control","jsx","resolveRel","jsxs","ExpandableRowControls","event","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","Surface","padding","overflow","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA2FA,MAAMA,IAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,IAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,IACF,0KAEEC,IACF,yGASEC,IAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,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D;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEJC,KAAY,gBAAAR,EAAC,OAAA,EAAI,IAAIY,GAAS,UAAApD,EAAA,CAAS;AAAA,IAAA,GAC5C;AAAA,EAER;AAAA,EACA,EAAE,UAAU2C,EAAA;AAChB,GAOMa,IAAW,CAAC;AAAA,EACd,UAAAxD;AAAA,EACA,SAAAyD,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,MAAA3C;AAAA,EACA,cAAcG;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAb,IAAY;AAAA,EACZ,OAAAC;AACJ,MASQ,gBAAAiC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qDAPfkB,MAAa,SACP,kBACAA,MAAa,YACX,qBACA,iBAGyE,oGAAoGD,IAAU,cAAc,EAAE,IAAInD,CAAS;AAAA,IACxN,OAAO,EAAE,WAAWT,GAAe,GAAG8D,GAAkB,GAAGpD,EAAA;AAAA,IAC3D,MAAAQ;AAAA,IACA,cAAYG;AAAA,IACZ,mBAAiBC;AAAA,IAEhB,UAAAnB;AAAA,EAAA;AAAA;AAKbwD,EAAQ,MAAM1D;AACd0D,EAAQ,gBAAgBV;"}
1
+ {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport { paintOnChild } from './asChild';\nimport DisclosureArrow from './DisclosureArrow';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { safeHref } from './safeHref';\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\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; `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 /**\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 /** `compact` is an 8px by 16px inset the row owns. */\n inset?: 'none' | 'compact';\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst INSET_CLASSES: Record<NonNullable<SurfaceRowChromeProps['inset']>, string> = {\n none: '',\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 /** 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}\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\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 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 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 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 interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover =\n disabled && (interactive || asChild)\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 hasTrailing = !asChild && isRenderableNode(trailing);\n const insetClass = INSET_CLASSES[inset];\n const controlPadding = insetClass && !hasTrailing ? '' : '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 controlClasses = [\n interactive\n ? `appearance-none ${tinted ? '' : 'bg-transparent'} ${controlPadding} ${FOCUS_RING_INSET}`\n : '',\n interactive && !disabled ? 'cursor-pointer' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const classes = [chromeClasses, controlClasses, hasTrailing ? '' : insetClass, className]\n .filter(Boolean)\n .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 === true && 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 // 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, classes, rowStyle);\n }\n\n if (hasTrailing) {\n const control =\n href && !disabled ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\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={[\n chromeClasses,\n 'flex items-center',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n >\n {trailing}\n </div>\n </div>\n );\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`}\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\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 <SurfaceRow divider={divider} tone={tone} className={className} style={style}>\n {/* `group` so the arrow takes its hover state from the whole row. */}\n <div\n className={`group flex items-center w-full ${toggle ? 'cursor-pointer' : ''} ${\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 = (({\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;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","selected","selection","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","role","href","safeHref","ariaLabel","ariaLabelledBy","interactive","hover","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlClasses","FOCUS_RING_INSET","classes","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","control","jsx","resolveRel","jsxs","ExpandableRowControls","event","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","Surface","padding","overflow","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA4DA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA,EACN,SAAS;AACb,GAmCMC,KAAqE;AAAA,EACvE,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACX,GAUMC,KAAkF;AAAA,EACpF,SAAS;AAAA,EACT,OAAO;AACX,GAaMC,KACF,0KAEEC,KACF,yGASEC,IAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAA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AAM,gBAAA,GACNU,EAAA;AAAA,gBACJ;AAAA,gBAEA,UAAA,gBAAAd,EAACe,KAAgB,UAAAP,EAAA,CAAoB;AAAA,cAAA;AAAA,YAAA,GAGjD;AAAA,YACCD;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEJC,KAAY,gBAAAR,EAAC,OAAA,EAAI,IAAIY,GAAS,UAAAzD,EAAA,CAAS;AAAA,IAAA,GAC5C;AAAA,EAER;AAAA,EACA,EAAE,UAAUgD,GAAA;AAChB,GAOMa,IAAW,CAAC;AAAA,EACd,UAAA7D;AAAA,EACA,SAAA8D,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,MAAA/C;AAAA,EACA,cAAcG;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAb,IAAY;AAAA,EACZ,OAAAC;AACJ,MASQ,gBAAAqC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qDAPfkB,MAAa,SACP,kBACAA,MAAa,YACX,qBACA,iBAGyE,oGAAoGD,IAAU,cAAc,EAAE,IAAIvD,CAAS;AAAA,IACxN,OAAO,EAAE,WAAWV,IAAe,GAAGmE,GAAkB,GAAGxD,EAAA;AAAA,IAC3D,MAAAQ;AAAA,IACA,cAAYG;AAAA,IACZ,mBAAiBC;AAAA,IAEhB,UAAApB;AAAA,EAAA;AAAA;AAKb6D,EAAQ,MAAM/D;AACd+D,EAAQ,gBAAgBV;"}
@@ -1,58 +1,65 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- const p = 200, _ = 160, d = 200, i = 260, x = 8, I = {
2
+ const _ = 200, i = 160, x = 200, I = 260, b = 8, f = {
3
3
  none: "",
4
4
  compact: "px-[12px] py-[8px]",
5
5
  default: "px-[16px] py-[12px]"
6
+ }, L = {
7
+ card: "bg-[var(--malachite-card-background)]",
8
+ page: "bg-[var(--malachite-card-sunken-background)]"
6
9
  }, T = ({
7
- children: l,
8
- minWidth: e = d,
9
- className: o = "",
10
- style: t
10
+ children: a,
11
+ minWidth: e = x,
12
+ className: t = "",
13
+ style: l
11
14
  }) => /* @__PURE__ */ s(
12
15
  "div",
13
16
  {
14
- className: o,
15
- style: { flex: `100 1 ${i}px`, minWidth: e, ...t },
16
- children: l
17
+ className: t,
18
+ style: { flex: `100 1 ${I}px`, minWidth: e, ...l },
19
+ children: a
17
20
  }
18
- ), f = ({
19
- children: l,
20
- width: e = p,
21
- minWidth: o = _,
22
- grow: t = !0,
23
- className: a = "",
21
+ ), u = ({
22
+ children: a,
23
+ width: e = _,
24
+ minWidth: t = i,
25
+ grow: l = !0,
26
+ className: o = "",
24
27
  style: r
25
- }) => /* @__PURE__ */ s("div", { className: a, style: { flex: `${t ? 1 : 0} 1 ${e}px`, minWidth: o, ...r }, children: l }), c = ({
26
- children: l,
28
+ }) => /* @__PURE__ */ s("div", { className: o, style: { flex: `${l ? 1 : 0} 1 ${e}px`, minWidth: t, ...r }, children: a }), c = ({
29
+ children: a,
27
30
  divider: e = !1,
28
- padding: o = "default",
29
- layout: t = "plain",
30
- className: a = "",
31
- style: r
31
+ padding: t = "default",
32
+ layout: l = "plain",
33
+ surface: o = "card",
34
+ sticky: r = !1,
35
+ className: n = "",
36
+ style: d
32
37
  }) => {
33
- const n = [
34
- "w-full bg-[var(--malachite-card-background)]",
35
- I[o],
38
+ const p = [
39
+ "w-full",
40
+ L[o],
41
+ r ? "sticky top-0 z-10" : "",
42
+ f[t],
36
43
  e ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : "",
37
- a
44
+ n
38
45
  ].filter(Boolean).join(" ");
39
- return /* @__PURE__ */ s("div", { className: n, style: { ...t === "filters" ? {
46
+ return /* @__PURE__ */ s("div", { className: p, style: { ...l === "filters" ? {
40
47
  display: "flex",
41
48
  alignItems: "center",
42
49
  flexWrap: "wrap",
43
- gap: x
44
- } : {}, ...r }, children: l });
50
+ gap: b
51
+ } : {}, ...d }, children: a });
45
52
  };
46
53
  c.Fill = T;
47
- c.Item = f;
54
+ c.Item = u;
48
55
  export {
49
- i as TOOLBAR_FILL_BASIS_PX,
50
- d as TOOLBAR_FILL_MIN_WIDTH_PX,
51
- _ as TOOLBAR_FILTER_MIN_WIDTH_PX,
52
- p as TOOLBAR_FILTER_WIDTH_PX,
56
+ I as TOOLBAR_FILL_BASIS_PX,
57
+ x as TOOLBAR_FILL_MIN_WIDTH_PX,
58
+ i as TOOLBAR_FILTER_MIN_WIDTH_PX,
59
+ _ as TOOLBAR_FILTER_WIDTH_PX,
53
60
  c as Toolbar,
54
61
  T as ToolbarFill,
55
- f as ToolbarItem,
62
+ u as ToolbarItem,
56
63
  c as default
57
64
  };
58
65
  //# sourceMappingURL=Toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.js","sources":["../../src/components/Toolbar.tsx"],"sourcesContent":["import React from 'react';\n\nexport const TOOLBAR_FILTER_WIDTH_PX = 200;\n\nexport const TOOLBAR_FILTER_MIN_WIDTH_PX = 160;\n\nexport const TOOLBAR_FILL_MIN_WIDTH_PX = 200;\n\nexport const TOOLBAR_FILL_BASIS_PX = 260;\n\nconst TOOLBAR_GAP_PX = 8;\n\nexport interface ToolbarProps {\n children?: React.ReactNode;\n /** Draw a bottom divider — for a bar that sits above scrolling/list content. */\n divider?: boolean;\n /** Padding preset (applies to both axes). `none` for a bar that must sit flush with\n * the content it pins over — the consumer then owns the gutter. */\n padding?: 'none' | 'compact' | 'default';\n layout?: 'plain' | 'filters';\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport interface ToolbarFillProps {\n children?: React.ReactNode;\n minWidth?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport interface ToolbarItemProps {\n children?: React.ReactNode;\n width?: number;\n minWidth?: number;\n grow?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst PADDING_CLASSES: Record<NonNullable<ToolbarProps['padding']>, string> = {\n none: '',\n compact: 'px-[12px] py-[8px]',\n default: 'px-[16px] py-[12px]',\n};\n\nconst ToolbarFill: React.FC<ToolbarFillProps> = ({\n children,\n minWidth = TOOLBAR_FILL_MIN_WIDTH_PX,\n className = '',\n style,\n}) => (\n <div\n className={className}\n style={{ flex: `100 1 ${TOOLBAR_FILL_BASIS_PX}px`, minWidth, ...style }}\n >\n {children}\n </div>\n);\n\nconst ToolbarItem: React.FC<ToolbarItemProps> = ({\n children,\n width = TOOLBAR_FILTER_WIDTH_PX,\n minWidth = TOOLBAR_FILTER_MIN_WIDTH_PX,\n grow = true,\n className = '',\n style,\n}) => (\n <div className={className} style={{ flex: `${grow ? 1 : 0} 1 ${width}px`, minWidth, ...style }}>\n {children}\n </div>\n);\n\ninterface ToolbarComponent extends React.FC<ToolbarProps> {\n Fill: typeof ToolbarFill;\n Item: typeof ToolbarItem;\n}\n\nconst Toolbar = (({\n children,\n divider = false,\n padding = 'default',\n layout = 'plain',\n className = '',\n style,\n}) => {\n const classes = [\n 'w-full bg-[var(--malachite-card-background)]',\n PADDING_CLASSES[padding],\n divider ? 'border-0 border-b border-solid border-[var(--malachite-card-border)]' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const layoutStyle: React.CSSProperties =\n layout === 'filters'\n ? {\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n gap: TOOLBAR_GAP_PX,\n }\n : {};\n\n return (\n <div className={classes} style={{ ...layoutStyle, ...style }}>\n {children}\n </div>\n );\n}) as ToolbarComponent;\n\nToolbar.Fill = ToolbarFill;\nToolbar.Item = ToolbarItem;\n\nexport default Toolbar;\nexport { Toolbar, ToolbarFill, ToolbarItem };\n"],"names":["TOOLBAR_FILTER_WIDTH_PX","TOOLBAR_FILTER_MIN_WIDTH_PX","TOOLBAR_FILL_MIN_WIDTH_PX","TOOLBAR_FILL_BASIS_PX","TOOLBAR_GAP_PX","PADDING_CLASSES","ToolbarFill","children","minWidth","className","style","jsx","ToolbarItem","width","grow","Toolbar","divider","padding","layout","classes"],"mappings":";AAEO,MAAMA,IAA0B,KAE1BC,IAA8B,KAE9BC,IAA4B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AAER;AAEAQ,EAAQ,OAAOT;AACfS,EAAQ,OAAOH;"}
1
+ {"version":3,"file":"Toolbar.js","sources":["../../src/components/Toolbar.tsx"],"sourcesContent":["import React from 'react';\n\nexport const TOOLBAR_FILTER_WIDTH_PX = 200;\n\nexport const TOOLBAR_FILTER_MIN_WIDTH_PX = 160;\n\nexport const TOOLBAR_FILL_MIN_WIDTH_PX = 200;\n\nexport const TOOLBAR_FILL_BASIS_PX = 260;\n\nconst TOOLBAR_GAP_PX = 8;\n\nexport interface ToolbarProps {\n children?: React.ReactNode;\n /** Draw a bottom divider — for a bar that sits above scrolling/list content. */\n divider?: boolean;\n /** Padding preset (applies to both axes). `none` for a bar that must sit flush with\n * the content it pins over — the consumer then owns the gutter. */\n padding?: 'none' | 'compact' | 'default';\n layout?: 'plain' | 'filters';\n /** `page` paints the sunken page ground, for a bar that sits above a card. */\n surface?: 'card' | 'page';\n sticky?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport interface ToolbarFillProps {\n children?: React.ReactNode;\n minWidth?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport interface ToolbarItemProps {\n children?: React.ReactNode;\n width?: number;\n minWidth?: number;\n grow?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst PADDING_CLASSES: Record<NonNullable<ToolbarProps['padding']>, string> = {\n none: '',\n compact: 'px-[12px] py-[8px]',\n default: 'px-[16px] py-[12px]',\n};\n\nconst SURFACE_CLASSES: Record<NonNullable<ToolbarProps['surface']>, string> = {\n card: 'bg-[var(--malachite-card-background)]',\n page: 'bg-[var(--malachite-card-sunken-background)]',\n};\n\nconst ToolbarFill: React.FC<ToolbarFillProps> = ({\n children,\n minWidth = TOOLBAR_FILL_MIN_WIDTH_PX,\n className = '',\n style,\n}) => (\n <div\n className={className}\n style={{ flex: `100 1 ${TOOLBAR_FILL_BASIS_PX}px`, minWidth, ...style }}\n >\n {children}\n </div>\n);\n\nconst ToolbarItem: React.FC<ToolbarItemProps> = ({\n children,\n width = TOOLBAR_FILTER_WIDTH_PX,\n minWidth = TOOLBAR_FILTER_MIN_WIDTH_PX,\n grow = true,\n className = '',\n style,\n}) => (\n <div className={className} style={{ flex: `${grow ? 1 : 0} 1 ${width}px`, minWidth, ...style }}>\n {children}\n </div>\n);\n\ninterface ToolbarComponent extends React.FC<ToolbarProps> {\n Fill: typeof ToolbarFill;\n Item: typeof ToolbarItem;\n}\n\nconst Toolbar = (({\n children,\n divider = false,\n padding = 'default',\n layout = 'plain',\n surface = 'card',\n sticky = false,\n className = '',\n style,\n}) => {\n const classes = [\n 'w-full',\n SURFACE_CLASSES[surface],\n sticky ? 'sticky top-0 z-10' : '',\n PADDING_CLASSES[padding],\n divider ? 'border-0 border-b border-solid border-[var(--malachite-card-border)]' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const layoutStyle: React.CSSProperties =\n layout === 'filters'\n ? {\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n gap: TOOLBAR_GAP_PX,\n }\n : {};\n\n return (\n <div className={classes} style={{ ...layoutStyle, ...style }}>\n {children}\n </div>\n );\n}) as ToolbarComponent;\n\nToolbar.Fill = ToolbarFill;\nToolbar.Item = ToolbarItem;\n\nexport default Toolbar;\nexport { Toolbar, ToolbarFill, ToolbarItem };\n"],"names":["TOOLBAR_FILTER_WIDTH_PX","TOOLBAR_FILTER_MIN_WIDTH_PX","TOOLBAR_FILL_MIN_WIDTH_PX","TOOLBAR_FILL_BASIS_PX","TOOLBAR_GAP_PX","PADDING_CLASSES","SURFACE_CLASSES","ToolbarFill","children","minWidth","className","style","jsx","ToolbarItem","width","grow","Toolbar","divider","padding","layout","surface","sticky","classes"],"mappings":";AAEO,MAAMA,IAA0B,KAE1BC,IAA8B,KAE9BC,IAA4B,KAE5BC,IAAwB,KAE/BC,IAAiB,GAiCjBC,IAAwE;AAAA,EAC1E,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AACb,GAEMC,IAAwE;AAAA,E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