@stackone/malachite 2.87.0 → 2.88.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.
- package/COMPONENTS.md +2 -2
- package/dist/components/Accordion.js +206 -179
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Button.js +118 -81
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Chat/ChatModelPicker.js +70 -67
- package/dist/components/Chat/ChatModelPicker.js.map +1 -1
- package/dist/components/FilterSearch.js +92 -91
- package/dist/components/FilterSearch.js.map +1 -1
- package/dist/components/MultiSelect.js +190 -189
- package/dist/components/MultiSelect.js.map +1 -1
- package/dist/components/PinnedCornerCap.js +32 -19
- package/dist/components/PinnedCornerCap.js.map +1 -1
- package/dist/components/QueryInput.js +95 -92
- package/dist/components/QueryInput.js.map +1 -1
- package/dist/components/SplitButton.js +62 -61
- package/dist/components/SplitButton.js.map +1 -1
- package/dist/components/Surface.js +98 -94
- package/dist/components/Surface.js.map +1 -1
- package/dist/components/Tooltip.js +93 -90
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/WizardLayout.js +49 -46
- package/dist/components/WizardLayout.js.map +1 -1
- package/dist/components/activeElement.js +5 -1
- package/dist/components/activeElement.js.map +1 -1
- package/dist/components/useFollowTrigger.js +28 -0
- package/dist/components/useFollowTrigger.js.map +1 -0
- package/dist/index.d.ts +8 -6
- package/dist/tailwind.css.js +1 -1
- package/package.json +1 -1
|
@@ -1,77 +1,80 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as j, useState as
|
|
3
|
-
import { Button as
|
|
4
|
-
import
|
|
5
|
-
import { GLASS_SURFACE_STYLE as
|
|
6
|
-
const
|
|
7
|
-
default: "px-6
|
|
8
|
-
large: "
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
import { useRef as j, useState as A, useLayoutEffect as L } from "react";
|
|
3
|
+
import { Button as R } from "./Button.js";
|
|
4
|
+
import E from "./CustomIcons/ArrowLeftIcon.js";
|
|
5
|
+
import { GLASS_SURFACE_STYLE as T } from "./glassSurface.js";
|
|
6
|
+
const r = {
|
|
7
|
+
default: "px-6",
|
|
8
|
+
large: "px-[28px] max-sm:px-[16px]"
|
|
9
|
+
}, z = {
|
|
10
|
+
default: `${r.default} pt-4 min-h-[var(--malachite-control-height-small,28px)]`,
|
|
11
|
+
large: `h-[60px] ${r.large} max-sm:h-[52px]`
|
|
12
|
+
}, I = ({
|
|
13
|
+
showBack: d = !1,
|
|
14
|
+
onBack: h,
|
|
15
|
+
backDisabled: u = !1,
|
|
16
|
+
reserveBack: v = !0,
|
|
17
|
+
topBarSize: c = "default",
|
|
18
|
+
leading: g,
|
|
19
|
+
stepper: N,
|
|
17
20
|
trailing: w,
|
|
18
|
-
banner:
|
|
21
|
+
banner: n,
|
|
19
22
|
header: s,
|
|
20
23
|
footer: l,
|
|
21
|
-
footerGlass:
|
|
22
|
-
footerAlign:
|
|
23
|
-
center:
|
|
24
|
+
footerGlass: b = !1,
|
|
25
|
+
footerAlign: y = "full",
|
|
26
|
+
center: $ = !1,
|
|
24
27
|
contentWidth: a = 480,
|
|
25
|
-
minWidth:
|
|
28
|
+
minWidth: o,
|
|
26
29
|
children: k,
|
|
27
30
|
className: S = ""
|
|
28
31
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
return
|
|
31
|
-
const i =
|
|
32
|
+
const m = j(null), [_, x] = A(0);
|
|
33
|
+
return L(() => {
|
|
34
|
+
const i = m.current;
|
|
32
35
|
if (!i) {
|
|
33
|
-
|
|
36
|
+
x(0);
|
|
34
37
|
return;
|
|
35
38
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
return
|
|
39
|
+
const f = () => x(i.offsetHeight);
|
|
40
|
+
f();
|
|
41
|
+
const p = new ResizeObserver(f);
|
|
42
|
+
return p.observe(i), () => p.disconnect();
|
|
40
43
|
}, [l]), /* @__PURE__ */ t(
|
|
41
44
|
"div",
|
|
42
45
|
{
|
|
43
46
|
className: `w-full h-screen flex flex-col overflow-hidden bg-[var(--malachite-card-sunken-background)] ${S}`,
|
|
44
|
-
style:
|
|
47
|
+
style: o ? { minWidth: `${o}px` } : void 0,
|
|
45
48
|
children: [
|
|
46
49
|
/* @__PURE__ */ t(
|
|
47
50
|
"div",
|
|
48
51
|
{
|
|
49
|
-
className: `w-full shrink-0 flex items-center justify-between ${
|
|
52
|
+
className: `w-full shrink-0 flex items-center justify-between ${z[c]}`,
|
|
50
53
|
children: [
|
|
51
54
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-[16px] min-w-0", children: [
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
d ? /* @__PURE__ */ e(
|
|
56
|
+
R,
|
|
54
57
|
{
|
|
55
58
|
variant: "outline",
|
|
56
59
|
size: "small",
|
|
57
60
|
iconOnly: !0,
|
|
58
|
-
icon: /* @__PURE__ */ e(
|
|
59
|
-
disabled:
|
|
60
|
-
onClick:
|
|
61
|
+
icon: /* @__PURE__ */ e(E, { size: 14 }),
|
|
62
|
+
disabled: u,
|
|
63
|
+
onClick: h,
|
|
61
64
|
"aria-label": "Back",
|
|
62
65
|
className: "w-[var(--malachite-control-height-small,28px)] h-[var(--malachite-control-height-small,28px)] shrink-0"
|
|
63
66
|
}
|
|
64
|
-
) :
|
|
65
|
-
|
|
67
|
+
) : v ? /* @__PURE__ */ e("span", { className: "w-[var(--malachite-control-height-small,28px)] h-[var(--malachite-control-height-small,28px)] shrink-0" }) : null,
|
|
68
|
+
g
|
|
66
69
|
] }),
|
|
67
70
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-[16px]", children: [
|
|
68
71
|
w ?? null,
|
|
69
|
-
|
|
72
|
+
N ?? null
|
|
70
73
|
] })
|
|
71
74
|
]
|
|
72
75
|
}
|
|
73
76
|
),
|
|
74
|
-
|
|
77
|
+
n ? /* @__PURE__ */ e("div", { className: `w-full shrink-0 pt-[12px] ${r[c]}`, children: n }) : null,
|
|
75
78
|
s ? /* @__PURE__ */ e("div", { className: "w-full shrink-0 flex flex-col items-center px-6 pt-8", children: /* @__PURE__ */ e(
|
|
76
79
|
"div",
|
|
77
80
|
{
|
|
@@ -84,12 +87,12 @@ const B = {
|
|
|
84
87
|
/* @__PURE__ */ e(
|
|
85
88
|
"div",
|
|
86
89
|
{
|
|
87
|
-
className: `absolute inset-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] flex flex-col items-center px-6 ${
|
|
90
|
+
className: `absolute inset-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] flex flex-col items-center px-6 ${$ ? "justify-center" : "justify-start"}`,
|
|
88
91
|
style: {
|
|
89
92
|
// Reserve the overlaid footer's height plus a gap, so the last item
|
|
90
93
|
// clears the footer with breathing room (not flush against it, which
|
|
91
94
|
// reads as hidden content continuing underneath).
|
|
92
|
-
paddingBottom: l ? `${
|
|
95
|
+
paddingBottom: l ? `${_ + 24}px` : "48px"
|
|
93
96
|
},
|
|
94
97
|
children: /* @__PURE__ */ e(
|
|
95
98
|
"div",
|
|
@@ -109,10 +112,10 @@ const B = {
|
|
|
109
112
|
l ? /* @__PURE__ */ e(
|
|
110
113
|
"div",
|
|
111
114
|
{
|
|
112
|
-
ref:
|
|
115
|
+
ref: m,
|
|
113
116
|
className: "absolute inset-x-0 bottom-0 z-20",
|
|
114
|
-
style:
|
|
115
|
-
children:
|
|
117
|
+
style: b ? T : void 0,
|
|
118
|
+
children: y === "content" ? /* @__PURE__ */ e("div", { className: "flex justify-center px-6 pt-4 pb-3", children: /* @__PURE__ */ e("div", { className: "w-full", style: { maxWidth: `${a}px` }, children: l }) }) : l
|
|
116
119
|
}
|
|
117
120
|
) : null
|
|
118
121
|
] })
|
|
@@ -121,7 +124,7 @@ const B = {
|
|
|
121
124
|
);
|
|
122
125
|
};
|
|
123
126
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
I as WizardLayout,
|
|
128
|
+
I as default
|
|
126
129
|
};
|
|
127
130
|
//# sourceMappingURL=WizardLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardLayout.js","sources":["../../src/components/WizardLayout.tsx"],"sourcesContent":["import React, { useLayoutEffect, useRef, useState } from 'react';\nimport Button from './Button';\nimport ArrowLeftIcon from './CustomIcons/ArrowLeftIcon';\nimport { GLASS_SURFACE_STYLE } from './glassSurface';\n\nexport interface WizardLayoutProps {\n /** Renders the outline back button in the top-left slot. */\n showBack?: boolean;\n onBack?: () => void;\n backDisabled?: boolean;\n /** `false` drops the hidden back button's square, so `leading` sits at the same inset as `trailing`. */\n reserveBack?: boolean;\n /** `large`: a 60px bar with 28px insets (52px and 16px below 640px), items centred. */\n topBarSize?: 'default' | 'large';\n /** Top-left slot beside the back button — e.g. a user avatar menu. */\n leading?: React.ReactNode;\n /** Right top-bar slot (sits just before `stepper`) — e.g. a theme toggle. */\n stepper?: React.ReactNode;\n /** Far-right top-bar slot — e.g. a theme toggle. */\n trailing?: React.ReactNode;\n /** A page-wide notice under the top bar, above `header`. */\n banner?: React.ReactNode;\n /**\n * Pinned below the top bar and always visible while the content scrolls —\n * e.g. connection logos + a step title. Rendered in the same centred column\n * as the content (`contentWidth`).\n */\n header?: React.ReactNode;\n /** Pinned to the bottom of the screen — typically a <FooterNav /> or a primary CTA. */\n footer?: React.ReactNode;\n /**\n * Give the pinned footer a frosted-glass treatment (translucent background +\n * backdrop blur) so scrolling content shows through it. The footer already sits\n * above sticky body content, so it reads as glass over the scrolling list.\n */\n footerGlass?: boolean;\n /** `content` holds the footer to the content column, so a full-width action lines up with the list. */\n footerAlign?: 'full' | 'content';\n /** Vertically centre the content (used for terminal/success screens). */\n center?: boolean;\n /** Max width of the centered content column. */\n contentWidth?: number;\n /** Minimum width of the whole layout, below which it scrolls horizontally. */\n minWidth?: number;\n children?: React.ReactNode;\n className?: string;\n}\n\nconst TOP_BAR_CLASSES: Record<NonNullable<WizardLayoutProps['topBarSize']>, string> = {\n default: 'px-6 pt-4 min-h-[var(--malachite-control-height-small,28px)]',\n large: 'h-[60px] px-[28px] max-sm:h-[52px] max-sm:px-[16px]',\n};\n\nconst WizardLayout: React.FC<WizardLayoutProps> = ({\n showBack = false,\n onBack,\n backDisabled = false,\n reserveBack = true,\n topBarSize = 'default',\n leading,\n stepper,\n trailing,\n banner,\n header,\n footer,\n footerGlass = false,\n footerAlign = 'full',\n center = false,\n contentWidth = 480,\n minWidth,\n children,\n className = '',\n}) => {\n // The footer overlays the bottom of the scroll area (so content can glass under\n // it). Measure it so the scroll content reserves matching bottom space and the\n // last item is never hidden behind it.\n const footerRef = useRef<HTMLDivElement>(null);\n const [footerHeight, setFooterHeight] = useState(0);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-run when the footer node mounts/unmounts so the observer attaches to the current element.\n useLayoutEffect(() => {\n const el = footerRef.current;\n if (!el) {\n setFooterHeight(0);\n return;\n }\n const update = () => setFooterHeight(el.offsetHeight);\n update();\n const observer = new ResizeObserver(update);\n observer.observe(el);\n return () => observer.disconnect();\n }, [footer]);\n\n return (\n <div\n className={`w-full h-screen flex flex-col overflow-hidden bg-[var(--malachite-card-sunken-background)] ${className}`}\n style={minWidth ? { minWidth: `${minWidth}px` } : undefined}\n >\n <div\n className={`w-full shrink-0 flex items-center justify-between ${TOP_BAR_CLASSES[topBarSize]}`}\n >\n <div className=\"flex items-center gap-[16px] min-w-0\">\n {showBack ? (\n <Button\n variant=\"outline\"\n size=\"small\"\n iconOnly\n icon={<ArrowLeftIcon size={14} />}\n disabled={backDisabled}\n onClick={onBack}\n aria-label=\"Back\"\n className=\"w-[var(--malachite-control-height-small,28px)] h-[var(--malachite-control-height-small,28px)] shrink-0\"\n />\n ) : reserveBack ? (\n <span className=\"w-[var(--malachite-control-height-small,28px)] h-[var(--malachite-control-height-small,28px)] shrink-0\" />\n ) : null}\n {leading}\n </div>\n <div className=\"flex items-center gap-[16px]\">\n {trailing ?? null}\n {stepper ?? null}\n </div>\n </div>\n\n {banner ? <div className=\"w-full shrink-0 px-[12px] pt-[12px]\">{banner}</div> : null}\n\n {header ? (\n <div className=\"w-full shrink-0 flex flex-col items-center px-6 pt-8\">\n <div\n className=\"w-full flex flex-col items-center gap-[24px]\"\n style={{ maxWidth: `${contentWidth}px` }}\n >\n {header}\n </div>\n </div>\n ) : null}\n\n <div className=\"relative flex-1 min-h-0\">\n {/* The gutter is held on both edges so a classic scrollbar keeps the content\n centred on the page, in line with the pinned header and the overlaid footer. */}\n <div\n className={`absolute inset-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] flex flex-col items-center px-6 ${\n center ? 'justify-center' : 'justify-start'\n }`}\n style={{\n // Reserve the overlaid footer's height plus a gap, so the last item\n // clears the footer with breathing room (not flush against it, which\n // reads as hidden content continuing underneath).\n paddingBottom: footer ? `${footerHeight + 24}px` : '48px',\n }}\n >\n <div\n className=\"w-full flex flex-col items-center gap-[40px]\"\n style={{\n maxWidth: `${contentWidth}px`,\n // Top padding lives on the scrolling content — NOT the scrollport —\n // so a `position: sticky` child pins flush to the top with no gap.\n paddingTop: header ? '32px' : '48px',\n }}\n >\n {children}\n </div>\n </div>\n\n {footer ? (\n <div\n ref={footerRef}\n // z-20 keeps the pinned footer above sticky body content (e.g. a\n // sticky Accordion header at z-10) so it can't paint over the footer.\n className=\"absolute inset-x-0 bottom-0 z-20\"\n style={footerGlass ? GLASS_SURFACE_STYLE : undefined}\n >\n {footerAlign === 'content' ? (\n <div className=\"flex justify-center px-6 pt-4 pb-3\">\n <div className=\"w-full\" style={{ maxWidth: `${contentWidth}px` }}>\n {footer}\n </div>\n </div>\n ) : (\n footer\n )}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nexport default WizardLayout;\nexport { WizardLayout };\n"],"names":["TOP_BAR_CLASSES","WizardLayout","showBack","onBack","backDisabled","reserveBack","topBarSize","leading","stepper","trailing","banner","header","footer","footerGlass","footerAlign","center","contentWidth","minWidth","children","className","footerRef","useRef","footerHeight","setFooterHeight","useState","useLayoutEffect","el","update","observer","jsxs","jsx","Button","ArrowLeftIcon","GLASS_SURFACE_STYLE"],"mappings":";;;;;AAgDA,MAAMA,IAAgF;AAAA,EAClF,SAAS;AAAA,EACT,OAAO;AACX,GAEMC,IAA4C,CAAC;AAAA,EAC/C,UAAAC,IAAW;AAAA,EACX,QAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;AAIF,QAAMC,IAAYC,EAAuB,IAAI,GACvC,CAACC,GAAcC,CAAe,IAAIC,EAAS,CAAC;AAGlD,SAAAC,EAAgB,MAAM;AAClB,UAAMC,IAAKN,EAAU;AACrB,QAAI,CAACM,GAAI;AACL,MAAAH,EAAgB,CAAC;AACjB;AAAA,IACJ;AACA,UAAMI,IAAS,MAAMJ,EAAgBG,EAAG,YAAY;AACpD,IAAAC,EAAA;AACA,UAAMC,IAAW,IAAI,eAAeD,CAAM;AAC1C,WAAAC,EAAS,QAAQF,CAAE,GACZ,MAAME,EAAS,WAAA;AAAA,EAC1B,GAAG,CAAChB,CAAM,CAAC,GAGP,gBAAAiB;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,8FAA8FV,CAAS;AAAA,MAClH,OAAOF,IAAW,EAAE,UAAU,GAAGA,CAAQ,SAAS;AAAA,MAElD,UAAA;AAAA,QAAA,gBAAAY;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,qD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,kBACG,WAAU;AAAA,kBACV,OAAO;AAAA,oBACH,UAAU,GAAGd,CAAY;AAAA;AAAA;AAAA,oBAGzB,YAAYL,IAAS,SAAS;AAAA,kBAAA;AAAA,kBAGjC,UAAAO;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,UAGHN,IACG,gBAAAkB;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,KAAKV;AAAA,cAGL,WAAU;AAAA,cACV,OAAOP,IAAcoB,IAAsB;AAAA,cAE1C,gBAAgB,YACb,gBAAAH,EAAC,SAAI,WAAU,sCACX,4BAAC,OAAA,EAAI,WAAU,UAAS,OAAO,EAAE,UAAU,GAAGd,CAAY,QACrD,UAAAJ,EAAA,CACL,GACJ,IAEAA;AAAA,YAAA;AAAA,UAAA,IAGR;AAAA,QAAA,EAAA,CACR;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"WizardLayout.js","sources":["../../src/components/WizardLayout.tsx"],"sourcesContent":["import React, { useLayoutEffect, useRef, useState } from 'react';\nimport Button from './Button';\nimport ArrowLeftIcon from './CustomIcons/ArrowLeftIcon';\nimport { GLASS_SURFACE_STYLE } from './glassSurface';\n\nexport interface WizardLayoutProps {\n /** Renders the outline back button in the top-left slot. */\n showBack?: boolean;\n onBack?: () => void;\n backDisabled?: boolean;\n /** `false` drops the hidden back button's square, so `leading` sits at the same inset as `trailing`. */\n reserveBack?: boolean;\n /** `large`: a 60px bar with 28px insets (52px and 16px below 640px), items centred. */\n topBarSize?: 'default' | 'large';\n /** Top-left slot beside the back button — e.g. a user avatar menu. */\n leading?: React.ReactNode;\n /** Right top-bar slot (sits just before `stepper`) — e.g. a theme toggle. */\n stepper?: React.ReactNode;\n /** Far-right top-bar slot — e.g. a theme toggle. */\n trailing?: React.ReactNode;\n /** A page-wide notice under the top bar, above `header`. */\n banner?: React.ReactNode;\n /**\n * Pinned below the top bar and always visible while the content scrolls —\n * e.g. connection logos + a step title. Rendered in the same centred column\n * as the content (`contentWidth`).\n */\n header?: React.ReactNode;\n /** Pinned to the bottom of the screen — typically a <FooterNav /> or a primary CTA. */\n footer?: React.ReactNode;\n /**\n * Give the pinned footer a frosted-glass treatment (translucent background +\n * backdrop blur) so scrolling content shows through it. The footer already sits\n * above sticky body content, so it reads as glass over the scrolling list.\n */\n footerGlass?: boolean;\n /** `content` holds the footer to the content column, so a full-width action lines up with the list. */\n footerAlign?: 'full' | 'content';\n /** Vertically centre the content (used for terminal/success screens). */\n center?: boolean;\n /** Max width of the centered content column. */\n contentWidth?: number;\n /** Minimum width of the whole layout, below which it scrolls horizontally. */\n minWidth?: number;\n children?: React.ReactNode;\n className?: string;\n}\n\ntype TopBarSize = NonNullable<WizardLayoutProps['topBarSize']>;\n\n// Shared by the top bar and the banner under it, so the banner's edges line up with the bar's items.\nconst TOP_BAR_INSETS: Record<TopBarSize, string> = {\n default: 'px-6',\n large: 'px-[28px] max-sm:px-[16px]',\n};\n\nconst TOP_BAR_CLASSES: Record<TopBarSize, string> = {\n default: `${TOP_BAR_INSETS.default} pt-4 min-h-[var(--malachite-control-height-small,28px)]`,\n large: `h-[60px] ${TOP_BAR_INSETS.large} max-sm:h-[52px]`,\n};\n\nconst WizardLayout: React.FC<WizardLayoutProps> = ({\n showBack = false,\n onBack,\n backDisabled = false,\n reserveBack = true,\n topBarSize = 'default',\n leading,\n stepper,\n trailing,\n banner,\n header,\n footer,\n footerGlass = false,\n footerAlign = 'full',\n center = false,\n contentWidth = 480,\n minWidth,\n children,\n className = '',\n}) => {\n // The footer overlays the bottom of the scroll area (so content can glass under\n // it). Measure it so the scroll content reserves matching bottom space and the\n // last item is never hidden behind it.\n const footerRef = useRef<HTMLDivElement>(null);\n const [footerHeight, setFooterHeight] = useState(0);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: re-run when the footer node mounts/unmounts so the observer attaches to the current element.\n useLayoutEffect(() => {\n const el = footerRef.current;\n if (!el) {\n setFooterHeight(0);\n return;\n }\n const update = () => setFooterHeight(el.offsetHeight);\n update();\n const observer = new ResizeObserver(update);\n observer.observe(el);\n return () => observer.disconnect();\n }, [footer]);\n\n return (\n <div\n className={`w-full h-screen flex flex-col overflow-hidden bg-[var(--malachite-card-sunken-background)] ${className}`}\n style={minWidth ? { minWidth: `${minWidth}px` } : undefined}\n >\n <div\n className={`w-full shrink-0 flex items-center justify-between ${TOP_BAR_CLASSES[topBarSize]}`}\n >\n <div className=\"flex items-center gap-[16px] min-w-0\">\n {showBack ? (\n <Button\n variant=\"outline\"\n size=\"small\"\n iconOnly\n icon={<ArrowLeftIcon size={14} />}\n disabled={backDisabled}\n onClick={onBack}\n aria-label=\"Back\"\n className=\"w-[var(--malachite-control-height-small,28px)] h-[var(--malachite-control-height-small,28px)] shrink-0\"\n />\n ) : reserveBack ? (\n <span className=\"w-[var(--malachite-control-height-small,28px)] h-[var(--malachite-control-height-small,28px)] shrink-0\" />\n ) : null}\n {leading}\n </div>\n <div className=\"flex items-center gap-[16px]\">\n {trailing ?? null}\n {stepper ?? null}\n </div>\n </div>\n\n {banner ? (\n <div className={`w-full shrink-0 pt-[12px] ${TOP_BAR_INSETS[topBarSize]}`}>\n {banner}\n </div>\n ) : null}\n\n {header ? (\n <div className=\"w-full shrink-0 flex flex-col items-center px-6 pt-8\">\n <div\n className=\"w-full flex flex-col items-center gap-[24px]\"\n style={{ maxWidth: `${contentWidth}px` }}\n >\n {header}\n </div>\n </div>\n ) : null}\n\n <div className=\"relative flex-1 min-h-0\">\n {/* The gutter is held on both edges so a classic scrollbar keeps the content\n centred on the page, in line with the pinned header and the overlaid footer. */}\n <div\n className={`absolute inset-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] flex flex-col items-center px-6 ${\n center ? 'justify-center' : 'justify-start'\n }`}\n style={{\n // Reserve the overlaid footer's height plus a gap, so the last item\n // clears the footer with breathing room (not flush against it, which\n // reads as hidden content continuing underneath).\n paddingBottom: footer ? `${footerHeight + 24}px` : '48px',\n }}\n >\n <div\n className=\"w-full flex flex-col items-center gap-[40px]\"\n style={{\n maxWidth: `${contentWidth}px`,\n // Top padding lives on the scrolling content — NOT the scrollport —\n // so a `position: sticky` child pins flush to the top with no gap.\n paddingTop: header ? '32px' : '48px',\n }}\n >\n {children}\n </div>\n </div>\n\n {footer ? (\n <div\n ref={footerRef}\n // z-20 keeps the pinned footer above sticky body content (e.g. a\n // sticky Accordion header at z-10) so it can't paint over the footer.\n className=\"absolute inset-x-0 bottom-0 z-20\"\n style={footerGlass ? GLASS_SURFACE_STYLE : undefined}\n >\n {footerAlign === 'content' ? (\n <div className=\"flex justify-center px-6 pt-4 pb-3\">\n <div className=\"w-full\" style={{ maxWidth: `${contentWidth}px` }}>\n {footer}\n </div>\n </div>\n ) : (\n footer\n )}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nexport default WizardLayout;\nexport { WizardLayout };\n"],"names":["TOP_BAR_INSETS","TOP_BAR_CLASSES","WizardLayout","showBack","onBack","backDisabled","reserveBack","topBarSize","leading","stepper","trailing","banner","header","footer","footerGlass","footerAlign","center","contentWidth","minWidth","children","className","footerRef","useRef","footerHeight","setFooterHeight","useState","useLayoutEffect","el","update","observer","jsxs","jsx","Button","ArrowLeftIcon","GLASS_SURFACE_STYLE"],"mappings":";;;;;AAmDA,MAAMA,IAA6C;AAAA,EAC/C,SAAS;AAAA,EACT,OAAO;AACX,GAEMC,IAA8C;AAAA,EAChD,SAAS,GAAGD,EAAe,OAAO;AAAA,EAClC,OAAO,YAAYA,EAAe,KAAK;AAC3C,GAEME,IAA4C,CAAC;AAAA,EAC/C,UAAAC,IAAW;AAAA,EACX,QAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,aAAAC,IAAc;AAAA,EACd,YAAAC,IAAa;AAAA,EACb,SAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc;A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AAJ,EAAA,CACL,GACJ,IAEAA;AAAA,YAAA;AAAA,UAAA,IAGR;AAAA,QAAA,EAAA,CACR;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -3,6 +3,9 @@ const n = () => {
|
|
|
3
3
|
let e = document.activeElement;
|
|
4
4
|
for (; (o = e == null ? void 0 : e.shadowRoot) != null && o.activeElement; )
|
|
5
5
|
e = e.shadowRoot.activeElement;
|
|
6
|
+
return e;
|
|
7
|
+
}, c = () => {
|
|
8
|
+
const e = n();
|
|
6
9
|
return e instanceof HTMLElement ? e : null;
|
|
7
10
|
}, r = (e, o) => {
|
|
8
11
|
for (let t = o; t; ) {
|
|
@@ -14,6 +17,7 @@ const n = () => {
|
|
|
14
17
|
};
|
|
15
18
|
export {
|
|
16
19
|
r as containsComposed,
|
|
17
|
-
|
|
20
|
+
c as getDeepActiveElement,
|
|
21
|
+
n as getDeepActiveNode
|
|
18
22
|
};
|
|
19
23
|
//# sourceMappingURL=activeElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activeElement.js","sources":["../../src/components/activeElement.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"activeElement.js","sources":["../../src/components/activeElement.ts"],"sourcesContent":["/**\n * `document.activeElement` stops at a shadow host; descend to the real focused node. Any\n * element, so a focused SVG still counts as focus.\n */\nexport const getDeepActiveNode = (): Element | null => {\n let active: Element | null = document.activeElement;\n while (active?.shadowRoot?.activeElement) {\n active = active.shadowRoot.activeElement;\n }\n return active;\n};\n\n/** The deep active element, when it is an HTML element that can take `.focus()` options. */\nexport const getDeepActiveElement = (): HTMLElement | null => {\n const active = getDeepActiveNode();\n return active instanceof HTMLElement ? active : null;\n};\n\n/** `Node.contains` that also follows shadow roots up to their hosts. */\nexport const containsComposed = (container: Node, node: Node | null): boolean => {\n for (let current: Node | null = node; current; ) {\n if (current === container) {\n return true;\n }\n current = current instanceof ShadowRoot ? current.host : current.parentNode;\n }\n return false;\n};\n"],"names":["getDeepActiveNode","_a","active","getDeepActiveElement","containsComposed","container","node","current"],"mappings":"AAIO,MAAMA,IAAoB,MAAsB;AAAhD,MAAAC;AACH,MAAIC,IAAyB,SAAS;AACtC,UAAOD,IAAAC,KAAA,gBAAAA,EAAQ,eAAR,QAAAD,EAAoB;AACvB,IAAAC,IAASA,EAAO,WAAW;AAE/B,SAAOA;AACX,GAGaC,IAAuB,MAA0B;AAC1D,QAAMD,IAASF,EAAA;AACf,SAAOE,aAAkB,cAAcA,IAAS;AACpD,GAGaE,IAAmB,CAACC,GAAiBC,MAA+B;AAC7E,WAASC,IAAuBD,GAAMC,KAAW;AAC7C,QAAIA,MAAYF;AACZ,aAAO;AAEX,IAAAE,IAAUA,aAAmB,aAAaA,EAAQ,OAAOA,EAAQ;AAAA,EACrE;AACA,SAAO;AACX;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect as p } from "react";
|
|
2
|
+
import { rectSignature as F, isTriggerOffscreen as H } from "./floatingMenuGeometry.js";
|
|
3
|
+
import { useLatestRef as l } from "./useLatestRef.js";
|
|
4
|
+
const a = (e) => e.width === 0 && e.height === 0 && e.top === 0 && e.left === 0, h = (e) => `${F(e)}|${window.innerWidth}x${window.innerHeight}`, B = (e, t, g, m) => {
|
|
5
|
+
const o = l(g), i = l(m);
|
|
6
|
+
p(() => {
|
|
7
|
+
if (!e)
|
|
8
|
+
return;
|
|
9
|
+
let s = t.current ? h(t.current.getBoundingClientRect()) : "", c = 0, r = !1;
|
|
10
|
+
const u = () => {
|
|
11
|
+
r = !0, c = requestAnimationFrame(w), r = !1;
|
|
12
|
+
}, w = () => {
|
|
13
|
+
if (r)
|
|
14
|
+
return;
|
|
15
|
+
const f = t.current;
|
|
16
|
+
if (f) {
|
|
17
|
+
const n = f.getBoundingClientRect(), d = h(n);
|
|
18
|
+
d !== s && (s = d, (a(n) || H(n, window.innerWidth, window.innerHeight)) && i.current ? i.current() : a(n) || o.current(n));
|
|
19
|
+
}
|
|
20
|
+
u();
|
|
21
|
+
};
|
|
22
|
+
return u(), () => cancelAnimationFrame(c);
|
|
23
|
+
}, [e, t, o, i]);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
B as useFollowTrigger
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=useFollowTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFollowTrigger.js","sources":["../../src/components/useFollowTrigger.ts"],"sourcesContent":["import { type RefObject, useEffect } from 'react';\nimport { isTriggerOffscreen, rectSignature } from './floatingMenuGeometry';\nimport { useLatestRef } from './useLatestRef';\n\n// `display: none` reports an empty rect at the origin. A trigger that is merely empty (its\n// only children positioned out of flow) still sits somewhere, and is followed.\nconst isDetached = (rect: DOMRect) =>\n rect.width === 0 && rect.height === 0 && rect.top === 0 && rect.left === 0;\n\n// The viewport is part of it: a resize can leave a trigger offscreen without moving it.\nconst signatureOf = (rect: DOMRect) =>\n `${rectSignature(rect)}|${window.innerWidth}x${window.innerHeight}`;\n\n/**\n * `scroll` is not composed, so a window listener never hears a scroller inside a consumer's\n * shadow root: while `active`, the trigger's rect is polled once a frame instead.\n */\nexport const useFollowTrigger = (\n active: boolean,\n triggerRef: RefObject<Element | null>,\n onMove: (rect: DOMRect) => void,\n onHide?: () => void,\n): void => {\n const onMoveRef = useLatestRef(onMove);\n const onHideRef = useLatestRef(onHide);\n\n useEffect(() => {\n if (!active) {\n return;\n }\n // Measured now, not on the first frame: a move before that frame is still a move.\n let lastRect = triggerRef.current\n ? signatureOf(triggerRef.current.getBoundingClientRect())\n : '';\n let frame = 0;\n let scheduling = false;\n // A test double that runs the callback inside `requestAnimationFrame` itself would\n // recurse; such a frame stops the loop instead. A browser never calls back that way.\n const schedule = () => {\n scheduling = true;\n frame = requestAnimationFrame(follow);\n scheduling = false;\n };\n const follow = () => {\n if (scheduling) {\n return;\n }\n const trigger = triggerRef.current;\n if (trigger) {\n const rect = trigger.getBoundingClientRect();\n const signature = signatureOf(rect);\n if (signature !== lastRect) {\n lastRect = signature;\n const hidden =\n isDetached(rect) ||\n isTriggerOffscreen(rect, window.innerWidth, window.innerHeight);\n if (hidden && onHideRef.current) {\n onHideRef.current();\n } else if (!isDetached(rect)) {\n onMoveRef.current(rect);\n }\n }\n }\n schedule();\n };\n schedule();\n return () => cancelAnimationFrame(frame);\n }, [active, triggerRef, onMoveRef, onHideRef]);\n};\n"],"names":["isDetached","rect","signatureOf","rectSignature","useFollowTrigger","active","triggerRef","onMove","onHide","onMoveRef","useLatestRef","onHideRef","useEffect","lastRect","frame","scheduling","schedule","follow","trigger","signature","isTriggerOffscreen"],"mappings":";;;AAMA,MAAMA,IAAa,CAACC,MAChBA,EAAK,UAAU,KAAKA,EAAK,WAAW,KAAKA,EAAK,QAAQ,KAAKA,EAAK,SAAS,GAGvEC,IAAc,CAACD,MACjB,GAAGE,EAAcF,CAAI,CAAC,IAAI,OAAO,UAAU,IAAI,OAAO,WAAW,IAMxDG,IAAmB,CAC5BC,GACAC,GACAC,GACAC,MACO;AACP,QAAMC,IAAYC,EAAaH,CAAM,GAC/BI,IAAYD,EAAaF,CAAM;AAErC,EAAAI,EAAU,MAAM;AACZ,QAAI,CAACP;AACD;AAGJ,QAAIQ,IAAWP,EAAW,UACpBJ,EAAYI,EAAW,QAAQ,sBAAA,CAAuB,IACtD,IACFQ,IAAQ,GACRC,IAAa;AAGjB,UAAMC,IAAW,MAAM;AACnB,MAAAD,IAAa,IACbD,IAAQ,sBAAsBG,CAAM,GACpCF,IAAa;AAAA,IACjB,GACME,IAAS,MAAM;AACjB,UAAIF;AACA;AAEJ,YAAMG,IAAUZ,EAAW;AAC3B,UAAIY,GAAS;AACT,cAAMjB,IAAOiB,EAAQ,sBAAA,GACfC,IAAYjB,EAAYD,CAAI;AAClC,QAAIkB,MAAcN,MACdA,IAAWM,IAEPnB,EAAWC,CAAI,KACfmB,EAAmBnB,GAAM,OAAO,YAAY,OAAO,WAAW,MACpDU,EAAU,UACpBA,EAAU,QAAA,IACFX,EAAWC,CAAI,KACvBQ,EAAU,QAAQR,CAAI;AAAA,MAGlC;AACA,MAAAe,EAAA;AAAA,IACJ;AACA,WAAAA,EAAA,GACO,MAAM,qBAAqBF,CAAK;AAAA,EAC3C,GAAG,CAACT,GAAQC,GAAYG,GAAWE,CAAS,CAAC;AACjD;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare type AccessPillsSize = 'default' | 'dense';
|
|
|
32
32
|
/** `'mixed'` is partly on: some, not all, of the effect's actions are allowed. */
|
|
33
33
|
export declare type AccessPillState = boolean | 'mixed';
|
|
34
34
|
|
|
35
|
-
export declare const Accordion: default_2.
|
|
35
|
+
export declare const Accordion: default_2.ForwardRefExoticComponent<AccordionProps & default_2.RefAttributes<HTMLDivElement>>;
|
|
36
36
|
|
|
37
37
|
declare interface AccordionBaseProps {
|
|
38
38
|
className?: string;
|
|
@@ -66,11 +66,13 @@ declare interface AccordionBaseProps {
|
|
|
66
66
|
/** Offset (px) from the top of the scroll container when `stickyHeader` is set. */
|
|
67
67
|
stickyTopOffset?: number;
|
|
68
68
|
/**
|
|
69
|
-
* With `stickyHeader`, rounds the header into its card's top corners once it pins,
|
|
70
|
-
*
|
|
69
|
+
* With `stickyHeader`, rounds the header into its card's top corners once it pins,
|
|
70
|
+
* in a flat, default-tone `<Surface overflow="clip" shadow={false}>`. Set
|
|
71
71
|
* `--malachite-ctx-pinned-surround` on an ancestor when the card sits on another ground.
|
|
72
72
|
*/
|
|
73
73
|
pinnedCorners?: boolean;
|
|
74
|
+
/** Change it after mount to flash an outline around the section. */
|
|
75
|
+
flashKey?: default_2.Key;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
/**
|
|
@@ -86,7 +88,7 @@ export declare type AccordionProps = AccordionBaseProps & AccordionToggleProps &
|
|
|
86
88
|
});
|
|
87
89
|
|
|
88
90
|
declare interface AccordionToggleProps {
|
|
89
|
-
/** `false` is a section that never closes; the toggle props are then ignored. */
|
|
91
|
+
/** `false` is a section that never closes; the toggle props except `animate` are then ignored. */
|
|
90
92
|
collapsible?: boolean;
|
|
91
93
|
/** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */
|
|
92
94
|
arrowPosition?: 'start' | 'end' | 'gutter';
|
|
@@ -5226,7 +5228,7 @@ export declare interface SurfaceProps {
|
|
|
5226
5228
|
* Content overflow. Defaults to `hidden` so children are clipped to the rounded
|
|
5227
5229
|
* corners. Use `clip` to keep the rounded clipping WITHOUT creating a scroll
|
|
5228
5230
|
* container — so a `position: sticky` descendant still pins (unlike `hidden`,
|
|
5229
|
-
* which traps it). `visible` disables clipping entirely.
|
|
5231
|
+
* which traps it). `visible` disables clipping entirely. A flat, default-tone `clip` card clips at its border.
|
|
5230
5232
|
*/
|
|
5231
5233
|
overflow?: 'hidden' | 'visible' | 'clip';
|
|
5232
5234
|
/**
|
|
@@ -5313,7 +5315,7 @@ export declare interface SurfaceRowProps extends SurfaceRowChromeProps {
|
|
|
5313
5315
|
* which has no hover, always shows it.
|
|
5314
5316
|
*/
|
|
5315
5317
|
revealTrailing?: boolean;
|
|
5316
|
-
/** The row's indicator, before the children. */
|
|
5318
|
+
/** The row's indicator, before the children. With this or `dimmed`, pass one child. */
|
|
5317
5319
|
leading?: default_2.ReactNode;
|
|
5318
5320
|
/** Fades the children, not `leading` or `trailing`. */
|
|
5319
5321
|
dimmed?: boolean;
|