@stackone/malachite 2.117.0 → 2.119.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 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`, `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`.
@@ -120,7 +120,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
120
120
  - **`PillButton`** — Pill-shaped button, often used for filters/toggleable chips. `shape="tab"` squares the top corners so a row of them reads as attached to whatever sits above — the controls under a chat composer. Pass `href` and an interactive, non-disabled pill renders a real anchor (cmd-click, copy-link) instead of navigating from `onClick`; a disabled or `interactive={false}` pill stays static, and an unsafe scheme such as `javascript:` is dropped. `target="_blank"` always carries `noopener noreferrer`. _Key props:_ `label`, `icon`, `trailingIcon`, `selected`, `disabled`, `interactive`, `size`, `variant`, `shape` (`pill` | `tab`), `onClick`, `href`, `target`, `rel`.
121
121
  - **`CopyButton`** — The small copy control a copyable `Input` ends with, for a copyable value that is not an input, such as a list of scopes beside its label, so the two read the same. With `value` it copies and shows a check for a second; without, the click is the caller’s. _Key props:_ `value`, `onCopy`, `copied`, `aria-label`, `tooltip`.
122
122
  - **`BannerButton`** — A banner that is one button: the warm ground, an icon in a white tile, a title with one line under it, and an arrow at the end that darkens on hover. For an offer of help beside a form, such as opening its setup guide, that wants more presence than a link and less than a primary button. Pass `aria-expanded` when it opens and closes something. _Key props:_ `icon`, `title`, `description`, `trailing`, `onClick`, `aria-expanded`, `aria-controls`, `aria-label`.
123
- - **`Link`** — Styled anchor/link text. Opens in a new tab by default; with `renderLink`, a root-relative href goes through the app's own link component instead (href, classes, children and `onClick` when set; no `target` or `rel`), while any other href keeps the new-tab anchor. _Key props:_ `href`, `color`, `size`, `underline`, `onClick`, `renderLink`, `target`, `rel`.
123
+ - **`Link`** — Styled anchor/link text. Opens in a new tab by default; with `renderLink`, a root-relative href goes through the app's own link component instead (href, classes, children and `onClick` when set; no `target` or `rel`), while any other href keeps the new-tab anchor. _Key props:_ `href`, `color`, `size`, `underline`, `truncate` (as a flex item, shrinks and ellipsizes the label), `onClick`, `renderLink`, `target`, `rel`.
124
124
  - **`CopyButton`** — The small copy control a copyable `Input` ends with, for a copyable value that is not an input, such as a list of scopes beside its label, so the two read the same. With `value` it copies and shows a check for a second; without, the click is the caller’s. _Key props:_ `value`, `onCopy`, `copied`, `aria-label`, `tooltip`.
125
125
  - **`InlineConfirm`** — A confirmation asked on the control that triggered it rather than in a modal, for a reversible bulk edit where a dialog would be heavier than the change it guards. Drawn to the design's chip: 33px tall, 12px radius, its confirm cell running to the pill's own edge between two rules. Reads its own `inlineConfirm` theme tokens — a shade off the `SelectionBar` it appears beside, by design. Carries a spinning glyph by default — its own, so it takes the pill's colour rather than the sheet's dimmed grey — standing for a change waiting on an answer; pass `icon={null}` to drop it or a node to replace it. Anchored placement is in viewport coordinates, so the chip must not sit inside an ancestor carrying `transform`, `filter` or `contain`. It takes focus on open so `Enter` confirms, dismisses on `Escape` (through the shared escape-layer stack, so the topmost overlay answers) or a click outside, and returns focus to whatever opened it. `role="alertdialog"` named by the message itself, so the confirm button is never announced bare. Only one can be open at a time: opening a second dismisses the first, so it is never ambiguous what Yes answers. Pass `anchorTo` (a ref to the control it answers for) and it pins itself to that control's left, follows it while the page or a sticky header scrolls, dismisses once it scrolls out of view, and treats clicks on it as inside — without which the same click would dismiss and reopen. Left unanchored it renders in flow for the consumer to place, and must then not sit in a container that clips overflow (`Table` header cells among them). Nothing renders while `open` is false, and its listeners are attached only while it is open. _Key props:_ `open`, `message`, `confirmLabel`, `onConfirm`, `onDismiss`, `anchorTo`, `icon`, `className`, `style`.
126
126
  - **`SelectionBar`** — A bar reporting a pending selection and the actions that resolve it, for flows where changes accumulate and save once rather than writing on every toggle. Paints its own inverted surface from the `selectionBar` theme tokens, so its buttons are its own rather than `Button`. A count renders as one phrase (`3 Added`), not a number styled apart from its label, and an empty `value` carries a bare message instead; the separators between counts and before an action are glyphs (`•`, `|`) in the muted colour, not drawn rules. `emphasis` runs `primary` (a light filled button with its own edge, for the action that commits) → `secondary`, the default (a filled chip) → `quiet` (unfilled, taking a wash on hover). The pill is edgeless in light mode and keeps a hairline `border` token in dark, where a shadow alone would not separate it from the sheet. Defaults to `placement="sticky"` — render it as the last child of the scrolling content and it holds its place over a long list. Counts are announced through a live region that outlives the bar, so the first change is not lost; `open` drives an animated mount so it can appear and leave as the selection goes dirty and clean. Every action closes the bar, so the caller must move focus deliberately in `onClick`. `notice` wraps the whole bar in a warning sleeve carrying that message, for state the bar is reporting rather than an action it offers — a refused exit, say — and it leads the announcement; an empty string renders no sleeve. _Key props:_ `open`, `counts` (`value`, `label`), `actions` (`label`, `onClick`, `emphasis`, `icon`, `iconPosition`, `disabled`, `dividerBefore`), `placement`, `notice`, `aria-label`, `className`.
@@ -1,7 +1,7 @@
1
1
  import { jsx as h } from "react/jsx-runtime";
2
- import { FOCUS_RING as f } from "./focusRing.js";
3
- import { isRootRelative as g } from "./safeHref.js";
4
- const d = (e) => {
2
+ import { FOCUS_RING as g } from "./focusRing.js";
3
+ import { isRootRelative as d } from "./safeHref.js";
4
+ const v = "inline-block max-w-full min-w-0 truncate align-bottom", p = (e) => {
5
5
  if (!e) return "";
6
6
  switch (e) {
7
7
  case "xsmall":
@@ -19,23 +19,24 @@ const d = (e) => {
19
19
  default:
20
20
  return "";
21
21
  }
22
- }, $ = ({
22
+ }, N = ({
23
23
  children: e,
24
24
  href: t,
25
- target: n = "_blank",
26
- rel: s = "noopener noreferrer",
25
+ target: s = "_blank",
26
+ rel: l = "noopener noreferrer",
27
27
  className: o = "",
28
28
  color: i = "default",
29
29
  size: m,
30
30
  underline: c = !0,
31
+ truncate: u = !1,
31
32
  onClick: a,
32
33
  renderLink: r
33
34
  }) => {
34
- const x = i === "dimmed" ? "text-[var(--malachite-text-dimmed)] hover:text-[var(--malachite-text-primary)]" : "text-[var(--malachite-text-link-foreground)] hover:text-[var(--malachite-text-link-foreground-hover)]", u = d(m), l = `${c ? "underline" : "no-underline"} rounded-xs cursor-pointer transition-colors duration-200 ease-in-out ${f} ${x} ${u} ${o}`;
35
- return r && g(t) ? r({ href: t, className: l, children: e, ...a ? { onClick: a } : {} }) : /* @__PURE__ */ h("a", { href: t, target: n, rel: s, className: l, onClick: a, children: e });
35
+ const x = i === "dimmed" ? "text-[var(--malachite-text-dimmed)] hover:text-[var(--malachite-text-primary)]" : "text-[var(--malachite-text-link-foreground)] hover:text-[var(--malachite-text-link-foreground-hover)]", f = p(m), n = `${c ? "underline" : "no-underline"} rounded-xs cursor-pointer transition-colors duration-200 ease-in-out ${g} ${x} ${f} ${u ? v : ""} ${o}`;
36
+ return r && d(t) ? r({ href: t, className: n, children: e, ...a ? { onClick: a } : {} }) : /* @__PURE__ */ h("a", { href: t, target: s, rel: l, className: n, onClick: a, children: e });
36
37
  };
37
38
  export {
38
- $ as Link,
39
- $ as default
39
+ N as Link,
40
+ N as default
40
41
  };
41
42
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../src/components/Link.tsx"],"sourcesContent":["import React from 'react';\nimport type { RenderLink } from './PageLayout/types';\nimport type { FontSize } from './Typography/Text';\nimport { FOCUS_RING } from './focusRing';\nimport { isRootRelative } from './safeHref';\n\nexport interface LinkProps {\n href: string;\n target?: '_blank' | '_self' | '_parent' | '_top';\n rel?: string;\n children: React.ReactNode;\n className?: string;\n color?: 'default' | 'dimmed';\n size?: FontSize;\n underline?: boolean;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n /** Renders a root-relative href through the app's router instead of a new-tab anchor, without `target` or `rel`. Other hrefs keep the anchor. */\n renderLink?: RenderLink;\n}\n\nconst getFontSizeClass = (size?: FontSize): string => {\n if (!size) return '';\n switch (size) {\n case 'xsmall':\n return 'text-[length:var(--malachite-font-size-xsmall)]';\n case 'small':\n return 'text-[length:var(--malachite-font-size-small)]';\n case 'medium':\n return 'text-[length:var(--malachite-font-size-medium)]';\n case 'large':\n return 'text-[length:var(--malachite-font-size-large)]';\n case 'xlarge':\n return 'text-[length:var(--malachite-font-size-xlarge)]';\n case 'xxlarge':\n return 'text-[length:var(--malachite-font-size-xxlarge)]';\n default:\n return '';\n }\n};\n\nexport const Link: React.FC<LinkProps> = ({\n children,\n href,\n target = '_blank',\n rel = 'noopener noreferrer',\n className = '',\n color = 'default',\n size,\n underline = true,\n onClick,\n renderLink,\n}) => {\n const colorClasses =\n color === 'dimmed'\n ? 'text-[var(--malachite-text-dimmed)] hover:text-[var(--malachite-text-primary)]'\n : 'text-[var(--malachite-text-link-foreground)] hover:text-[var(--malachite-text-link-foreground-hover)]';\n\n const fontSizeClasses = getFontSizeClass(size);\n const classes = `${underline ? 'underline' : 'no-underline'} rounded-xs cursor-pointer transition-colors duration-200 ease-in-out ${FOCUS_RING} ${colorClasses} ${fontSizeClasses} ${className}`;\n\n if (renderLink && isRootRelative(href)) {\n return renderLink({ href, className: classes, children, ...(onClick ? { onClick } : {}) });\n }\n\n return (\n <a href={href} target={target} rel={rel} className={classes} onClick={onClick}>\n {children}\n </a>\n );\n};\n\nexport default Link;\n"],"names":["getFontSizeClass","size","Link","children","href","target","rel","className","color","underline","onClick","renderLink","colorClasses","fontSizeClasses","classes","FOCUS_RING","isRootRelative","jsx"],"mappings":";;;AAoBA,MAAMA,IAAmB,CAACC,MAA4B;AAClD,MAAI,CAACA,EAAM,QAAO;AAClB,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAEaC,IAA4B,CAAC;AAAA,EACtC,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,KAAAC,IAAM;AAAA,EACN,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,MAAAP;AAAA,EACA,WAAAQ,IAAY;AAAA,EACZ,SAAAC;AAAA,EACA,YAAAC;AACJ,MAAM;AACF,QAAMC,IACFJ,MAAU,WACJ,mFACA,yGAEJK,IAAkBb,EAAiBC,CAAI,GACvCa,IAAU,GAAGL,IAAY,cAAc,cAAc,yEAAyEM,CAAU,IAAIH,CAAY,IAAIC,CAAe,IAAIN,CAAS;AAE9L,SAAII,KAAcK,EAAeZ,CAAI,IAC1BO,EAAW,EAAE,MAAAP,GAAM,WAAWU,GAAS,UAAAX,GAAU,GAAIO,IAAU,EAAE,SAAAA,EAAA,IAAY,CAAA,GAAK,IAIzF,gBAAAO,EAAC,OAAE,MAAAb,GAAY,QAAAC,GAAgB,KAAAC,GAAU,WAAWQ,GAAS,SAAAJ,GACxD,UAAAP,GACL;AAER;"}
1
+ {"version":3,"file":"Link.js","sources":["../../src/components/Link.tsx"],"sourcesContent":["import React from 'react';\nimport type { RenderLink } from './PageLayout/types';\nimport type { FontSize } from './Typography/Text';\nimport { FOCUS_RING } from './focusRing';\nimport { isRootRelative } from './safeHref';\n\nexport interface LinkProps {\n href: string;\n target?: '_blank' | '_self' | '_parent' | '_top';\n rel?: string;\n children: React.ReactNode;\n className?: string;\n color?: 'default' | 'dimmed';\n size?: FontSize;\n underline?: boolean;\n /** Lets the link shrink as a flex item and ends an overflowing label with an ellipsis; a wrapper around the link must shrink too. */\n truncate?: boolean;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n /** Renders a root-relative href through the app's router instead of a new-tab anchor, without `target` or `rel`. Other hrefs keep the anchor. */\n renderLink?: RenderLink;\n}\n\nconst TRUNCATE_CLASSES = 'inline-block max-w-full min-w-0 truncate align-bottom';\n\nconst getFontSizeClass = (size?: FontSize): string => {\n if (!size) return '';\n switch (size) {\n case 'xsmall':\n return 'text-[length:var(--malachite-font-size-xsmall)]';\n case 'small':\n return 'text-[length:var(--malachite-font-size-small)]';\n case 'medium':\n return 'text-[length:var(--malachite-font-size-medium)]';\n case 'large':\n return 'text-[length:var(--malachite-font-size-large)]';\n case 'xlarge':\n return 'text-[length:var(--malachite-font-size-xlarge)]';\n case 'xxlarge':\n return 'text-[length:var(--malachite-font-size-xxlarge)]';\n default:\n return '';\n }\n};\n\nexport const Link: React.FC<LinkProps> = ({\n children,\n href,\n target = '_blank',\n rel = 'noopener noreferrer',\n className = '',\n color = 'default',\n size,\n underline = true,\n truncate = false,\n onClick,\n renderLink,\n}) => {\n const colorClasses =\n color === 'dimmed'\n ? 'text-[var(--malachite-text-dimmed)] hover:text-[var(--malachite-text-primary)]'\n : 'text-[var(--malachite-text-link-foreground)] hover:text-[var(--malachite-text-link-foreground-hover)]';\n\n const fontSizeClasses = getFontSizeClass(size);\n const truncateClasses = truncate ? TRUNCATE_CLASSES : '';\n const classes = `${underline ? 'underline' : 'no-underline'} rounded-xs cursor-pointer transition-colors duration-200 ease-in-out ${FOCUS_RING} ${colorClasses} ${fontSizeClasses} ${truncateClasses} ${className}`;\n\n if (renderLink && isRootRelative(href)) {\n return renderLink({ href, className: classes, children, ...(onClick ? { onClick } : {}) });\n }\n\n return (\n <a href={href} target={target} rel={rel} className={classes} onClick={onClick}>\n {children}\n </a>\n );\n};\n\nexport default Link;\n"],"names":["TRUNCATE_CLASSES","getFontSizeClass","size","Link","children","href","target","rel","className","color","underline","truncate","onClick","renderLink","colorClasses","fontSizeClasses","classes","FOCUS_RING","isRootRelative","jsx"],"mappings":";;;AAsBA,MAAMA,IAAmB,yDAEnBC,IAAmB,CAACC,MAA4B;AAClD,MAAI,CAACA,EAAM,QAAO;AAClB,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAEaC,IAA4B,CAAC;AAAA,EACtC,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,KAAAC,IAAM;AAAA,EACN,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ;AAAA,EACR,MAAAP;AAAA,EACA,WAAAQ,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,SAAAC;AAAA,EACA,YAAAC;AACJ,MAAM;AACF,QAAMC,IACFL,MAAU,WACJ,mFACA,yGAEJM,IAAkBd,EAAiBC,CAAI,GAEvCc,IAAU,GAAGN,IAAY,cAAc,cAAc,yEAAyEO,CAAU,IAAIH,CAAY,IAAIC,CAAe,IADzJJ,IAAWX,IAAmB,EAC8I,IAAIQ,CAAS;AAEjN,SAAIK,KAAcK,EAAeb,CAAI,IAC1BQ,EAAW,EAAE,MAAAR,GAAM,WAAWW,GAAS,UAAAZ,GAAU,GAAIQ,IAAU,EAAE,SAAAA,EAAA,IAAY,CAAA,GAAK,IAIzF,gBAAAO,EAAC,OAAE,MAAAd,GAAY,QAAAC,GAAgB,KAAAC,GAAU,WAAWS,GAAS,SAAAJ,GACxD,UAAAR,GACL;AAER;"}
@@ -1,10 +1,11 @@
1
1
  import { EmptyLayout as o } from "./emptyLayout.js";
2
- import { RegularLayout as t } from "./regularLayout.js";
3
- import { PageActions as u } from "./regularLayout.js";
4
- const e = { Regular: t, Empty: o };
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
- u as PageActions,
7
- e as PageLayout,
8
- e as default
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":";;;AAGO,MAAMA,IAAa,EAAA,SAAEC,UAASC,EAAA;"}
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;"}
@@ -1,48 +1,42 @@
1
- import { jsx as l, jsxs as n, Fragment as P } from "react/jsx-runtime";
2
- import j from "../ActionMenu.js";
3
- import { Alert as G } from "../Alert.js";
4
- import { Breadcrumbs as L } from "../Breadcrumbs.js";
5
- import { hasBackButton as z } from "../breadcrumbsNav.js";
6
- import { Button as U } from "../Button.js";
7
- import V from "../OverflowRow.js";
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 F from "../Typography/PageTitle.js";
9
+ import U from "../Typography/PageTitle.js";
10
10
  import I from "../Typography/Text.js";
11
- import { safeHref as E } from "../safeHref.js";
12
- import { CARD_MIN_HEIGHT as K, CARD_RADIUS as W, CARD_CLASSES as q, HEADER_HEIGHT as J, DIVIDER_CLASSES as w, CONTENT_MIN_HEIGHT as Q, CONTENT_INSET_VAR as T } from "./constants.js";
13
- const X = {
14
- narrow: 520
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: Y(e)
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
- V,
26
+ z,
33
27
  {
34
28
  gap: 8,
35
29
  justify: "end",
36
30
  renderOverflow: (e) => /* @__PURE__ */ l(
37
- j,
31
+ u,
38
32
  {
39
- items: Z(
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 = E(e.href);
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
- U,
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 = [], pe = ({
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: t,
79
- description: d,
80
- buttons: o = le,
72
+ subtitle: d,
73
+ description: o,
74
+ buttons: t = le,
81
75
  loading: s = !1,
82
- children: S,
76
+ children: E,
83
77
  centered: f = !1,
84
78
  noPadding: p = !1,
85
79
  contentGap: g = "small",
86
- contentWidth: N,
80
+ contentWidth: v,
87
81
  alert: m,
88
- role: k,
89
- "aria-label": C,
90
- "aria-labelledby": H,
91
- className: A = "",
92
- style: B
82
+ role: T,
83
+ "aria-label": k,
84
+ "aria-labelledby": C,
85
+ className: S = "",
86
+ style: A
93
87
  }) => {
94
- const R = z(a), D = p ? 0 : f ? "5vh 14vw" : "40px", O = p ? "0px" : f ? "14vw" : "40px", $ = !!(s || i || t || d || o.length > 0), v = t ? s ? /* @__PURE__ */ l(h.Input, { width: 120, height: 24 }) : /* @__PURE__ */ l(I, { color: "secondary", size: "small", children: t }) : null, x = s ? /* @__PURE__ */ l(h.Input, { width: 200, height: 40 }) : i ? /* @__PURE__ */ n("div", { className: "flex items-center", style: { gap: 12 }, children: [
95
- /* @__PURE__ */ l(F, { children: i }),
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, u = d ? s ? /* @__PURE__ */ l(h.Input, { width: 120, height: 24 }) : /* @__PURE__ */ l(I, { color: "secondary", style: { lineHeight: 1.6 }, children: d }) : null, M = $ ? /* @__PURE__ */ n("div", { className: "flex flex-col", style: { gap: 12 }, children: [
98
- x || v || o.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between", style: { gap: 12 }, children: [
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
- v,
106
- x
99
+ N,
100
+ y
107
101
  ]
108
102
  }
109
103
  ),
110
- s ? null : /* @__PURE__ */ l(b, { buttons: o })
104
+ s ? null : /* @__PURE__ */ l(b, { buttons: t })
111
105
  ] }) : null,
112
- u
113
- ] }) : null, y = /* @__PURE__ */ n(P, { children: [
114
- M,
115
- S
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: `${q} ${A}`,
121
- style: { borderRadius: W, minHeight: K, ...B },
122
- role: k,
123
- "aria-label": C,
124
- "aria-labelledby": H,
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: J,
133
- paddingInlineStart: R ? 16 : 28,
126
+ height: q,
127
+ paddingInlineStart: H ? 16 : 28,
134
128
  paddingInlineEnd: 16
135
129
  },
136
130
  children: /* @__PURE__ */ l(
137
- L,
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(G, { message: m.message, type: m.type, hasMargin: !1 }) }) : null,
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: D,
155
- minHeight: Q,
156
- gap: _[g],
157
- [T]: O
148
+ padding: B,
149
+ minHeight: J,
150
+ gap: X[g],
151
+ [Q]: R
158
152
  },
159
- children: N ? /* @__PURE__ */ l(
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
- pe as RegularLayout,
181
- pe as default
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,CAAK,IAAIH,EAAO,KAAK;AAAA,IAC7B,OAAOA,EAAO;AAAA,IACd,GAAII,IAAO,EAAE,MAAAA,GAAM,QAAQJ,EAAO,UAAU,aAAa,EAAE,SAASA,EAAO,QAAA;AAAA,IAC3E,UAAUA,EAAO;AAAA,IACjB,MAAMA,EAAO;AAAA,IACb,SAASA,EAAO;AAAA,IAChB,QAAQD,EAASC,CAAM;AAAA,EAAA;AAE3B,SAAOA,EAAO,iBAAiBG,IAAQ,IACjC,CAAC,EAAE,MAAM,WAAoB,KAAK,WAAWA,CAAK,IAAIH,EAAO,KAAK,GAAA,GAAMM,CAAI,IAC5E,CAACA,CAAI;AACf,CAAC,GAYQC,IAAmD,CAAC,EAAE,SAAAL,QAC3DA,EAAQ,WAAW,IACZ,OAKP,gBAAAM,EAAC,OAAA,EAAI,WAAU,WACX,UAAA,gBAAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACG,KAAK;AAAA,IACL,SA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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,EAAO,YAAY,SAErDC,IAAc,CAACC,MACjBA,EAAQ,QAAQ,CAACF,GAAQG,MAAU;AAC/B,QAAMC,IAAOC,EAASL,EAAO,IAAI,GAC3BM,IAAuB;AAAA,IACzB,KAAK,GAAGH,CAAK,IAAIH,EAAO,KAAK;AAAA,IAC7B,OAAOA,EAAO;AAAA,IACd,GAAII,IAAO,EAAE,MAAAA,GAAM,QAAQJ,EAAO,UAAU,aAAa,EAAE,SAASA,EAAO,QAAA;AAAA,IAC3E,UAAUA,EAAO;AAAA,IACjB,MAAMA,EAAO;AAAA,IACb,SAASA,EAAO;AAAA,IAChB,QAAQD,EAASC,CAAM;AAAA,EAAA;AAE3B,SAAOA,EAAO,iBAAiBG,IAAQ,IACjC,CAAC,EAAE,MAAM,WAAoB,KAAK,WAAWA,CAAK,IAAIH,EAAO,KAAK,GAAA,GAAMM,CAAI,IAC5E,CAACA,CAAI;AACf,CAAC,GAYQC,IAAmD,CAAC,EAAE,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AiB,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
@@ -3703,6 +3703,8 @@ export declare interface LinkProps {
3703
3703
  color?: 'default' | 'dimmed';
3704
3704
  size?: FontSize;
3705
3705
  underline?: boolean;
3706
+ /** Lets the link shrink as a flex item and ends an overflowing label with an ellipsis; a wrapper around the link must shrink too. */
3707
+ truncate?: boolean;
3706
3708
  onClick?: default_2.MouseEventHandler<HTMLAnchorElement>;
3707
3709
  /** Renders a root-relative href through the app's router instead of a new-tab anchor, without `target` or `rel`. Other hrefs keep the anchor. */
3708
3710
  renderLink?: RenderLink;
@@ -4607,6 +4609,19 @@ export declare const PageActions: default_2.FC<{
4607
4609
  buttons: PageAction[];
4608
4610
  }>;
4609
4611
 
4612
+ export declare interface PageColumnProps {
4613
+ /** `narrow` fits a single-column form. */
4614
+ width: PageContentWidth;
4615
+ gap?: PageContentGap;
4616
+ /**
4617
+ * For a page rendered without `PageLayout.Regular` around it: adds 40px above and below and
4618
+ * 16px side gutters, so the column keeps clear of the viewport edges on a phone.
4619
+ */
4620
+ standalone?: boolean;
4621
+ children: default_2.ReactNode;
4622
+ className?: string;
4623
+ }
4624
+
4610
4625
  export declare type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';
4611
4626
 
4612
4627
  export declare type PageContentWidth = 'narrow';
@@ -4614,6 +4629,7 @@ export declare type PageContentWidth = 'narrow';
4614
4629
  export declare const PageLayout: {
4615
4630
  Regular: FC<RegularLayoutProps>;
4616
4631
  Empty: FC<EmptyLayoutProps>;
4632
+ Column: FC<PageColumnProps>;
4617
4633
  };
4618
4634
 
4619
4635
  declare interface PageTitleProps {