@stackone/malachite 2.130.1 → 2.132.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,314 +1,355 @@
1
- import { jsxs as l, jsx as e, Fragment as O } from "react/jsx-runtime";
2
- import { useId as pe, useState as d, useCallback as Je, useMemo as Qe, useRef as T, useLayoutEffect as Ze, useEffect as Ne } from "react";
3
- import { createPortal as er } from "react-dom";
4
- import { ShadowRootWrapper as rr } from "../ShadowRootWrapper.js";
5
- import tr from "./CalloutStrip.js";
6
- import lr from "./CustomIcons/ArrowLeftIcon.js";
7
- import nr from "./CustomIcons/ArrowLineLeftIcon.js";
8
- import or from "./CustomIcons/ArrowLineRightIcon.js";
9
- import ar from "./CustomIcons/DismissIcon.js";
10
- import xe from "./SidePanelSheet.js";
11
- import ir from "./SidePanelTabs.js";
12
- import A from "./SidePanelTitle.js";
13
- import sr from "./Typography/EllipsisText.js";
14
- import { afterNextPaint as cr } from "./afterNextPaint.js";
15
- import { FOCUS_RING as dr } from "./focusRing.js";
1
+ import { jsxs as t, jsx as e, Fragment as T } from "react/jsx-runtime";
2
+ import { useId as fe, useState as x, useCallback as er, useMemo as rr, useRef as P, useLayoutEffect as lr, useEffect as Se } from "react";
3
+ import { createPortal as tr } from "react-dom";
4
+ import { ShadowRootWrapper as nr } from "../ShadowRootWrapper.js";
5
+ import _e from "./CalloutStrip.js";
6
+ import ar from "./CustomIcons/ArrowLeftIcon.js";
7
+ import or from "./CustomIcons/ArrowLineLeftIcon.js";
8
+ import ir from "./CustomIcons/ArrowLineRightIcon.js";
9
+ import sr from "./CustomIcons/DismissIcon.js";
10
+ import be from "./SidePanelSheet.js";
11
+ import cr from "./SidePanelTabs.js";
12
+ import z from "./SidePanelTitle.js";
13
+ import dr from "./Typography/EllipsisText.js";
14
+ import { afterNextPaint as mr } from "./afterNextPaint.js";
15
+ import { FOCUS_RING as pr } from "./focusRing.js";
16
16
  import { inertWhen as y } from "./inert.js";
17
- import { useOverlayBehaviour as mr, OVERLAY_ICON_BUTTON_CLASSES as M } from "./overlayBehaviour.js";
18
- import { OVERLAY_ELEVATED_ATTR as pr, overlayIdentity as he } from "./portalOverlay.js";
19
- import { SidePanelOverlayContext as xr } from "./sidePanelOverlay.js";
20
- import { SidePanelTabsContext as ue } from "./sidePanelTabsContext.js";
21
- const N = 200, fe = "360px", k = 16, be = 320, hr = "cubic-bezier(0.2, 0.8, 0.2, 1)", ve = "var(--malachite-card-warm-background, rgb(244, 242, 240))", ge = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, ur = 1, we = (t) => t === void 0 ? void 0 : t + ur, fr = (t, o, n) => {
22
- const [s, b] = d({});
23
- return Ne(() => {
24
- if (!t || typeof ResizeObserver > "u")
17
+ import { useOverlayBehaviour as xr, OVERLAY_ICON_BUTTON_CLASSES as B } from "./overlayBehaviour.js";
18
+ import { OVERLAY_ELEVATED_ATTR as hr, overlayIdentity as ue } from "./portalOverlay.js";
19
+ import { SidePanelOverlayContext as fr } from "./sidePanelOverlay.js";
20
+ import { SidePanelTabsContext as ve } from "./sidePanelTabsContext.js";
21
+ const N = 200, ge = "360px", I = 16, we = 320, br = "cubic-bezier(0.2, 0.8, 0.2, 1)", ye = "var(--malachite-card-warm-background, rgb(244, 242, 240))", Ne = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches, ur = 1, $e = (l) => l === void 0 ? void 0 : l + ur, vr = (l, a, n) => {
22
+ const [c, o] = x({});
23
+ return Se(() => {
24
+ if (!l || typeof ResizeObserver > "u")
25
25
  return;
26
- const h = () => b({
27
- header: o == null ? void 0 : o.getBoundingClientRect().height,
26
+ const s = () => o({
27
+ header: a == null ? void 0 : a.getBoundingClientRect().height,
28
28
  footer: n == null ? void 0 : n.getBoundingClientRect().height
29
- }), m = new ResizeObserver(h);
30
- return o && m.observe(o), n && m.observe(n), h(), () => m.disconnect();
31
- }, [t, o, n]), s;
32
- }, z = ({
33
- bodyPadding: t,
34
- className: o = "",
29
+ }), d = new ResizeObserver(s);
30
+ return a && d.observe(a), n && d.observe(n), s(), () => d.disconnect();
31
+ }, [l, a, n]), c;
32
+ }, k = ({
33
+ bodyPadding: l,
34
+ className: a = "",
35
35
  callouts: n,
36
- calloutId: s,
37
- renderLink: b,
38
- stableGutter: h = !1,
39
- scrollerRef: m,
40
- children: f
36
+ calloutId: c,
37
+ renderLink: o,
38
+ stableGutter: s = !1,
39
+ scrollerRef: d,
40
+ children: u
41
41
  }) => {
42
42
  const v = !!(n != null && n.length);
43
- return /* @__PURE__ */ l(
43
+ return /* @__PURE__ */ t(
44
44
  "div",
45
45
  {
46
- ref: m,
47
- className: `min-h-0 flex-1 overflow-y-auto [scrollbar-color:var(--malachite-text-dimmed)_transparent] ${h ? "[scrollbar-gutter:stable]" : ""} ${t && !v ? "px-[28px]" : ""} ${o}`,
46
+ ref: d,
47
+ className: `min-h-0 flex-1 overflow-y-auto [scrollbar-color:var(--malachite-text-dimmed)_transparent] ${s ? "[scrollbar-gutter:stable]" : ""} ${l && !v ? "px-[28px]" : ""} ${a}`,
48
48
  children: [
49
49
  n == null ? void 0 : n.map((C, g) => /* @__PURE__ */ e(
50
- tr,
50
+ _e,
51
51
  {
52
- id: s ? `${s}-${g}` : void 0,
52
+ id: c ? `${c}-${g}` : void 0,
53
53
  type: C.type,
54
54
  message: C.message,
55
- renderLink: b
55
+ renderLink: o
56
56
  },
57
57
  g
58
58
  )),
59
- t ? /* @__PURE__ */ e("div", { className: v ? "p-[28px]" : "py-[28px]", children: f }) : f
59
+ l ? /* @__PURE__ */ e("div", { className: v ? "p-[28px]" : "py-[28px]", children: u }) : u
60
60
  ]
61
61
  }
62
62
  );
63
- }, $ = (t) => typeof t == "number" ? `${t}px` : t, br = (t) => {
64
- t.key === "Enter" && t.target instanceof HTMLInputElement && t.preventDefault();
65
- }, ye = "isolate col-start-2 row-span-3 row-start-1 grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-subgrid", vr = ({ onSubmit: t, children: o }) => t ? /* @__PURE__ */ e(
63
+ }, gr = "border-0 border-solid border-[var(--malachite-card-border)] border-r @max-xl:border-r-0 @max-xl:border-b", wr = ({ columns: l, callouts: a, calloutId: n, renderLink: c }) => /* @__PURE__ */ t(T, { children: [
64
+ a != null && a.length ? /* @__PURE__ */ e("div", { className: "shrink-0", children: a.map((o, s) => /* @__PURE__ */ e(
65
+ _e,
66
+ {
67
+ id: `${n}-${s}`,
68
+ type: o.type,
69
+ message: o.message,
70
+ renderLink: c
71
+ },
72
+ s
73
+ )) }) : null,
74
+ /* @__PURE__ */ e("div", { className: "@container flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 @max-xl:flex-col @max-xl:overflow-y-auto", children: l.map((o, s) => {
75
+ const d = o.bodyPadding ?? !0;
76
+ return /* @__PURE__ */ e(
77
+ "section",
78
+ {
79
+ "aria-label": o["aria-label"],
80
+ className: `flex min-h-0 min-w-0 flex-col @max-xl:min-h-[240px] ${s < l.length - 1 ? gr : ""}`,
81
+ style: { flex: `${o.share} 1 0px` },
82
+ children: o.fill ? /* @__PURE__ */ e(
83
+ "div",
84
+ {
85
+ className: `flex min-h-0 flex-1 flex-col overflow-hidden ${d ? "p-[28px]" : ""}`,
86
+ children: o.content
87
+ }
88
+ ) : /* @__PURE__ */ e(k, { bodyPadding: d, children: o.content })
89
+ },
90
+ o.id
91
+ );
92
+ }) }) })
93
+ ] }), $ = (l) => typeof l == "number" ? `${l}px` : l, yr = (l) => {
94
+ l.key === "Enter" && l.target instanceof HTMLInputElement && l.preventDefault();
95
+ }, Ce = "isolate col-start-2 row-span-3 row-start-1 grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-subgrid", Nr = ({ onSubmit: l, children: a }) => l ? /* @__PURE__ */ e(
66
96
  "form",
67
97
  {
68
98
  noValidate: !0,
69
- className: ye,
99
+ className: Ce,
70
100
  onSubmit: (n) => {
71
- n.preventDefault(), n.stopPropagation(), t(n);
101
+ n.preventDefault(), n.stopPropagation(), l(n);
72
102
  },
73
- children: o
103
+ children: a
74
104
  }
75
- ) : /* @__PURE__ */ e("div", { className: ye, children: o }), gr = ({
76
- open: t,
77
- onClose: o,
105
+ ) : /* @__PURE__ */ e("div", { className: Ce, children: a }), $r = ({
106
+ open: l,
107
+ onClose: a,
78
108
  title: n,
79
- subtitle: s,
80
- subtitlePlacement: b = "inline",
81
- subtitleExtra: h,
82
- titleExtra: m,
83
- description: f,
109
+ subtitle: c,
110
+ subtitlePlacement: o = "inline",
111
+ subtitleExtra: s,
112
+ titleExtra: d,
113
+ description: u,
84
114
  toolbar: v,
85
115
  toolbarPadding: C = "default",
86
116
  headerDivider: g = !1,
87
- icon: D,
88
- headerExtra: B,
89
- footer: I,
90
- onSubmit: H,
91
- onBack: j,
117
+ icon: H,
118
+ headerExtra: V,
119
+ footer: R,
120
+ onSubmit: j,
121
+ onBack: U,
92
122
  maxWidth: w = 1080,
93
- "aria-label": $e,
94
- "aria-labelledby": V,
95
- bodyPadding: Ce = !0,
96
- stacking: Se = "default",
97
- callouts: P,
98
- renderLink: _e,
123
+ "aria-label": Pe,
124
+ "aria-labelledby": X,
125
+ bodyPadding: Ie = !0,
126
+ stacking: Te = "default",
127
+ callouts: E,
128
+ renderLink: F,
99
129
  aside: r,
100
- sheet: p,
101
- progress: X,
130
+ sheet: h,
131
+ progress: G,
102
132
  subheader: S,
103
- children: Te
133
+ tray: K,
134
+ columns: W,
135
+ children: ke
104
136
  }) => {
105
- const F = pe(), [U, ke] = d(null), [Ie, G] = d(0), K = Je(() => (G((a) => a + 1), () => G((a) => a - 1)), []), [W, Pe] = d(null), Re = Qe(
106
- () => ({ stripSlot: U, scroller: W, registerTabs: K }),
107
- [U, W, K]
108
- ), [Ee, Le] = d(null), [Oe, Ae] = d(null), [Me, ze] = d(null), i = (r == null ? void 0 : r.layout) === "detached", u = i ? (r == null ? void 0 : r.open) ?? !0 : !!r, Y = fr(i, Oe, Me), q = pe(), [J, Q] = d(!1), [De, Z] = d(!1), _ = T(null), x = T(null), ee = T(null), {
109
- ref: Be,
110
- isTopmost: He,
111
- zIndex: je,
112
- elevated: Ve
113
- } = mr({
114
- open: t,
115
- onClose: p ? p.onClose : o,
116
- elevated: Se === "above-app-overlays",
117
- hostRef: ee
118
- }), re = T(p);
119
- if (Ze(() => {
120
- t && (re.current = p);
121
- }), Ne(() => (t ? (Z(!0), x.current && (clearTimeout(x.current), x.current = null), cr(_, () => Q(!0))) : (Q(!1), x.current = setTimeout(() => {
122
- x.current = null, Z(!1);
137
+ const L = fe(), [Y, Re] = x(null), [Ee, q] = x(0), J = er(() => (q((i) => i + 1), () => q((i) => i - 1)), []), [Q, Le] = x(null), Oe = rr(
138
+ () => ({ stripSlot: Y, scroller: Q, registerTabs: J }),
139
+ [Y, Q, J]
140
+ ), [Ae, Me] = x(null), [De, ze] = x(null), [Be, He] = x(null), m = (r == null ? void 0 : r.layout) === "detached", b = m ? (r == null ? void 0 : r.open) ?? !0 : !!r, Z = vr(m, De, Be), ee = fe(), [re, le] = x(!1), [Ve, te] = x(!1), _ = P(null), f = P(null), ne = P(null), {
141
+ ref: je,
142
+ isTopmost: Ue,
143
+ zIndex: Xe,
144
+ elevated: Fe
145
+ } = xr({
146
+ open: l,
147
+ onClose: h ? h.onClose : a,
148
+ elevated: Te === "above-app-overlays",
149
+ hostRef: ne
150
+ }), ae = P(h);
151
+ if (lr(() => {
152
+ l && (ae.current = h);
153
+ }), Se(() => (l ? (te(!0), f.current && (clearTimeout(f.current), f.current = null), mr(_, () => le(!0))) : (le(!1), f.current = setTimeout(() => {
154
+ f.current = null, te(!1);
123
155
  }, N)), () => {
124
- _.current !== null && (cancelAnimationFrame(_.current), _.current = null), x.current && (clearTimeout(x.current), x.current = null);
125
- }), [t]), !De)
156
+ _.current !== null && (cancelAnimationFrame(_.current), _.current = null), f.current && (clearTimeout(f.current), f.current = null);
157
+ }), [l]), !Ve)
126
158
  return null;
127
- const te = () => {
128
- p == null || p.onClose(), o();
129
- }, c = t ? p : re.current, le = P == null ? void 0 : P.filter((a) => a.message.trim()), R = `calc(${$(w)} - 2px)`, Xe = g ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : "", Fe = g ? "[box-shadow:inset_0_-1px_0_var(--malachite-card-border)]" : "", Ue = r && !i ? /* @__PURE__ */ l(
159
+ const oe = () => {
160
+ h == null || h.onClose(), a();
161
+ }, p = l ? h : ae.current, O = E == null ? void 0 : E.filter((i) => i.message.trim()), A = `calc(${$(w)} - 2px)`, Ge = g ? "border-0 border-b border-solid border-[var(--malachite-card-border)]" : "", Ke = g ? "[box-shadow:inset_0_-1px_0_var(--malachite-card-border)]" : "", We = r && !m ? /* @__PURE__ */ t(
130
162
  "aside",
131
163
  {
132
164
  "aria-label": r.title,
133
- ...y(!!c),
165
+ ...y(!!p),
134
166
  className: "col-start-1 row-span-3 row-start-1 grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-subgrid overflow-hidden border-0 border-r border-solid border-[var(--malachite-card-border)]",
135
167
  children: [
136
- /* @__PURE__ */ l(
168
+ /* @__PURE__ */ t(
137
169
  "div",
138
170
  {
139
- className: `box-border flex min-h-[56px] min-w-0 items-center gap-[8px] px-[20px] py-[8px] ${Xe}`,
171
+ className: `box-border flex min-h-[56px] min-w-0 items-center gap-[8px] px-[20px] py-[8px] ${Ge}`,
140
172
  children: [
141
- /* @__PURE__ */ e("span", { className: "flex min-w-0 shrink-0", children: /* @__PURE__ */ e(A, { children: r.title }) }),
173
+ /* @__PURE__ */ e("span", { className: "flex min-w-0 shrink-0", children: /* @__PURE__ */ e(z, { children: r.title }) }),
142
174
  r.headerExtra ? /* @__PURE__ */ e("span", { className: "ml-auto flex shrink-0 items-center", children: r.headerExtra }) : null
143
175
  ]
144
176
  }
145
177
  ),
146
- /* @__PURE__ */ e("div", { className: `flex min-h-0 flex-col ${r.footer ? "" : "row-span-2"}`, children: /* @__PURE__ */ e(z, { bodyPadding: r.bodyPadding ?? !0, children: r.children }) }),
178
+ /* @__PURE__ */ e("div", { className: `flex min-h-0 flex-col ${r.footer ? "" : "row-span-2"}`, children: /* @__PURE__ */ e(k, { bodyPadding: r.bodyPadding ?? !0, children: r.children }) }),
147
179
  r.footer ? /* @__PURE__ */ e("div", { className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]", children: r.footer }) : null
148
180
  ]
149
181
  }
150
- ) : null, ne = b === "below" && !!s, oe = /* @__PURE__ */ e(
182
+ ) : null, ie = o === "below" && !!c, se = /* @__PURE__ */ e(
151
183
  "span",
152
184
  {
153
- className: ne ? "flex min-w-0 shrink" : "flex min-w-0 max-w-full shrink-0",
154
- children: /* @__PURE__ */ e(A, { children: n })
185
+ className: ie ? "flex min-w-0 shrink" : "flex min-w-0 max-w-full shrink-0",
186
+ children: /* @__PURE__ */ e(z, { children: n })
155
187
  }
156
- ), E = s ? /* @__PURE__ */ e(
157
- sr,
188
+ ), M = c ? /* @__PURE__ */ e(
189
+ dr,
158
190
  {
159
- tooltip: s,
191
+ tooltip: c,
160
192
  tooltipWhenTruncated: !0,
161
193
  tooltipPlacement: "bottom",
162
194
  color: "secondary",
163
195
  className: "min-w-0 text-[13px]",
164
- children: s
196
+ children: c
165
197
  }
166
- ) : null, ae = m ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: m }) : null, ie = B ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-baseline", children: B }) : null, se = X === void 0 ? null : /* @__PURE__ */ e(
198
+ ) : null, ce = d ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: d }) : null, de = V ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-baseline", children: V }) : null, me = G === void 0 ? null : /* @__PURE__ */ e(
167
199
  "span",
168
200
  {
169
201
  "aria-hidden": "true",
170
202
  className: `absolute ${S ? "bottom-[-1px]" : "bottom-0"} left-0 h-[3px] bg-[var(--malachite-accent-foreground)]`,
171
203
  style: {
172
- width: `${Math.round(Math.min(1, Math.max(0, X)) * 100)}%`,
173
- transition: ge() ? void 0 : "width 280ms ease-out"
204
+ width: `${Math.round(Math.min(1, Math.max(0, G)) * 100)}%`,
205
+ transition: Ne() ? void 0 : "width 280ms ease-out"
174
206
  }
175
207
  }
176
- ), ce = /* @__PURE__ */ e(O, { children: /* @__PURE__ */ l(vr, { onSubmit: H, children: [
177
- /* @__PURE__ */ l(
208
+ ), pe = /* @__PURE__ */ e(T, { children: /* @__PURE__ */ t(Nr, { onSubmit: j, children: [
209
+ /* @__PURE__ */ t(
178
210
  "div",
179
211
  {
180
- ref: Ae,
181
- className: `relative box-border flex min-h-[56px] flex-col justify-center px-[20px] ${Fe}`,
182
- ...y(!!c),
212
+ ref: ze,
213
+ className: `relative box-border flex min-h-[56px] flex-col justify-center px-[20px] ${Ke}`,
214
+ ...y(!!p),
183
215
  children: [
184
- S ? null : se,
185
- /* @__PURE__ */ l("div", { className: "flex min-h-[56px] items-center gap-[12px] py-[8px]", children: [
186
- j ? /* @__PURE__ */ e(
216
+ S ? null : me,
217
+ /* @__PURE__ */ t("div", { className: "flex min-h-[56px] items-center gap-[12px] py-[8px]", children: [
218
+ U ? /* @__PURE__ */ e(
187
219
  "button",
188
220
  {
189
221
  type: "button",
190
222
  "aria-label": "Back",
191
- onClick: j,
192
- className: M,
193
- children: /* @__PURE__ */ e(lr, { size: 16 })
223
+ onClick: U,
224
+ className: B,
225
+ children: /* @__PURE__ */ e(ar, { size: 16 })
194
226
  }
195
227
  ) : null,
196
- D ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: D }) : null,
197
- ne ? /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-[12px]", children: [
198
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
199
- /* @__PURE__ */ l("div", { className: "flex min-w-0 items-baseline gap-[8px]", children: [
200
- oe,
201
- ae
228
+ H ? /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: H }) : null,
229
+ ie ? /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center gap-[12px]", children: [
230
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
231
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 items-baseline gap-[8px]", children: [
232
+ se,
233
+ ce
202
234
  ] }),
203
- h ? /* @__PURE__ */ l("div", { className: "flex min-w-0 items-baseline gap-[12px]", children: [
204
- E,
205
- /* @__PURE__ */ e("span", { className: "ml-auto flex shrink-0 items-baseline text-[13px]", children: h })
206
- ] }) : E
235
+ s ? /* @__PURE__ */ t("div", { className: "flex min-w-0 items-baseline gap-[12px]", children: [
236
+ M,
237
+ /* @__PURE__ */ e("span", { className: "ml-auto flex shrink-0 items-baseline text-[13px]", children: s })
238
+ ] }) : M
207
239
  ] }),
208
- ie
209
- ] }) : /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-baseline gap-[12px]", children: [
210
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-baseline gap-[8px]", children: [
211
- /* @__PURE__ */ l("div", { className: "flex min-w-0 items-baseline gap-[8px]", children: [
212
- oe,
213
- E
240
+ de
241
+ ] }) : /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-baseline gap-[12px]", children: [
242
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-baseline gap-[8px]", children: [
243
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 items-baseline gap-[8px]", children: [
244
+ se,
245
+ M
214
246
  ] }),
215
- ae
247
+ ce
216
248
  ] }),
217
- ie
249
+ de
218
250
  ] }),
219
251
  /* @__PURE__ */ e(
220
252
  "button",
221
253
  {
222
254
  type: "button",
223
255
  "aria-label": "Close",
224
- onClick: te,
225
- className: M,
226
- children: /* @__PURE__ */ e(ar, { size: 10 })
256
+ onClick: oe,
257
+ className: B,
258
+ children: /* @__PURE__ */ e(sr, { size: 10 })
227
259
  }
228
260
  )
229
261
  ] }),
230
- f ? /* @__PURE__ */ e(
262
+ u ? /* @__PURE__ */ e(
231
263
  "div",
232
264
  {
233
- id: q,
265
+ id: ee,
234
266
  className: "-mt-[8px] pb-[16px] text-[13px] leading-[1.6] text-[var(--malachite-text-secondary)]",
235
- children: f
267
+ children: u
236
268
  }
237
269
  ) : null
238
270
  ]
239
271
  }
240
272
  ),
241
- /* @__PURE__ */ l(
273
+ /* @__PURE__ */ t(
242
274
  "div",
243
275
  {
244
- className: `flex min-h-0 flex-col ${I ? "" : "row-span-2"}`,
245
- ...y(!!c),
276
+ className: `flex min-h-0 flex-col ${R ? "" : "row-span-2"}`,
277
+ ...y(!!p),
246
278
  children: [
247
- S ? /* @__PURE__ */ l("div", { className: "relative box-border flex min-h-[56px] shrink-0 items-center border-0 border-b border-solid border-[var(--malachite-card-border)] px-[20px]", children: [
279
+ S ? /* @__PURE__ */ t("div", { className: "relative box-border flex min-h-[56px] shrink-0 items-center border-0 border-b border-solid border-[var(--malachite-card-border)] px-[20px]", children: [
248
280
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: S }),
249
- se
281
+ me
250
282
  ] }) : null,
251
283
  v ? /* @__PURE__ */ e(
252
284
  "div",
253
285
  {
254
286
  className: `shrink-0 pt-[16px] pb-[8px] ${C === "body" ? "px-[28px]" : "px-[16px]"}`,
255
- onKeyDown: H ? br : void 0,
287
+ onKeyDown: j ? yr : void 0,
256
288
  children: v
257
289
  }
258
290
  ) : null,
259
- /* @__PURE__ */ e("div", { ref: ke, className: "shrink-0 px-[28px] empty:hidden" }),
260
- /* @__PURE__ */ e(
261
- z,
291
+ /* @__PURE__ */ e("div", { ref: Re, className: "shrink-0 px-[28px] empty:hidden" }),
292
+ W ? /* @__PURE__ */ e(
293
+ wr,
262
294
  {
263
- bodyPadding: Ce,
264
- callouts: le,
265
- calloutId: F,
266
- renderLink: _e,
267
- stableGutter: Ie > 0,
268
- scrollerRef: Pe,
269
- children: /* @__PURE__ */ e(ue.Provider, { value: Re, children: Te })
295
+ columns: W,
296
+ callouts: O,
297
+ calloutId: L,
298
+ renderLink: F
270
299
  }
271
- )
300
+ ) : /* @__PURE__ */ e(
301
+ k,
302
+ {
303
+ bodyPadding: Ie,
304
+ callouts: O,
305
+ calloutId: L,
306
+ renderLink: F,
307
+ stableGutter: Ee > 0,
308
+ scrollerRef: Le,
309
+ children: /* @__PURE__ */ e(ve.Provider, { value: Oe, children: ke })
310
+ }
311
+ ),
312
+ K ? /* @__PURE__ */ e("div", { className: "max-h-[55%] shrink-0 overflow-x-hidden overflow-y-auto [scrollbar-color:var(--malachite-text-dimmed)_transparent]", children: K }) : null
272
313
  ]
273
314
  }
274
315
  ),
275
- I ? /* @__PURE__ */ e(
316
+ R ? /* @__PURE__ */ e(
276
317
  "div",
277
318
  {
278
- ref: ze,
319
+ ref: He,
279
320
  className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]",
280
- ...y(!!c),
281
- children: I
321
+ ...y(!!p),
322
+ children: R
282
323
  }
283
324
  ) : null
284
- ] }) }), de = `max(${fe}, min(${$(w)}, calc(100vw - ${$(w)} - 40px)))`, Ge = (a) => ge() ? {} : {
285
- transition: `transform ${be}ms ${hr}, opacity ${N}ms, visibility 0s linear ${a ? 0 : be}ms`
286
- }, Ke = r && i ? /* @__PURE__ */ l(
325
+ ] }) }), xe = `max(${ge}, min(${$(w)}, calc(100vw - ${$(w)} - 40px)))`, Ye = (i) => Ne() ? {} : {
326
+ transition: `transform ${we}ms ${br}, opacity ${N}ms, visibility 0s linear ${i ? 0 : we}ms`
327
+ }, qe = r && m ? /* @__PURE__ */ t(
287
328
  "aside",
288
329
  {
289
330
  "aria-label": r.title,
290
- "aria-hidden": u ? void 0 : !0,
291
- ...y(!!c),
331
+ "aria-hidden": b ? void 0 : !0,
332
+ ...y(!!p),
292
333
  className: "absolute top-0 bottom-0 grid grid-cols-[minmax(0,1fr)] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-l-[16px] text-[var(--malachite-card-foreground)] [box-shadow:var(--malachite-shadow-lg)]",
293
334
  style: {
294
- right: `calc(100% - ${k}px)`,
295
- width: `calc(${de} + ${k}px)`,
296
- paddingRight: k,
335
+ right: `calc(100% - ${I}px)`,
336
+ width: `calc(${xe} + ${I}px)`,
337
+ paddingRight: I,
297
338
  boxSizing: "border-box",
298
- background: ve,
299
- transform: u ? "translateX(0)" : `translateX(calc(100% - ${k}px))`,
300
- opacity: u ? 1 : 0,
301
- visibility: u ? "visible" : "hidden",
302
- ...Ge(u)
339
+ background: ye,
340
+ transform: b ? "translateX(0)" : `translateX(calc(100% - ${I}px))`,
341
+ opacity: b ? 1 : 0,
342
+ visibility: b ? "visible" : "hidden",
343
+ ...Ye(b)
303
344
  },
304
345
  children: [
305
- /* @__PURE__ */ l(
346
+ /* @__PURE__ */ t(
306
347
  "div",
307
348
  {
308
349
  className: "box-border flex min-w-0 items-center gap-[10px] px-[20px] py-[8px] [box-shadow:inset_0_-1px_0_var(--malachite-card-border)]",
309
- style: { minHeight: we(Y.header) },
350
+ style: { minHeight: $e(Z.header) },
310
351
  children: [
311
- /* @__PURE__ */ e("span", { className: "mr-[10px] flex shrink-0", children: /* @__PURE__ */ e(A, { children: r.title }) }),
352
+ /* @__PURE__ */ e("span", { className: "mr-[10px] flex shrink-0", children: /* @__PURE__ */ e(z, { children: r.title }) }),
312
353
  r.headerExtra ? /* @__PURE__ */ e("span", { className: "ml-auto flex min-w-0 shrink items-center justify-end", children: r.headerExtra }) : null,
313
354
  r.onOpenChange ? /* @__PURE__ */ e(
314
355
  "button",
@@ -317,18 +358,18 @@ const N = 200, fe = "360px", k = 16, be = 320, hr = "cubic-bezier(0.2, 0.8, 0.2,
317
358
  "aria-label": `Collapse ${r.title}`,
318
359
  title: `Collapse ${r.title}`,
319
360
  onClick: () => {
320
- var a;
321
- return (a = r.onOpenChange) == null ? void 0 : a.call(r, !1);
361
+ var i;
362
+ return (i = r.onOpenChange) == null ? void 0 : i.call(r, !1);
322
363
  },
323
- className: M,
324
- children: /* @__PURE__ */ e(or, { size: 16 })
364
+ className: B,
365
+ children: /* @__PURE__ */ e(ir, { size: 16 })
325
366
  }
326
367
  ) : null
327
368
  ]
328
369
  }
329
370
  ),
330
371
  /* @__PURE__ */ e("div", { className: `flex min-h-0 flex-col ${r.footer ? "" : "row-span-2"}`, children: /* @__PURE__ */ e(
331
- z,
372
+ k,
332
373
  {
333
374
  bodyPadding: r.bodyPadding ?? !0,
334
375
  className: "[scrollbar-color:var(--malachite-text-dimmed)_transparent]",
@@ -339,26 +380,26 @@ const N = 200, fe = "360px", k = 16, be = 320, hr = "cubic-bezier(0.2, 0.8, 0.2,
339
380
  "div",
340
381
  {
341
382
  className: "box-border flex flex-col justify-center border-0 border-t border-solid border-[var(--malachite-card-border)] px-[20px] py-[12px]",
342
- style: { minHeight: we(Y.footer) },
383
+ style: { minHeight: $e(Z.footer) },
343
384
  children: r.footer
344
385
  }
345
386
  ) : null
346
387
  ]
347
388
  }
348
- ) : null, L = (r == null ? void 0 : r.tabLabel) ?? `Open ${(r == null ? void 0 : r.title) ?? ""}`, We = r && i && !u && r.onOpenChange ? /* @__PURE__ */ l(
389
+ ) : null, D = (r == null ? void 0 : r.tabLabel) ?? `Open ${(r == null ? void 0 : r.title) ?? ""}`, Je = r && m && !b && r.onOpenChange ? /* @__PURE__ */ t(
349
390
  "button",
350
391
  {
351
392
  type: "button",
352
- "aria-label": L,
353
- title: L,
393
+ "aria-label": D,
394
+ title: D,
354
395
  onClick: () => {
355
- var a;
356
- return (a = r.onOpenChange) == null ? void 0 : a.call(r, !0);
396
+ var i;
397
+ return (i = r.onOpenChange) == null ? void 0 : i.call(r, !0);
357
398
  },
358
- className: `absolute flex cursor-pointer flex-col items-center rounded-l-[14px] border-0 py-[12px] pr-0 pl-[2px] text-[13px] font-medium text-[var(--malachite-text-primary)] [box-shadow:var(--malachite-shadow-lg)] ${dr}`,
359
- style: { right: "100%", top: 20, width: 42, background: ve },
399
+ className: `absolute flex cursor-pointer flex-col items-center rounded-l-[14px] border-0 py-[12px] pr-0 pl-[2px] text-[13px] font-medium text-[var(--malachite-text-primary)] [box-shadow:var(--malachite-shadow-lg)] ${pr}`,
400
+ style: { right: "100%", top: 20, width: 42, background: ye },
360
401
  children: [
361
- /* @__PURE__ */ e(nr, { size: 16 }),
402
+ /* @__PURE__ */ e(or, { size: 16 }),
362
403
  /* @__PURE__ */ e("span", { "aria-hidden": "true", style: { height: 12, flexShrink: 0 } }),
363
404
  /* @__PURE__ */ e(
364
405
  "span",
@@ -369,90 +410,90 @@ const N = 200, fe = "360px", k = 16, be = 320, hr = "cubic-bezier(0.2, 0.8, 0.2,
369
410
  transform: "rotate(180deg)",
370
411
  whiteSpace: "nowrap"
371
412
  },
372
- children: L
413
+ children: D
373
414
  }
374
415
  ),
375
416
  r.tabIcon ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "mt-[8px] flex", children: r.tabIcon }) : null
376
417
  ]
377
418
  }
378
- ) : null, Ye = /* @__PURE__ */ e(
419
+ ) : null, Qe = /* @__PURE__ */ e(
379
420
  "div",
380
421
  {
381
- ref: Le,
422
+ ref: Me,
382
423
  className: "pointer-events-none absolute top-0 right-0 bottom-0 z-[20]",
383
424
  style: {
384
- left: i && u ? `calc(-1 * ${de})` : 0
425
+ left: m && b ? `calc(-1 * ${xe})` : 0
385
426
  }
386
427
  }
387
- ), me = "grid grid-rows-[auto_minmax(0,1fr)_auto] rounded-[20px] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] text-[var(--malachite-card-foreground)] [box-shadow:var(--malachite-shadow-lg)]";
388
- return er(
428
+ ), he = "grid grid-rows-[auto_minmax(0,1fr)_auto] rounded-[20px] border border-solid border-[var(--malachite-card-border)] bg-[var(--malachite-card-background)] text-[var(--malachite-card-foreground)] [box-shadow:var(--malachite-shadow-lg)]";
429
+ return tr(
389
430
  // Host carries the stacking context — ShadowRootWrapper's `isolation` would
390
431
  // otherwise flatten our z-index and let sticky page elements paint over us.
391
432
  /* @__PURE__ */ e(
392
- rr,
433
+ nr,
393
434
  {
394
- hostRef: ee,
395
- hostStyle: { position: "relative", zIndex: je },
396
- hostProps: Ve ? { ...he("sidepanel"), [pr]: "" } : he("sidepanel"),
397
- children: /* @__PURE__ */ e(ue.Provider, { value: null, children: /* @__PURE__ */ l("div", { className: "fixed inset-0 z-[1000]", children: [
435
+ hostRef: ne,
436
+ hostStyle: { position: "relative", zIndex: Xe },
437
+ hostProps: Fe ? { ...ue("sidepanel"), [hr]: "" } : ue("sidepanel"),
438
+ children: /* @__PURE__ */ e(ve.Provider, { value: null, children: /* @__PURE__ */ t("div", { className: "fixed inset-0 z-[1000]", children: [
398
439
  /* @__PURE__ */ e(
399
440
  "div",
400
441
  {
401
442
  "aria-hidden": "true",
402
- onClick: te,
403
- className: `absolute inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${J ? "opacity-100" : "opacity-0"}`
443
+ onClick: oe,
444
+ className: `absolute inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${re ? "opacity-100" : "opacity-0"}`
404
445
  }
405
446
  ),
406
447
  /* @__PURE__ */ e(
407
448
  "div",
408
449
  {
409
- ref: Be,
450
+ ref: je,
410
451
  role: "dialog",
411
- "aria-modal": He ? "true" : void 0,
452
+ "aria-modal": Ue ? "true" : void 0,
412
453
  "aria-describedby": [
413
- ...(le ?? []).map((a, qe) => `${F}-${qe}`),
414
- f ? q : null
454
+ ...(O ?? []).map((i, Ze) => `${L}-${Ze}`),
455
+ u ? ee : null
415
456
  ].filter(Boolean).join(" ") || void 0,
416
457
  tabIndex: -1,
417
- "aria-label": V ? void 0 : $e ?? (typeof n == "string" ? n : void 0),
418
- "aria-labelledby": V,
419
- className: i ? "absolute top-[8px] right-[8px] bottom-[8px] outline-none" : `absolute top-[8px] right-[8px] bottom-[8px] overflow-x-auto overflow-y-hidden outline-none ${me}`,
458
+ "aria-label": X ? void 0 : Pe ?? (typeof n == "string" ? n : void 0),
459
+ "aria-labelledby": X,
460
+ className: m ? "absolute top-[8px] right-[8px] bottom-[8px] outline-none" : `absolute top-[8px] right-[8px] bottom-[8px] overflow-x-auto overflow-y-hidden outline-none ${he}`,
420
461
  style: {
421
- width: `min(calc(100% - 16px), ${r && !i ? `calc(2 * ${$(w)})` : $(w)})`,
462
+ width: `min(calc(100% - 16px), ${r && !m ? `calc(2 * ${$(w)})` : $(w)})`,
422
463
  // Inline: Tailwind translate utilities silently break inside
423
464
  // shadow roots (see CLAUDE.md Shadow DOM caveats).
424
- transform: J ? "translateX(0)" : "translateX(calc(100% + 16px))",
465
+ transform: re ? "translateX(0)" : "translateX(calc(100% + 16px))",
425
466
  transition: `transform ${N}ms ease-in-out, width ${N}ms ease-in-out, grid-template-columns ${N}ms ease-in-out`,
426
467
  // The panel's own column is the width it has without an aside: `maxWidth`
427
468
  // less the 1px border either side, so opening the aside never widens it.
428
469
  // With an aside neither column gives way, so a narrow window scrolls the
429
470
  // panel instead. Both templates share one shape so the minimums animate
430
471
  // with the width rather than overflowing mid-transition.
431
- gridTemplateColumns: i ? void 0 : r ? `minmax(${fe}, 1fr) minmax(${R}, ${R})` : `minmax(0px, 1fr) minmax(0px, ${R})`
472
+ gridTemplateColumns: m ? void 0 : r ? `minmax(${ge}, 1fr) minmax(${A}, ${A})` : `minmax(0px, 1fr) minmax(0px, ${A})`
432
473
  },
433
- children: /* @__PURE__ */ l(xr.Provider, { value: Ee, children: [
434
- i ? /* @__PURE__ */ l(O, { children: [
435
- Ke,
436
- We,
437
- /* @__PURE__ */ l(
474
+ children: /* @__PURE__ */ t(fr.Provider, { value: Ae, children: [
475
+ m ? /* @__PURE__ */ t(T, { children: [
476
+ qe,
477
+ Je,
478
+ /* @__PURE__ */ t(
438
479
  "div",
439
480
  {
440
- className: `absolute inset-0 overflow-hidden ${me}`,
481
+ className: `absolute inset-0 overflow-hidden ${he}`,
441
482
  style: {
442
483
  gridTemplateColumns: "0px minmax(0px, 1fr)"
443
484
  },
444
485
  children: [
445
- ce,
446
- c ? /* @__PURE__ */ e(xe, { sheet: c }) : null
486
+ pe,
487
+ p ? /* @__PURE__ */ e(be, { sheet: p }) : null
447
488
  ]
448
489
  }
449
490
  )
450
- ] }) : /* @__PURE__ */ l(O, { children: [
451
- Ue,
452
- ce,
453
- c ? /* @__PURE__ */ e(xe, { sheet: c }) : null
491
+ ] }) : /* @__PURE__ */ t(T, { children: [
492
+ We,
493
+ pe,
494
+ p ? /* @__PURE__ */ e(be, { sheet: p }) : null
454
495
  ] }),
455
- Ye
496
+ Qe
456
497
  ] })
457
498
  }
458
499
  )
@@ -462,9 +503,9 @@ const N = 200, fe = "360px", k = 16, be = 320, hr = "cubic-bezier(0.2, 0.8, 0.2,
462
503
  document.body
463
504
  );
464
505
  };
465
- gr.Tabs = ir;
506
+ $r.Tabs = cr;
466
507
  export {
467
- gr as SidePanel,
468
- gr as default
508
+ $r as SidePanel,
509
+ $r as default
469
510
  };
470
511
  //# sourceMappingURL=SidePanel.js.map