@stackone/malachite 2.85.0 → 2.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/COMPONENTS.md +6 -5
  2. package/dist/components/Accordion.js +130 -103
  3. package/dist/components/Accordion.js.map +1 -1
  4. package/dist/components/Button.js.map +1 -1
  5. package/dist/components/Card.js +128 -75
  6. package/dist/components/Card.js.map +1 -1
  7. package/dist/components/FilterSearch.js +228 -224
  8. package/dist/components/FilterSearch.js.map +1 -1
  9. package/dist/components/FrameHeader.js +36 -0
  10. package/dist/components/FrameHeader.js.map +1 -0
  11. package/dist/components/LoadingBar.js +5 -5
  12. package/dist/components/LoadingBar.js.map +1 -1
  13. package/dist/components/MultiSelect.js +431 -382
  14. package/dist/components/MultiSelect.js.map +1 -1
  15. package/dist/components/SplitButton.js.map +1 -1
  16. package/dist/components/Surface.js +211 -159
  17. package/dist/components/Surface.js.map +1 -1
  18. package/dist/components/Table/Table.js +630 -606
  19. package/dist/components/Table/Table.js.map +1 -1
  20. package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
  21. package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
  22. package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
  23. package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
  24. package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
  25. package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
  26. package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
  27. package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
  28. package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
  29. package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
  30. package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
  31. package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
  32. package/dist/components/TimeBarChart/stackLayout.js +25 -0
  33. package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
  34. package/dist/components/TimeBarChart/timeBuckets.js +133 -0
  35. package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
  36. package/dist/components/TimeBarChart/tones.js +10 -0
  37. package/dist/components/TimeBarChart/tones.js.map +1 -0
  38. package/dist/components/buttonStyles.js +2 -0
  39. package/dist/components/buttonStyles.js.map +1 -1
  40. package/dist/components/dateMath.js +1 -0
  41. package/dist/components/dateMath.js.map +1 -1
  42. package/dist/components/filterSearchModel.js +53 -45
  43. package/dist/components/filterSearchModel.js.map +1 -1
  44. package/dist/components/focusRing.js +8 -7
  45. package/dist/components/focusRing.js.map +1 -1
  46. package/dist/components/frameStyles.js +14 -0
  47. package/dist/components/frameStyles.js.map +1 -0
  48. package/dist/components/headerContent.js +10 -0
  49. package/dist/components/headerContent.js.map +1 -0
  50. package/dist/index.d.ts +149 -18
  51. package/dist/index.js +24 -22
  52. package/dist/index.js.map +1 -1
  53. package/dist/tailwind.css.js +1 -1
  54. package/dist/theme.js +340 -340
  55. package/dist/theme.js.map +1 -1
  56. package/package.json +1 -1
@@ -1,246 +1,298 @@
1
- import { jsx as t, jsxs as O } from "react/jsx-runtime";
2
- import q from "react";
3
- import { DisclosureArrow as J } from "./DisclosureArrow.js";
4
- import { paintOnChild as M } from "./asChild.js";
5
- import { FOCUS_RING_INSET as j } from "./focusRing.js";
6
- import { resolveRel as I } from "./linkRel.js";
7
- import { isRenderableNode as Q } from "./renderableNode.js";
8
- import { safeHref as Y } from "./safeHref.js";
9
- import { FOREGROUND_RESET as Z, SELECTED_TEXT_CONTEXT as ee, SELECTED_ROW_ACCENT as ae, SELECTED_ROW_FOREGROUND as re, SELECTED_ROW_BACKGROUND as B } from "./selectedRow.js";
10
- const te = {
1
+ import { jsx as o, jsxs as E } from "react/jsx-runtime";
2
+ import me, { useRef as L, useEffect as be } from "react";
3
+ import { DisclosureArrow as pe } from "./DisclosureArrow.js";
4
+ import { paintOnChild as he } from "./asChild.js";
5
+ import { FOCUS_RING_INSET as Z, FOCUS_RING_INSET_OVERLAY_HIDDEN as ge } from "./focusRing.js";
6
+ import { resolveRel as J } from "./linkRel.js";
7
+ import { isRenderableNode as M } from "./renderableNode.js";
8
+ import { safeHref as xe } from "./safeHref.js";
9
+ import { FOREGROUND_RESET as ve, SELECTED_TEXT_CONTEXT as Ee, SELECTED_ROW_ACCENT as we, SELECTED_ROW_FOREGROUND as Ce, SELECTED_ROW_BACKGROUND as Q } from "./selectedRow.js";
10
+ const Ne = {
11
11
  none: "",
12
12
  // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.
13
13
  compact: "px-[16px] py-[8px]"
14
- }, oe = {
14
+ }, Se = {
15
15
  default: "",
16
16
  muted: "bg-[var(--malachite-card-dimmed-background)]",
17
17
  success: "bg-[var(--malachite-tag-success-background)]",
18
18
  error: "bg-[var(--malachite-tag-error-background)]"
19
- }, le = {
19
+ }, Re = {
20
20
  success: "var(--malachite-tag-success-foreground)",
21
21
  error: "var(--malachite-tag-error-foreground)"
22
- }, ie = "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", ne = "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 = (o) => {
22
+ }, ye = "opacity-0 transition-opacity group-[:hover]/row:opacity-100 group-focus-within/row:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100", ke = (r) => {
23
+ var c;
24
+ const n = r.getRootNode(), e = ((c = n.getSelection) == null ? void 0 : c.call(n)) ?? r.ownerDocument.getSelection();
25
+ if (!e || e.isCollapsed)
26
+ return !1;
27
+ for (let l = 0; l < e.rangeCount; l += 1)
28
+ if (e.getRangeAt(l).intersectsNode(r))
29
+ return !0;
30
+ return !1;
31
+ }, _e = (r) => new r.constructor("click", r), Oe = "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)", ee = (r) => {
23
32
  const {
24
- children: a,
25
- divider: r = !1,
33
+ children: n,
34
+ divider: a = !1,
26
35
  disabled: e = !1,
27
36
  selected: c,
28
- selection: s,
37
+ selection: l,
29
38
  tone: d = "default",
30
- inset: f = "none",
31
- className: b = "",
32
- style: h
33
- } = o, l = o.asChild === !0, {
39
+ inset: w = "none",
40
+ className: m = "",
41
+ style: C
42
+ } = r, s = r.asChild === !0, {
34
43
  onClick: i,
35
- href: u,
36
- target: m,
37
- rel: T,
38
- trailing: $,
39
- revealTrailing: A,
40
- role: n
41
- } = l ? {} : o, x = Y(u), g = l ? void 0 : o["aria-label"], v = l ? void 0 : o["aria-labelledby"], C = l ? void 0 : o.tabIndex, S = !!(i || x), U = e && (S || l) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", G = d !== "default", W = oe[d], w = !l && Q($), R = te[f], X = R && !w ? "" : "p-0", D = [
44
+ href: b,
45
+ target: p,
46
+ rel: $,
47
+ trailing: I,
48
+ revealTrailing: P,
49
+ leading: y,
50
+ dimmed: B,
51
+ role: u
52
+ } = s ? {} : r, h = xe(b), F = s ? void 0 : r["aria-label"], U = s ? void 0 : r["aria-labelledby"], te = s ? void 0 : r.tabIndex, j = !!(i || h), ae = e && (j || s) ? "" : "transition-colors hover:bg-[var(--malachite-buttonlist-hover-background)]", oe = d !== "default", ne = Se[d], G = !s && M(I), k = Ne[w], ce = k ? "" : "p-0", W = [
42
53
  "w-full text-left border-0",
43
- W,
44
- r ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
45
- U
46
- ].filter(Boolean).join(" "), k = [
47
- S ? `appearance-none ${G ? "" : "bg-transparent"} ${X} ${j}` : "",
48
- S && !e ? "cursor-pointer" : ""
49
- ].filter(Boolean).join(" "), N = [D, k, w ? "" : R, b].filter(Boolean).join(" "), H = s ? s !== "announce" : n !== "checkbox", z = s !== "tint", K = c === !0 && H ? {
50
- backgroundImage: `linear-gradient(${B}, ${B})`,
51
- color: re,
52
- ...z ? { boxShadow: `inset 2px 0 0 ${ae}` } : {},
53
- ...ee
54
- } : {}, _ = le[d], E = { ..._ ? {
54
+ ne,
55
+ a ? "border-b border-solid border-[var(--malachite-card-border)]" : "",
56
+ ae
57
+ ].filter(Boolean).join(" "), H = [
58
+ "appearance-none",
59
+ oe ? "" : "bg-transparent",
60
+ e ? "" : "cursor-pointer"
61
+ ], X = (t) => [W, ...t, k, m].filter(Boolean).join(" "), le = l ? l !== "announce" : u !== "checkbox", ie = l !== "tint", f = G && !!i && !h && !e, K = L(null), V = L(null), g = L(!1), se = (t) => {
62
+ g.current = t.target !== t.currentTarget;
63
+ }, de = (t) => {
64
+ g.current || (g.current = t.target !== t.currentTarget);
65
+ };
66
+ be(() => {
67
+ const t = K.current;
68
+ if (!f || !t)
69
+ return;
70
+ const S = (v) => {
71
+ const A = g.current;
72
+ g.current = !1;
73
+ const D = V.current;
74
+ !D || v.target !== t || A || v.detail <= 1 && !v.shiftKey && ke(t) || (v.stopPropagation(), D.focus({ preventScroll: !0 }), D.dispatchEvent(_e(v)));
75
+ };
76
+ return t.addEventListener("click", S), () => t.removeEventListener("click", S);
77
+ }, [f]);
78
+ const ue = c === !0 && le ? {
79
+ backgroundImage: `linear-gradient(${Q}, ${Q})`,
80
+ color: Ce,
81
+ ...ie ? { boxShadow: `inset 2px 0 0 ${we}` } : {},
82
+ ...Ee
83
+ } : {}, _ = Re[d], N = { ..._ ? {
55
84
  color: _,
56
85
  "--malachite-ctx-text-primary": _
57
- } : {}, ...K, ...h }, p = n === "checkbox" && c === "mixed" ? "mixed" : n === "radio" || n === "checkbox" ? c === !0 : void 0, y = p === void 0 && c === !0 ? !0 : void 0, L = {
58
- role: n,
59
- "aria-checked": p,
60
- "aria-current": y,
61
- "aria-label": g,
62
- "aria-labelledby": v,
63
- "aria-disabled": n && e ? !0 : void 0
86
+ } : {}, ...ue, ...C }, O = u === "checkbox" && c === "mixed" ? "mixed" : u === "radio" || u === "checkbox" ? c === !0 : void 0, z = O === void 0 && c === !0 ? !0 : void 0, Y = {
87
+ role: u,
88
+ "aria-checked": O,
89
+ "aria-current": z,
90
+ "aria-label": F,
91
+ "aria-labelledby": U,
92
+ "aria-disabled": u && e ? !0 : void 0
64
93
  };
65
- if (l)
66
- return M(a, N, E);
67
- if (w) {
68
- const V = x && !e ? /* @__PURE__ */ t(
94
+ if (s)
95
+ return he(n, X([]), N);
96
+ const R = {
97
+ role: u,
98
+ tabIndex: te,
99
+ "aria-checked": O,
100
+ "aria-current": z,
101
+ "aria-label": F,
102
+ "aria-labelledby": U
103
+ }, fe = M(y), q = y !== void 0 || B !== void 0, x = q ? /* @__PURE__ */ E("span", { className: "flex w-full min-w-0 items-center gap-[12px]", children: [
104
+ fe && /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center", children: y }),
105
+ /* @__PURE__ */ o(
106
+ "span",
107
+ {
108
+ className: `flex flex-1 min-w-0 items-center transition-opacity ${B ? "opacity-60" : ""}`,
109
+ children: n
110
+ }
111
+ )
112
+ ] }) : n;
113
+ if (G) {
114
+ const t = e ? null : /* @__PURE__ */ o(
115
+ "span",
116
+ {
117
+ "aria-hidden": "true",
118
+ "data-malachite-row-ring": "",
119
+ className: ge
120
+ }
121
+ ), S = [
122
+ ...H,
123
+ "outline-none border-0 p-0 flex-1 min-w-0 text-left"
124
+ ].filter(Boolean).join(" "), A = !!h && !e ? /* @__PURE__ */ E(
69
125
  "a",
70
126
  {
71
- href: x,
72
- target: m,
73
- rel: I(T, m),
127
+ href: h,
128
+ target: p,
129
+ rel: J($, p),
74
130
  onClick: i,
75
- className: `${k} border-0 flex-1 min-w-0 text-left no-underline text-inherit`,
76
- role: n,
77
- tabIndex: C,
78
- "aria-checked": p,
79
- "aria-current": y,
80
- "aria-label": g,
81
- "aria-labelledby": v,
82
- children: a
131
+ className: `${S} no-underline text-inherit`,
132
+ "data-malachite-row-control": "",
133
+ ...R,
134
+ children: [
135
+ x,
136
+ t
137
+ ]
83
138
  }
84
- ) : i ? /* @__PURE__ */ t(
139
+ ) : i ? /* @__PURE__ */ E(
85
140
  "button",
86
141
  {
142
+ ref: V,
87
143
  type: "button",
88
144
  onClick: i,
89
145
  disabled: e,
90
- className: `${k} border-0 flex-1 min-w-0 text-left`,
91
- role: n,
92
- tabIndex: C,
93
- "aria-checked": p,
94
- "aria-current": y,
95
- "aria-label": g,
96
- "aria-labelledby": v,
97
- children: a
146
+ className: S,
147
+ "data-malachite-row-control": "",
148
+ ...R,
149
+ children: [
150
+ x,
151
+ t
152
+ ]
98
153
  }
99
- ) : (
100
- // The set goes here, not on the wrapper: `radio` and `checkbox` make their
101
- // descendants presentational, which would bury a control in the trailing slot.
102
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", ...L, children: a })
103
- );
104
- return /* @__PURE__ */ O(
154
+ ) : /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", "data-malachite-row-control": "", ...Y, children: x });
155
+ return /* @__PURE__ */ E(
105
156
  "div",
106
157
  {
107
158
  className: [
108
- D,
109
- "flex items-center",
110
- R,
111
- A ? "group/row" : "",
112
- b
159
+ W,
160
+ "relative flex items-center",
161
+ f ? "cursor-pointer" : "",
162
+ k,
163
+ P ? "group/row" : "",
164
+ m
113
165
  ].filter(Boolean).join(" "),
114
- style: E,
166
+ style: N,
167
+ "data-malachite-row": "",
168
+ "data-disabled": e ? "" : void 0,
169
+ ref: K,
170
+ role: f ? "presentation" : void 0,
171
+ onPointerDownCapture: f ? se : void 0,
172
+ onPointerUpCapture: f ? de : void 0,
115
173
  children: [
116
- V,
117
- /* @__PURE__ */ t(
174
+ A,
175
+ /* @__PURE__ */ o(
118
176
  "div",
119
177
  {
120
- className: `shrink-0 flex items-center ${A ? ie : ""}`,
121
- children: $
178
+ className: `shrink-0 flex items-center ${f ? "cursor-default" : ""} ${P ? ye : ""}`,
179
+ "data-malachite-row-slot": "",
180
+ children: I
122
181
  }
123
182
  )
124
183
  ]
125
184
  }
126
185
  );
127
186
  }
128
- return x && !e ? /* @__PURE__ */ t(
187
+ const T = X(
188
+ j ? [...H, ce, Z] : []
189
+ );
190
+ return h && !e ? /* @__PURE__ */ o(
129
191
  "a",
130
192
  {
131
- href: x,
132
- target: m,
133
- rel: I(T, m),
193
+ href: h,
194
+ target: p,
195
+ rel: J($, p),
134
196
  onClick: i,
135
- className: `${N} no-underline text-inherit`,
136
- style: E,
137
- role: n,
138
- tabIndex: C,
139
- "aria-checked": p,
140
- "aria-current": y,
141
- "aria-label": g,
142
- "aria-labelledby": v,
143
- children: a
197
+ className: `${T} no-underline text-inherit ${q ? "block" : ""}`,
198
+ style: N,
199
+ ...R,
200
+ children: x
144
201
  }
145
- ) : i ? /* @__PURE__ */ t(
202
+ ) : i ? /* @__PURE__ */ o(
146
203
  "button",
147
204
  {
148
205
  type: "button",
149
206
  onClick: i,
150
207
  disabled: e,
151
- className: N,
152
- style: E,
153
- role: n,
154
- tabIndex: C,
155
- "aria-checked": p,
156
- "aria-current": y,
157
- "aria-label": g,
158
- "aria-labelledby": v,
159
- children: a
208
+ className: T,
209
+ style: N,
210
+ ...R,
211
+ children: x
160
212
  }
161
- ) : /* @__PURE__ */ t("div", { className: N, style: E, ...L, children: a });
162
- }, ce = ({ children: o, className: a = "", style: r }) => /* @__PURE__ */ t("div", { className: a, style: r, onClick: (e) => e.stopPropagation(), children: o }), ye = 39, se = Object.assign(
213
+ ) : /* @__PURE__ */ o("div", { className: T, style: N, ...Y, children: x });
214
+ }, Te = ({ children: r, className: n = "", style: a }) => /* @__PURE__ */ o("div", { className: n, style: a, onClick: (e) => e.stopPropagation(), children: r }), He = 39, Ae = Object.assign(
163
215
  ({
164
- header: o,
165
- children: a,
166
- expanded: r,
216
+ header: r,
217
+ children: n,
218
+ expanded: a,
167
219
  onToggle: e,
168
220
  sticky: c = !1,
169
- stickyTopOffset: s = 0,
221
+ stickyTopOffset: l = 0,
170
222
  divider: d = !1,
171
- tone: f = "default",
172
- "aria-label": b,
173
- className: h = "",
174
- style: l
223
+ tone: w = "default",
224
+ "aria-label": m,
225
+ className: C = "",
226
+ style: s
175
227
  }) => {
176
- const i = q.useId(), u = e ? () => e(!r) : void 0;
177
- return /* @__PURE__ */ O(F, { divider: d, tone: f, className: h, style: l, children: [
178
- /* @__PURE__ */ O(
228
+ const i = me.useId(), b = e ? () => e(!a) : void 0;
229
+ return /* @__PURE__ */ E(ee, { divider: d, tone: w, className: C, style: s, children: [
230
+ /* @__PURE__ */ E(
179
231
  "div",
180
232
  {
181
- className: `group flex items-center w-full ${u ? "cursor-pointer" : ""} ${c && r ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
182
- style: c && r ? { top: s } : void 0,
183
- onClick: u,
233
+ className: `group flex items-center w-full ${b ? "cursor-pointer" : ""} ${c && a ? "sticky z-[1] bg-[var(--malachite-card-background)]" : ""}`,
234
+ style: c && a ? { top: l } : void 0,
235
+ onClick: b,
184
236
  role: "presentation",
185
237
  children: [
186
- /* @__PURE__ */ t("span", { className: "shrink-0 flex items-center pl-[16px] pr-[12px]", children: u && /* @__PURE__ */ t(
238
+ /* @__PURE__ */ o("span", { className: "shrink-0 flex items-center pl-[16px] pr-[12px]", children: b && /* @__PURE__ */ o(
187
239
  "button",
188
240
  {
189
241
  type: "button",
190
- className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${j}`,
191
- "aria-expanded": r,
242
+ className: `appearance-none bg-transparent border-0 p-0 flex items-center cursor-pointer ${Z}`,
243
+ "aria-expanded": a,
192
244
  "aria-controls": i,
193
- "aria-label": b,
194
- onClick: (m) => {
195
- m.stopPropagation(), u();
245
+ "aria-label": m,
246
+ onClick: (p) => {
247
+ p.stopPropagation(), b();
196
248
  },
197
- children: /* @__PURE__ */ t(J, { expanded: r })
249
+ children: /* @__PURE__ */ o(pe, { expanded: a })
198
250
  }
199
251
  ) }),
200
- o
252
+ r
201
253
  ]
202
254
  }
203
255
  ),
204
- r && /* @__PURE__ */ t("div", { id: i, children: a })
256
+ a && /* @__PURE__ */ o("div", { id: i, children: n })
205
257
  ] });
206
258
  },
207
- { Controls: ce }
208
- ), de = {
259
+ { Controls: Te }
260
+ ), De = {
209
261
  default: "bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]",
210
262
  highlight: "bg-[var(--malachite-card-warm-background,rgb(244,242,240))]"
211
- }, P = ({
212
- children: o,
213
- padding: a = !1,
214
- overflow: r = "hidden",
263
+ }, re = ({
264
+ children: r,
265
+ padding: n = !1,
266
+ overflow: a = "hidden",
215
267
  tone: e = "default",
216
268
  shadow: c = e !== "highlight",
217
- role: s,
269
+ role: l,
218
270
  "aria-label": d,
219
- "aria-labelledby": f,
220
- className: b = "",
221
- style: h
222
- }) => /* @__PURE__ */ t(
271
+ "aria-labelledby": w,
272
+ className: m = "",
273
+ style: C
274
+ }) => /* @__PURE__ */ o(
223
275
  "div",
224
276
  {
225
- className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${r === "clip" ? "overflow-clip" : r === "visible" ? "overflow-visible" : "overflow-hidden"} ${de[e]} ${a ? "py-3 px-4" : ""} ${b}`,
277
+ className: `w-full rounded-[var(--malachite-radius-xxl,14px)] ${a === "clip" ? "overflow-clip" : a === "visible" ? "overflow-visible" : "overflow-hidden"} ${De[e]} ${n ? "py-3 px-4" : ""} ${m}`,
226
278
  style: {
227
- ...c ? { boxShadow: ne } : {},
228
- ...Z,
229
- ...h
279
+ ...c ? { boxShadow: Oe } : {},
280
+ ...ve,
281
+ ...C
230
282
  },
231
- role: s,
283
+ role: l,
232
284
  "aria-label": d,
233
- "aria-labelledby": f,
234
- children: o
285
+ "aria-labelledby": w,
286
+ children: r
235
287
  }
236
288
  );
237
- P.Row = F;
238
- P.ExpandableRow = se;
289
+ re.Row = ee;
290
+ re.ExpandableRow = Ae;
239
291
  export {
240
- ye as EXPANDABLE_ROW_LEAD_PX,
241
- P as Surface,
242
- se as SurfaceExpandableRow,
243
- F as SurfaceRow,
244
- P as default
292
+ He as EXPANDABLE_ROW_LEAD_PX,
293
+ re as Surface,
294
+ Ae as SurfaceExpandableRow,
295
+ ee as SurfaceRow,
296
+ re as default
245
297
  };
246
298
  //# sourceMappingURL=Surface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { FOCUS_RING_INSET } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport type SurfaceTone = 'default' | 'highlight';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n /**\n * `false` drops the elevation shadow, for a card that sits flat on its ground.\n * Default: `true`, or `false` with `tone=\"highlight\"`.\n */\n shadow?: boolean;\n /**\n * `highlight` paints the warm ground with no border and no shadow, for a static block that\n * stands out from the page, such as a hero or a guide's section header. Its ground is too\n * close to `Surface.Row`'s hover for clickable rows inside it.\n */\n tone?: SurfaceTone;\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `tint` paints it\n * without the accent bar, for a menu whose choice is already marked inside the row;\n * `announce` leaves the visual to a control inside the row and only sets the ARIA state.\n * Defaults to `announce` under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'tint' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success` 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 // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background)]',\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 tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover =\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 !== 'announce' : role !== 'checkbox';\n const accent = selection !== 'tint';\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n ...(accent ? { boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}` } : {}),\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, 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 tabIndex={tabIndex}\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 tabIndex={tabIndex}\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 tabIndex={tabIndex}\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 tabIndex={tabIndex}\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_TONE_CLASSES: Record<SurfaceTone, string> = {\n default:\n 'bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]',\n highlight: 'bg-[var(--malachite-card-warm-background,rgb(244,242,240))]',\n};\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n tone = 'default',\n shadow = tone !== 'highlight',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const 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} ${SURFACE_TONE_CLASSES[tone]} ${padding ? 'py-3 px-4' : ''} ${className}`}\n style={{\n ...(shadow ? { boxShadow: TRIPLE_SHADOW } : {}),\n ...FOREGROUND_RESET,\n ...style,\n }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","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","tabIndex","interactive","hover","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlClasses","FOCUS_RING_INSET","classes","paints","accent","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_TONE_CLASSES","Surface","padding","overflow","shadow","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA0EA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA;AAAA,EAEN,SAAS;AACb,GAqCMC,KAAqE;AAAA,EACvE,SAAS;AAAA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AAA,IACtJ,OAAO;AAAA,MACH,GAAI6D,IAAS,EAAE,WAAWvE,GAAA,IAAkB,CAAA;AAAA,MAC5C,GAAGwE;AAAA,MACH,GAAG7D;AAAA,IAAA;AAAA,IAEP,MAAAQ;AAAA,IACA,cAAYG;AAAA,IACZ,mBAAiBC;AAAA,IAEhB,UAAApB;AAAA,EAAA;AAAA;AAKbiE,EAAQ,MAAMnE;AACdmE,EAAQ,gBAAgBX;"}
1
+ {"version":3,"file":"Surface.js","sources":["../../src/components/Surface.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { paintOnChild } from './asChild';\nimport { FOCUS_RING_INSET, FOCUS_RING_INSET_OVERLAY_HIDDEN } from './focusRing';\nimport { resolveRel } from './linkRel';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport {\n FOREGROUND_RESET,\n SELECTED_ROW_ACCENT,\n SELECTED_ROW_BACKGROUND,\n SELECTED_ROW_FOREGROUND,\n SELECTED_TEXT_CONTEXT,\n} from './selectedRow';\n\nexport type SurfaceTone = 'default' | 'highlight';\n\nexport interface SurfaceProps {\n children?: React.ReactNode;\n padding?: boolean;\n /**\n * Content overflow. Defaults to `hidden` so children are clipped to the rounded\n * corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll\n * container — so a `position: sticky` descendant still pins (unlike `hidden`,\n * which traps it). `visible` disables clipping entirely.\n */\n overflow?: 'hidden' | 'visible' | 'clip';\n /**\n * `false` drops the elevation shadow, for a card that sits flat on its ground.\n * Default: `true`, or `false` with `tone=\"highlight\"`.\n */\n shadow?: boolean;\n /**\n * `highlight` paints the warm ground with no border and no shadow, for a static block that\n * stands out from the page, such as a hero or a guide's section header. Its ground is too\n * close to `Surface.Row`'s hover for clickable rows inside it.\n */\n tone?: SurfaceTone;\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\ninterface SurfaceRowChromeProps {\n children?: React.ReactNode;\n /** Renders a bottom divider — omit on the last row in a Surface. */\n divider?: boolean;\n /** Removes the hover affordance / disables the control (e.g. while loading/busy). */\n disabled?: boolean;\n /** Announces the row as selected — `aria-checked` under a `radio`/`checkbox` role,\n * `aria-current` otherwise — and paints `Table`'s selected treatment unless `selection`\n * says not to. `'mixed'` is for a `checkbox` row that is partly selected: it announces\n * `aria-checked=\"mixed\"` there, never paints and never marks the row current, and counts\n * as not selected under any other role. */\n selected?: boolean | 'mixed';\n /** How a `selected` row shows it. `highlight` paints the treatment; `tint` paints it\n * without the accent bar, for a menu whose choice is already marked inside the row;\n * `announce` leaves the visual to a control inside the row and only sets the ARIA state.\n * Defaults to `announce` under `role=\"checkbox\"` and `highlight` otherwise. */\n selection?: 'highlight' | 'tint' | 'announce';\n /**\n * Tints the whole row by what it reports. `muted` is a row whose subject is inactive —\n * not disabled: it stays interactive. `success` 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 // The 16px is ROW_INSET_PX in accordionBodyInset.ts too; Accordion's bodyIndent gives it back.\n compact: 'px-[16px] py-[8px]',\n};\n\n/** Stays an interface under its original name: a consumer may `extends` it. */\nexport interface SurfaceRowProps extends SurfaceRowChromeProps {\n asChild?: false;\n /**\n * When provided, the whole row becomes clickable: it renders as a `<button>`\n * (or `<a>` when `href` is set), so the entire row is the click target with\n * native focus + Enter/Space — no manual tabIndex/key handlers. For a\n * selectable row, put a presentational `<Radio>`/`<Checkbox>` inside as the\n * visual indicator; do NOT nest an interactive control (invalid + double tab stop).\n */\n onClick?: (event: React.MouseEvent) => void;\n /** Renders the clickable row as an anchor instead of a button. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n /** Content pinned right, outside the row button, so it may hold its own control. */\n trailing?: React.ReactNode;\n /**\n * Shows `trailing` only while the row is hovered or holds focus, and while a menu\n * it opened is still open. Hidden by opacity, so it stays in the tab order; a touch screen,\n * which has no hover, always shows it.\n */\n revealTrailing?: boolean;\n /** The row's indicator, before the children. */\n leading?: React.ReactNode;\n /** Fades the children, not `leading` or `trailing`. */\n dimmed?: boolean;\n /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `-1` takes the row out of the Tab order, for a roving radio group. */\n tabIndex?: number;\n}\n\n/**\n * The outcome tones reuse the tag tokens rather than minting row ones, so a row saying \"this\n * passed\" and a tag saying it are the same green wherever the two sit together.\n */\nconst TONE_CLASSES: Record<NonNullable<SurfaceRowProps['tone']>, string> = {\n default: '',\n muted: 'bg-[var(--malachite-card-dimmed-background)]',\n success: 'bg-[var(--malachite-tag-success-background)]',\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 selectsTextIn = (row: Element): boolean => {\n const root = row.getRootNode();\n const ownSelection = (root as Partial<Pick<Document, 'getSelection'>>).getSelection?.();\n const selection = ownSelection ?? row.ownerDocument.getSelection();\n if (!selection || selection.isCollapsed) {\n return false;\n }\n for (let index = 0; index < selection.rangeCount; index += 1) {\n if (selection.getRangeAt(index).intersectsNode(row)) {\n return true;\n }\n }\n return false;\n};\n\nconst forwardedClick = (event: MouseEvent): MouseEvent =>\n new (event.constructor as typeof MouseEvent)('click', event);\n\nconst TRIPLE_SHADOW =\n '0px 0px 4px 0px rgba(0,0,0,0.08), 0px 4px 4px 0px rgba(0,0,0,0.08), 0px 4px 10px 0px rgba(0,0,0,0.05)';\n\n/**\n * A single full-bleed row inside a <Surface>. Owns the row chrome — hover\n * highlight, colour transition and an optional bottom divider — so consumers\n * compose their own content inside without re-implementing design-system styling.\n * Pass `onClick`/`href` to make the entire row clickable (rendered as a real\n * button/anchor, so keyboard navigation works natively).\n */\nconst SurfaceRow: React.FC<AnySurfaceRowProps> = (props) => {\n const {\n children,\n divider = false,\n disabled = false,\n selected,\n selection,\n tone = 'default',\n inset = 'none',\n className = '',\n style,\n } = props;\n const asChild = props.asChild === true;\n const {\n onClick,\n href: rawHref,\n target,\n rel,\n trailing,\n revealTrailing,\n leading,\n dimmed,\n role,\n } = asChild ? ({} as SurfaceRowProps) : (props as SurfaceRowProps);\n // A rejected href (e.g. `javascript:`) leaves the row a button or a plain row, never an anchor.\n const href = safeHref(rawHref);\n const ariaLabel = asChild ? undefined : (props as SurfaceRowProps)['aria-label'];\n const ariaLabelledBy = asChild ? undefined : (props as SurfaceRowProps)['aria-labelledby'];\n const tabIndex = asChild ? undefined : (props as SurfaceRowProps).tabIndex;\n const interactive = Boolean(onClick || href);\n // `asChild` is interactive for the hover affordance only, not the focus/reset classes.\n const hover =\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 ? '' : 'p-0';\n\n const chromeClasses = [\n 'w-full text-left border-0',\n toneClass,\n divider ? 'border-b border-solid border-[var(--malachite-card-border)]' : '',\n hover,\n ]\n .filter(Boolean)\n .join(' ');\n\n const controlReset = [\n 'appearance-none',\n tinted ? '' : 'bg-transparent',\n disabled ? '' : 'cursor-pointer',\n ];\n const rowClasses = (control: string[]) =>\n [chromeClasses, ...control, insetClass, className].filter(Boolean).join(' ');\n\n const paints = selection ? selection !== 'announce' : role !== 'checkbox';\n const accent = selection !== 'tint';\n\n const forwards = hasTrailing && Boolean(onClick) && !href && !disabled;\n const rowRef = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLButtonElement>(null);\n const pressLeftPadding = useRef(false);\n const startPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current = event.target !== event.currentTarget;\n };\n const trackPress = (event: React.PointerEvent<HTMLDivElement>) => {\n pressLeftPadding.current ||= event.target !== event.currentTarget;\n };\n useEffect(() => {\n const row = rowRef.current;\n if (!forwards || !row) {\n return undefined;\n }\n const forwardPaddingClick = (event: MouseEvent) => {\n const leftPadding = pressLeftPadding.current;\n pressLeftPadding.current = false;\n const control = controlRef.current;\n if (\n !control ||\n event.target !== row ||\n leftPadding ||\n (event.detail <= 1 && !event.shiftKey && selectsTextIn(row))\n ) {\n return;\n }\n event.stopPropagation();\n control.focus({ preventScroll: true });\n control.dispatchEvent(forwardedClick(event));\n };\n row.addEventListener('click', forwardPaddingClick);\n return () => row.removeEventListener('click', forwardPaddingClick);\n }, [forwards]);\n\n // A gradient layer so the tint composites over hover, and an inset shadow because\n // `ring-*` silently doesn't paint in a shadow root.\n const selectedStyle: React.CSSProperties =\n selected === true && paints\n ? {\n backgroundImage: `linear-gradient(${SELECTED_ROW_BACKGROUND}, ${SELECTED_ROW_BACKGROUND})`,\n color: SELECTED_ROW_FOREGROUND,\n ...(accent ? { boxShadow: `inset 2px 0 0 ${SELECTED_ROW_ACCENT}` } : {}),\n ...SELECTED_TEXT_CONTEXT,\n }\n : {};\n\n const toneForeground = TONE_FOREGROUNDS[tone];\n const toneStyle: React.CSSProperties = toneForeground\n ? ({\n color: toneForeground,\n '--malachite-ctx-text-primary': toneForeground,\n } as React.CSSProperties)\n : {};\n\n // `selected` last of the two: a row can be both, and selection is the state the reader is\n // acting on, so it wins the colour.\n const rowStyle = { ...toneStyle, ...selectedStyle, ...style };\n\n // Only a checkbox has a partly-checked state; a radio is chosen or not.\n const ariaChecked =\n role === 'checkbox' && selected === 'mixed'\n ? ('mixed' as const)\n : role === 'radio' || role === 'checkbox'\n ? selected === true\n : undefined;\n // `aria-current`, not `aria-pressed`: a selected row is one of many choices, not a toggle\n // (same call as `Dropdown`'s options). A role that carries its own state uses that instead.\n const ariaCurrent = ariaChecked === undefined && selected === true ? true : undefined;\n\n // Everything a control would have carried, for the branches that render none: the row\n // element is then the only thing assistive tech sees. `aria-disabled` because there is no\n // control to be natively disabled — and it is inert without a role, like the name.\n const rowFallbackAria = {\n role,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-disabled': role && disabled ? true : undefined,\n };\n\n if (asChild) {\n return paintOnChild(children, rowClasses([]), rowStyle);\n }\n\n // The set goes here, not on the wrapper: `radio` and `checkbox` make their\n // descendants presentational, which would bury a control in the trailing slot.\n const controlAria = {\n role,\n tabIndex,\n 'aria-checked': ariaChecked,\n 'aria-current': ariaCurrent,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n };\n\n const hasLeading = isRenderableNode(leading);\n const boxed = leading !== undefined || dimmed !== undefined;\n const content = boxed ? (\n <span className=\"flex w-full min-w-0 items-center gap-[12px]\">\n {hasLeading && <span className=\"shrink-0 flex items-center\">{leading}</span>}\n <span\n className={`flex flex-1 min-w-0 items-center transition-opacity ${dimmed ? 'opacity-60' : ''}`}\n >\n {children}\n </span>\n </span>\n ) : (\n children\n );\n\n if (hasTrailing) {\n const focusRing = disabled ? null : (\n <span\n aria-hidden=\"true\"\n data-malachite-row-ring=\"\"\n className={FOCUS_RING_INSET_OVERLAY_HIDDEN}\n />\n );\n const rowControlClasses = [\n ...controlReset,\n 'outline-none border-0 p-0 flex-1 min-w-0 text-left',\n ]\n .filter(Boolean)\n .join(' ');\n const anchor = Boolean(href) && !disabled;\n const control = anchor ? (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${rowControlClasses} no-underline text-inherit`}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </a>\n ) : onClick ? (\n <button\n ref={controlRef}\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={rowControlClasses}\n data-malachite-row-control=\"\"\n {...controlAria}\n >\n {content}\n {focusRing}\n </button>\n ) : (\n <div className=\"flex-1 min-w-0\" data-malachite-row-control=\"\" {...rowFallbackAria}>\n {content}\n </div>\n );\n\n return (\n <div\n className={[\n chromeClasses,\n 'relative flex items-center',\n forwards ? 'cursor-pointer' : '',\n insetClass,\n revealTrailing ? 'group/row' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={rowStyle}\n data-malachite-row=\"\"\n data-disabled={disabled ? '' : undefined}\n ref={rowRef}\n role={forwards ? 'presentation' : undefined}\n onPointerDownCapture={forwards ? startPress : undefined}\n onPointerUpCapture={forwards ? trackPress : undefined}\n >\n {control}\n <div\n className={`shrink-0 flex items-center ${forwards ? 'cursor-default' : ''} ${revealTrailing ? REVEALED_ON_INTERACTION : ''}`}\n data-malachite-row-slot=\"\"\n >\n {trailing}\n </div>\n </div>\n );\n }\n\n const classes = rowClasses(\n interactive ? [...controlReset, controlPadding, FOCUS_RING_INSET] : [],\n );\n\n if (href && !disabled) {\n return (\n <a\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n onClick={onClick}\n className={`${classes} no-underline text-inherit ${boxed ? 'block' : ''}`}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </a>\n );\n }\n\n if (onClick) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={classes}\n style={rowStyle}\n {...controlAria}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={classes} style={rowStyle} {...rowFallbackAria}>\n {content}\n </div>\n );\n};\n\nexport interface SurfaceExpandableRowProps {\n /** The row itself, laid out across the line. May hold its own controls. */\n header: React.ReactNode;\n /** The body, rendered beneath the row while it is open. */\n children?: React.ReactNode;\n expanded: boolean;\n /** Omit for a row that cannot open. The arrow's space is still reserved, so a list of\n * rows stays in one column whether or not each one has a body. */\n onToggle?: (expanded: boolean) => void;\n /**\n * Pins the row while its body scrolls, so a long body never leaves the reader without\n * the line it belongs to. Offset by whatever is already pinned above it.\n */\n sticky?: boolean;\n stickyTopOffset?: number;\n divider?: boolean;\n tone?: SurfaceRowProps['tone'];\n /** Names the disclosure control, which is otherwise only an arrow. */\n 'aria-label'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Stops a click inside it from toggling the row, for the cells that hold controls.\n *\n * Explicit rather than sniffing the event's target for an interactive ancestor: a control\n * rendering into a shadow root retargets the event to its host, so the sniff would miss\n * exactly the components most likely to sit in a row.\n */\nconst ExpandableRowControls: React.FC<{\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}> = ({ children, className = '', style }) => (\n <div className={className} style={style} onClick={(event) => event.stopPropagation()}>\n {children}\n </div>\n);\n\n/**\n * A row that opens to reveal a body, for a line that carries its own controls.\n *\n * Not `Accordion`: that puts its header inside the toggle button, so a header holding a\n * dropdown or a second button is invalid. Here the row surface takes the click and a cell\n * opts out with `ExpandableRow.Controls`, while the arrow stays a real button so the\n * keyboard reaches it.\n */\n/**\n * The space before the header: the arrow's own inset, its glyph and the gap after it.\n * Exported so a consumer aligning a column header above these rows offsets by the same\n * amount instead of guessing at it.\n */\nexport const EXPANDABLE_ROW_LEAD_PX = 39;\n\nconst SurfaceExpandableRow: React.FC<SurfaceExpandableRowProps> & {\n Controls: typeof ExpandableRowControls;\n} = Object.assign(\n ({\n header,\n children,\n expanded,\n onToggle,\n sticky = false,\n stickyTopOffset = 0,\n divider = false,\n tone = 'default',\n 'aria-label': ariaLabel,\n className = '',\n style,\n }: SurfaceExpandableRowProps) => {\n const bodyId = React.useId();\n const toggle = onToggle ? () => onToggle(!expanded) : undefined;\n\n return (\n <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_TONE_CLASSES: Record<SurfaceTone, string> = {\n default:\n 'bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]',\n highlight: 'bg-[var(--malachite-card-warm-background,rgb(244,242,240))]',\n};\n\nconst Surface = (({\n children,\n padding = false,\n overflow = 'hidden',\n tone = 'default',\n shadow = tone !== 'highlight',\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}: SurfaceProps) => {\n // Literal class names (not interpolated) so Tailwind's JIT emits them.\n const 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} ${SURFACE_TONE_CLASSES[tone]} ${padding ? 'py-3 px-4' : ''} ${className}`}\n style={{\n ...(shadow ? { boxShadow: TRIPLE_SHADOW } : {}),\n ...FOREGROUND_RESET,\n ...style,\n }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </div>\n );\n}) as SurfaceComponent;\n\nSurface.Row = SurfaceRow;\nSurface.ExpandableRow = SurfaceExpandableRow;\n\nexport default Surface;\nexport { Surface, SurfaceRow, SurfaceExpandableRow };\n"],"names":["INSET_CLASSES","TONE_CLASSES","TONE_FOREGROUNDS","REVEALED_ON_INTERACTION","selectsTextIn","row","root","selection","_a","index","forwardedClick","event","TRIPLE_SHADOW","SurfaceRow","props","children","divider","disabled","selected","tone","inset","className","style","asChild","onClick","rawHref","target","rel","trailing","revealTrailing","leading","dimmed","role","href","safeHref","ariaLabel","ariaLabelledBy","tabIndex","interactive","hover","tinted","toneClass","hasTrailing","isRenderableNode","insetClass","controlPadding","chromeClasses","controlReset","rowClasses","control","paints","accent","forwards","rowRef","useRef","controlRef","pressLeftPadding","startPress","trackPress","useEffect","forwardPaddingClick","leftPadding","selectedStyle","SELECTED_ROW_BACKGROUND","SELECTED_ROW_FOREGROUND","SELECTED_ROW_ACCENT","SELECTED_TEXT_CONTEXT","toneForeground","rowStyle","ariaChecked","ariaCurrent","rowFallbackAria","paintOnChild","controlAria","hasLeading","boxed","content","jsxs","jsx","focusRing","FOCUS_RING_INSET_OVERLAY_HIDDEN","rowControlClasses","resolveRel","classes","FOCUS_RING_INSET","ExpandableRowControls","EXPANDABLE_ROW_LEAD_PX","SurfaceExpandableRow","header","expanded","onToggle","sticky","stickyTopOffset","bodyId","React","toggle","DisclosureArrow","SURFACE_TONE_CLASSES","Surface","padding","overflow","shadow","FOREGROUND_RESET"],"mappings":";;;;;;;;;AA0EA,MAAMA,KAA6E;AAAA,EAC/E,MAAM;AAAA;AAAA,EAEN,SAAS;AACb,GAyCMC,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,KAAgB,CAACC,MAA0B;;AAC7C,QAAMC,IAAOD,EAAI,YAAA,GAEXE,MADgBC,IAAAF,EAAiD,iBAAjD,gBAAAE,EAAA,KAAAF,OACYD,EAAI,cAAc,aAAA;AACpD,MAAI,CAACE,KAAaA,EAAU;AACxB,WAAO;AAEX,WAASE,IAAQ,GAAGA,IAAQF,EAAU,YAAYE,KAAS;AACvD,QAAIF,EAAU,WAAWE,CAAK,EAAE,eAAeJ,CAAG;AAC9C,aAAO;AAGf,SAAO;AACX,GAEMK,KAAiB,CAACC,MACpB,IAAKA,EAAM,YAAkC,SAASA,CAAK,GAEzDC,KACF,yGASEC,KAA2C,CAACC,MAAU;AACxD,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,I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