@stackone/malachite 2.118.0 → 2.120.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 +1 -1
- package/dist/components/LoadingScreen.js +29 -28
- package/dist/components/LoadingScreen.js.map +1 -1
- package/dist/components/PageLayout/constants.js +9 -7
- package/dist/components/PageLayout/constants.js.map +1 -1
- package/dist/components/PageLayout/cssUrl.js +5 -0
- package/dist/components/PageLayout/cssUrl.js.map +1 -0
- package/dist/components/PageLayout/emptyLayout.js +48 -24
- package/dist/components/PageLayout/emptyLayout.js.map +1 -1
- package/dist/components/PageLayout/index.js +7 -6
- package/dist/components/PageLayout/index.js.map +1 -1
- package/dist/components/PageLayout/pageColumn.js +35 -0
- package/dist/components/PageLayout/pageColumn.js.map +1 -0
- package/dist/components/PageLayout/regularLayout.js +57 -75
- package/dist/components/PageLayout/regularLayout.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +2 -2
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
import { jsx as l, jsxs as n, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { Alert as
|
|
4
|
-
import { Breadcrumbs as
|
|
5
|
-
import { hasBackButton as
|
|
6
|
-
import { Button as
|
|
7
|
-
import
|
|
1
|
+
import { jsx as l, jsxs as n, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import u from "../ActionMenu.js";
|
|
3
|
+
import { Alert as P } from "../Alert.js";
|
|
4
|
+
import { Breadcrumbs as j } from "../Breadcrumbs.js";
|
|
5
|
+
import { hasBackButton as G } from "../breadcrumbsNav.js";
|
|
6
|
+
import { Button as L } from "../Button.js";
|
|
7
|
+
import z from "../OverflowRow.js";
|
|
8
8
|
import h from "../Skeleton.js";
|
|
9
|
-
import
|
|
9
|
+
import U from "../Typography/PageTitle.js";
|
|
10
10
|
import I from "../Typography/Text.js";
|
|
11
|
-
import { safeHref as
|
|
12
|
-
import { CARD_MIN_HEIGHT as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
small: 8,
|
|
17
|
-
medium: 16,
|
|
18
|
-
large: 24,
|
|
19
|
-
xlarge: 40
|
|
20
|
-
}, Y = (a) => a.variant === "destructive" || a.variant === "error", Z = (a) => a.flatMap((e, r) => {
|
|
21
|
-
const i = E(e.href), c = {
|
|
11
|
+
import { safeHref as _ } from "../safeHref.js";
|
|
12
|
+
import { CARD_MIN_HEIGHT as V, CARD_RADIUS as F, CARD_CLASSES as K, HEADER_HEIGHT as q, DIVIDER_CLASSES as w, CONTENT_MIN_HEIGHT as J, CONTENT_INSET_VAR as Q } from "./constants.js";
|
|
13
|
+
import { CONTENT_GAPS as X, PageColumn as Y } from "./pageColumn.js";
|
|
14
|
+
const Z = (a) => a.variant === "destructive" || a.variant === "error", W = (a) => a.flatMap((e, r) => {
|
|
15
|
+
const i = _(e.href), c = {
|
|
22
16
|
key: `${r}-${e.label}`,
|
|
23
17
|
label: e.label,
|
|
24
18
|
...i ? { href: i, target: e.target ?? "_blank" } : { onClick: e.onClick },
|
|
25
19
|
disabled: e.disabled,
|
|
26
20
|
icon: e.icon,
|
|
27
21
|
tooltip: e.tooltip,
|
|
28
|
-
danger:
|
|
22
|
+
danger: Z(e)
|
|
29
23
|
};
|
|
30
24
|
return e.dividerBefore && r > 0 ? [{ type: "divider", key: `divider-${r}-${e.label}` }, c] : [c];
|
|
31
25
|
}), b = ({ buttons: a }) => a.length === 0 ? null : /* @__PURE__ */ l("div", { className: "min-w-0", children: /* @__PURE__ */ l(
|
|
32
|
-
|
|
26
|
+
z,
|
|
33
27
|
{
|
|
34
28
|
gap: 8,
|
|
35
29
|
justify: "end",
|
|
36
30
|
renderOverflow: (e) => /* @__PURE__ */ l(
|
|
37
|
-
|
|
31
|
+
u,
|
|
38
32
|
{
|
|
39
|
-
items:
|
|
33
|
+
items: W(
|
|
40
34
|
a.slice(Math.max(0, a.length - e))
|
|
41
35
|
)
|
|
42
36
|
}
|
|
43
37
|
),
|
|
44
38
|
children: a.map((e, r) => {
|
|
45
|
-
const i =
|
|
39
|
+
const i = _(e.href);
|
|
46
40
|
return /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
47
41
|
e.dividerBefore && r > 0 ? /* @__PURE__ */ l(
|
|
48
42
|
"span",
|
|
@@ -52,7 +46,7 @@ const X = {
|
|
|
52
46
|
}
|
|
53
47
|
) : null,
|
|
54
48
|
/* @__PURE__ */ l(
|
|
55
|
-
|
|
49
|
+
L,
|
|
56
50
|
{
|
|
57
51
|
variant: e.variant ?? "filled",
|
|
58
52
|
size: "medium",
|
|
@@ -69,59 +63,59 @@ const X = {
|
|
|
69
63
|
] }, `${r}-${e.label}`);
|
|
70
64
|
})
|
|
71
65
|
}
|
|
72
|
-
) }), ee = [], le = [],
|
|
66
|
+
) }), ee = [], le = [], ge = ({
|
|
73
67
|
breadcrumbLinks: a = ee,
|
|
74
68
|
breadcrumbActions: e,
|
|
75
69
|
renderLink: r,
|
|
76
70
|
title: i,
|
|
77
71
|
titleSuffix: c,
|
|
78
|
-
subtitle:
|
|
79
|
-
description:
|
|
80
|
-
buttons:
|
|
72
|
+
subtitle: d,
|
|
73
|
+
description: o,
|
|
74
|
+
buttons: t = le,
|
|
81
75
|
loading: s = !1,
|
|
82
|
-
children:
|
|
76
|
+
children: E,
|
|
83
77
|
centered: f = !1,
|
|
84
78
|
noPadding: p = !1,
|
|
85
79
|
contentGap: g = "small",
|
|
86
|
-
contentWidth:
|
|
80
|
+
contentWidth: v,
|
|
87
81
|
alert: m,
|
|
88
|
-
role:
|
|
89
|
-
"aria-label":
|
|
90
|
-
"aria-labelledby":
|
|
91
|
-
className:
|
|
92
|
-
style:
|
|
82
|
+
role: T,
|
|
83
|
+
"aria-label": k,
|
|
84
|
+
"aria-labelledby": C,
|
|
85
|
+
className: S = "",
|
|
86
|
+
style: A
|
|
93
87
|
}) => {
|
|
94
|
-
const
|
|
95
|
-
/* @__PURE__ */ l(
|
|
88
|
+
const H = G(a), B = p ? 0 : f ? "5vh 14vw" : "40px", R = p ? "0px" : f ? "14vw" : "40px", $ = !!(s || i || d || o || t.length > 0), N = d ? s ? /* @__PURE__ */ l(h.Input, { width: 120, height: 24 }) : /* @__PURE__ */ l(I, { color: "secondary", size: "small", children: d }) : null, y = s ? /* @__PURE__ */ l(h.Input, { width: 200, height: 40 }) : i ? /* @__PURE__ */ n("div", { className: "flex items-center", style: { gap: 12 }, children: [
|
|
89
|
+
/* @__PURE__ */ l(U, { children: i }),
|
|
96
90
|
c
|
|
97
|
-
] }) : null,
|
|
98
|
-
|
|
91
|
+
] }) : null, D = o ? s ? /* @__PURE__ */ l(h.Input, { width: 120, height: 24 }) : /* @__PURE__ */ l(I, { color: "secondary", style: { lineHeight: 1.6 }, children: o }) : null, O = $ ? /* @__PURE__ */ n("div", { className: "flex flex-col", style: { gap: 12 }, children: [
|
|
92
|
+
y || N || t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between", style: { gap: 12 }, children: [
|
|
99
93
|
/* @__PURE__ */ n(
|
|
100
94
|
"div",
|
|
101
95
|
{
|
|
102
96
|
className: "flex flex-col flex-auto min-w-0 overflow-hidden",
|
|
103
97
|
style: { gap: 4 },
|
|
104
98
|
children: [
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
N,
|
|
100
|
+
y
|
|
107
101
|
]
|
|
108
102
|
}
|
|
109
103
|
),
|
|
110
|
-
s ? null : /* @__PURE__ */ l(b, { buttons:
|
|
104
|
+
s ? null : /* @__PURE__ */ l(b, { buttons: t })
|
|
111
105
|
] }) : null,
|
|
112
|
-
|
|
113
|
-
] }) : null,
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
D
|
|
107
|
+
] }) : null, x = /* @__PURE__ */ n(M, { children: [
|
|
108
|
+
O,
|
|
109
|
+
E
|
|
116
110
|
] });
|
|
117
111
|
return /* @__PURE__ */ n(
|
|
118
112
|
"main",
|
|
119
113
|
{
|
|
120
|
-
className: `${
|
|
121
|
-
style: { borderRadius:
|
|
122
|
-
role:
|
|
123
|
-
"aria-label":
|
|
124
|
-
"aria-labelledby":
|
|
114
|
+
className: `${K} ${S}`,
|
|
115
|
+
style: { borderRadius: F, minHeight: V, ...A },
|
|
116
|
+
role: T,
|
|
117
|
+
"aria-label": k,
|
|
118
|
+
"aria-labelledby": C,
|
|
125
119
|
"aria-busy": s || void 0,
|
|
126
120
|
children: [
|
|
127
121
|
/* @__PURE__ */ l(
|
|
@@ -129,12 +123,12 @@ const X = {
|
|
|
129
123
|
{
|
|
130
124
|
className: `flex items-center ${w}`,
|
|
131
125
|
style: {
|
|
132
|
-
height:
|
|
133
|
-
paddingInlineStart:
|
|
126
|
+
height: q,
|
|
127
|
+
paddingInlineStart: H ? 16 : 28,
|
|
134
128
|
paddingInlineEnd: 16
|
|
135
129
|
},
|
|
136
130
|
children: /* @__PURE__ */ l(
|
|
137
|
-
|
|
131
|
+
j,
|
|
138
132
|
{
|
|
139
133
|
links: a,
|
|
140
134
|
actions: e,
|
|
@@ -145,30 +139,18 @@ const X = {
|
|
|
145
139
|
)
|
|
146
140
|
}
|
|
147
141
|
),
|
|
148
|
-
m ? /* @__PURE__ */ l("div", { className: w, style: { padding: "10px 16px" }, children: /* @__PURE__ */ l(
|
|
142
|
+
m ? /* @__PURE__ */ l("div", { className: w, style: { padding: "10px 16px" }, children: /* @__PURE__ */ l(P, { message: m.message, type: m.type, hasMargin: !1 }) }) : null,
|
|
149
143
|
/* @__PURE__ */ l(
|
|
150
144
|
"div",
|
|
151
145
|
{
|
|
152
146
|
className: "flex flex-col",
|
|
153
147
|
style: {
|
|
154
|
-
padding:
|
|
155
|
-
minHeight:
|
|
156
|
-
gap:
|
|
157
|
-
[
|
|
148
|
+
padding: B,
|
|
149
|
+
minHeight: J,
|
|
150
|
+
gap: X[g],
|
|
151
|
+
[Q]: R
|
|
158
152
|
},
|
|
159
|
-
children:
|
|
160
|
-
"div",
|
|
161
|
-
{
|
|
162
|
-
className: "flex flex-col flex-1 w-full",
|
|
163
|
-
style: {
|
|
164
|
-
maxWidth: X[N],
|
|
165
|
-
marginInline: "auto",
|
|
166
|
-
gap: _[g],
|
|
167
|
-
[T]: "0px"
|
|
168
|
-
},
|
|
169
|
-
children: y
|
|
170
|
-
}
|
|
171
|
-
) : y
|
|
153
|
+
children: v ? /* @__PURE__ */ l(Y, { width: v, gap: g, children: x }) : x
|
|
172
154
|
}
|
|
173
155
|
)
|
|
174
156
|
]
|
|
@@ -177,7 +159,7 @@ const X = {
|
|
|
177
159
|
};
|
|
178
160
|
export {
|
|
179
161
|
b as PageActions,
|
|
180
|
-
|
|
181
|
-
|
|
162
|
+
ge as RegularLayout,
|
|
163
|
+
ge as default
|
|
182
164
|
};
|
|
183
165
|
//# sourceMappingURL=regularLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regularLayout.js","sources":["../../../src/components/PageLayout/regularLayout.tsx"],"sourcesContent":["import React from 'react';\nimport ActionMenu, { type ActionMenuItem } from '../ActionMenu';\nimport Alert, { type AlertType } from '../Alert';\nimport Breadcrumbs from '../Breadcrumbs';\nimport { hasBackButton } from '../breadcrumbsNav';\nimport Button from '../Button';\nimport OverflowRow from '../OverflowRow';\nimport Skeleton from '../Skeleton';\nimport PageTitle from '../Typography/PageTitle';\nimport Text from '../Typography/Text';\nimport { safeHref } from '../safeHref';\nimport {\n CARD_CLASSES,\n CARD_MIN_HEIGHT,\n CARD_RADIUS,\n CONTENT_INSET_VAR,\n CONTENT_MIN_HEIGHT,\n DIVIDER_CLASSES,\n HEADER_HEIGHT,\n} from './constants';\nimport type { BreadcrumbLink, PageAction, RenderLink } from './types';\n\nexport type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';\n\nexport type PageContentWidth = 'narrow';\n\nexport interface RegularLayoutProps {\n breadcrumbLinks?: BreadcrumbLink[];\n breadcrumbActions?: PageAction[];\n renderLink?: RenderLink;\n title?: React.ReactNode;\n titleSuffix?: React.ReactNode;\n subtitle?: string;\n description?: React.ReactNode;\n buttons?: PageAction[];\n /**\n * Hides the buttons and skeletons the title. `subtitle` and `description` are only\n * skeletoned when those props are also passed.\n */\n loading?: boolean;\n children: React.ReactNode;\n centered?: boolean;\n noPadding?: boolean;\n contentGap?: PageContentGap;\n /** Caps the content column and centres it; `narrow` fits a single-column form. */\n contentWidth?: PageContentWidth;\n alert?: { message: string; type?: AlertType };\n /** Demotes the default `main` landmark — pass e.g. `region` when the app owns its own. */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst CONTENT_WIDTHS: Record<PageContentWidth, number> = {\n narrow: 520,\n};\n\nconst CONTENT_GAPS: Record<PageContentGap, number> = {\n small: 8,\n medium: 16,\n large: 24,\n xlarge: 40,\n};\n\nconst isDanger = (button: PageAction): boolean =>\n button.variant === 'destructive' || button.variant === 'error';\n\nconst toMenuItems = (buttons: PageAction[]): ActionMenuItem[] =>\n buttons.flatMap((button, index) => {\n const href = safeHref(button.href);\n const item: ActionMenuItem = {\n key: `${index}-${button.label}`,\n label: button.label,\n ...(href ? { href, target: button.target ?? '_blank' } : { onClick: button.onClick }),\n disabled: button.disabled,\n icon: button.icon,\n tooltip: button.tooltip,\n danger: isDanger(button),\n };\n return button.dividerBefore && index > 0\n ? [{ type: 'divider' as const, key: `divider-${index}-${button.label}` }, item]\n : [item];\n });\n\n// Not `ActionBar`: it measures by walking ancestors for `clientWidth`, and this chrome\n// mounts on every page. OverflowRow batches its measurement instead.\n// A divider must live in the same OverflowRow child as its button — a standalone child\n// would survive its hidden button and break the child-index-to-button mapping.\n/**\n * The page's action buttons, collapsing into an overflow menu as the row narrows. Exported so\n * a page that renders its own header block — e.g. one that scrolls the title away — keeps the\n * same behaviour instead of hand-rolling `buttons.map(...)` and losing the collapse, the\n * dividers and the href handling.\n */\nexport const PageActions: React.FC<{ buttons: PageAction[] }> = ({ buttons }) => {\n if (buttons.length === 0) {\n return null;\n }\n\n // min-w-0 gives OverflowRow a shrinkable container to collapse against.\n return (\n <div className=\"min-w-0\">\n <OverflowRow\n gap={8}\n justify=\"end\"\n renderOverflow={(hiddenCount) => (\n <ActionMenu\n items={toMenuItems(\n buttons.slice(Math.max(0, buttons.length - hiddenCount)),\n )}\n />\n )}\n >\n {buttons.map((button, index) => {\n const href = safeHref(button.href);\n return (\n <div key={`${index}-${button.label}`} className=\"flex items-center gap-2\">\n {button.dividerBefore && index > 0 ? (\n <span\n aria-hidden=\"true\"\n className=\"h-4 w-px bg-[var(--malachite-card-border)]\"\n />\n ) : null}\n <Button\n variant={button.variant ?? 'filled'}\n size=\"medium\"\n disabled={button.disabled}\n icon={button.icon}\n tooltip={button.tooltip}\n tooltipPlacement={button.tooltipPlacement}\n href={href}\n target={href ? (button.target ?? '_blank') : undefined}\n onClick={href ? undefined : button.onClick}\n >\n {button.label}\n </Button>\n </div>\n );\n })}\n </OverflowRow>\n </div>\n );\n};\n\nconst NO_LINKS: BreadcrumbLink[] = [];\nconst NO_BUTTONS: PageAction[] = [];\n\nconst RegularLayout: React.FC<RegularLayoutProps> = ({\n breadcrumbLinks = NO_LINKS,\n breadcrumbActions,\n renderLink,\n title,\n titleSuffix,\n subtitle,\n description,\n buttons = NO_BUTTONS,\n loading = false,\n children,\n centered = false,\n noPadding = false,\n contentGap = 'small',\n contentWidth,\n alert,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}) => {\n const hasBack = hasBackButton(breadcrumbLinks);\n const contentPadding = noPadding ? 0 : centered ? '5vh 14vw' : '40px';\n // Published so a full-bleed child (CardStrip's bottom rule) can cancel it and re-apply\n // it as its own padding, instead of hardcoding the gutter at the call site.\n const contentInset = noPadding ? '0px' : centered ? '14vw' : '40px';\n const hasHeaderBlock = Boolean(\n loading || title || subtitle || description || buttons.length > 0,\n );\n\n const subtitleNode = subtitle ? (\n loading ? (\n <Skeleton.Input width={120} height={24} />\n ) : (\n <Text color=\"secondary\" size=\"small\">\n {subtitle}\n </Text>\n )\n ) : null;\n\n const titleNode = loading ? (\n <Skeleton.Input width={200} height={40} />\n ) : title ? (\n <div className=\"flex items-center\" style={{ gap: 12 }}>\n <PageTitle>{title}</PageTitle>\n {titleSuffix}\n </div>\n ) : null;\n\n const descriptionNode = description ? (\n loading ? (\n <Skeleton.Input width={120} height={24} />\n ) : (\n <Text color=\"secondary\" style={{ lineHeight: 1.6 }}>\n {description}\n </Text>\n )\n ) : null;\n\n const headerBlock = hasHeaderBlock ? (\n <div className=\"flex flex-col\" style={{ gap: 12 }}>\n {titleNode || subtitleNode || buttons.length > 0 ? (\n <div className=\"flex flex-wrap items-center justify-between\" style={{ gap: 12 }}>\n <div\n className=\"flex flex-col flex-auto min-w-0 overflow-hidden\"\n style={{ gap: 4 }}\n >\n {subtitleNode}\n {titleNode}\n </div>\n {loading ? null : <PageActions buttons={buttons} />}\n </div>\n ) : null}\n {descriptionNode}\n </div>\n ) : null;\n\n const body = (\n <>\n {headerBlock}\n {children}\n </>\n );\n\n return (\n <main\n className={`${CARD_CLASSES} ${className}`}\n style={{ borderRadius: CARD_RADIUS, minHeight: CARD_MIN_HEIGHT, ...style }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-busy={loading || undefined}\n >\n <div\n className={`flex items-center ${DIVIDER_CLASSES}`}\n style={{\n height: HEADER_HEIGHT,\n paddingInlineStart: hasBack ? 16 : 28,\n paddingInlineEnd: 16,\n }}\n >\n <Breadcrumbs\n links={breadcrumbLinks}\n actions={breadcrumbActions}\n renderLink={renderLink}\n titleElement={title && !loading ? undefined : 'h1'}\n className=\"flex-1 min-w-0\"\n />\n </div>\n\n {alert ? (\n <div className={DIVIDER_CLASSES} style={{ padding: '10px 16px' }}>\n <Alert message={alert.message} type={alert.type} hasMargin={false} />\n </div>\n ) : null}\n\n <div\n className=\"flex flex-col\"\n style={\n {\n padding: contentPadding,\n minHeight: CONTENT_MIN_HEIGHT,\n gap: CONTENT_GAPS[contentGap],\n [CONTENT_INSET_VAR]: contentInset,\n } as React.CSSProperties\n }\n >\n {contentWidth ? (\n <div\n className=\"flex flex-col flex-1 w-full\"\n style={\n {\n maxWidth: CONTENT_WIDTHS[contentWidth],\n marginInline: 'auto',\n gap: CONTENT_GAPS[contentGap],\n [CONTENT_INSET_VAR]: '0px',\n } as React.CSSProperties\n }\n >\n {body}\n </div>\n ) : (\n body\n )}\n </div>\n </main>\n );\n};\n\nexport default RegularLayout;\nexport { RegularLayout };\n"],"names":["CONTENT_WIDTHS","CONTENT_GAPS","isDanger","button","toMenuItems","buttons","index","href","safeHref","item","PageActions","jsx","OverflowRow","hiddenCount","ActionMenu","jsxs","Button","NO_LINKS","NO_BUTTONS","RegularLayout","breadcrumbLinks","breadcrumbActions","renderLink","title","titleSuffix","subtitle","description","loading","children","centered","noPadding","contentGap","contentWidth","alert","role","ariaLabel","ariaLabelledBy","className","style","hasBack","hasBackButton","contentPadding","contentInset","hasHeaderBlock","subtitleNode","Skeleton","Text","titleNode","PageTitle","descriptionNode","headerBlock","body","Fragment","CARD_CLASSES","CARD_RADIUS","CARD_MIN_HEIGHT","DIVIDER_CLASSES","HEADER_HEIGHT","Breadcrumbs","Alert","CONTENT_MIN_HEIGHT","CONTENT_INSET_VAR"],"mappings":";;;;;;;;;;;;AAuDA,MAAMA,IAAmD;AAAA,EACrD,QAAQ;AACZ,GAEMC,IAA+C;AAAA,EACjD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACZ,GAEMC,IAAW,CAACC,MACdA,EAAO,YAAY,iBAAiBA,EAAO,YAAY,SAErDC,IAAc,CAACC,MACjBA,EAAQ,QAAQ,CAACF,GAAQG,MAAU;AAC/B,QAAMC,IAAOC,EAASL,EAAO,IAAI,GAC3BM,IAAuB;AAAA,IACzB,KAAK,GAAGH,CAA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AAA,gBAAAhB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,qBAAqB6C,CAAe;AAAA,YAC/C,OAAO;AAAA,cACH,QAAQC;AAAA,cACR,oBAAoBlB,IAAU,KAAK;AAAA,cACnC,kBAAkB;AAAA,YAAA;AAAA,YAGtB,UAAA,gBAAA5B;AAAA,cAAC+C;AAAA,cAAA;AAAA,gBACG,OAAOtC;AAAA,gBACP,SAASC;AAAA,gBACT,YAAAC;AAAA,gBACA,cAAcC,KAAS,CAACI,IAAU,SAAY;AAAA,gBAC9C,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACd;AAAA,QAAA;AAAA,QAGHM,sBACI,OAAA,EAAI,WAAWuB,GAAiB,OAAO,EAAE,SAAS,YAAA,GAC/C,4BAACG,GAAA,EAAM,SAAS1B,EAAM,SAAS,MAAMA,EAAM,MAAM,WAAW,IAAO,EAAA,CACvE,IACA;AAAA,QAEJ,gBAAAtB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,OACI;AAAA,cACI,SAAS8B;AAAA,cACT,WAAWmB;AAAA,cACX,KAAK3D,EAAa8B,CAAU;AAAA,cAC5B,CAAC8B,CAAiB,GAAGnB;AAAA,YAAA;AAAA,YAI5B,UAAAV,IACG,gBAAArB;AAAA,cAAC;AAAA,cAAA;AAAA,gBACG,WAAU;AAAA,gBACV,OACI;AAAA,kBACI,UAAUX,EAAegC,CAAY;AAAA,kBACrC,cAAc;AAAA,kBACd,KAAK/B,EAAa8B,CAAU;AAAA,kBAC5B,CAAC8B,CAAiB,GAAG;AAAA,gBAAA;AAAA,gBAI5B,UAAAV;AAAA,cAAA;AAAA,YAAA,IAGLA;AAAA,UAAA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"regularLayout.js","sources":["../../../src/components/PageLayout/regularLayout.tsx"],"sourcesContent":["import React from 'react';\nimport ActionMenu, { type ActionMenuItem } from '../ActionMenu';\nimport Alert, { type AlertType } from '../Alert';\nimport Breadcrumbs from '../Breadcrumbs';\nimport { hasBackButton } from '../breadcrumbsNav';\nimport Button from '../Button';\nimport OverflowRow from '../OverflowRow';\nimport Skeleton from '../Skeleton';\nimport PageTitle from '../Typography/PageTitle';\nimport Text from '../Typography/Text';\nimport { safeHref } from '../safeHref';\nimport {\n CARD_CLASSES,\n CARD_MIN_HEIGHT,\n CARD_RADIUS,\n CONTENT_INSET_VAR,\n CONTENT_MIN_HEIGHT,\n DIVIDER_CLASSES,\n HEADER_HEIGHT,\n} from './constants';\nimport { CONTENT_GAPS, PageColumn, type PageContentGap, type PageContentWidth } from './pageColumn';\nimport type { BreadcrumbLink, PageAction, RenderLink } from './types';\n\nexport type { PageContentGap, PageContentWidth };\n\nexport interface RegularLayoutProps {\n breadcrumbLinks?: BreadcrumbLink[];\n breadcrumbActions?: PageAction[];\n renderLink?: RenderLink;\n title?: React.ReactNode;\n titleSuffix?: React.ReactNode;\n subtitle?: string;\n description?: React.ReactNode;\n buttons?: PageAction[];\n /**\n * Hides the buttons and skeletons the title. `subtitle` and `description` are only\n * skeletoned when those props are also passed.\n */\n loading?: boolean;\n children: React.ReactNode;\n centered?: boolean;\n noPadding?: boolean;\n contentGap?: PageContentGap;\n /** Caps the content column and centres it; `narrow` fits a single-column form. */\n contentWidth?: PageContentWidth;\n alert?: { message: string; type?: AlertType };\n /** Demotes the default `main` landmark — pass e.g. `region` when the app owns its own. */\n role?: React.AriaRole;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n style?: React.CSSProperties;\n}\n\nconst isDanger = (button: PageAction): boolean =>\n button.variant === 'destructive' || button.variant === 'error';\n\nconst toMenuItems = (buttons: PageAction[]): ActionMenuItem[] =>\n buttons.flatMap((button, index) => {\n const href = safeHref(button.href);\n const item: ActionMenuItem = {\n key: `${index}-${button.label}`,\n label: button.label,\n ...(href ? { href, target: button.target ?? '_blank' } : { onClick: button.onClick }),\n disabled: button.disabled,\n icon: button.icon,\n tooltip: button.tooltip,\n danger: isDanger(button),\n };\n return button.dividerBefore && index > 0\n ? [{ type: 'divider' as const, key: `divider-${index}-${button.label}` }, item]\n : [item];\n });\n\n// Not `ActionBar`: it measures by walking ancestors for `clientWidth`, and this chrome\n// mounts on every page. OverflowRow batches its measurement instead.\n// A divider must live in the same OverflowRow child as its button — a standalone child\n// would survive its hidden button and break the child-index-to-button mapping.\n/**\n * The page's action buttons, collapsing into an overflow menu as the row narrows. Exported so\n * a page that renders its own header block — e.g. one that scrolls the title away — keeps the\n * same behaviour instead of hand-rolling `buttons.map(...)` and losing the collapse, the\n * dividers and the href handling.\n */\nexport const PageActions: React.FC<{ buttons: PageAction[] }> = ({ buttons }) => {\n if (buttons.length === 0) {\n return null;\n }\n\n // min-w-0 gives OverflowRow a shrinkable container to collapse against.\n return (\n <div className=\"min-w-0\">\n <OverflowRow\n gap={8}\n justify=\"end\"\n renderOverflow={(hiddenCount) => (\n <ActionMenu\n items={toMenuItems(\n buttons.slice(Math.max(0, buttons.length - hiddenCount)),\n )}\n />\n )}\n >\n {buttons.map((button, index) => {\n const href = safeHref(button.href);\n return (\n <div key={`${index}-${button.label}`} className=\"flex items-center gap-2\">\n {button.dividerBefore && index > 0 ? (\n <span\n aria-hidden=\"true\"\n className=\"h-4 w-px bg-[var(--malachite-card-border)]\"\n />\n ) : null}\n <Button\n variant={button.variant ?? 'filled'}\n size=\"medium\"\n disabled={button.disabled}\n icon={button.icon}\n tooltip={button.tooltip}\n tooltipPlacement={button.tooltipPlacement}\n href={href}\n target={href ? (button.target ?? '_blank') : undefined}\n onClick={href ? undefined : button.onClick}\n >\n {button.label}\n </Button>\n </div>\n );\n })}\n </OverflowRow>\n </div>\n );\n};\n\nconst NO_LINKS: BreadcrumbLink[] = [];\nconst NO_BUTTONS: PageAction[] = [];\n\nconst RegularLayout: React.FC<RegularLayoutProps> = ({\n breadcrumbLinks = NO_LINKS,\n breadcrumbActions,\n renderLink,\n title,\n titleSuffix,\n subtitle,\n description,\n buttons = NO_BUTTONS,\n loading = false,\n children,\n centered = false,\n noPadding = false,\n contentGap = 'small',\n contentWidth,\n alert,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}) => {\n const hasBack = hasBackButton(breadcrumbLinks);\n const contentPadding = noPadding ? 0 : centered ? '5vh 14vw' : '40px';\n // Published so a full-bleed child (CardStrip's bottom rule) can cancel it and re-apply\n // it as its own padding, instead of hardcoding the gutter at the call site.\n const contentInset = noPadding ? '0px' : centered ? '14vw' : '40px';\n const hasHeaderBlock = Boolean(\n loading || title || subtitle || description || buttons.length > 0,\n );\n\n const subtitleNode = subtitle ? (\n loading ? (\n <Skeleton.Input width={120} height={24} />\n ) : (\n <Text color=\"secondary\" size=\"small\">\n {subtitle}\n </Text>\n )\n ) : null;\n\n const titleNode = loading ? (\n <Skeleton.Input width={200} height={40} />\n ) : title ? (\n <div className=\"flex items-center\" style={{ gap: 12 }}>\n <PageTitle>{title}</PageTitle>\n {titleSuffix}\n </div>\n ) : null;\n\n const descriptionNode = description ? (\n loading ? (\n <Skeleton.Input width={120} height={24} />\n ) : (\n <Text color=\"secondary\" style={{ lineHeight: 1.6 }}>\n {description}\n </Text>\n )\n ) : null;\n\n const headerBlock = hasHeaderBlock ? (\n <div className=\"flex flex-col\" style={{ gap: 12 }}>\n {titleNode || subtitleNode || buttons.length > 0 ? (\n <div className=\"flex flex-wrap items-center justify-between\" style={{ gap: 12 }}>\n <div\n className=\"flex flex-col flex-auto min-w-0 overflow-hidden\"\n style={{ gap: 4 }}\n >\n {subtitleNode}\n {titleNode}\n </div>\n {loading ? null : <PageActions buttons={buttons} />}\n </div>\n ) : null}\n {descriptionNode}\n </div>\n ) : null;\n\n const body = (\n <>\n {headerBlock}\n {children}\n </>\n );\n\n return (\n <main\n className={`${CARD_CLASSES} ${className}`}\n style={{ borderRadius: CARD_RADIUS, minHeight: CARD_MIN_HEIGHT, ...style }}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-busy={loading || undefined}\n >\n <div\n className={`flex items-center ${DIVIDER_CLASSES}`}\n style={{\n height: HEADER_HEIGHT,\n paddingInlineStart: hasBack ? 16 : 28,\n paddingInlineEnd: 16,\n }}\n >\n <Breadcrumbs\n links={breadcrumbLinks}\n actions={breadcrumbActions}\n renderLink={renderLink}\n titleElement={title && !loading ? undefined : 'h1'}\n className=\"flex-1 min-w-0\"\n />\n </div>\n\n {alert ? (\n <div className={DIVIDER_CLASSES} style={{ padding: '10px 16px' }}>\n <Alert message={alert.message} type={alert.type} hasMargin={false} />\n </div>\n ) : null}\n\n <div\n className=\"flex flex-col\"\n style={\n {\n padding: contentPadding,\n minHeight: CONTENT_MIN_HEIGHT,\n gap: CONTENT_GAPS[contentGap],\n [CONTENT_INSET_VAR]: contentInset,\n } as React.CSSProperties\n }\n >\n {contentWidth ? (\n <PageColumn width={contentWidth} gap={contentGap}>\n {body}\n </PageColumn>\n ) : (\n body\n )}\n </div>\n </main>\n );\n};\n\nexport default RegularLayout;\nexport { RegularLayout };\n"],"names":["isDanger","button","toMenuItems","buttons","index","href","safeHref","item","PageActions","jsx","OverflowRow","hiddenCount","ActionMenu","jsxs","Button","NO_LINKS","NO_BUTTONS","RegularLayout","breadcrumbLinks","breadcrumbActions","renderLink","title","titleSuffix","subtitle","description","loading","children","centered","noPadding","contentGap","contentWidth","alert","role","ariaLabel","ariaLabelledBy","className","style","hasBack","hasBackButton","contentPadding","contentInset","hasHeaderBlock","subtitleNode","Skeleton","Text","titleNode","PageTitle","descriptionNode","headerBlock","body","Fragment","CARD_CLASSES","CARD_RADIUS","CARD_MIN_HEIGHT","DIVIDER_CLASSES","HEADER_HEIGHT","Breadcrumbs","Alert","CONTENT_MIN_HEIGHT","CONTENT_GAPS","CONTENT_INSET_VAR","PageColumn"],"mappings":";;;;;;;;;;;;;AAsDA,MAAMA,IAAW,CAACC,MACdA,EAAO,YAAY,iBAAiBA,EA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cAAciB,GAAa,WAAWC,GAAiB,GAAGjB,EAAA;AAAA,MACnE,MAAAJ;AAAA,MACA,cAAYC;AAAA,MACZ,mBAAiBC;AAAA,MACjB,aAAWT,KAAW;AAAA,MAEtB,UAAA;AAAA,QAAA,gBAAAhB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,qBAAqB6C,CAAe;AAAA,YAC/C,OAAO;AAAA,cACH,QAAQC;AAAA,cACR,oBAAoBlB,IAAU,KAAK;AAAA,cACnC,kBAAkB;AAAA,YAAA;AAAA,YAGtB,UAAA,gBAAA5B;AAAA,cAAC+C;AAAA,cAAA;AAAA,gBACG,OAAOtC;AAAA,gBACP,SAASC;AAAA,gBACT,YAAAC;AAAA,gBACA,cAAcC,KAAS,CAACI,IAAU,SAAY;AAAA,gBAC9C,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACd;AAAA,QAAA;AAAA,QAGHM,sBACI,OAAA,EAAI,WAAWuB,GAAiB,OAAO,EAAE,SAAS,YAAA,GAC/C,4BAACG,GAAA,EAAM,SAAS1B,EAAM,SAAS,MAAMA,EAAM,MAAM,WAAW,IAAO,EAAA,CACvE,IACA;AAAA,QAEJ,gBAAAtB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,OACI;AAAA,cACI,SAAS8B;AAAA,cACT,WAAWmB;AAAA,cACX,KAAKC,EAAa9B,CAAU;AAAA,cAC5B,CAAC+B,CAAiB,GAAGpB;AAAA,YAAA;AAAA,YAI5B,UAAAV,sBACI+B,GAAA,EAAW,OAAO/B,GAAc,KAAKD,GACjC,aACL,IAEAoB;AAAA,UAAA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2041,6 +2041,16 @@ export declare interface EmptyLayoutProps {
|
|
|
2041
2041
|
uniformPadding?: boolean;
|
|
2042
2042
|
headerActions?: default_2.ReactNode;
|
|
2043
2043
|
background?: default_2.ReactNode;
|
|
2044
|
+
/**
|
|
2045
|
+
* An image for the lower half of the content area, cover-fitted. It is multiplied onto the card, so
|
|
2046
|
+
* artwork drawn for a white card sinks into a dark one. Ignored when `background` is set.
|
|
2047
|
+
*/
|
|
2048
|
+
backgroundImage?: string;
|
|
2049
|
+
/**
|
|
2050
|
+
* For a screen rendered before the app frame: adds the page inset around the card and paints
|
|
2051
|
+
* it with the page background.
|
|
2052
|
+
*/
|
|
2053
|
+
standalone?: boolean;
|
|
2044
2054
|
/** Demotes the default `main` landmark — pass e.g. `region` when the app owns its own. */
|
|
2045
2055
|
role?: default_2.AriaRole;
|
|
2046
2056
|
'aria-label'?: string;
|
|
@@ -4609,6 +4619,19 @@ export declare const PageActions: default_2.FC<{
|
|
|
4609
4619
|
buttons: PageAction[];
|
|
4610
4620
|
}>;
|
|
4611
4621
|
|
|
4622
|
+
export declare interface PageColumnProps {
|
|
4623
|
+
/** `narrow` fits a single-column form. */
|
|
4624
|
+
width: PageContentWidth;
|
|
4625
|
+
gap?: PageContentGap;
|
|
4626
|
+
/**
|
|
4627
|
+
* For a page rendered without `PageLayout.Regular` around it: adds 40px above and below and
|
|
4628
|
+
* 16px side gutters, so the column keeps clear of the viewport edges on a phone.
|
|
4629
|
+
*/
|
|
4630
|
+
standalone?: boolean;
|
|
4631
|
+
children: default_2.ReactNode;
|
|
4632
|
+
className?: string;
|
|
4633
|
+
}
|
|
4634
|
+
|
|
4612
4635
|
export declare type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4613
4636
|
|
|
4614
4637
|
export declare type PageContentWidth = 'narrow';
|
|
@@ -4616,6 +4639,7 @@ export declare type PageContentWidth = 'narrow';
|
|
|
4616
4639
|
export declare const PageLayout: {
|
|
4617
4640
|
Regular: FC<RegularLayoutProps>;
|
|
4618
4641
|
Empty: FC<EmptyLayoutProps>;
|
|
4642
|
+
Column: FC<PageColumnProps>;
|
|
4619
4643
|
};
|
|
4620
4644
|
|
|
4621
4645
|
declare interface PageTitleProps {
|