@stackone/malachite 2.130.1 → 2.131.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.
- package/COMPONENTS.md +2 -2
- package/dist/components/FormActions.js +44 -37
- package/dist/components/FormActions.js.map +1 -1
- package/dist/components/SidePanel.js +275 -234
- package/dist/components/SidePanel.js.map +1 -1
- package/dist/index.d.ts +43 -21
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1,314 +1,355 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { ShadowRootWrapper as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { afterNextPaint as
|
|
15
|
-
import { FOCUS_RING as
|
|
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
|
|
18
|
-
import { OVERLAY_ELEVATED_ATTR as
|
|
19
|
-
import { SidePanelOverlayContext as
|
|
20
|
-
import { SidePanelTabsContext as
|
|
21
|
-
const N = 200,
|
|
22
|
-
const [
|
|
23
|
-
return
|
|
24
|
-
if (!
|
|
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
|
|
27
|
-
header:
|
|
26
|
+
const s = () => o({
|
|
27
|
+
header: a == null ? void 0 : a.getBoundingClientRect().height,
|
|
28
28
|
footer: n == null ? void 0 : n.getBoundingClientRect().height
|
|
29
|
-
}),
|
|
30
|
-
return
|
|
31
|
-
}, [
|
|
32
|
-
},
|
|
33
|
-
bodyPadding:
|
|
34
|
-
className:
|
|
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:
|
|
37
|
-
renderLink:
|
|
38
|
-
stableGutter:
|
|
39
|
-
scrollerRef:
|
|
40
|
-
children:
|
|
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__ */
|
|
43
|
+
return /* @__PURE__ */ t(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
|
-
ref:
|
|
47
|
-
className: `min-h-0 flex-1 overflow-y-auto [scrollbar-color:var(--malachite-text-dimmed)_transparent] ${
|
|
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
|
-
|
|
50
|
+
_e,
|
|
51
51
|
{
|
|
52
|
-
id:
|
|
52
|
+
id: c ? `${c}-${g}` : void 0,
|
|
53
53
|
type: C.type,
|
|
54
54
|
message: C.message,
|
|
55
|
-
renderLink:
|
|
55
|
+
renderLink: o
|
|
56
56
|
},
|
|
57
57
|
g
|
|
58
58
|
)),
|
|
59
|
-
|
|
59
|
+
l ? /* @__PURE__ */ e("div", { className: v ? "p-[28px]" : "py-[28px]", children: u }) : u
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
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:
|
|
99
|
+
className: Ce,
|
|
70
100
|
onSubmit: (n) => {
|
|
71
|
-
n.preventDefault(), n.stopPropagation(),
|
|
101
|
+
n.preventDefault(), n.stopPropagation(), l(n);
|
|
72
102
|
},
|
|
73
|
-
children:
|
|
103
|
+
children: a
|
|
74
104
|
}
|
|
75
|
-
) : /* @__PURE__ */ e("div", { className:
|
|
76
|
-
open:
|
|
77
|
-
onClose:
|
|
105
|
+
) : /* @__PURE__ */ e("div", { className: Ce, children: a }), $r = ({
|
|
106
|
+
open: l,
|
|
107
|
+
onClose: a,
|
|
78
108
|
title: n,
|
|
79
|
-
subtitle:
|
|
80
|
-
subtitlePlacement:
|
|
81
|
-
subtitleExtra:
|
|
82
|
-
titleExtra:
|
|
83
|
-
description:
|
|
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:
|
|
88
|
-
headerExtra:
|
|
89
|
-
footer:
|
|
90
|
-
onSubmit:
|
|
91
|
-
onBack:
|
|
117
|
+
icon: H,
|
|
118
|
+
headerExtra: V,
|
|
119
|
+
footer: R,
|
|
120
|
+
onSubmit: j,
|
|
121
|
+
onBack: U,
|
|
92
122
|
maxWidth: w = 1080,
|
|
93
|
-
"aria-label":
|
|
94
|
-
"aria-labelledby":
|
|
95
|
-
bodyPadding:
|
|
96
|
-
stacking:
|
|
97
|
-
callouts:
|
|
98
|
-
renderLink:
|
|
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:
|
|
101
|
-
progress:
|
|
130
|
+
sheet: h,
|
|
131
|
+
progress: G,
|
|
102
132
|
subheader: S,
|
|
103
|
-
|
|
133
|
+
tray: K,
|
|
134
|
+
columns: W,
|
|
135
|
+
children: ke
|
|
104
136
|
}) => {
|
|
105
|
-
const
|
|
106
|
-
() => ({ stripSlot:
|
|
107
|
-
[
|
|
108
|
-
), [
|
|
109
|
-
ref:
|
|
110
|
-
isTopmost:
|
|
111
|
-
zIndex:
|
|
112
|
-
elevated:
|
|
113
|
-
} =
|
|
114
|
-
open:
|
|
115
|
-
onClose:
|
|
116
|
-
elevated:
|
|
117
|
-
hostRef:
|
|
118
|
-
}),
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
}),
|
|
122
|
-
|
|
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),
|
|
125
|
-
}), [
|
|
156
|
+
_.current !== null && (cancelAnimationFrame(_.current), _.current = null), f.current && (clearTimeout(f.current), f.current = null);
|
|
157
|
+
}), [l]), !Ve)
|
|
126
158
|
return null;
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
},
|
|
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(!!
|
|
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__ */
|
|
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] ${
|
|
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(
|
|
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(
|
|
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,
|
|
182
|
+
) : null, ie = o === "below" && !!c, se = /* @__PURE__ */ e(
|
|
151
183
|
"span",
|
|
152
184
|
{
|
|
153
|
-
className:
|
|
154
|
-
children: /* @__PURE__ */ e(
|
|
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
|
-
),
|
|
157
|
-
|
|
188
|
+
), M = c ? /* @__PURE__ */ e(
|
|
189
|
+
dr,
|
|
158
190
|
{
|
|
159
|
-
tooltip:
|
|
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:
|
|
196
|
+
children: c
|
|
165
197
|
}
|
|
166
|
-
) : null,
|
|
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,
|
|
173
|
-
transition:
|
|
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
|
-
),
|
|
177
|
-
/* @__PURE__ */
|
|
208
|
+
), pe = /* @__PURE__ */ e(T, { children: /* @__PURE__ */ t(Nr, { onSubmit: j, children: [
|
|
209
|
+
/* @__PURE__ */ t(
|
|
178
210
|
"div",
|
|
179
211
|
{
|
|
180
|
-
ref:
|
|
181
|
-
className: `relative box-border flex min-h-[56px] flex-col justify-center px-[20px] ${
|
|
182
|
-
...y(!!
|
|
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 :
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
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:
|
|
192
|
-
className:
|
|
193
|
-
children: /* @__PURE__ */ e(
|
|
223
|
+
onClick: U,
|
|
224
|
+
className: B,
|
|
225
|
+
children: /* @__PURE__ */ e(ar, { size: 16 })
|
|
194
226
|
}
|
|
195
227
|
) : null,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
/* @__PURE__ */ e("span", { className: "ml-auto flex shrink-0 items-baseline text-[13px]", children:
|
|
206
|
-
] }) :
|
|
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
|
-
|
|
209
|
-
] }) : /* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
|
|
213
|
-
|
|
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
|
-
|
|
247
|
+
ce
|
|
216
248
|
] }),
|
|
217
|
-
|
|
249
|
+
de
|
|
218
250
|
] }),
|
|
219
251
|
/* @__PURE__ */ e(
|
|
220
252
|
"button",
|
|
221
253
|
{
|
|
222
254
|
type: "button",
|
|
223
255
|
"aria-label": "Close",
|
|
224
|
-
onClick:
|
|
225
|
-
className:
|
|
226
|
-
children: /* @__PURE__ */ e(
|
|
256
|
+
onClick: oe,
|
|
257
|
+
className: B,
|
|
258
|
+
children: /* @__PURE__ */ e(sr, { size: 10 })
|
|
227
259
|
}
|
|
228
260
|
)
|
|
229
261
|
] }),
|
|
230
|
-
|
|
262
|
+
u ? /* @__PURE__ */ e(
|
|
231
263
|
"div",
|
|
232
264
|
{
|
|
233
|
-
id:
|
|
265
|
+
id: ee,
|
|
234
266
|
className: "-mt-[8px] pb-[16px] text-[13px] leading-[1.6] text-[var(--malachite-text-secondary)]",
|
|
235
|
-
children:
|
|
267
|
+
children: u
|
|
236
268
|
}
|
|
237
269
|
) : null
|
|
238
270
|
]
|
|
239
271
|
}
|
|
240
272
|
),
|
|
241
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ t(
|
|
242
274
|
"div",
|
|
243
275
|
{
|
|
244
|
-
className: `flex min-h-0 flex-col ${
|
|
245
|
-
...y(!!
|
|
276
|
+
className: `flex min-h-0 flex-col ${R ? "" : "row-span-2"}`,
|
|
277
|
+
...y(!!p),
|
|
246
278
|
children: [
|
|
247
|
-
S ? /* @__PURE__ */
|
|
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
|
-
|
|
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:
|
|
287
|
+
onKeyDown: j ? yr : void 0,
|
|
256
288
|
children: v
|
|
257
289
|
}
|
|
258
290
|
) : null,
|
|
259
|
-
/* @__PURE__ */ e("div", { ref:
|
|
260
|
-
/* @__PURE__ */ e(
|
|
261
|
-
|
|
291
|
+
/* @__PURE__ */ e("div", { ref: Re, className: "shrink-0 px-[28px] empty:hidden" }),
|
|
292
|
+
W ? /* @__PURE__ */ e(
|
|
293
|
+
wr,
|
|
262
294
|
{
|
|
263
|
-
|
|
264
|
-
callouts:
|
|
265
|
-
calloutId:
|
|
266
|
-
renderLink:
|
|
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
|
-
|
|
316
|
+
R ? /* @__PURE__ */ e(
|
|
276
317
|
"div",
|
|
277
318
|
{
|
|
278
|
-
ref:
|
|
319
|
+
ref: He,
|
|
279
320
|
className: "border-0 border-t border-solid border-[var(--malachite-card-border)] px-[24px] py-[16px]",
|
|
280
|
-
...y(!!
|
|
281
|
-
children:
|
|
321
|
+
...y(!!p),
|
|
322
|
+
children: R
|
|
282
323
|
}
|
|
283
324
|
) : null
|
|
284
|
-
] }) }),
|
|
285
|
-
transition: `transform ${
|
|
286
|
-
},
|
|
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":
|
|
291
|
-
...y(!!
|
|
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% - ${
|
|
295
|
-
width: `calc(${
|
|
296
|
-
paddingRight:
|
|
335
|
+
right: `calc(100% - ${I}px)`,
|
|
336
|
+
width: `calc(${xe} + ${I}px)`,
|
|
337
|
+
paddingRight: I,
|
|
297
338
|
boxSizing: "border-box",
|
|
298
|
-
background:
|
|
299
|
-
transform:
|
|
300
|
-
opacity:
|
|
301
|
-
visibility:
|
|
302
|
-
...
|
|
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__ */
|
|
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:
|
|
350
|
+
style: { minHeight: $e(Z.header) },
|
|
310
351
|
children: [
|
|
311
|
-
/* @__PURE__ */ e("span", { className: "mr-[10px] flex shrink-0", children: /* @__PURE__ */ e(
|
|
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
|
|
321
|
-
return (
|
|
361
|
+
var i;
|
|
362
|
+
return (i = r.onOpenChange) == null ? void 0 : i.call(r, !1);
|
|
322
363
|
},
|
|
323
|
-
className:
|
|
324
|
-
children: /* @__PURE__ */ e(
|
|
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
|
-
|
|
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:
|
|
383
|
+
style: { minHeight: $e(Z.footer) },
|
|
343
384
|
children: r.footer
|
|
344
385
|
}
|
|
345
386
|
) : null
|
|
346
387
|
]
|
|
347
388
|
}
|
|
348
|
-
) : null,
|
|
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":
|
|
353
|
-
title:
|
|
393
|
+
"aria-label": D,
|
|
394
|
+
title: D,
|
|
354
395
|
onClick: () => {
|
|
355
|
-
var
|
|
356
|
-
return (
|
|
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)] ${
|
|
359
|
-
style: { right: "100%", top: 20, width: 42, background:
|
|
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(
|
|
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:
|
|
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,
|
|
419
|
+
) : null, Qe = /* @__PURE__ */ e(
|
|
379
420
|
"div",
|
|
380
421
|
{
|
|
381
|
-
ref:
|
|
422
|
+
ref: Me,
|
|
382
423
|
className: "pointer-events-none absolute top-0 right-0 bottom-0 z-[20]",
|
|
383
424
|
style: {
|
|
384
|
-
left:
|
|
425
|
+
left: m && b ? `calc(-1 * ${xe})` : 0
|
|
385
426
|
}
|
|
386
427
|
}
|
|
387
|
-
),
|
|
388
|
-
return
|
|
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
|
-
|
|
433
|
+
nr,
|
|
393
434
|
{
|
|
394
|
-
hostRef:
|
|
395
|
-
hostStyle: { position: "relative", zIndex:
|
|
396
|
-
hostProps:
|
|
397
|
-
children: /* @__PURE__ */ e(
|
|
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:
|
|
403
|
-
className: `absolute inset-0 bg-[var(--malachite-overlay-scrim)] transition-opacity duration-200 ease-in-out ${
|
|
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:
|
|
450
|
+
ref: je,
|
|
410
451
|
role: "dialog",
|
|
411
|
-
"aria-modal":
|
|
452
|
+
"aria-modal": Ue ? "true" : void 0,
|
|
412
453
|
"aria-describedby": [
|
|
413
|
-
...(
|
|
414
|
-
|
|
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":
|
|
418
|
-
"aria-labelledby":
|
|
419
|
-
className:
|
|
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 && !
|
|
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:
|
|
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:
|
|
472
|
+
gridTemplateColumns: m ? void 0 : r ? `minmax(${ge}, 1fr) minmax(${A}, ${A})` : `minmax(0px, 1fr) minmax(0px, ${A})`
|
|
432
473
|
},
|
|
433
|
-
children: /* @__PURE__ */
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
/* @__PURE__ */
|
|
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 ${
|
|
481
|
+
className: `absolute inset-0 overflow-hidden ${he}`,
|
|
441
482
|
style: {
|
|
442
483
|
gridTemplateColumns: "0px minmax(0px, 1fr)"
|
|
443
484
|
},
|
|
444
485
|
children: [
|
|
445
|
-
|
|
446
|
-
|
|
486
|
+
pe,
|
|
487
|
+
p ? /* @__PURE__ */ e(be, { sheet: p }) : null
|
|
447
488
|
]
|
|
448
489
|
}
|
|
449
490
|
)
|
|
450
|
-
] }) : /* @__PURE__ */
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
491
|
+
] }) : /* @__PURE__ */ t(T, { children: [
|
|
492
|
+
We,
|
|
493
|
+
pe,
|
|
494
|
+
p ? /* @__PURE__ */ e(be, { sheet: p }) : null
|
|
454
495
|
] }),
|
|
455
|
-
|
|
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
|
-
|
|
506
|
+
$r.Tabs = cr;
|
|
466
507
|
export {
|
|
467
|
-
|
|
468
|
-
|
|
508
|
+
$r as SidePanel,
|
|
509
|
+
$r as default
|
|
469
510
|
};
|
|
470
511
|
//# sourceMappingURL=SidePanel.js.map
|