@stackone/malachite 2.95.0 → 2.95.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,183 +1,186 @@
1
- import { jsxs as S, jsx as t } from "react/jsx-runtime";
2
- import ue, { useId as me, useState as c, useEffect as K, useRef as q } from "react";
3
- import { DisclosureArrow as A } from "./DisclosureArrow.js";
4
- import fe from "./PinnedCornerCap.js";
5
- import { ARROW_PX as B, toggleGapPx as pe, togglePaddingLeftPx as be, bodyInsetPx as he } from "./accordionBodyInset.js";
6
- import { FOCUS_RING as ge, FOCUS_RING_INSET as ve } from "./focusRing.js";
7
- import { FRAME_BACKGROUND as xe, FRAME_CLASS as we } from "./frameStyles.js";
8
- import { isRenderableNode as W } from "./renderableNode.js";
9
- import { usePinned as Ne } from "./usePinned.js";
10
- const Re = "--malachite-ctx-pinned-surround", ke = 300, X = 1600, _e = { position: "absolute", width: 0, height: 0 }, ye = ({
11
- title: Y,
12
- header: J,
13
- className: Q,
1
+ import { jsxs as B, jsx as t } from "react/jsx-runtime";
2
+ import fe, { useId as pe, useState as c, useEffect as X, useRef as g } from "react";
3
+ import be from "./CollapseFocusHandOff.js";
4
+ import { DisclosureArrow as I } from "./DisclosureArrow.js";
5
+ import he from "./PinnedCornerCap.js";
6
+ import { ARROW_PX as L, toggleGapPx as ge, togglePaddingLeftPx as ve, bodyInsetPx as xe } from "./accordionBodyInset.js";
7
+ import { FOCUS_RING as we, FOCUS_RING_INSET as Ne } from "./focusRing.js";
8
+ import { FRAME_BACKGROUND as Re, FRAME_CLASS as ke } from "./frameStyles.js";
9
+ import { inertWhen as ye } from "./inert.js";
10
+ import { isRenderableNode as Y } from "./renderableNode.js";
11
+ import { usePinned as Ce } from "./usePinned.js";
12
+ const _e = "--malachite-ctx-pinned-surround", Se = 300, J = 1600, Ae = { position: "absolute", width: 0, height: 0 }, Be = ({
13
+ title: Q,
14
+ header: V,
15
+ className: Z,
14
16
  children: i,
15
- trailing: I,
16
- leading: L,
17
+ trailing: F,
18
+ leading: $,
17
19
  arrowPosition: u = "start",
18
- highlightExpanded: g = !0,
19
- bodyIndent: V = "none",
20
- variant: Z = "default",
21
- defaultExpanded: H = !1,
22
- isExpanded: v,
23
- onToggle: x,
24
- disabled: w = !1,
20
+ highlightExpanded: v = !0,
21
+ bodyIndent: H = "none",
22
+ variant: ee = "default",
23
+ defaultExpanded: te = !1,
24
+ isExpanded: x,
25
+ onToggle: w,
26
+ disabled: N = !1,
25
27
  stickyHeader: d = !1,
26
28
  stickyTopOffset: m = 0,
27
- pinnedCorners: ee = !1,
29
+ pinnedCorners: re = !1,
28
30
  animate: l = !0,
29
- collapsible: o = !0,
31
+ collapsible: n = !0,
30
32
  flashKey: f
31
- }, te) => {
32
- const N = w || !o, r = Z === "sunken", R = `${me()}-body`, [$, j] = c(H), [re, ne] = c(f), [p, oe] = c(0), [E, F] = c(!1);
33
- Object.is(f, re) || (ne(f), f !== void 0 && (oe(p + 1), F(!0))), K(() => {
33
+ }, oe) => {
34
+ const R = N || !n, r = ee === "sunken", k = `${pe()}-body`, [j, E] = c(te), [ne, ae] = c(f), [p, se] = c(0), [P, D] = c(!1);
35
+ Object.is(f, ne) || (ae(f), f !== void 0 && (se(p + 1), D(!0))), X(() => {
34
36
  if (p === 0)
35
37
  return;
36
- const n = window.setTimeout(() => F(!1), X);
37
- return () => window.clearTimeout(n);
38
- }, [p]), !o && !$ && j(!0);
39
- const e = !o || (v !== void 0 ? v : $), k = o && u === "gutter", ae = l || e && !!i, [s, b] = c(!o), P = q(e);
40
- !e && s ? b(!1) : e && !l && !s && b(!0), K(() => {
38
+ const o = window.setTimeout(() => D(!1), J);
39
+ return () => window.clearTimeout(o);
40
+ }, [p]), !n && !j && E(!0);
41
+ const e = !n || (x !== void 0 ? x : j), y = n && u === "gutter", ie = l || e && !!i, [s, b] = c(!n), M = g(e);
42
+ !e && s ? b(!1) : e && !l && !s && b(!0), X(() => {
41
43
  if (!e) {
42
- P.current = !1;
44
+ M.current = !1;
43
45
  return;
44
46
  }
45
- if (!l || s || P.current && o)
47
+ if (!l || s || M.current && n)
46
48
  return;
47
- const n = window.setTimeout(() => b(!0), ke);
48
- return () => window.clearTimeout(n);
49
- }, [l, e, o, s]);
50
- const D = q(null), M = !!d && ee && !r, _ = Ne(D, m, M), y = W(L), a = V === "title", h = a ? "grid grid-cols-subgrid col-span-4" : "", z = () => {
51
- const n = !e;
52
- v === void 0 && j(n), x == null || x(n);
53
- }, se = [
49
+ const o = window.setTimeout(() => b(!0), Se);
50
+ return () => window.clearTimeout(o);
51
+ }, [l, e, n, s]);
52
+ const C = g(null), z = g(null), T = g(null), G = !!d && re && !r, _ = Ce(T, m, G), S = Y($), a = H === "title", h = a ? "grid grid-cols-subgrid col-span-4" : "", O = () => {
53
+ const o = !e;
54
+ x === void 0 && E(o), w == null || w(o);
55
+ }, de = [
54
56
  a ? "grid grid-cols-[auto_auto_minmax(0,1fr)_auto]" : "flex flex-col",
55
57
  "w-full text-left",
56
58
  // The table's frame, so a sunken section reads as the same kind of container as a table
57
59
  // beside it, in both themes.
58
- r ? we : "",
59
- E ? "relative" : "",
60
- Q
61
- ].filter(Boolean).join(" "), ie = [
60
+ r ? ke : "",
61
+ P ? "relative" : "",
62
+ Z
63
+ ].filter(Boolean).join(" "), le = [
62
64
  // `group` only when enabled, so the arrow doesn't darken on hover while disabled.
63
- N ? "" : "group",
65
+ R ? "" : "group",
64
66
  a ? h : "flex w-full",
65
67
  "items-center transition-colors",
66
68
  r ? "" : "border-0 border-b border-solid border-[var(--malachite-card-border)]",
67
69
  d ? `sticky ${_ ? "z-10" : "z-[8]"}` : "",
68
- r ? "bg-transparent" : d ? e && g || N ? "" : "hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]" : e && g ? "bg-[var(--malachite-buttonlist-hover-background)]" : N ? "bg-transparent" : "bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]"
69
- ].filter(Boolean).join(" "), T = [
70
+ r ? "bg-transparent" : d ? e && v || R ? "" : "hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]" : e && v ? "bg-[var(--malachite-buttonlist-hover-background)]" : R ? "bg-transparent" : "bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]"
71
+ ].filter(Boolean).join(" "), U = [
70
72
  "flex flex-1 items-center min-w-0 text-left",
71
73
  r ? "pr-[16px] py-[12px]" : "pr-[16px] py-[16px]",
72
74
  a ? "col-start-3" : ""
73
- ].filter(Boolean).join(" "), de = [
74
- T,
75
+ ].filter(Boolean).join(" "), ce = [
76
+ U,
75
77
  "appearance-none border-0 bg-transparent cursor-pointer select-none disabled:cursor-not-allowed",
76
- r ? `rounded-lg ${ge}` : ve
77
- ].join(" "), G = {
78
- paddingLeft: be(y || k),
79
- gap: pe(r)
80
- }, U = J ?? /* @__PURE__ */ t("span", { className: "flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]", children: Y }), le = !r && e && g, ce = d ? {
78
+ r ? `rounded-lg ${we}` : Ne
79
+ ].join(" "), K = {
80
+ paddingLeft: ve(S || y),
81
+ gap: ge(r)
82
+ }, W = V ?? /* @__PURE__ */ t("span", { className: "flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]", children: Q }), ue = !r && e && v, me = d ? {
81
83
  top: `${m}px`,
82
- backgroundColor: r ? xe : "var(--malachite-card-background)",
83
- ...le && {
84
+ backgroundColor: r ? Re : "var(--malachite-card-background)",
85
+ ...ue && {
84
86
  backgroundImage: "linear-gradient(var(--malachite-buttonlist-hover-background), var(--malachite-buttonlist-hover-background))"
85
87
  }
86
- } : {}, C = he({
87
- arrowPosition: o ? u : "end",
88
- hasLeading: y,
88
+ } : {}, A = xe({
89
+ arrowPosition: n ? u : "end",
90
+ hasLeading: S,
89
91
  sunken: r
90
- }), O = a ? /* @__PURE__ */ t(
92
+ }), q = a ? /* @__PURE__ */ t(
91
93
  "div",
92
94
  {
93
95
  className: "col-start-3 col-span-2 min-w-0",
94
- style: C < 0 ? { marginLeft: C } : { paddingLeft: C },
96
+ style: A < 0 ? { marginLeft: A } : { paddingLeft: A },
95
97
  children: i
96
98
  }
97
99
  ) : i;
98
- return /* @__PURE__ */ S(
100
+ return /* @__PURE__ */ B(
99
101
  "div",
100
102
  {
101
- ref: te,
102
- className: se,
103
+ ref: oe,
104
+ className: de,
103
105
  style: d && m ? { scrollMarginTop: m } : void 0,
104
106
  children: [
105
- E && /* @__PURE__ */ t(
107
+ P && /* @__PURE__ */ t(
106
108
  "span",
107
109
  {
108
110
  "aria-hidden": "true",
109
111
  className: "pointer-events-none absolute inset-0 z-[11] rounded-[inherit] [outline-offset:-2px] [animation:malachite-section-flash_ease-out] motion-reduce:[animation-name:malachite-section-flash-still]",
110
- style: { animationDuration: `${X}ms` },
112
+ style: { animationDuration: `${J}ms` },
111
113
  "data-accordion-flash": ""
112
114
  },
113
115
  p
114
116
  ),
115
- M && /* @__PURE__ */ t("div", { ref: D, "aria-hidden": "true", style: _e }),
116
- /* @__PURE__ */ S(
117
+ G && /* @__PURE__ */ t("div", { ref: T, "aria-hidden": "true", style: Ae }),
118
+ /* @__PURE__ */ B(
117
119
  "div",
118
120
  {
119
- className: ie,
120
- style: ce,
121
+ className: le,
122
+ style: me,
121
123
  "data-accordion-header": "",
122
124
  "data-pinned": _ ? "" : void 0,
123
125
  children: [
124
126
  _ && /* @__PURE__ */ t(
125
- fe,
127
+ he,
126
128
  {
127
129
  bordered: !0,
128
130
  radius: "var(--malachite-radius-xxl, 14px)",
129
- surround: `var(${Re}, var(--malachite-card-sunken-background))`
131
+ surround: `var(${_e}, var(--malachite-card-sunken-background))`
130
132
  }
131
133
  ),
132
- k && /* @__PURE__ */ t(
134
+ y && /* @__PURE__ */ t(
133
135
  "button",
134
136
  {
135
137
  type: "button",
136
138
  tabIndex: -1,
137
139
  "aria-hidden": "true",
138
140
  className: `${a ? "col-start-1" : ""} shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed`,
139
- onMouseDown: (n) => n.preventDefault(),
140
- onClick: z,
141
- disabled: w,
142
- children: /* @__PURE__ */ t(A, { expanded: e, size: B })
141
+ onMouseDown: (o) => o.preventDefault(),
142
+ onClick: O,
143
+ disabled: N,
144
+ children: /* @__PURE__ */ t(I, { expanded: e, size: L })
143
145
  }
144
146
  ),
145
- y && /* @__PURE__ */ t(
147
+ S && /* @__PURE__ */ t(
146
148
  "div",
147
149
  {
148
- className: `${a ? "col-start-2" : ""} shrink-0 flex items-center ${k ? "pl-[12px]" : "pl-[16px]"}`,
149
- children: L
150
+ className: `${a ? "col-start-2" : ""} shrink-0 flex items-center ${y ? "pl-[12px]" : "pl-[16px]"}`,
151
+ children: $
150
152
  }
151
153
  ),
152
- o ? /* @__PURE__ */ S(
154
+ n ? /* @__PURE__ */ B(
153
155
  "button",
154
156
  {
157
+ ref: z,
155
158
  type: "button",
156
- className: de,
157
- style: G,
158
- onClick: z,
159
+ className: ce,
160
+ style: K,
161
+ onClick: O,
159
162
  "aria-expanded": e,
160
- "aria-controls": ae ? R : void 0,
161
- disabled: w,
163
+ "aria-controls": ie ? k : void 0,
164
+ disabled: N,
162
165
  children: [
163
- u === "start" && /* @__PURE__ */ t(A, { expanded: e, size: B }),
164
- U,
166
+ u === "start" && /* @__PURE__ */ t(I, { expanded: e, size: L }),
167
+ W,
165
168
  u === "end" && /* @__PURE__ */ t(
166
- A,
169
+ I,
167
170
  {
168
171
  expanded: e,
169
- size: B,
172
+ size: L,
170
173
  className: "ml-auto"
171
174
  }
172
175
  )
173
176
  ]
174
177
  }
175
- ) : /* @__PURE__ */ t("div", { className: T, style: G, children: U }),
176
- W(I) && /* @__PURE__ */ t(
178
+ ) : /* @__PURE__ */ t("div", { className: U, style: K, children: W }),
179
+ Y(F) && /* @__PURE__ */ t(
177
180
  "div",
178
181
  {
179
182
  className: `${a ? "col-start-4" : ""} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`,
180
- children: I
183
+ children: F
181
184
  }
182
185
  )
183
186
  ]
@@ -192,11 +195,13 @@ const Re = "--malachite-ctx-pinned-surround", ke = 300, X = 1600, _e = { positio
192
195
  /* @__PURE__ */ t(
193
196
  "div",
194
197
  {
195
- id: R,
198
+ ref: C,
199
+ ...ye(!e),
200
+ id: k,
196
201
  className: `grid ${a ? "grid-cols-subgrid col-span-4" : "grid-cols-[minmax(0,1fr)]"} w-full transition-[grid-template-rows] duration-200 ease-in-out`,
197
202
  style: { gridTemplateRows: e ? "1fr" : "0fr" },
198
- onTransitionEnd: (n) => {
199
- n.target === n.currentTarget && n.propertyName === "grid-template-rows" && b(e);
203
+ onTransitionEnd: (o) => {
204
+ o.target === o.currentTarget && o.propertyName === "grid-template-rows" && b(e);
200
205
  },
201
206
  children: /* @__PURE__ */ t(
202
207
  "div",
@@ -210,7 +215,7 @@ const Re = "--malachite-ctx-pinned-surround", ke = 300, X = 1600, _e = { positio
210
215
  h,
211
216
  r ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]"
212
217
  ].filter(Boolean).join(" "),
213
- children: O
218
+ children: q
214
219
  }
215
220
  )
216
221
  }
@@ -222,22 +227,24 @@ const Re = "--malachite-ctx-pinned-surround", ke = 300, X = 1600, _e = { positio
222
227
  e && i && /* @__PURE__ */ t(
223
228
  "div",
224
229
  {
225
- id: R,
230
+ ref: C,
231
+ id: k,
226
232
  className: [
227
233
  h,
228
234
  r ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]"
229
235
  ].filter(Boolean).join(" "),
230
- children: O
236
+ children: q
231
237
  }
232
238
  )
233
- )
239
+ ),
240
+ /* @__PURE__ */ t(be, { expanded: e, bodyRef: C, toggleRef: z })
234
241
  ]
235
242
  }
236
243
  );
237
- }, Ce = ue.forwardRef(ye);
238
- Ce.displayName = "Accordion";
244
+ }, Ie = fe.forwardRef(Be);
245
+ Ie.displayName = "Accordion";
239
246
  export {
240
- Ce as Accordion,
241
- Ce as default
247
+ Ie as Accordion,
248
+ Ie as default
242
249
  };
243
250
  //# sourceMappingURL=Accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sources":["../../src/components/Accordion.tsx"],"sourcesContent":["import React, { useEffect, useId, useRef, useState } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport PinnedCornerCap from './PinnedCornerCap';\nimport { ARROW_PX, bodyInsetPx, toggleGapPx, togglePaddingLeftPx } from './accordionBodyInset';\nimport { FOCUS_RING, FOCUS_RING_INSET } from './focusRing';\nimport { FRAME_BACKGROUND, FRAME_CLASS } from './frameStyles';\nimport { isRenderableNode } from './renderableNode';\nimport { usePinned } from './usePinned';\n\n/** The ground behind a pinned header's card, painted into its corners. A context channel, not a\n * theme token: no palette value, not settable through `applyTheme`, absent from\n * `getCurrentTheme`. Set it on an ancestor when the card does not sit on the page ground. */\nconst PINNED_SURROUND_CHANNEL = '--malachite-ctx-pinned-surround';\n\nconst SETTLE_FALLBACK_MS = 300;\nconst FLASH_MS = 1600;\n\n// Out of flow with no insets: it rests at the section's top without a cell or a caller's gap.\nconst PIN_MARKER_STYLE: React.CSSProperties = { position: 'absolute', width: 0, height: 0 };\n\ninterface AccordionBaseProps {\n className?: string;\n children?: React.ReactNode;\n /**\n * Visual style. `default` is the flat list row (row dividers, hover background).\n * `sunken` draws the section as a sunken card (a rounded container in the table's frame\n * colour, no dividers/hover) — used for stacked detail sections in side panels and\n * detail pages (see `CollapsibleSection`). Both lead with the arrow: it is the affordance\n * that says the section opens, and a reader scanning a stack of them finds it in\n * one column rather than at whatever width each header happens to end.\n */\n variant?: 'default' | 'sunken';\n /**\n * Content pinned to the right of the header, OUTSIDE the toggle button — so it may\n * be interactive (e.g. a Checkbox) without nesting a button inside a button.\n */\n trailing?: React.ReactNode;\n /** Before the title, outside the toggle button. */\n leading?: React.ReactNode;\n /** `false` keeps an open row on the card ground. */\n highlightExpanded?: boolean;\n /** `title` starts the body under the title, 16px short of it for a compact `Surface.Row`. */\n bodyIndent?: 'none' | 'title';\n /**\n * Pin the header row to the top of the nearest scroll container so it stays\n * reachable while the body scrolls. Needs a scroll ancestor that clips without\n * trapping sticky — e.g. a `<Surface overflow=\"clip\">` (`overflow: hidden` traps it).\n */\n stickyHeader?: boolean;\n /** Offset (px) from the top of the scroll container when `stickyHeader` is set. */\n stickyTopOffset?: number;\n /**\n * With `stickyHeader`, rounds the header into its card's top corners once it pins,\n * in a flat, default-tone `<Surface overflow=\"clip\" shadow={false}>`. Set\n * `--malachite-ctx-pinned-surround` on an ancestor when the card sits on another ground.\n */\n pinnedCorners?: boolean;\n /** Change it after mount to flash an outline around the section. */\n flashKey?: React.Key;\n}\n\ninterface AccordionToggleProps {\n /** `false` is a section that never closes; the toggle props except `animate` are then ignored. */\n collapsible?: boolean;\n /** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */\n arrowPosition?: 'start' | 'end' | 'gutter';\n defaultExpanded?: boolean;\n isExpanded?: boolean;\n onToggle?: (expanded: boolean) => void;\n /** Disables the toggle (and its hover). Trailing controls manage their own state. */\n disabled?: boolean;\n /**\n * Animate the expand/collapse height (default `true`). Set `false` for an instant\n * open — the body isn't clipped, so a `position: sticky` child pins immediately with\n * no post-animation settle.\n */\n animate?: boolean;\n}\n\n/**\n * Requires at least one of `title` (simple text header) or `header` (rich ReactNode\n * content for the toggle area, e.g. avatar + badges) so the toggle is never empty.\n */\ntype AccordionProps = AccordionBaseProps &\n AccordionToggleProps &\n ({ title: string; header?: React.ReactNode } | { title?: string; header: React.ReactNode });\n\nconst AccordionSection = (\n {\n title,\n header,\n className,\n children,\n trailing,\n leading,\n arrowPosition = 'start',\n highlightExpanded = true,\n bodyIndent = 'none',\n variant = 'default',\n defaultExpanded = false,\n isExpanded,\n onToggle,\n disabled = false,\n stickyHeader = false,\n stickyTopOffset = 0,\n pinnedCorners = false,\n animate = true,\n collapsible = true,\n flashKey,\n }: AccordionProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const quiet = disabled || !collapsible;\n const sunken = variant === 'sunken';\n const instanceId = useId();\n const bodyId = `${instanceId}-body`;\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const [prevFlashKey, setPrevFlashKey] = useState(flashKey);\n const [flashRun, setFlashRun] = useState(0);\n const [flashing, setFlashing] = useState(false);\n if (!Object.is(flashKey, prevFlashKey)) {\n setPrevFlashKey(flashKey);\n if (flashKey !== undefined) {\n setFlashRun(flashRun + 1);\n setFlashing(true);\n }\n }\n useEffect(() => {\n if (flashRun === 0) {\n return;\n }\n const end = window.setTimeout(() => setFlashing(false), FLASH_MS);\n return () => window.clearTimeout(end);\n }, [flashRun]);\n if (!collapsible && !internalExpanded) {\n setInternalExpanded(true);\n }\n\n // Use controlled state if isExpanded is provided, otherwise use internal state\n const expanded = !collapsible || (isExpanded !== undefined ? isExpanded : internalExpanded);\n const gutter = collapsible && arrowPosition === 'gutter';\n\n // The instant path only renders the body while expanded; don't advertise\n // aria-controls when the referenced element isn't in the DOM.\n const bodyRendered = animate || (expanded && !!children);\n\n // The body clips overflow so the expand/collapse height animation works. Once fully\n // expanded we release the clip (after the transition) so a `position: sticky` child\n // inside can pin — `overflow: hidden` would otherwise trap it.\n const [bodySettled, setBodySettled] = useState(!collapsible);\n const mountedOpen = useRef(expanded);\n if (!expanded && bodySettled) {\n setBodySettled(false);\n } else if (expanded && !animate && !bodySettled) {\n setBodySettled(true);\n }\n useEffect(() => {\n if (!expanded) {\n mountedOpen.current = false;\n return undefined;\n }\n if (!animate || bodySettled || (mountedOpen.current && collapsible)) {\n return undefined;\n }\n // Not `transitioncancel`: reversing a running transition fires it while the new one runs.\n const fallback = window.setTimeout(() => setBodySettled(true), SETTLE_FALLBACK_MS);\n return () => window.clearTimeout(fallback);\n }, [animate, expanded, collapsible, bodySettled]);\n const markerRef = useRef<HTMLDivElement>(null);\n const capsCorners = Boolean(stickyHeader) && pinnedCorners && !sunken;\n const pinned = usePinned(markerRef, stickyTopOffset, capsCorners);\n const hasLeading = isRenderableNode(leading);\n\n // One header column per slot, so the body can start at the toggle's.\n const titleGrid = bodyIndent === 'title';\n const subgrid = titleGrid ? 'grid grid-cols-subgrid col-span-4' : '';\n\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n setInternalExpanded(newExpanded);\n }\n onToggle?.(newExpanded);\n };\n\n const containerClasses = [\n titleGrid ? 'grid grid-cols-[auto_auto_minmax(0,1fr)_auto]' : 'flex flex-col',\n 'w-full text-left',\n // The table's frame, so a sunken section reads as the same kind of container as a table\n // beside it, in both themes.\n sunken ? FRAME_CLASS : '',\n flashing ? 'relative' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // The whole header row is a `group` so the disclosure arrow darkens on hover; the\n // hover background and arrow react to hovering anywhere on the row. The sunken\n // variant carries its own card chrome instead of row dividers/hover.\n // A pinned header's hover paints over its inline ground (headerRowStyle), which beats a\n // bg-colour class. Written out in full so Tailwind's scanner generates it.\n const pinnedBackground =\n (expanded && highlightExpanded) || quiet\n ? ''\n : 'hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]';\n const rowBackground = sunken\n ? 'bg-transparent'\n : stickyHeader\n ? pinnedBackground\n : expanded && highlightExpanded\n ? 'bg-[var(--malachite-buttonlist-hover-background)]'\n : quiet\n ? 'bg-transparent'\n : 'bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]';\n const headerRowClasses = [\n // `group` only when enabled, so the arrow doesn't darken on hover while disabled.\n quiet ? '' : 'group',\n titleGrid ? subgrid : 'flex w-full',\n 'items-center transition-colors',\n sunken ? '' : 'border-0 border-b border-solid border-[var(--malachite-card-border)]',\n stickyHeader ? `sticky ${pinned ? 'z-10' : 'z-[8]'}` : '',\n rowBackground,\n ]\n .filter(Boolean)\n .join(' ');\n const titleAreaClasses = [\n 'flex flex-1 items-center min-w-0 text-left',\n sunken ? 'pr-[16px] py-[12px]' : 'pr-[16px] py-[16px]',\n titleGrid ? 'col-start-3' : '',\n ]\n .filter(Boolean)\n .join(' ');\n // Full-bleed default rows use an inset ring; the padded sunken toggle fits an outset one.\n const toggleButtonClasses = [\n titleAreaClasses,\n 'appearance-none border-0 bg-transparent cursor-pointer select-none disabled:cursor-not-allowed',\n sunken ? `rounded-lg ${FOCUS_RING}` : FOCUS_RING_INSET,\n ].join(' ');\n const titleAreaStyle: React.CSSProperties = {\n paddingLeft: togglePaddingLeftPx(hasLeading || gutter),\n gap: toggleGapPx(sunken),\n };\n const titleContent = header ?? (\n <span className=\"flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]\">\n {title}\n </span>\n );\n\n // Inline so the offset, the opaque ground and the open highlight apply even where arbitrary\n // classes are not compiled. The ground is the variant's own: a sunken section pinned in card\n // white would float over its frame.\n const highlighted = !sunken && expanded && highlightExpanded;\n const headerRowStyle: React.CSSProperties = stickyHeader\n ? {\n top: `${stickyTopOffset}px`,\n backgroundColor: sunken ? FRAME_BACKGROUND : 'var(--malachite-card-background)',\n ...(highlighted && {\n backgroundImage:\n 'linear-gradient(var(--malachite-buttonlist-hover-background), var(--malachite-buttonlist-hover-background))',\n }),\n }\n : {};\n\n const titleInset = bodyInsetPx({\n arrowPosition: collapsible ? arrowPosition : 'end',\n hasLeading,\n sunken,\n });\n const bodyChildren = titleGrid ? (\n <div\n className=\"col-start-3 col-span-2 min-w-0\"\n style={titleInset < 0 ? { marginLeft: titleInset } : { paddingLeft: titleInset }}\n >\n {children}\n </div>\n ) : (\n children\n );\n\n return (\n <div\n ref={ref}\n className={containerClasses}\n style={\n stickyHeader && stickyTopOffset ? { scrollMarginTop: stickyTopOffset } : undefined\n }\n >\n {flashing && (\n <span\n key={flashRun}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 z-[11] rounded-[inherit] [outline-offset:-2px] [animation:malachite-section-flash_ease-out] motion-reduce:[animation-name:malachite-section-flash-still]\"\n style={{ animationDuration: `${FLASH_MS}ms` }}\n data-accordion-flash=\"\"\n />\n )}\n {capsCorners && <div ref={markerRef} aria-hidden=\"true\" style={PIN_MARKER_STYLE} />}\n <div\n className={headerRowClasses}\n style={headerRowStyle}\n data-accordion-header=\"\"\n data-pinned={pinned ? '' : undefined}\n >\n {pinned && (\n <PinnedCornerCap\n bordered\n radius=\"var(--malachite-radius-xxl, 14px)\"\n surround={`var(${PINNED_SURROUND_CHANNEL}, var(--malachite-card-sunken-background))`}\n />\n )}\n {gutter && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className={`${titleGrid ? 'col-start-1' : ''} shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={handleToggle}\n disabled={disabled}\n >\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n </button>\n )}\n {hasLeading && (\n <div\n className={`${titleGrid ? 'col-start-2' : ''} shrink-0 flex items-center ${gutter ? 'pl-[12px]' : 'pl-[16px]'}`}\n >\n {leading}\n </div>\n )}\n {/* Toggle area — arrow + header/title. Interactive trailing sits outside it. */}\n {collapsible ? (\n <button\n type=\"button\"\n className={toggleButtonClasses}\n style={titleAreaStyle}\n onClick={handleToggle}\n aria-expanded={expanded}\n aria-controls={bodyRendered ? bodyId : undefined}\n disabled={disabled}\n >\n {arrowPosition === 'start' && (\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n )}\n {titleContent}\n {arrowPosition === 'end' && (\n <DisclosureArrow\n expanded={expanded}\n size={ARROW_PX}\n className=\"ml-auto\"\n />\n )}\n </button>\n ) : (\n <div className={titleAreaClasses} style={titleAreaStyle}>\n {titleContent}\n </div>\n )}\n {isRenderableNode(trailing) && (\n <div\n className={`${titleGrid ? 'col-start-4' : ''} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`}\n >\n {trailing}\n </div>\n )}\n </div>\n\n {animate ? (\n /* Height animates via grid-template-rows (0fr → 1fr); body clips during.\n grid-cols-[minmax(0,1fr)] pins the single column to the track width so\n wide, non-wrapping children (e.g. a table with long cell text) can't grow\n the implicit `auto` column to their max-content and overflow the container;\n the title grid's body cell uses min-w-0 instead. */\n <div\n id={bodyId}\n className={`grid ${titleGrid ? 'grid-cols-subgrid col-span-4' : 'grid-cols-[minmax(0,1fr)]'} w-full transition-[grid-template-rows] duration-200 ease-in-out`}\n style={{ gridTemplateRows: expanded ? '1fr' : '0fr' }}\n onTransitionEnd={(event) => {\n if (\n event.target === event.currentTarget &&\n event.propertyName === 'grid-template-rows'\n ) {\n setBodySettled(expanded);\n }\n }}\n >\n <div\n className={[subgrid, bodySettled ? 'overflow-visible' : 'overflow-hidden']\n .filter(Boolean)\n .join(' ')}\n data-settled={bodySettled ? '' : undefined}\n >\n {children && (\n <div\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )}\n </div>\n </div>\n ) : (\n /* Instant open — no clip, so a sticky child inside pins immediately. */\n expanded &&\n children && (\n <div\n id={bodyId}\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )\n )}\n </div>\n );\n};\n\nconst Accordion = React.forwardRef(AccordionSection);\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\nexport { Accordion };\nexport type { AccordionProps };\n"],"names":["PINNED_SURROUND_CHANNEL","SETTLE_FALLBACK_MS","FLASH_MS","PIN_MARKER_STYLE","AccordionSection","title","header","className","children","trailing","leading","arrowPosition","highlightExpanded","bodyIndent","variant","defaultExpanded","isExpanded","onToggle","disabled","stickyHeader","stickyTopOffset","pinnedCorners","animate","collapsible","flashKey","ref","quiet","sunken","bodyId","useId","internalExpanded","setInternalExpanded","useState","prevFlashKey","setPrevFlashKey","flashRun","setFlashRun","flashing","setFlashing","useEffect","end","expanded","gutter","bodyRendered","bodySettled","setBodySettled","mountedOpen","useRef","fallback","markerRef","capsCorners","pinned","usePinned","hasLeading","isRenderableNode","titleGrid","subgrid","handleToggle","newExpanded","containerClasses","FRAME_CLASS","headerRowClasses","titleAreaClasses","toggleButtonClasses","FOCUS_RING","FOCUS_RING_INSET","titleAreaStyle","togglePaddingLeftPx","toggleGapPx","titleContent","jsx","highlighted","headerRowStyle","FRAME_BACKGROUND","titleInset","bodyInsetPx","bodyChildren","jsxs","PinnedCornerCap","event","DisclosureArrow","ARROW_PX","Accordion","React"],"mappings":";;;;;;;;;AAYA,MAAMA,KAA0B,mCAE1BC,KAAqB,KACrBC,IAAW,MAGXC,KAAwC,EAAE,UAAU,YAAY,OAAO,GAAG,QAAQ,EAAA,GAqElFC,KAAmB,CACrB;AAAA,EACI,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,mBAAAC,IAAoB;AAAA,EACpB,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,iBAAAC,IAAkB;AAAA,EAClB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,iBAAAC,IAAkB;AAAA,EAClB,eAAAC,KAAgB;AAAA,EAChB,SAAAC,IAAU;AAAA,EACV,aAAAC,IAAc;AAAA,EACd,UAAAC;AACJ,GACAC,OACC;AACD,QAAMC,IAAQR,KAAY,CAACK,GACrBI,IAASb,MAAY,UAErBc,IAAS,GADIC,GAAA,CACS,SACtB,CAACC,GAAkBC,CAAmB,IAAIC,EAASjB,CAAe,GAClE,CAACkB,IAAcC,EAAe,IAAIF,EAAS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AA;AAAA;AAAA;AAAA;AAAA,UAMG,gBAAAgD;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,IAAI1C;AAAA,cACJ,WAAW,QAAQ2B,IAAY,iCAAiC,2BAA2B;AAAA,cAC3F,OAAO,EAAE,kBAAkBd,IAAW,QAAQ,MAAA;AAAA,cAC9C,iBAAiB,CAACsC,MAAU;AACxB,gBACIA,EAAM,WAAWA,EAAM,iBACvBA,EAAM,iBAAiB,wBAEvBlC,EAAeJ,CAAQ;AAAA,cAE/B;AAAA,cAEA,UAAA,gBAAA6B;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW,CAACd,GAASZ,IAAc,qBAAqB,iBAAiB,EACpE,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,kBACb,gBAAcA,IAAc,KAAK;AAAA,kBAEhC,UAAApC,KACG,gBAAA8D;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACG,WAAW;AAAA,wBACPd;AAAA,wBACA7B,IACM,aACA;AAAA,sBAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,sBAEZ,UAAAiD;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACL;AAAA,cAAA;AAAA,YAER;AAAA,UAAA;AAAA;AAAA;AAAA,UAIJnC,KACAjC,KACI,gBAAA8D;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,IAAI1C;AAAA,cACJ,WAAW;AAAA,gBACP4B;AAAA,gBACA7B,IACM,aACA;AAAA,cAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,cAEZ,UAAAiD;AAAA,YAAA;AAAA,UAAA;AAAA;AAAA,MACL;AAAA,IAAA;AAAA,EAAA;AAKpB,GAEMM,KAAYC,GAAM,WAAW/E,EAAgB;AACnD8E,GAAU,cAAc;"}
1
+ {"version":3,"file":"Accordion.js","sources":["../../src/components/Accordion.tsx"],"sourcesContent":["import React, { useEffect, useId, useRef, useState } from 'react';\nimport CollapseFocusHandOff from './CollapseFocusHandOff';\nimport DisclosureArrow from './DisclosureArrow';\nimport PinnedCornerCap from './PinnedCornerCap';\nimport { ARROW_PX, bodyInsetPx, toggleGapPx, togglePaddingLeftPx } from './accordionBodyInset';\nimport { FOCUS_RING, FOCUS_RING_INSET } from './focusRing';\nimport { FRAME_BACKGROUND, FRAME_CLASS } from './frameStyles';\nimport { inertWhen } from './inert';\nimport { isRenderableNode } from './renderableNode';\nimport { usePinned } from './usePinned';\n\n/** The ground behind a pinned header's card, painted into its corners. A context channel, not a\n * theme token: no palette value, not settable through `applyTheme`, absent from\n * `getCurrentTheme`. Set it on an ancestor when the card does not sit on the page ground. */\nconst PINNED_SURROUND_CHANNEL = '--malachite-ctx-pinned-surround';\n\nconst SETTLE_FALLBACK_MS = 300;\nconst FLASH_MS = 1600;\n\n// Out of flow with no insets: it rests at the section's top without a cell or a caller's gap.\nconst PIN_MARKER_STYLE: React.CSSProperties = { position: 'absolute', width: 0, height: 0 };\n\ninterface AccordionBaseProps {\n className?: string;\n children?: React.ReactNode;\n /**\n * Visual style. `default` is the flat list row (row dividers, hover background).\n * `sunken` draws the section as a sunken card (a rounded container in the table's frame\n * colour, no dividers/hover) — used for stacked detail sections in side panels and\n * detail pages (see `CollapsibleSection`). Both lead with the arrow: it is the affordance\n * that says the section opens, and a reader scanning a stack of them finds it in\n * one column rather than at whatever width each header happens to end.\n */\n variant?: 'default' | 'sunken';\n /**\n * Content pinned to the right of the header, OUTSIDE the toggle button — so it may\n * be interactive (e.g. a Checkbox) without nesting a button inside a button.\n */\n trailing?: React.ReactNode;\n /** Before the title, outside the toggle button. */\n leading?: React.ReactNode;\n /** `false` keeps an open row on the card ground. */\n highlightExpanded?: boolean;\n /** `title` starts the body under the title, 16px short of it for a compact `Surface.Row`. */\n bodyIndent?: 'none' | 'title';\n /**\n * Pin the header row to the top of the nearest scroll container so it stays\n * reachable while the body scrolls. Needs a scroll ancestor that clips without\n * trapping sticky — e.g. a `<Surface overflow=\"clip\">` (`overflow: hidden` traps it).\n */\n stickyHeader?: boolean;\n /** Offset (px) from the top of the scroll container when `stickyHeader` is set. */\n stickyTopOffset?: number;\n /**\n * With `stickyHeader`, rounds the header into its card's top corners once it pins,\n * in a flat, default-tone `<Surface overflow=\"clip\" shadow={false}>`. Set\n * `--malachite-ctx-pinned-surround` on an ancestor when the card sits on another ground.\n */\n pinnedCorners?: boolean;\n /** Change it after mount to flash an outline around the section. */\n flashKey?: React.Key;\n}\n\ninterface AccordionToggleProps {\n /** `false` is a section that never closes; the toggle props except `animate` are then ignored. */\n collapsible?: boolean;\n /** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */\n arrowPosition?: 'start' | 'end' | 'gutter';\n defaultExpanded?: boolean;\n isExpanded?: boolean;\n onToggle?: (expanded: boolean) => void;\n /** Disables the toggle (and its hover). Trailing controls manage their own state. */\n disabled?: boolean;\n /**\n * Animate the expand/collapse height (default `true`). Set `false` for an instant\n * open — the body isn't clipped, so a `position: sticky` child pins immediately with\n * no post-animation settle.\n */\n animate?: boolean;\n}\n\n/**\n * Requires at least one of `title` (simple text header) or `header` (rich ReactNode\n * content for the toggle area, e.g. avatar + badges) so the toggle is never empty.\n */\ntype AccordionProps = AccordionBaseProps &\n AccordionToggleProps &\n ({ title: string; header?: React.ReactNode } | { title?: string; header: React.ReactNode });\n\nconst AccordionSection = (\n {\n title,\n header,\n className,\n children,\n trailing,\n leading,\n arrowPosition = 'start',\n highlightExpanded = true,\n bodyIndent = 'none',\n variant = 'default',\n defaultExpanded = false,\n isExpanded,\n onToggle,\n disabled = false,\n stickyHeader = false,\n stickyTopOffset = 0,\n pinnedCorners = false,\n animate = true,\n collapsible = true,\n flashKey,\n }: AccordionProps,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const quiet = disabled || !collapsible;\n const sunken = variant === 'sunken';\n const instanceId = useId();\n const bodyId = `${instanceId}-body`;\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const [prevFlashKey, setPrevFlashKey] = useState(flashKey);\n const [flashRun, setFlashRun] = useState(0);\n const [flashing, setFlashing] = useState(false);\n if (!Object.is(flashKey, prevFlashKey)) {\n setPrevFlashKey(flashKey);\n if (flashKey !== undefined) {\n setFlashRun(flashRun + 1);\n setFlashing(true);\n }\n }\n useEffect(() => {\n if (flashRun === 0) {\n return;\n }\n const end = window.setTimeout(() => setFlashing(false), FLASH_MS);\n return () => window.clearTimeout(end);\n }, [flashRun]);\n if (!collapsible && !internalExpanded) {\n setInternalExpanded(true);\n }\n\n // Use controlled state if isExpanded is provided, otherwise use internal state\n const expanded = !collapsible || (isExpanded !== undefined ? isExpanded : internalExpanded);\n const gutter = collapsible && arrowPosition === 'gutter';\n\n // The instant path only renders the body while expanded; don't advertise\n // aria-controls when the referenced element isn't in the DOM.\n const bodyRendered = animate || (expanded && !!children);\n\n // The body clips overflow so the expand/collapse height animation works. Once fully\n // expanded we release the clip (after the transition) so a `position: sticky` child\n // inside can pin — `overflow: hidden` would otherwise trap it.\n const [bodySettled, setBodySettled] = useState(!collapsible);\n const mountedOpen = useRef(expanded);\n if (!expanded && bodySettled) {\n setBodySettled(false);\n } else if (expanded && !animate && !bodySettled) {\n setBodySettled(true);\n }\n useEffect(() => {\n if (!expanded) {\n mountedOpen.current = false;\n return undefined;\n }\n if (!animate || bodySettled || (mountedOpen.current && collapsible)) {\n return undefined;\n }\n // Not `transitioncancel`: reversing a running transition fires it while the new one runs.\n const fallback = window.setTimeout(() => setBodySettled(true), SETTLE_FALLBACK_MS);\n return () => window.clearTimeout(fallback);\n }, [animate, expanded, collapsible, bodySettled]);\n // A collapsed animated body is only a zero-height row, so it renders `inert` (below); an\n // instant one unmounts. Either way focus inside it is handed out (`CollapseFocusHandOff`).\n const bodyRef = useRef<HTMLDivElement>(null);\n const toggleRef = useRef<HTMLButtonElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const capsCorners = Boolean(stickyHeader) && pinnedCorners && !sunken;\n const pinned = usePinned(markerRef, stickyTopOffset, capsCorners);\n const hasLeading = isRenderableNode(leading);\n\n // One header column per slot, so the body can start at the toggle's.\n const titleGrid = bodyIndent === 'title';\n const subgrid = titleGrid ? 'grid grid-cols-subgrid col-span-4' : '';\n\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n setInternalExpanded(newExpanded);\n }\n onToggle?.(newExpanded);\n };\n\n const containerClasses = [\n titleGrid ? 'grid grid-cols-[auto_auto_minmax(0,1fr)_auto]' : 'flex flex-col',\n 'w-full text-left',\n // The table's frame, so a sunken section reads as the same kind of container as a table\n // beside it, in both themes.\n sunken ? FRAME_CLASS : '',\n flashing ? 'relative' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // The whole header row is a `group` so the disclosure arrow darkens on hover; the\n // hover background and arrow react to hovering anywhere on the row. The sunken\n // variant carries its own card chrome instead of row dividers/hover.\n // A pinned header's hover paints over its inline ground (headerRowStyle), which beats a\n // bg-colour class. Written out in full so Tailwind's scanner generates it.\n const pinnedBackground =\n (expanded && highlightExpanded) || quiet\n ? ''\n : 'hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]';\n const rowBackground = sunken\n ? 'bg-transparent'\n : stickyHeader\n ? pinnedBackground\n : expanded && highlightExpanded\n ? 'bg-[var(--malachite-buttonlist-hover-background)]'\n : quiet\n ? 'bg-transparent'\n : 'bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]';\n const headerRowClasses = [\n // `group` only when enabled, so the arrow doesn't darken on hover while disabled.\n quiet ? '' : 'group',\n titleGrid ? subgrid : 'flex w-full',\n 'items-center transition-colors',\n sunken ? '' : 'border-0 border-b border-solid border-[var(--malachite-card-border)]',\n stickyHeader ? `sticky ${pinned ? 'z-10' : 'z-[8]'}` : '',\n rowBackground,\n ]\n .filter(Boolean)\n .join(' ');\n const titleAreaClasses = [\n 'flex flex-1 items-center min-w-0 text-left',\n sunken ? 'pr-[16px] py-[12px]' : 'pr-[16px] py-[16px]',\n titleGrid ? 'col-start-3' : '',\n ]\n .filter(Boolean)\n .join(' ');\n // Full-bleed default rows use an inset ring; the padded sunken toggle fits an outset one.\n const toggleButtonClasses = [\n titleAreaClasses,\n 'appearance-none border-0 bg-transparent cursor-pointer select-none disabled:cursor-not-allowed',\n sunken ? `rounded-lg ${FOCUS_RING}` : FOCUS_RING_INSET,\n ].join(' ');\n const titleAreaStyle: React.CSSProperties = {\n paddingLeft: togglePaddingLeftPx(hasLeading || gutter),\n gap: toggleGapPx(sunken),\n };\n const titleContent = header ?? (\n <span className=\"flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]\">\n {title}\n </span>\n );\n\n // Inline so the offset, the opaque ground and the open highlight apply even where arbitrary\n // classes are not compiled. The ground is the variant's own: a sunken section pinned in card\n // white would float over its frame.\n const highlighted = !sunken && expanded && highlightExpanded;\n const headerRowStyle: React.CSSProperties = stickyHeader\n ? {\n top: `${stickyTopOffset}px`,\n backgroundColor: sunken ? FRAME_BACKGROUND : 'var(--malachite-card-background)',\n ...(highlighted && {\n backgroundImage:\n 'linear-gradient(var(--malachite-buttonlist-hover-background), var(--malachite-buttonlist-hover-background))',\n }),\n }\n : {};\n\n const titleInset = bodyInsetPx({\n arrowPosition: collapsible ? arrowPosition : 'end',\n hasLeading,\n sunken,\n });\n const bodyChildren = titleGrid ? (\n <div\n className=\"col-start-3 col-span-2 min-w-0\"\n style={titleInset < 0 ? { marginLeft: titleInset } : { paddingLeft: titleInset }}\n >\n {children}\n </div>\n ) : (\n children\n );\n\n return (\n <div\n ref={ref}\n className={containerClasses}\n style={\n stickyHeader && stickyTopOffset ? { scrollMarginTop: stickyTopOffset } : undefined\n }\n >\n {flashing && (\n <span\n key={flashRun}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 z-[11] rounded-[inherit] [outline-offset:-2px] [animation:malachite-section-flash_ease-out] motion-reduce:[animation-name:malachite-section-flash-still]\"\n style={{ animationDuration: `${FLASH_MS}ms` }}\n data-accordion-flash=\"\"\n />\n )}\n {capsCorners && <div ref={markerRef} aria-hidden=\"true\" style={PIN_MARKER_STYLE} />}\n <div\n className={headerRowClasses}\n style={headerRowStyle}\n data-accordion-header=\"\"\n data-pinned={pinned ? '' : undefined}\n >\n {pinned && (\n <PinnedCornerCap\n bordered\n radius=\"var(--malachite-radius-xxl, 14px)\"\n surround={`var(${PINNED_SURROUND_CHANNEL}, var(--malachite-card-sunken-background))`}\n />\n )}\n {gutter && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className={`${titleGrid ? 'col-start-1' : ''} shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={handleToggle}\n disabled={disabled}\n >\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n </button>\n )}\n {hasLeading && (\n <div\n className={`${titleGrid ? 'col-start-2' : ''} shrink-0 flex items-center ${gutter ? 'pl-[12px]' : 'pl-[16px]'}`}\n >\n {leading}\n </div>\n )}\n {/* Toggle area — arrow + header/title. Interactive trailing sits outside it. */}\n {collapsible ? (\n <button\n ref={toggleRef}\n type=\"button\"\n className={toggleButtonClasses}\n style={titleAreaStyle}\n onClick={handleToggle}\n aria-expanded={expanded}\n aria-controls={bodyRendered ? bodyId : undefined}\n disabled={disabled}\n >\n {arrowPosition === 'start' && (\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n )}\n {titleContent}\n {arrowPosition === 'end' && (\n <DisclosureArrow\n expanded={expanded}\n size={ARROW_PX}\n className=\"ml-auto\"\n />\n )}\n </button>\n ) : (\n <div className={titleAreaClasses} style={titleAreaStyle}>\n {titleContent}\n </div>\n )}\n {isRenderableNode(trailing) && (\n <div\n className={`${titleGrid ? 'col-start-4' : ''} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`}\n >\n {trailing}\n </div>\n )}\n </div>\n\n {animate ? (\n /* Height animates via grid-template-rows (0fr → 1fr); body clips during.\n grid-cols-[minmax(0,1fr)] pins the single column to the track width so\n wide, non-wrapping children (e.g. a table with long cell text) can't grow\n the implicit `auto` column to their max-content and overflow the container;\n the title grid's body cell uses min-w-0 instead. */\n <div\n ref={bodyRef}\n {...inertWhen(!expanded)}\n id={bodyId}\n className={`grid ${titleGrid ? 'grid-cols-subgrid col-span-4' : 'grid-cols-[minmax(0,1fr)]'} w-full transition-[grid-template-rows] duration-200 ease-in-out`}\n style={{ gridTemplateRows: expanded ? '1fr' : '0fr' }}\n onTransitionEnd={(event) => {\n if (\n event.target === event.currentTarget &&\n event.propertyName === 'grid-template-rows'\n ) {\n setBodySettled(expanded);\n }\n }}\n >\n <div\n className={[subgrid, bodySettled ? 'overflow-visible' : 'overflow-hidden']\n .filter(Boolean)\n .join(' ')}\n data-settled={bodySettled ? '' : undefined}\n >\n {children && (\n <div\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )}\n </div>\n </div>\n ) : (\n /* Instant open — no clip, so a sticky child inside pins immediately. */\n expanded &&\n children && (\n <div\n ref={bodyRef}\n id={bodyId}\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )\n )}\n {/* Last, so a toggle mounted in the same commit has its ref by the hand-off. */}\n <CollapseFocusHandOff expanded={expanded} bodyRef={bodyRef} toggleRef={toggleRef} />\n </div>\n );\n};\n\nconst Accordion = React.forwardRef(AccordionSection);\nAccordion.displayName = 'Accordion';\n\nexport default Accordion;\nexport { Accordion };\nexport type { AccordionProps };\n"],"names":["PINNED_SURROUND_CHANNEL","SETTLE_FALLBACK_MS","FLASH_MS","PIN_MARKER_STYLE","AccordionSection","title","header","className","children","trailing","leading","arrowPosition","highlightExpanded","bodyIndent","variant","defaultExpanded","isExpanded","onToggle","disabled","stickyHeader","stickyTopOffset","pinnedCorners","animate","collapsible","flashKey","ref","quiet","sunken","bodyId","useId","internalExpanded","setInternalExpanded","useState","prevFlashKey","setPrevFlashKey","flashRun","setFlashRun","flashing","setFlashing","useEffect","end","expanded","gutter","bodyRendered","bodySettled","setBodySettled","mountedOpen","useRef","fallback","bodyRef","toggleRef","markerRef","capsCorners","pinned","usePinned","hasLeading","isRenderableNode","titleGrid","subgrid","handleToggle","newExpanded","containerClasses","FRAME_CLASS","headerRowClasses","titleAreaClasses","toggleButtonClasses","FOCUS_RING","FOCUS_RING_INSET","titleAreaStyle","togglePaddingLeftPx","toggleGapPx","titleContent","jsx","highlighted","headerRowStyle","FRAME_BACKGROUND","titleInset","bodyInsetPx","bodyChildren","jsxs","PinnedCornerCap","event","DisclosureArrow","ARROW_PX","inertWhen","CollapseFocusHandOff","Accordion","React"],"mappings":";;;;;;;;;;;AAcA,MAAMA,KAA0B,mCAE1BC,KAAqB,KACrBC,IAAW,MAGXC,KAAwC,EAAE,UAAU,YAAY,OAAO,GAAG,QAAQ,EAAA,GAqElFC,KAAmB,CACrB;AAAA,EACI,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,mBAAAC,IAAoB;AAAA,EACpB,YAAAC,IAAa;AAAA,EACb,SAAAC,KAAU;AAAA,EACV,iBAAAC,KAAkB;AAAA,EAClB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,iBAAAC,IAAkB;AAAA,EAClB,eAAAC,KAAgB;AAAA,EAChB,SAAAC,IAAU;AAAA,EACV,aAAAC,IAAc;AAAA,EACd,UAAAC;AACJ,GACAC,OACC;AACD,QAAMC,IAAQR,KAAY,CAACK,GACrBI,IAASb,OA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A,cAEZ,UAAAmD;AAAA,YAAA;AAAA,UAAA;AAAA;AAAA,QAKb,gBAAAN,EAACa,IAAA,EAAqB,UAAA5C,GAAoB,SAAAQ,GAAkB,WAAAC,EAAA,CAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9F,GAEMoC,KAAYC,GAAM,WAAWnF,EAAgB;AACnDkF,GAAU,cAAc;"}
@@ -1,12 +1,12 @@
1
1
  import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
2
  import { Avatar as s } from "./Avatar.js";
3
3
  import { Tag as d } from "./Tag.js";
4
- import { Typography as m } from "./Typography/index.js";
4
+ import { Typography as c } from "./Typography/index.js";
5
5
  import { getFontWeight as g, getFontSize as u } from "./Typography/textStyles.js";
6
- const W = ({
6
+ const N = ({
7
7
  src: l,
8
8
  name: t,
9
- showName: c = !0,
9
+ showName: m = !0,
10
10
  size: r = 24,
11
11
  nameSize: a = "medium",
12
12
  nameWeight: i = "normal",
@@ -15,7 +15,7 @@ const W = ({
15
15
  className: n = ""
16
16
  }) => {
17
17
  const h = r <= 18 ? "gap-2" : "gap-3";
18
- return c ? (
18
+ return m ? (
19
19
  // `max-w-full` is what makes `truncate` work — without it the box is floored at the name's min-content width.
20
20
  /* @__PURE__ */ p("span", { className: `inline-flex items-center ${h} max-w-full ${n}`.trim(), children: [
21
21
  /* @__PURE__ */ e(
@@ -31,17 +31,18 @@ const W = ({
31
31
  ),
32
32
  /* @__PURE__ */ p("span", { className: "inline-flex items-center gap-2 min-w-0", children: [
33
33
  f ? /* @__PURE__ */ e(
34
- m.EllipsisText,
34
+ c.EllipsisText,
35
35
  {
36
36
  maxWidth: "100%",
37
37
  tooltip: t,
38
+ tooltipWhenTruncated: !0,
38
39
  style: {
39
40
  fontSize: u(a),
40
41
  fontWeight: g(i)
41
42
  },
42
43
  children: t
43
44
  }
44
- ) : /* @__PURE__ */ e(m.Text, { size: a, fontWeight: i, children: t }),
45
+ ) : /* @__PURE__ */ e(c.Text, { size: a, fontWeight: i, children: t }),
45
46
  o ? /* @__PURE__ */ e("span", { className: "shrink-0", children: /* @__PURE__ */ e(d, { value: o, textTransform: "none", paddingSize: "compact" }) }) : null
46
47
  ] })
47
48
  ] })
@@ -58,6 +59,6 @@ const W = ({
58
59
  );
59
60
  };
60
61
  export {
61
- W as default
62
+ N as default
62
63
  };
63
64
  //# sourceMappingURL=AppLogo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppLogo.js","sources":["../../src/components/AppLogo.tsx"],"sourcesContent":["import React from 'react';\nimport Avatar from './Avatar';\nimport Tag from './Tag';\nimport Typography from './Typography';\nimport type { FontSize, FontWeight } from './Typography/Text';\nimport { getFontSize, getFontWeight } from './Typography/textStyles';\n\nexport interface AppLogoProps {\n /** Connector logo URL. Falls back to a \"no logo available\" placeholder when missing or broken. */\n src?: string;\n /** Connector name — the accessible label and the visible text. */\n name: string;\n /** Renders the name beside the mark. Omit for a bare logo (e.g. inside a dense row). */\n showName?: boolean;\n /** Pixel size of the square mark. */\n size?: number;\n nameSize?: FontSize;\n /** Defaults to `normal`. Raise it when the logo doubles as a page title. */\n nameWeight?: FontWeight;\n /** Rendered as a tag after the name, e.g. `v1.2.0` or `Legacy`. */\n version?: string;\n /** Truncates a long name with an ellipsis and reveals the full value on hover. */\n truncate?: boolean;\n className?: string;\n}\n\nconst AppLogo: React.FC<AppLogoProps> = ({\n src,\n name,\n showName = true,\n size = 24,\n nameSize = 'medium',\n nameWeight = 'normal',\n version,\n truncate = false,\n className = '',\n}) => {\n const gap = size <= 18 ? 'gap-2' : 'gap-3';\n\n if (!showName) {\n return (\n <Avatar\n src={src}\n name={name}\n size={size}\n shape=\"square\"\n fallback=\"placeholder\"\n className={className}\n />\n );\n }\n\n return (\n // `max-w-full` is what makes `truncate` work — without it the box is floored at the name's min-content width.\n <span className={`inline-flex items-center ${gap} max-w-full ${className}`.trim()}>\n <Avatar\n src={src}\n name={name}\n size={size}\n shape=\"square\"\n fallback=\"placeholder\"\n className=\"shrink-0\"\n />\n <span className=\"inline-flex items-center gap-2 min-w-0\">\n {truncate ? (\n <Typography.EllipsisText\n maxWidth=\"100%\"\n tooltip={name}\n style={{\n fontSize: getFontSize(nameSize),\n fontWeight: getFontWeight(nameWeight),\n }}\n >\n {name}\n </Typography.EllipsisText>\n ) : (\n <Typography.Text size={nameSize} fontWeight={nameWeight}>\n {name}\n </Typography.Text>\n )}\n {version ? (\n <span className=\"shrink-0\">\n <Tag value={version} textTransform=\"none\" paddingSize=\"compact\" />\n </span>\n ) : null}\n </span>\n </span>\n );\n};\n\nexport default AppLogo;\n"],"names":["AppLogo","src","name","showName","size","nameSize","nameWeight","version","truncate","className","gap","jsxs","jsx","Avatar","Typography","getFontSize","getFontWeight","Tag"],"mappings":";;;;;AA0BA,MAAMA,IAAkC,CAAC;AAAA,EACrC,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,SAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAMN,KAAQ,KAAK,UAAU;AAEnC,SAAKD;AAAA;AAAA,IAeD,gBAAAQ,EAAC,UAAK,WAAW,4BAA4BD,CAAG,eAAeD,CAAS,GAAG,KAAA,GACvE,UAAA;AAAA,MAAA,gBAAAG;AAAA,QAACC;AAAA,QAAA;AAAA,UACG,KAAAZ;AAAA,UACA,MAAAC;AAAA,UACA,MAAAE;AAAA,UACA,OAAM;AAAA,UACN,UAAS;AAAA,UACT,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAEd,gBAAAO,EAAC,QAAA,EAAK,WAAU,0CACX,UAAA;AAAA,QAAAH,IACG,gBAAAI;AAAA,UAACE,EAAW;AAAA,UAAX;AAAA,YACG,UAAS;AAAA,YACT,SAASZ;AAAA,YACT,OAAO;AAAA,cACH,UAAUa,EAAYV,CAAQ;AAAA,cAC9B,YAAYW,EAAcV,CAAU;AAAA,YAAA;AAAA,YAGvC,UAAAJ;AAAA,UAAA;AAAA,QAAA,sBAGJY,EAAW,MAAX,EAAgB,MAAMT,GAAU,YAAYC,GACxC,UAAAJ,GACL;AAAA,QAEHK,IACG,gBAAAK,EAAC,QAAA,EAAK,WAAU,YACZ,UAAA,gBAAAA,EAACK,GAAA,EAAI,OAAOV,GAAS,eAAc,QAAO,aAAY,UAAA,CAAU,GACpE,IACA;AAAA,MAAA,EAAA,CACR;AAAA,IAAA,EAAA,CACJ;AAAA,MA7CI,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAZ;AAAA,MACA,MAAAC;AAAA,MACA,MAAAE;AAAA,MACA,OAAM;AAAA,MACN,UAAS;AAAA,MACT,WAAAK;AAAA,IAAA;AAAA,EAAA;AAyChB;"}
1
+ {"version":3,"file":"AppLogo.js","sources":["../../src/components/AppLogo.tsx"],"sourcesContent":["import React from 'react';\nimport Avatar from './Avatar';\nimport Tag from './Tag';\nimport Typography from './Typography';\nimport type { FontSize, FontWeight } from './Typography/Text';\nimport { getFontSize, getFontWeight } from './Typography/textStyles';\n\nexport interface AppLogoProps {\n /** Connector logo URL. Falls back to a \"no logo available\" placeholder when missing or broken. */\n src?: string;\n /** Connector name — the accessible label and the visible text. */\n name: string;\n /** Renders the name beside the mark. Omit for a bare logo (e.g. inside a dense row). */\n showName?: boolean;\n /** Pixel size of the square mark. */\n size?: number;\n nameSize?: FontSize;\n /** Defaults to `normal`. Raise it when the logo doubles as a page title. */\n nameWeight?: FontWeight;\n /** Rendered as a tag after the name, e.g. `v1.2.0` or `Legacy`. */\n version?: string;\n /** Truncates a long name with an ellipsis, and reveals it on hover once it is cut off. */\n truncate?: boolean;\n className?: string;\n}\n\nconst AppLogo: React.FC<AppLogoProps> = ({\n src,\n name,\n showName = true,\n size = 24,\n nameSize = 'medium',\n nameWeight = 'normal',\n version,\n truncate = false,\n className = '',\n}) => {\n const gap = size <= 18 ? 'gap-2' : 'gap-3';\n\n if (!showName) {\n return (\n <Avatar\n src={src}\n name={name}\n size={size}\n shape=\"square\"\n fallback=\"placeholder\"\n className={className}\n />\n );\n }\n\n return (\n // `max-w-full` is what makes `truncate` work — without it the box is floored at the name's min-content width.\n <span className={`inline-flex items-center ${gap} max-w-full ${className}`.trim()}>\n <Avatar\n src={src}\n name={name}\n size={size}\n shape=\"square\"\n fallback=\"placeholder\"\n className=\"shrink-0\"\n />\n <span className=\"inline-flex items-center gap-2 min-w-0\">\n {truncate ? (\n <Typography.EllipsisText\n maxWidth=\"100%\"\n tooltip={name}\n tooltipWhenTruncated\n style={{\n fontSize: getFontSize(nameSize),\n fontWeight: getFontWeight(nameWeight),\n }}\n >\n {name}\n </Typography.EllipsisText>\n ) : (\n <Typography.Text size={nameSize} fontWeight={nameWeight}>\n {name}\n </Typography.Text>\n )}\n {version ? (\n <span className=\"shrink-0\">\n <Tag value={version} textTransform=\"none\" paddingSize=\"compact\" />\n </span>\n ) : null}\n </span>\n </span>\n );\n};\n\nexport default AppLogo;\n"],"names":["AppLogo","src","name","showName","size","nameSize","nameWeight","version","truncate","className","gap","jsxs","jsx","Avatar","Typography","getFontSize","getFontWeight","Tag"],"mappings":";;;;;AA0BA,MAAMA,IAAkC,CAAC;AAAA,EACrC,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,SAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAMN,KAAQ,KAAK,UAAU;AAEnC,SAAKD;AAAA;AAAA,IAeD,gBAAAQ,EAAC,UAAK,WAAW,4BAA4BD,CAAG,eAAeD,CAAS,GAAG,KAAA,GACvE,UAAA;AAAA,MAAA,gBAAAG;AAAA,QAACC;AAAA,QAAA;AAAA,UACG,KAAAZ;AAAA,UACA,MAAAC;AAAA,UACA,MAAAE;AAAA,UACA,OAAM;AAAA,UACN,UAAS;AAAA,UACT,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,MAEd,gBAAAO,EAAC,QAAA,EAAK,WAAU,0CACX,UAAA;AAAA,QAAAH,IACG,gBAAAI;AAAA,UAACE,EAAW;AAAA,UAAX;AAAA,YACG,UAAS;AAAA,YACT,SAASZ;AAAA,YACT,sBAAoB;AAAA,YACpB,OAAO;AAAA,cACH,UAAUa,EAAYV,CAAQ;AAAA,cAC9B,YAAYW,EAAcV,CAAU;AAAA,YAAA;AAAA,YAGvC,UAAAJ;AAAA,UAAA;AAAA,QAAA,sBAGJY,EAAW,MAAX,EAAgB,MAAMT,GAAU,YAAYC,GACxC,UAAAJ,GACL;AAAA,QAEHK,IACG,gBAAAK,EAAC,QAAA,EAAK,WAAU,YACZ,UAAA,gBAAAA,EAACK,GAAA,EAAI,OAAOV,GAAS,eAAc,QAAO,aAAY,UAAA,CAAU,GACpE,IACA;AAAA,MAAA,EAAA,CACR;AAAA,IAAA,EAAA,CACJ;AAAA,MA9CI,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,KAAAZ;AAAA,MACA,MAAAC;AAAA,MACA,MAAAE;AAAA,MACA,OAAM;AAAA,MACN,UAAS;AAAA,MACT,WAAAK;AAAA,IAAA;AAAA,EAAA;AA0ChB;"}
@@ -0,0 +1,18 @@
1
+ import n from "react";
2
+ import { holdsFocus as r, isFocusLost as s, focusSection as p } from "./collapseFocus.js";
3
+ class l extends n.Component {
4
+ getSnapshotBeforeUpdate(o) {
5
+ const e = this.props.bodyRef.current, t = e == null ? void 0 : e.parentElement;
6
+ return !o.expanded || this.props.expanded || !e || !t ? null : r(e, e.getRootNode()) ? { body: e, section: t } : null;
7
+ }
8
+ componentDidUpdate(o, e, t) {
9
+ t && s(t) && p(this.props.toggleRef.current, t.section);
10
+ }
11
+ render() {
12
+ return null;
13
+ }
14
+ }
15
+ export {
16
+ l as default
17
+ };
18
+ //# sourceMappingURL=CollapseFocusHandOff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapseFocusHandOff.js","sources":["../../src/components/CollapseFocusHandOff.tsx"],"sourcesContent":["import React from 'react';\nimport { type FocusSnapshot, focusSection, holdsFocus, isFocusLost } from './collapseFocus';\n\ninterface CollapseFocusHandOffProps {\n expanded: boolean;\n bodyRef: React.RefObject<HTMLDivElement | null>;\n toggleRef: React.RefObject<HTMLButtonElement | null>;\n}\n\n/**\n * Hands focus out of a collapsing body to the toggle, or the section when it is disabled. A\n * class for `getSnapshotBeforeUpdate`: it sees focus before an instant body unmounts.\n */\nclass CollapseFocusHandOff extends React.Component<CollapseFocusHandOffProps> {\n getSnapshotBeforeUpdate(previous: CollapseFocusHandOffProps): FocusSnapshot | null {\n const body = this.props.bodyRef.current;\n const section = body?.parentElement;\n if (!previous.expanded || this.props.expanded || !body || !section) {\n return null;\n }\n return holdsFocus(body, body.getRootNode()) ? { body, section } : null;\n }\n\n componentDidUpdate(\n _previous: CollapseFocusHandOffProps,\n _state: unknown,\n snapshot: FocusSnapshot | null,\n ): void {\n // Only while focus is still lost: something else may have taken it in this commit.\n if (snapshot && isFocusLost(snapshot)) {\n focusSection(this.props.toggleRef.current, snapshot.section);\n }\n }\n\n render(): null {\n return null;\n }\n}\n\nexport default CollapseFocusHandOff;\n"],"names":["CollapseFocusHandOff","React","previous","body","section","holdsFocus","_previous","_state","snapshot","isFocusLost","focusSection"],"mappings":";;AAaA,MAAMA,UAA6BC,EAAM,UAAqC;AAAA,EAC1E,wBAAwBC,GAA2D;AAC/E,UAAMC,IAAO,KAAK,MAAM,QAAQ,SAC1BC,IAAUD,KAAA,gBAAAA,EAAM;AACtB,WAAI,CAACD,EAAS,YAAY,KAAK,MAAM,YAAY,CAACC,KAAQ,CAACC,IAChD,OAEJC,EAAWF,GAAMA,EAAK,YAAA,CAAa,IAAI,EAAE,MAAAA,GAAM,SAAAC,EAAA,IAAY;AAAA,EACtE;AAAA,EAEA,mBACIE,GACAC,GACAC,GACI;AAEJ,IAAIA,KAAYC,EAAYD,CAAQ,KAChCE,EAAa,KAAK,MAAM,UAAU,SAASF,EAAS,OAAO;AAAA,EAEnE;AAAA,EAEA,SAAe;AACX,WAAO;AAAA,EACX;AACJ;"}