@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
package/COMPONENTS.md
CHANGED
|
@@ -17,7 +17,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
17
17
|
- **`SelectableCard`** — A card that is one option in a radio group — eyebrow, optional status tag, title, description, a count label and a top-right action slot. Use inside a `CardStrip`. Selection is controlled by the consumer: pass `selected`, which drives both the visual treatment and `aria-checked`. A selected card meets the sheet below the way a browser tab meets its toolbar — its bottom corners flare outward onto the strip’s rule — so its outline is one SVG path rather than borders, which would split into two lines at the tangent. `variant` picks the palette: `profile` (green), `library` (neutral) or `editing` (amber, for a profile with unsaved changes). `actions` stands in the card’s top-right corner, on the eyebrow row, and renders outside the control so a menu or icon button inside it stays clickable and keeps its own tab stop. Nothing else marks that corner: the flared outline, the tint and the green eyebrow already say which card is selected, so a radio there would only repeat them. `onDismiss` adds an x after `actions`, tinted like the eyebrow so it reads as part of the card — for discarding a draft card; `dismissDisabledReason` disables it and explains why in its tooltip. `isDefault` marks the card as the account default with a pin beside the title, named for assistive tech and tooltipped for everyone else — it belongs with the name it qualifies rather than among the actions, which read as things to press. `address` puts a one-line chip above the count for a copyable address such as a server URL: its `label` is cut short with an ellipsis, and its full `value` shows in a tooltip and is copied on click, without selecting the card. It takes the place of `description`, since the card has room for one or the other. For a row-shaped selectable use `Surface.Row` instead. _Key props:_ `value`, `title`, `titleIcon`, `isDefault`, `variant` (`profile` | `library` | `editing`), `eyebrow`, `status` (`label`, `type`, `tooltip`), `description`, `address` (`label`, `value`), `countLabel`, `actions`, `onDismiss` (`dismissLabel`, `dismissDisabledReason`), `selected`, `loading` (`loadingLabel`, `loadingHint`), `disabled`, `dimmed`, `onSelect`, `tabIndex`, `aria-label`, `className`, `style`.
|
|
18
18
|
- **`CardStrip`** — Horizontally scrolling radio group of cards, with edge arrows that appear only when the content overflows, an edge fade, scroll-snap and arrow-key navigation matching `SegmentedControl`. Owns interaction only: it finds its options by looking for `role="radio"` descendants carrying `data-value`, so any such child works (`SelectableCard` emits both). Pass a non-selectable terminal tile as `CardStrip.AddTile` — it sits inside the group but outside the radio set, and must be a direct child or it scrolls with the cards. Use `leading` to pin a card that should not scroll away; the strip tells the cards which slot they are in, so a pinned `SelectableCard` drops the left rule the scrolling ones draw. A strip too narrow to show a card beside `leading` scrolls it with the cards rather than squeezing them, so the selected card always has its full width. Set `bleed` when the strip sits in a `PageLayout`: the strip stretches past the horizontal padding of the layout so its bottom rule runs the full width of the page card, while the cards stay aligned to the gutter. With no cards at all the strip degenerates to its pinned slots alone — no trough, no scroller and no arrows — with the add tile standing beside `leading` and taking `primary` emphasis automatically, since adding the first card is the only thing on offer. _Key props:_ `value`, `tone` (`profile` | `library` | `editing` — read off the selected card unless set), `onChange`, `children`, `leading`, `arrows`, `fadeEdges`, `snap`, `bleed`, `scrollSelectedIntoView`, `aria-label`, `aria-labelledby`, `className`, `style`. `CardStrip.AddTile`: `label`, `icon`, `onClick`, `disabled`, `emphasis` (`primary` | `secondary` — left to the strip unless set: `primary` while there are no cards, `secondary` once there are), `className`.
|
|
19
19
|
- **`SplitScreenLayout`** — Two-pane full-screen layout (content + preview/aside) with an optional dismiss button.
|
|
20
|
-
- **`PageLayout`** — Standard page chrome: a bordered card holding a breadcrumb bar, an optional alert strip, and a header block (subtitle, title + suffix, description) above the page body. Used as `PageLayout.Regular`; `PageLayout.Empty` is the chrome-only variant for pre-auth and error screens, with `headerActions` and `background` slots. Actions are declared as data (`buttons`) rather than children, and any that do not fit collapse into an overflow `ActionMenu` via `OverflowRow`. A client-side-routed app must pass `renderLink` so crumbs and the back button go through its router instead of reloading the document. Both layouts render a `main` landmark, demoted via `role` when the app owns its own. Deliberately not a `Surface` — the page card is 16px and carries no shadow. _Key props:_ `PageLayout.Regular`: `breadcrumbLinks`, `breadcrumbActions`, `renderLink`, `title`, `titleSuffix`, `subtitle`, `description`, `buttons`, `loading`, `centered`, `noPadding`, `contentGap` (`small` | `medium` | `large` | `xlarge`, default `small`), `contentWidth` (`narrow`: caps and centres the header and body column for a single-column form), `alert`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Empty`: `title`, `centered`, `uniformPadding`, `headerActions`, `background`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`.
|
|
20
|
+
- **`PageLayout`** — Standard page chrome: a bordered card holding a breadcrumb bar, an optional alert strip, and a header block (subtitle, title + suffix, description) above the page body. Used as `PageLayout.Regular`; `PageLayout.Empty` is the chrome-only variant for pre-auth and error screens, with `headerActions` and `background` slots. `PageLayout.Column` is the capped, centred column that `contentWidth` uses, on its own; set `standalone` for a page with no layout around it. Actions are declared as data (`buttons`) rather than children, and any that do not fit collapse into an overflow `ActionMenu` via `OverflowRow`. A client-side-routed app must pass `renderLink` so crumbs and the back button go through its router instead of reloading the document. Both layouts render a `main` landmark, demoted via `role` when the app owns its own. Deliberately not a `Surface` — the page card is 16px and carries no shadow. _Key props:_ `PageLayout.Regular`: `breadcrumbLinks`, `breadcrumbActions`, `renderLink`, `title`, `titleSuffix`, `subtitle`, `description`, `buttons`, `loading`, `centered`, `noPadding`, `contentGap` (`small` | `medium` | `large` | `xlarge`, default `small`), `contentWidth` (`narrow`: caps and centres the header and body column for a single-column form), `alert`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Empty`: `title`, `centered`, `uniformPadding`, `headerActions`, `background`, `backgroundImage` (a URL laid over the lower half of the content area, cover-fitted and multiplied onto the card so artwork drawn for white sinks into dark; `background` wins), `standalone` (adds the page inset and page background, for a screen rendered before the app frame), `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Column`: `width` (`narrow`), `gap`, `standalone`, `className`.
|
|
21
21
|
- **`WizardLayout`** — Full-screen wizard scaffold: top bar (back button, right-aligned stepper, trailing slot), pinned `header` slot, centered scrolling content column, and a pinned footer (above sticky body content). `footerGlass` gives the footer a frosted translucent + backdrop-blur treatment. `banner` pins a page-wide notice under the top bar, above `header` and outside the content column, so a warning about the whole page is not squeezed to the column's width — pair it with `Alert layout="banner"`. `topBarSize="large"` draws a 60px top bar with 28px insets (52px and 16px below 640px). `footerAlign="content"` holds the footer to the content column, inside its gutter, so a full-width action lines up with the list above it. `reserveBack={false}` drops the square held for a hidden back button, so `leading` sits at the same inset as `trailing`; the default keeps it so `leading` does not move as the wizard steps. _Key props:_ `showBack`, `onBack`, `reserveBack`, `topBarSize` (`default` | `large`), `footerAlign` (`full` | `content`), `leading`, `stepper`, `trailing`, `banner`, `header`, `footer`, `footerGlass`, `center`, `contentWidth`, `minWidth`.
|
|
22
22
|
- **`PageActions`** — A page's action buttons, collapsing into an overflow menu as the row narrows. `PageLayout.Regular` renders these from its `buttons` prop; import it directly when a page builds its own header block (e.g. one that scrolls the title away) so the collapse, the dividers and the href handling come with it rather than being hand-rolled. _Key props:_ `buttons` (`PageAction[]`).
|
|
23
23
|
- **`Toolbar`** — Flat, opaque horizontal bar for a sub-header / filter row (e.g. a Search). Owns its chrome — an opaque ground (`card-background`, or the sunken page ground with `surface="page"` for a bar above a card), so it can pin over scrolling content, plus an optional bottom `divider` — so consumers don’t hand-roll background/border tokens. Its `TOOLBAR_FILTER_WIDTH_PX` / `TOOLBAR_FILTER_MIN_WIDTH_PX` / `TOOLBAR_FILL_BASIS_PX` / `TOOLBAR_FILL_MIN_WIDTH_PX` are exported so a control outside the bar can line up with one inside it without re-typing the number. `sticky` pins it to the top of its scroll container; any other positioning is left to the consumer, as is the gutter when `padding="none"` — use that when the bar must sit flush with the content it pins over. `layout="filters"` makes it own the layout too, which consumers were each re-deriving and getting wrong the same way: a `flex: 1` search with no floor collapses to nothing on a narrow viewport, and a row that cannot wrap runs off the page. Compose it as `Toolbar.Fill` for the search and `Toolbar.Item` per filter, as flat siblings; `grow={false}` stops a slot growing past its basis, for a row that already spaces its children, though it can still shrink toward its `minWidth`. The row packs greedily from its basis widths and each line's spare space is shared out by grow factor, which is deliberately lopsided: the search outweighs the filters a hundred to one, so a shared line leaves them at their 200px while a filter left alone on a wrapped line grows into the whole width instead of stranding beside a gap. A filter drops to the next line once its full 200px basis will not fit, and the filters sharing a line then compress toward a 160px floor. A search and a filter are laid out differently rather than uniformly, because a search field's useful width is "as much as you can spare" where a filter's is the width of a value. _Key props:_ `divider`, `padding` (`none` | `compact` | `default`), `layout` (`plain` | `filters`), `surface` (`card` | `page` — `page` paints the sunken page ground, for a bar that sits above a card rather than inside it), `sticky` (pins it to the top of its scroll container above the rows under it), `className`, `style`. `Fill`: `minWidth`. `Item`: `width`, `minWidth`, `grow`.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useId as g } from "react";
|
|
3
|
+
import { PAGE_BACKGROUND as p } from "./PageLayout/constants.js";
|
|
4
|
+
import { WORDMARK_VIEW_BOX as _, MARK_TOP_PATH as u, MARK_BOTTOM_PATH as b, MARK_LEFT_PATH as R, MARK_RIGHT_PATH as T, WORDMARK_TEXT_PATH as y } from "./stackOneWordmarkPaths.js";
|
|
4
5
|
import { useAdoptedStyleSheet as C } from "./useAdoptedStyleSheet.js";
|
|
5
|
-
const l = 164, E = 21,
|
|
6
|
+
const l = 164, E = 21, x = 4, K = 28, r = "#00AF66", s = "#285C4D", d = "malachite-loading-screen-scan", o = "malachite-loading-screen-band", c = 40, v = `
|
|
6
7
|
@keyframes ${d} {
|
|
7
8
|
from { transform: translateX(-100%); }
|
|
8
9
|
to { transform: translateX(${100 / (c / 100)}%); }
|
|
@@ -22,23 +23,23 @@ const l = 164, E = 21, v = 4, x = 28, r = "#00AF66", s = "#285C4D", d = "malachi
|
|
|
22
23
|
animation: none;
|
|
23
24
|
width: 100%;
|
|
24
25
|
}
|
|
25
|
-
}`,
|
|
26
|
-
"aria-label":
|
|
26
|
+
}`, M = "var(--malachite-card-subtle-divider, rgb(241, 241, 241))", m = `color-mix(in srgb, var(--malachite-text-primary, rgb(10, 10, 10)) 12%, ${p})`, S = ({
|
|
27
|
+
"aria-label": h = "Loading",
|
|
27
28
|
"aria-labelledby": i,
|
|
28
|
-
className:
|
|
29
|
+
className: f = ""
|
|
29
30
|
}) => {
|
|
30
|
-
const n =
|
|
31
|
-
C(n,
|
|
32
|
-
const
|
|
33
|
-
return /* @__PURE__ */
|
|
31
|
+
const n = A(null);
|
|
32
|
+
C(n, v, "malachite-loading-screen-keyframes");
|
|
33
|
+
const a = `mal-loading-screen-${g().replace(/[^a-zA-Z0-9_-]/g, "")}`;
|
|
34
|
+
return /* @__PURE__ */ t(
|
|
34
35
|
"div",
|
|
35
36
|
{
|
|
36
37
|
ref: n,
|
|
37
38
|
role: "progressbar",
|
|
38
39
|
"aria-busy": !0,
|
|
39
|
-
"aria-label": i === void 0 ?
|
|
40
|
+
"aria-label": i === void 0 ? h : void 0,
|
|
40
41
|
"aria-labelledby": i,
|
|
41
|
-
className:
|
|
42
|
+
className: f,
|
|
42
43
|
style: {
|
|
43
44
|
position: "fixed",
|
|
44
45
|
inset: 0,
|
|
@@ -46,25 +47,25 @@ const l = 164, E = 21, v = 4, x = 28, r = "#00AF66", s = "#285C4D", d = "malachi
|
|
|
46
47
|
flexDirection: "column",
|
|
47
48
|
alignItems: "center",
|
|
48
49
|
justifyContent: "center",
|
|
49
|
-
gap:
|
|
50
|
-
backgroundColor:
|
|
50
|
+
gap: K,
|
|
51
|
+
backgroundColor: p
|
|
51
52
|
},
|
|
52
53
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ t(
|
|
54
55
|
"svg",
|
|
55
56
|
{
|
|
56
|
-
viewBox:
|
|
57
|
+
viewBox: _,
|
|
57
58
|
width: l,
|
|
58
59
|
height: E,
|
|
59
60
|
fill: "none",
|
|
60
61
|
"aria-hidden": !0,
|
|
61
62
|
style: { color: "var(--malachite-text-primary, rgb(10, 10, 10))" },
|
|
62
63
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ t("defs", { children: [
|
|
65
|
+
/* @__PURE__ */ t(
|
|
65
66
|
"linearGradient",
|
|
66
67
|
{
|
|
67
|
-
id: `${
|
|
68
|
+
id: `${a}-top`,
|
|
68
69
|
x1: "133.334",
|
|
69
70
|
y1: "20.1114",
|
|
70
71
|
x2: "66.667",
|
|
@@ -76,10 +77,10 @@ const l = 164, E = 21, v = 4, x = 28, r = "#00AF66", s = "#285C4D", d = "malachi
|
|
|
76
77
|
]
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ t(
|
|
80
81
|
"linearGradient",
|
|
81
82
|
{
|
|
82
|
-
id: `${
|
|
83
|
+
id: `${a}-bottom`,
|
|
83
84
|
x1: "66.667",
|
|
84
85
|
y1: "97.8888",
|
|
85
86
|
x2: "133.334",
|
|
@@ -92,13 +93,13 @@ const l = 164, E = 21, v = 4, x = 28, r = "#00AF66", s = "#285C4D", d = "malachi
|
|
|
92
93
|
}
|
|
93
94
|
)
|
|
94
95
|
] }),
|
|
95
|
-
/* @__PURE__ */ e("path", { "data-malachite-shape": "", d:
|
|
96
|
+
/* @__PURE__ */ e("path", { "data-malachite-shape": "", d: u, fill: `url(#${a}-top)` }),
|
|
96
97
|
/* @__PURE__ */ e(
|
|
97
98
|
"path",
|
|
98
99
|
{
|
|
99
100
|
"data-malachite-shape": "",
|
|
100
101
|
d: b,
|
|
101
|
-
fill: `url(#${
|
|
102
|
+
fill: `url(#${a}-bottom)`
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
105
|
/* @__PURE__ */ e("path", { "data-malachite-shape": "", d: R, fill: r }),
|
|
@@ -114,10 +115,10 @@ const l = 164, E = 21, v = 4, x = 28, r = "#00AF66", s = "#285C4D", d = "malachi
|
|
|
114
115
|
position: "relative",
|
|
115
116
|
overflow: "hidden",
|
|
116
117
|
width: l,
|
|
117
|
-
height:
|
|
118
|
+
height: x,
|
|
118
119
|
borderRadius: 999,
|
|
119
120
|
backgroundColor: M,
|
|
120
|
-
backgroundImage: `linear-gradient(${
|
|
121
|
+
backgroundImage: `linear-gradient(${m}, ${m})`
|
|
121
122
|
},
|
|
122
123
|
children: /* @__PURE__ */ e("div", { className: o })
|
|
123
124
|
}
|
|
@@ -127,7 +128,7 @@ const l = 164, E = 21, v = 4, x = 28, r = "#00AF66", s = "#285C4D", d = "malachi
|
|
|
127
128
|
);
|
|
128
129
|
};
|
|
129
130
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
S as LoadingScreen,
|
|
132
|
+
S as default
|
|
132
133
|
};
|
|
133
134
|
//# sourceMappingURL=LoadingScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingScreen.js","sources":["../../src/components/LoadingScreen.tsx"],"sourcesContent":["import React, { useId, useRef } from 'react';\nimport {\n MARK_BOTTOM_PATH,\n MARK_LEFT_PATH,\n MARK_RIGHT_PATH,\n MARK_TOP_PATH,\n WORDMARK_TEXT_PATH,\n WORDMARK_VIEW_BOX,\n} from './stackOneWordmarkPaths';\nimport { useAdoptedStyleSheet } from './useAdoptedStyleSheet';\n\nexport interface LoadingScreenProps {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n}\n\nconst WIDTH_PX = 164;\nconst WORDMARK_HEIGHT_PX = 21;\nconst BAR_HEIGHT_PX = 4;\nconst GAP_PX = 28;\n\n// The brand mark's own colours, fixed like Avatar's placeholder logo: StackOne's mark looks\n// the same in every theme. Only the lettering follows the theme.\nconst MARK_GREEN = '#00AF66';\nconst MARK_SHADE = '#285C4D';\n\nconst KEYFRAME_NAME = 'malachite-loading-screen-scan';\nconst BAND_CLASS = 'malachite-loading-screen-band';\nconst BAND_WIDTH_PERCENT = 40;\n// A media query cannot override an inline style, so the band is styled here. Reduced motion\n// stops the scan at full width: a band frozen part way would read as progress.\nconst KEYFRAMES_CSS = `\n@keyframes ${KEYFRAME_NAME} {\n from { transform: translateX(-100%); }\n to { transform: translateX(${100 / (BAND_WIDTH_PERCENT / 100)}%); }\n}\n.${BAND_CLASS} {\n position: absolute;\n top: 0;\n left: 0;\n width: ${BAND_WIDTH_PERCENT}%;\n height: 100%;\n border-radius: 999px;\n background-color: var(--malachite-accent-background, rgb(0, 175, 102));\n animation: ${KEYFRAME_NAME} 1.1s ease-in-out infinite alternate;\n}\n@media (prefers-reduced-motion: reduce) {\n .${BAND_CLASS} {\n animation: none;\n width: 100%;\n }\n}`;\n\nconst
|
|
1
|
+
{"version":3,"file":"LoadingScreen.js","sources":["../../src/components/LoadingScreen.tsx"],"sourcesContent":["import React, { useId, useRef } from 'react';\nimport { PAGE_BACKGROUND } from './PageLayout/constants';\nimport {\n MARK_BOTTOM_PATH,\n MARK_LEFT_PATH,\n MARK_RIGHT_PATH,\n MARK_TOP_PATH,\n WORDMARK_TEXT_PATH,\n WORDMARK_VIEW_BOX,\n} from './stackOneWordmarkPaths';\nimport { useAdoptedStyleSheet } from './useAdoptedStyleSheet';\n\nexport interface LoadingScreenProps {\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n className?: string;\n}\n\nconst WIDTH_PX = 164;\nconst WORDMARK_HEIGHT_PX = 21;\nconst BAR_HEIGHT_PX = 4;\nconst GAP_PX = 28;\n\n// The brand mark's own colours, fixed like Avatar's placeholder logo: StackOne's mark looks\n// the same in every theme. Only the lettering follows the theme.\nconst MARK_GREEN = '#00AF66';\nconst MARK_SHADE = '#285C4D';\n\nconst KEYFRAME_NAME = 'malachite-loading-screen-scan';\nconst BAND_CLASS = 'malachite-loading-screen-band';\nconst BAND_WIDTH_PERCENT = 40;\n// A media query cannot override an inline style, so the band is styled here. Reduced motion\n// stops the scan at full width: a band frozen part way would read as progress.\nconst KEYFRAMES_CSS = `\n@keyframes ${KEYFRAME_NAME} {\n from { transform: translateX(-100%); }\n to { transform: translateX(${100 / (BAND_WIDTH_PERCENT / 100)}%); }\n}\n.${BAND_CLASS} {\n position: absolute;\n top: 0;\n left: 0;\n width: ${BAND_WIDTH_PERCENT}%;\n height: 100%;\n border-radius: 999px;\n background-color: var(--malachite-accent-background, rgb(0, 175, 102));\n animation: ${KEYFRAME_NAME} 1.1s ease-in-out infinite alternate;\n}\n@media (prefers-reduced-motion: reduce) {\n .${BAND_CLASS} {\n animation: none;\n width: 100%;\n }\n}`;\n\nconst TRACK_FALLBACK = 'var(--malachite-card-subtle-divider, rgb(241, 241, 241))';\nconst TRACK_MIX = `color-mix(in srgb, var(--malachite-text-primary, rgb(10, 10, 10)) 12%, ${PAGE_BACKGROUND})`;\n\n/**\n * The whole viewport while an app has nothing to show yet: the StackOne wordmark over a bar\n * scanning back and forth, on the page background. It is the screen unified-cloud paints before\n * its bundle loads, so a page that hands over to it, or from it, reads as one wait.\n */\nconst LoadingScreen: React.FC<LoadingScreenProps> = ({\n 'aria-label': ariaLabel = 'Loading',\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}) => {\n const ref = useRef<HTMLDivElement>(null);\n useAdoptedStyleSheet(ref, KEYFRAMES_CSS, 'malachite-loading-screen-keyframes');\n const gradientId = `mal-loading-screen-${useId().replace(/[^a-zA-Z0-9_-]/g, '')}`;\n\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-busy\n aria-label={ariaLabelledBy === undefined ? ariaLabel : undefined}\n aria-labelledby={ariaLabelledBy}\n className={className}\n style={{\n position: 'fixed',\n inset: 0,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: GAP_PX,\n backgroundColor: PAGE_BACKGROUND,\n }}\n >\n <svg\n viewBox={WORDMARK_VIEW_BOX}\n width={WIDTH_PX}\n height={WORDMARK_HEIGHT_PX}\n fill=\"none\"\n aria-hidden\n // The lettering takes `currentColor` from malachite's icon rule; the mark opts out.\n style={{ color: 'var(--malachite-text-primary, rgb(10, 10, 10))' }}\n >\n <defs>\n <linearGradient\n id={`${gradientId}-top`}\n x1=\"133.334\"\n y1=\"20.1114\"\n x2=\"66.667\"\n y2=\"20.1114\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={MARK_GREEN} />\n <stop offset=\"1\" stopColor={MARK_SHADE} />\n </linearGradient>\n <linearGradient\n id={`${gradientId}-bottom`}\n x1=\"66.667\"\n y1=\"97.8888\"\n x2=\"133.334\"\n y2=\"97.8888\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop stopColor={MARK_GREEN} />\n <stop offset=\"1\" stopColor={MARK_SHADE} />\n </linearGradient>\n </defs>\n <path data-malachite-shape=\"\" d={MARK_TOP_PATH} fill={`url(#${gradientId}-top)`} />\n <path\n data-malachite-shape=\"\"\n d={MARK_BOTTOM_PATH}\n fill={`url(#${gradientId}-bottom)`}\n />\n <path data-malachite-shape=\"\" d={MARK_LEFT_PATH} fill={MARK_GREEN} />\n <path data-malachite-shape=\"\" d={MARK_RIGHT_PATH} fill={MARK_GREEN} />\n <path d={WORDMARK_TEXT_PATH} fill=\"currentColor\" />\n </svg>\n <div\n style={{\n position: 'relative',\n overflow: 'hidden',\n width: WIDTH_PX,\n height: BAR_HEIGHT_PX,\n borderRadius: 999,\n backgroundColor: TRACK_FALLBACK,\n backgroundImage: `linear-gradient(${TRACK_MIX}, ${TRACK_MIX})`,\n }}\n >\n <div className={BAND_CLASS} />\n </div>\n </div>\n );\n};\n\nexport default LoadingScreen;\nexport { LoadingScreen };\n"],"names":["WIDTH_PX","WORDMARK_HEIGHT_PX","BAR_HEIGHT_PX","GAP_PX","MARK_GREEN","MARK_SHADE","KEYFRAME_NAME","BAND_CLASS","BAND_WIDTH_PERCENT","KEYFRAMES_CSS","TRACK_FALLBACK","TRACK_MIX","PAGE_BACKGROUND","LoadingScreen","ariaLabel","ariaLabelledBy","className","ref","useRef","useAdoptedStyleSheet","gradientId","useId","jsxs","WORDMARK_VIEW_BOX","jsx","MARK_TOP_PATH","MARK_BOTTOM_PATH","MARK_LEFT_PATH","MARK_RIGHT_PATH","WORDMARK_TEXT_PATH"],"mappings":"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"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
const a = "var(--malachite-radius-xxxl, 16px)",
|
|
1
|
+
const a = "var(--malachite-radius-xxxl, 16px)", c = "w-full overflow-hidden bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]", o = "border-b border-solid border-[var(--malachite-card-border)]", e = 56, t = 8, d = "var(--malachite-card-sunken-background, rgb(250, 250, 250))", n = "calc(100vh - 16px)", E = "calc(100vh - 136px)", r = "--malachite-page-content-inset", s = `var(${r}, 0px)`;
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
c as CARD_CLASSES,
|
|
4
|
+
n as CARD_MIN_HEIGHT,
|
|
5
5
|
a as CARD_RADIUS,
|
|
6
|
-
|
|
6
|
+
s as CONTENT_INSET,
|
|
7
7
|
r as CONTENT_INSET_VAR,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
e as HEADER_HEIGHT
|
|
8
|
+
E as CONTENT_MIN_HEIGHT,
|
|
9
|
+
o as DIVIDER_CLASSES,
|
|
10
|
+
e as HEADER_HEIGHT,
|
|
11
|
+
d as PAGE_BACKGROUND,
|
|
12
|
+
t as PAGE_INSET
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../src/components/PageLayout/constants.ts"],"sourcesContent":["// Not a <Surface>: that is a 14px card and paints a box-shadow this page card must not have.\nexport const CARD_RADIUS = 'var(--malachite-radius-xxxl, 16px)';\nexport const CARD_CLASSES =\n 'w-full overflow-hidden bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]';\nexport const DIVIDER_CLASSES = 'border-b border-solid border-[var(--malachite-card-border)]';\n\n// 56, not Figma's 60: the app sidebar's divider sits at 9 + 56 and this header's must land\n// on the same line (8px page inset + 1px card border + 56). Move both together or neither.\nexport const HEADER_HEIGHT = 56;\nexport const CARD_MIN_HEIGHT =
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../src/components/PageLayout/constants.ts"],"sourcesContent":["// Not a <Surface>: that is a 14px card and paints a box-shadow this page card must not have.\nexport const CARD_RADIUS = 'var(--malachite-radius-xxxl, 16px)';\nexport const CARD_CLASSES =\n 'w-full overflow-hidden bg-[var(--malachite-card-background)] border border-solid border-[var(--malachite-card-border)]';\nexport const DIVIDER_CLASSES = 'border-b border-solid border-[var(--malachite-card-border)]';\n\n// 56, not Figma's 60: the app sidebar's divider sits at 9 + 56 and this header's must land\n// on the same line (8px page inset + 1px card border + 56). Move both together or neither.\nexport const HEADER_HEIGHT = 56;\nexport const PAGE_INSET = 8;\nexport const PAGE_BACKGROUND = 'var(--malachite-card-sunken-background, rgb(250, 250, 250))';\nexport const CARD_MIN_HEIGHT = `calc(100vh - ${PAGE_INSET * 2}px)`;\n// 136 is not derivable from the constants above: the extra 64px is app chrome above the card.\nexport const CONTENT_MIN_HEIGHT = 'calc(100vh - 136px)';\n\n// Set by RegularLayout to its own horizontal content padding, so a `bleed` child can pull\n// itself out to the page card's edges without knowing which layout variant wraps it.\nexport const CONTENT_INSET_VAR = '--malachite-page-content-inset';\nexport const CONTENT_INSET = `var(${CONTENT_INSET_VAR}, 0px)`;\n"],"names":["CARD_RADIUS","CARD_CLASSES","DIVIDER_CLASSES","HEADER_HEIGHT","PAGE_INSET","PAGE_BACKGROUND","CARD_MIN_HEIGHT","CONTENT_MIN_HEIGHT","CONTENT_INSET_VAR","CONTENT_INSET"],"mappings":"AACO,MAAMA,IAAc,sCACdC,IACT,0HACSC,IAAkB,+DAIlBC,IAAgB,IAChBC,IAAa,GACbC,IAAkB,+DAClBC,IAAkB,sBAElBC,IAAqB,uBAIrBC,IAAoB,kCACpBC,IAAgB,OAAOD,CAAiB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cssUrl.js","sources":["../../../src/components/PageLayout/cssUrl.ts"],"sourcesContent":["export const cssUrl = (url: string): string =>\n `url(\"${url\n .replace(/[\\\\\"]/g, '\\\\$&')\n .replace(/[\\0-\\x1f\\x7f]/g, (c) => `\\\\${c.charCodeAt(0).toString(16)} `)}\")`;\n"],"names":["cssUrl","url","c"],"mappings":"AAAO,MAAMA,IAAS,CAACC,MACnB,QAAQA,EACH,QAAQ,UAAU,MAAM,EACxB,QAAQ,kBAAkB,CAACC,MAAM,KAAKA,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC;"}
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { CARD_MIN_HEIGHT as
|
|
4
|
-
|
|
2
|
+
import N from "../Typography/Text.js";
|
|
3
|
+
import { CARD_MIN_HEIGHT as u, CARD_RADIUS as v, CARD_CLASSES as g, HEADER_HEIGHT as y, DIVIDER_CLASSES as I, CONTENT_MIN_HEIGHT as x, PAGE_BACKGROUND as A, PAGE_INSET as S } from "./constants.js";
|
|
4
|
+
import { cssUrl as _ } from "./cssUrl.js";
|
|
5
|
+
const T = ({
|
|
5
6
|
title: i,
|
|
6
7
|
children: s,
|
|
7
8
|
centered: n = !1,
|
|
8
9
|
uniformPadding: l = !1,
|
|
9
|
-
headerActions:
|
|
10
|
+
headerActions: o,
|
|
10
11
|
background: t,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
backgroundImage: r,
|
|
13
|
+
standalone: c = !1,
|
|
14
|
+
role: m,
|
|
15
|
+
"aria-label": b,
|
|
16
|
+
"aria-labelledby": h,
|
|
17
|
+
className: p = "",
|
|
18
|
+
style: E
|
|
16
19
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */ a(
|
|
20
|
+
const f = l ? "8px" : n ? "5vh 14vw" : "40px", d = /* @__PURE__ */ a(
|
|
19
21
|
"main",
|
|
20
22
|
{
|
|
21
|
-
className: `${
|
|
22
|
-
style: { borderRadius:
|
|
23
|
-
role:
|
|
24
|
-
"aria-label":
|
|
25
|
-
"aria-labelledby":
|
|
23
|
+
className: `${g} ${p}`,
|
|
24
|
+
style: { borderRadius: v, minHeight: u, ...E },
|
|
25
|
+
role: m,
|
|
26
|
+
"aria-label": b,
|
|
27
|
+
"aria-labelledby": h,
|
|
26
28
|
children: [
|
|
27
29
|
/* @__PURE__ */ a(
|
|
28
30
|
"div",
|
|
29
31
|
{
|
|
30
|
-
className: `flex items-center justify-between gap-4 ${
|
|
32
|
+
className: `flex items-center justify-between gap-4 ${I}`,
|
|
31
33
|
style: {
|
|
32
|
-
height:
|
|
34
|
+
height: y,
|
|
33
35
|
paddingInlineStart: l ? 8 : 28,
|
|
34
36
|
paddingInlineEnd: l ? 8 : 16
|
|
35
37
|
},
|
|
36
38
|
children: [
|
|
37
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children: i ? /* @__PURE__ */ e(
|
|
38
|
-
|
|
39
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: i ? /* @__PURE__ */ e(N, { fontWeight: "bold", children: i }) : null }),
|
|
40
|
+
o
|
|
39
41
|
]
|
|
40
42
|
}
|
|
41
43
|
),
|
|
@@ -43,9 +45,19 @@ const u = ({
|
|
|
43
45
|
"div",
|
|
44
46
|
{
|
|
45
47
|
className: "relative",
|
|
46
|
-
style: { padding:
|
|
48
|
+
style: { padding: f, minHeight: x },
|
|
47
49
|
children: [
|
|
48
|
-
t ? /* @__PURE__ */ e("div", { "aria-hidden": "true", className: "absolute bottom-0 left-0 h-1/2 w-full z-0", children: t }) :
|
|
50
|
+
t ? /* @__PURE__ */ e("div", { "aria-hidden": "true", className: "absolute bottom-0 left-0 h-1/2 w-full z-0", children: t }) : r ? /* @__PURE__ */ e(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: "absolute bottom-0 left-0 h-1/2 w-full z-0 bg-cover bg-center",
|
|
55
|
+
style: {
|
|
56
|
+
backgroundImage: _(r),
|
|
57
|
+
mixBlendMode: "multiply"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
) : null,
|
|
49
61
|
/* @__PURE__ */ e("div", { className: "relative z-10", children: s })
|
|
50
62
|
]
|
|
51
63
|
}
|
|
@@ -53,9 +65,21 @@ const u = ({
|
|
|
53
65
|
]
|
|
54
66
|
}
|
|
55
67
|
);
|
|
68
|
+
return c ? /* @__PURE__ */ e(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
style: {
|
|
72
|
+
boxSizing: "border-box",
|
|
73
|
+
width: "100%",
|
|
74
|
+
padding: S,
|
|
75
|
+
backgroundColor: A
|
|
76
|
+
},
|
|
77
|
+
children: d
|
|
78
|
+
}
|
|
79
|
+
) : d;
|
|
56
80
|
};
|
|
57
81
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
82
|
+
T as EmptyLayout,
|
|
83
|
+
T as default
|
|
60
84
|
};
|
|
61
85
|
//# sourceMappingURL=emptyLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emptyLayout.js","sources":["../../../src/components/PageLayout/emptyLayout.tsx"],"sourcesContent":["import React from 'react';\nimport Text from '../Typography/Text';\nimport {\n CARD_CLASSES,\n CARD_MIN_HEIGHT,\n CARD_RADIUS,\n CONTENT_MIN_HEIGHT,\n DIVIDER_CLASSES,\n HEADER_HEIGHT,\n} from './constants';\n\nexport interface EmptyLayoutProps {\n title?: string;\n children: React.ReactNode;\n centered?: boolean;\n uniformPadding?: boolean;\n headerActions?: React.ReactNode;\n background?: React.ReactNode;\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 EmptyLayout: React.FC<EmptyLayoutProps> = ({\n title,\n children,\n centered = false,\n uniformPadding = false,\n headerActions,\n background,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}) => {\n const contentPadding = uniformPadding ? '8px' : centered ? '5vh 14vw' : '40px';\n
|
|
1
|
+
{"version":3,"file":"emptyLayout.js","sources":["../../../src/components/PageLayout/emptyLayout.tsx"],"sourcesContent":["import React from 'react';\nimport Text from '../Typography/Text';\nimport {\n CARD_CLASSES,\n CARD_MIN_HEIGHT,\n CARD_RADIUS,\n CONTENT_MIN_HEIGHT,\n DIVIDER_CLASSES,\n HEADER_HEIGHT,\n PAGE_BACKGROUND,\n PAGE_INSET,\n} from './constants';\nimport { cssUrl } from './cssUrl';\n\nexport interface EmptyLayoutProps {\n title?: string;\n children: React.ReactNode;\n centered?: boolean;\n uniformPadding?: boolean;\n headerActions?: React.ReactNode;\n background?: React.ReactNode;\n /**\n * An image for the lower half of the content area, cover-fitted. It is multiplied onto the card, so\n * artwork drawn for a white card sinks into a dark one. Ignored when `background` is set.\n */\n backgroundImage?: string;\n /**\n * For a screen rendered before the app frame: adds the page inset around the card and paints\n * it with the page background.\n */\n standalone?: boolean;\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 EmptyLayout: React.FC<EmptyLayoutProps> = ({\n title,\n children,\n centered = false,\n uniformPadding = false,\n headerActions,\n background,\n backgroundImage,\n standalone = false,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n style,\n}) => {\n const contentPadding = uniformPadding ? '8px' : centered ? '5vh 14vw' : '40px';\n const card = (\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 >\n <div\n className={`flex items-center justify-between gap-4 ${DIVIDER_CLASSES}`}\n style={{\n height: HEADER_HEIGHT,\n paddingInlineStart: uniformPadding ? 8 : 28,\n paddingInlineEnd: uniformPadding ? 8 : 16,\n }}\n >\n <div className=\"min-w-0\">\n {title ? <Text fontWeight=\"bold\">{title}</Text> : null}\n </div>\n {headerActions}\n </div>\n\n <div\n className=\"relative\"\n style={{ padding: contentPadding, minHeight: CONTENT_MIN_HEIGHT }}\n >\n {background ? (\n <div aria-hidden=\"true\" className=\"absolute bottom-0 left-0 h-1/2 w-full z-0\">\n {background}\n </div>\n ) : backgroundImage ? (\n <div\n aria-hidden=\"true\"\n className=\"absolute bottom-0 left-0 h-1/2 w-full z-0 bg-cover bg-center\"\n style={{\n backgroundImage: cssUrl(backgroundImage),\n mixBlendMode: 'multiply',\n }}\n />\n ) : null}\n <div className=\"relative z-10\">{children}</div>\n </div>\n </main>\n );\n\n return standalone ? (\n <div\n style={{\n boxSizing: 'border-box',\n width: '100%',\n padding: PAGE_INSET,\n backgroundColor: PAGE_BACKGROUND,\n }}\n >\n {card}\n </div>\n ) : (\n card\n );\n};\n\nexport default EmptyLayout;\nexport { EmptyLayout };\n"],"names":["EmptyLayout","title","children","centered","uniformPadding","headerActions","background","backgroundImage","standalone","role","ariaLabel","ariaLabelledBy","className","style","contentPadding","card","jsxs","CARD_CLASSES","CARD_RADIUS","CARD_MIN_HEIGHT","DIVIDER_CLASSES","HEADER_HEIGHT","jsx","Text","CONTENT_MIN_HEIGHT","cssUrl","PAGE_INSET","PAGE_BACKGROUND"],"mappings":";;;;AAuCA,MAAMA,IAA0C,CAAC;AAAA,EAC7C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,gBAAAC,IAAiB;AAAA,EACjB,eAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,MAAAC;AAAA,EACA,cAAcC;AAAA,EACd,mBAAmBC;AAAA,EACnB,WAAAC,IAAY;AAAA,EACZ,OAAAC;AACJ,MAAM;AACF,QAAMC,IAAiBV,IAAiB,QAAQD,IAAW,aAAa,QAClEY,IACF,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,GAAGC,CAAY,IAAIL,CAAS;AAAA,MACvC,OAAO,EAAE,cAAcM,GAAa,WAAWC,GAAiB,GAAGN,EAAA;AAAA,MACnE,MAAAJ;AAAA,MACA,cAAYC;AAAA,MACZ,mBAAiBC;AAAA,MAEjB,UAAA;AAAA,QAAA,gBAAAK;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,2CAA2CI,CAAe;AAAA,YACrE,OAAO;AAAA,cACH,QAAQC;AAAA,cACR,oBAAoBjB,IAAiB,IAAI;AAAA,cACzC,kBAAkBA,IAAiB,IAAI;AAAA,YAAA;AAAA,YAG3C,UAAA;AAAA,cAAA,gBAAAkB,EAAC,OAAA,EAAI,WAAU,WACV,UAAArB,IAAQ,gBAAAqB,EAACC,KAAK,YAAW,QAAQ,UAAAtB,EAAA,CAAM,IAAU,MACtD;AAAA,cACCI;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAGL,gBAAAW;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,OAAO,EAAE,SAASF,GAAgB,WAAWU,EAAA;AAAA,YAE5C,UAAA;AAAA,cAAAlB,IACG,gBAAAgB,EAAC,SAAI,eAAY,QAAO,WAAU,6CAC7B,UAAAhB,GACL,IACAC,IACA,gBAAAe;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,eAAY;AAAA,kBACZ,WAAU;AAAA,kBACV,OAAO;AAAA,oBACH,iBAAiBG,EAAOlB,CAAe;AAAA,oBACvC,cAAc;AAAA,kBAAA;AAAA,gBAClB;AAAA,cAAA,IAEJ;AAAA,cACJ,gBAAAe,EAAC,OAAA,EAAI,WAAU,iBAAiB,UAAApB,EAAA,CAAS;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAC7C;AAAA,IAAA;AAAA,EAAA;AAIR,SAAOM,IACH,gBAAAc;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,OAAO;AAAA,QACH,WAAW;AAAA,QACX,OAAO;AAAA,QACP,SAASI;AAAA,QACT,iBAAiBC;AAAA,MAAA;AAAA,MAGpB,UAAAZ;AAAA,IAAA;AAAA,EAAA,IAGLA;AAER;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { EmptyLayout as o } from "./emptyLayout.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { PageColumn as t } from "./pageColumn.js";
|
|
3
|
+
import { RegularLayout as m } from "./regularLayout.js";
|
|
4
|
+
import { PageActions as g } from "./regularLayout.js";
|
|
5
|
+
const u = { Regular: m, Empty: o, Column: t };
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
g as PageActions,
|
|
8
|
+
u as PageLayout,
|
|
9
|
+
u as default
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import Empty from './emptyLayout';\nimport Regular from './regularLayout';\n\nexport const PageLayout = { Regular, Empty };\n\nexport default PageLayout;\nexport type { BreadcrumbLink, PageAction, RenderLink } from './types';\nexport { PageActions } from './regularLayout';\nexport type { PageContentGap, PageContentWidth, RegularLayoutProps } from './regularLayout';\nexport type { EmptyLayoutProps } from './emptyLayout';\n"],"names":["PageLayout","Regular","Empty"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import Empty from './emptyLayout';\nimport Column from './pageColumn';\nimport Regular from './regularLayout';\n\nexport const PageLayout = { Regular, Empty, Column };\n\nexport default PageLayout;\nexport type { BreadcrumbLink, PageAction, RenderLink } from './types';\nexport { PageActions } from './regularLayout';\nexport type { PageContentGap, PageContentWidth, RegularLayoutProps } from './regularLayout';\nexport type { EmptyLayoutProps } from './emptyLayout';\nexport type { PageColumnProps } from './pageColumn';\n"],"names":["PageLayout","Regular","Empty","Column"],"mappings":";;;;AAIO,MAAMA,IAAa,EAAA,SAAEC,GAAA,OAASC,WAAOC,EAAA;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { CONTENT_INSET_VAR as s } from "./constants.js";
|
|
3
|
+
const t = {
|
|
4
|
+
narrow: 520
|
|
5
|
+
}, x = {
|
|
6
|
+
small: 8,
|
|
7
|
+
medium: 16,
|
|
8
|
+
large: 24,
|
|
9
|
+
xlarge: 40
|
|
10
|
+
}, i = 40, N = 16, f = ({
|
|
11
|
+
width: a,
|
|
12
|
+
gap: l,
|
|
13
|
+
standalone: o = !1,
|
|
14
|
+
children: e,
|
|
15
|
+
className: T = ""
|
|
16
|
+
}) => /* @__PURE__ */ m(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: `flex flex-col flex-1 w-full ${T}`,
|
|
20
|
+
style: {
|
|
21
|
+
maxWidth: t[a],
|
|
22
|
+
marginInline: "auto",
|
|
23
|
+
gap: l ? x[l] : void 0,
|
|
24
|
+
padding: o ? `${i}px ${N}px` : void 0,
|
|
25
|
+
[s]: o ? `${N}px` : "0px"
|
|
26
|
+
},
|
|
27
|
+
children: e
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
export {
|
|
31
|
+
x as CONTENT_GAPS,
|
|
32
|
+
f as PageColumn,
|
|
33
|
+
f as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=pageColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageColumn.js","sources":["../../../src/components/PageLayout/pageColumn.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTENT_INSET_VAR } from './constants';\n\nexport type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';\n\nexport type PageContentWidth = 'narrow';\n\nconst CONTENT_WIDTHS: Record<PageContentWidth, number> = {\n narrow: 520,\n};\n\nexport const CONTENT_GAPS: Record<PageContentGap, number> = {\n small: 8,\n medium: 16,\n large: 24,\n xlarge: 40,\n};\n\nconst STANDALONE_BLOCK_PADDING = 40;\nconst STANDALONE_GUTTER = 16;\n\nexport interface PageColumnProps {\n /** `narrow` fits a single-column form. */\n width: PageContentWidth;\n gap?: PageContentGap;\n /**\n * For a page rendered without `PageLayout.Regular` around it: adds 40px above and below and\n * 16px side gutters, so the column keeps clear of the viewport edges on a phone.\n */\n standalone?: boolean;\n children: React.ReactNode;\n className?: string;\n}\n\n/** A capped, centred column. `PageLayout.Regular`'s `contentWidth` renders its body through it. */\nconst PageColumn: React.FC<PageColumnProps> = ({\n width,\n gap,\n standalone = false,\n children,\n className = '',\n}) => (\n <div\n className={`flex flex-col flex-1 w-full ${className}`}\n style={\n {\n maxWidth: CONTENT_WIDTHS[width],\n marginInline: 'auto',\n gap: gap ? CONTENT_GAPS[gap] : undefined,\n padding: standalone\n ? `${STANDALONE_BLOCK_PADDING}px ${STANDALONE_GUTTER}px`\n : undefined,\n [CONTENT_INSET_VAR]: standalone ? `${STANDALONE_GUTTER}px` : '0px',\n } as React.CSSProperties\n }\n >\n {children}\n </div>\n);\n\nexport default PageColumn;\nexport { PageColumn };\n"],"names":["CONTENT_WIDTHS","CONTENT_GAPS","STANDALONE_BLOCK_PADDING","STANDALONE_GUTTER","PageColumn","width","gap","standalone","children","className","jsx","CONTENT_INSET_VAR"],"mappings":";;AAOA,MAAMA,IAAmD;AAAA,EACrD,QAAQ;AACZ,GAEaC,IAA+C;AAAA,EACxD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AACZ,GAEMC,IAA2B,IAC3BC,IAAoB,IAgBpBC,IAAwC,CAAC;AAAA,EAC3C,OAAAC;AAAA,EACA,KAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MACI,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,+BAA+BD,CAAS;AAAA,IACnD,OACI;AAAA,MACI,UAAUT,EAAeK,CAAK;AAAA,MAC9B,cAAc;AAAA,MACd,KAAKC,IAAML,EAAaK,CAAG,IAAI;AAAA,MAC/B,SAASC,IACH,GAAGL,CAAwB,MAAMC,CAAiB,OAClD;AAAA,MACN,CAACQ,CAAiB,GAAGJ,IAAa,GAAGJ,CAAiB,OAAO;AAAA,IAAA;AAAA,IAIpE,UAAAK;AAAA,EAAA;AACL;"}
|