@stackone/malachite 2.135.0 → 2.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +2 -2
- package/dist/components/PageLayout/pageColumn.js +15 -14
- package/dist/components/PageLayout/pageColumn.js.map +1 -1
- package/dist/components/PageLayout/pageColumns.js.map +1 -1
- package/dist/components/PageLayout/regularLayout.js.map +1 -1
- package/dist/components/StepList.js +89 -92
- package/dist/components/StepList.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/tailwind.css.js +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. `PageLayout.Column` is the capped, centred column that `contentWidth` uses, on its own; set `standalone` for a page with no layout around it. `PageLayout.Columns` puts exactly two children side by side as equal columns and stacks them when the content area (not the viewport) is narrower than 768px; it needs a parent with a definite width, such as the page body, and always stacks inside `contentWidth="narrow"`. 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` (
|
|
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. `PageLayout.Columns` puts exactly two children side by side as equal columns and stacks them when the content area (not the viewport) is narrower than 768px; it needs a parent with a definite width, such as the page body, and always stacks inside `contentWidth="narrow"` or `"medium"`. 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` (caps and centres the header and body column: `narrow` 520px for a single-column form, `medium` 760px for wider content such as a checklist), `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` | `medium`), `gap`, `standalone`, `className`. `PageLayout.Columns`: `gap` (default `xlarge`), `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`.
|
|
@@ -102,7 +102,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
102
102
|
- **`SearchTrigger`** — A button drawn as a filled search field, for opening a command palette or search dialog from app chrome such as a sidebar. It is not an input — typing happens in what it opens. `shortcut` draws flat `<kbd>` chips at the end (not `Keycap`, whose raised shadow reads as a second button inside a filled field), kept out of the accessible name; `iconOnly` makes a 36px icon tile matching a collapsed `NavItem`, named by `label`. _Key props:_ `label` (default `Search`), `shortcut` (`ReactNode[]`), `iconOnly`, `aria-label`, `className`, plus native button attributes (`onClick`, `aria-haspopup`, `aria-expanded`, `aria-keyshortcuts`).
|
|
103
103
|
- **`FooterNav`** — Footer navigation bar of links. _Key props:_ `FooterNavLink[]`.
|
|
104
104
|
- **`FooterLinks`** — Inline list of footer links (e.g. terms, privacy, support).
|
|
105
|
-
- **`StepList`** — A numbered, vertical list of setup steps: a marker per step joined by a line that turns solid once a step is complete, each step’s title and description, and an optional trailing action such as its button. Steps are `complete` (a tick on the accent fill), `open` (an accent ring) or `locked` (dimmed). The first open step carries `aria-current="step"` and is the only one to show its `children
|
|
105
|
+
- **`StepList`** — A numbered, vertical list of setup steps: a marker per step joined by a line that turns solid once a step is complete, each step’s title and description, and an optional trailing action such as its button. Steps are `complete` (a tick on the accent fill), `open` (an accent ring) or `locked` (dimmed). The first open step carries `aria-current="step"` and is the only one to show its `children`, under the title row and across the action column, so finishing a step collapses its content and opens the next one’s; focus that an update drops from the current step moves to the step now current, else stays on that row; dropped from any other row it stays on that row, else moves to the current step; failing both it moves to the list. `variant="focused"` marks each step with a ring around a rounded square (a tick once complete, an empty dimmed ring while locked) and a "Step N" label above its title, both in the accent on the current step only, and fades every other step and every connecting line to 40%, so the current step stands out, except a complete step’s `action`, which stays live; with no current step only locked steps fade. `size="small"` is the compact list for a sidebar; `dividers` rules a line under each row for a list that fills its container. `completeLabel` shows a dot and that label, such as "Completed", in the action column of a complete step with no `action`, hidden from assistive tech, which already hears the state. For a horizontal progress readout use `Stepper`; for a clickable step header use `StepTabs`. _Key props:_ `steps` (`key`, `title`, `description`, `status`, `action`, `children`), `variant` (`numbered` | `focused`), `size`, `dividers`, `completeLabel`, `aria-label`, `aria-labelledby`, `className`.
|
|
106
106
|
- **`StepTabs`** — Header for a short, ordered flow — a two-step drawer or wizard panel. Each step is a button carrying `aria-current="step"`, not a tab: the body beneath is the step’s form, so it keeps the normal tab order instead of adopting a `tablist`’s arrow-key contract. States are current / complete (a check, still reachable so the user can go back) / upcoming. For a read-only progress readout use `Stepper`. _Key props:_ `items` (`key`, `label`, `hint`, `disabled`), `activeKey`, `completedKeys`, `onChange`, `aria-label`, `aria-labelledby`, `className`.
|
|
107
107
|
- **`CommandPalette`** — Chrome for a command palette, over a headless library that keeps its own elements. `FieldRow`/`Field` take the query input, `List` the scrolling viewport (with a bottom fade for `hasMoreBelow`), `Group` + `Heading` a titled section, and `Row` one result — composing leading/label/tags/crumb/meta/status/hint so names start and statuses end on the same x down the list. `Message` covers empty and loading, `Legend` documents the scope sigils, `Footer` the key hints. Everything the library owns is taken through `asChild`, so its role, id, state and handlers are untouched.
|
|
108
108
|
- **`Keycap`** — One key on a keyboard, drawn as a cap — `esc`, `⌘`, a caret, or a sigil a user types to scope a search. Renders a `<kbd>`, or a button as soon as either `onClick` or `disabled` is passed — `disabled={false}` included, since naming the prop at all is the statement that the cap is a control. `SidePanelNavFooter` is built on it.
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { CONTENT_GAPS as
|
|
3
|
-
const
|
|
4
|
-
narrow: 520
|
|
5
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { CONTENT_GAPS as t, CONTENT_INSET_VAR as x } from "./constants.js";
|
|
3
|
+
const a = {
|
|
4
|
+
narrow: 520,
|
|
5
|
+
medium: 760
|
|
6
|
+
}, s = 40, T = 16, p = ({
|
|
6
7
|
width: l,
|
|
7
8
|
gap: o,
|
|
8
9
|
standalone: N = !1,
|
|
9
|
-
children:
|
|
10
|
-
className:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
10
|
+
children: e,
|
|
11
|
+
className: i = ""
|
|
12
|
+
}) => /* @__PURE__ */ m(
|
|
12
13
|
"div",
|
|
13
14
|
{
|
|
14
|
-
className: `flex flex-col flex-1 w-full ${
|
|
15
|
+
className: `flex flex-col flex-1 w-full ${i}`,
|
|
15
16
|
style: {
|
|
16
|
-
maxWidth:
|
|
17
|
+
maxWidth: a[l],
|
|
17
18
|
marginInline: "auto",
|
|
18
|
-
gap: o ?
|
|
19
|
-
padding: N ? `${
|
|
20
|
-
[
|
|
19
|
+
gap: o ? t[o] : void 0,
|
|
20
|
+
padding: N ? `${s}px ${T}px` : void 0,
|
|
21
|
+
[x]: N ? `${T}px` : "0px"
|
|
21
22
|
},
|
|
22
|
-
children:
|
|
23
|
+
children: e
|
|
23
24
|
}
|
|
24
25
|
);
|
|
25
26
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageColumn.js","sources":["../../../src/components/PageLayout/pageColumn.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTENT_GAPS, 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\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","STANDALONE_BLOCK_PADDING","STANDALONE_GUTTER","PageColumn","width","gap","standalone","children","className","jsx","CONTENT_GAPS","CONTENT_INSET_VAR"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"pageColumn.js","sources":["../../../src/components/PageLayout/pageColumn.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTENT_GAPS, CONTENT_INSET_VAR } from './constants';\n\nexport type PageContentGap = 'small' | 'medium' | 'large' | 'xlarge';\n\nexport type PageContentWidth = 'narrow' | 'medium';\n\n// Both stay under COLUMNS_STACK_BELOW_PX, which the Columns doc relies on; PageLayout.spec pins it.\nconst CONTENT_WIDTHS: Record<PageContentWidth, number> = {\n narrow: 520,\n medium: 760,\n};\n\nconst STANDALONE_BLOCK_PADDING = 40;\nconst STANDALONE_GUTTER = 16;\n\nexport interface PageColumnProps {\n /** `narrow` fits a single-column form; `medium` wider content, such as a checklist. */\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","STANDALONE_BLOCK_PADDING","STANDALONE_GUTTER","PageColumn","width","gap","standalone","children","className","jsx","CONTENT_GAPS","CONTENT_INSET_VAR"],"mappings":";;AAQA,MAAMA,IAAmD;AAAA,EACrD,QAAQ;AAAA,EACR,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,UAAUR,EAAeI,CAAK;AAAA,MAC9B,cAAc;AAAA,MACd,KAAKC,IAAMK,EAAaL,CAAG,IAAI;AAAA,MAC/B,SAASC,IACH,GAAGL,CAAwB,MAAMC,CAAiB,OAClD;AAAA,MACN,CAACS,CAAiB,GAAGL,IAAa,GAAGJ,CAAiB,OAAO;AAAA,IAAA;AAAA,IAIpE,UAAAK;AAAA,EAAA;AACL;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageColumns.js","sources":["../../../src/components/PageLayout/pageColumns.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTENT_GAPS, CONTENT_INSET_VAR } from './constants';\nimport type { PageContentGap } from './pageColumn';\n\nexport interface PageColumnsProps {\n /** Space between the columns, and between them once stacked. Defaults to `xlarge`. */\n gap?: PageContentGap;\n /** Exactly two children, one per column; a third wraps onto a new row. */\n children: React.ReactNode;\n className?: string;\n}\n\n/**\n * Two equal columns that stack into one when the content area, not the viewport, is narrower\n * than 768px, so a page beside the app sidebar stacks at the width it actually has. Needs a\n * parent with a definite width, such as a page body: it measures its container, so inside a\n * box that sizes to its content it collapses.
|
|
1
|
+
{"version":3,"file":"pageColumns.js","sources":["../../../src/components/PageLayout/pageColumns.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTENT_GAPS, CONTENT_INSET_VAR } from './constants';\nimport type { PageContentGap } from './pageColumn';\n\nexport interface PageColumnsProps {\n /** Space between the columns, and between them once stacked. Defaults to `xlarge`. */\n gap?: PageContentGap;\n /** Exactly two children, one per column; a third wraps onto a new row. */\n children: React.ReactNode;\n className?: string;\n}\n\n/**\n * Two equal columns that stack into one when the content area, not the viewport, is narrower\n * than 768px, so a page beside the app sidebar stacks at the width it actually has. Needs a\n * parent with a definite width, such as a page body: it measures its container, so inside a\n * box that sizes to its content it collapses. Always stacks in `contentWidth` narrow or medium.\n */\n/** The content width below which `PageLayout.Columns` stacks; matches its container query. */\nexport const COLUMNS_STACK_BELOW_PX = 768;\n\nconst PageColumns: React.FC<PageColumnsProps> = ({ gap = 'xlarge', children, className = '' }) => (\n <div\n className={`@container w-full ${className}`}\n style={{ [CONTENT_INSET_VAR]: '0px' } as React.CSSProperties}\n >\n <div\n className=\"grid grid-cols-1 items-start @[768px]:grid-cols-2\"\n style={{ gap: CONTENT_GAPS[gap] }}\n >\n {children}\n </div>\n </div>\n);\n\nexport default PageColumns;\nexport { PageColumns };\n"],"names":["PageColumns","gap","children","className","jsx","CONTENT_INSET_VAR","CONTENT_GAPS"],"mappings":";;AAqBA,MAAMA,IAA0C,CAAC,EAAE,KAAAC,IAAM,UAAU,UAAAC,GAAU,WAAAC,IAAY,SACrF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qBAAqBD,CAAS;AAAA,IACzC,OAAO,EAAE,CAACE,CAAiB,GAAG,MAAA;AAAA,IAE9B,UAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,OAAO,EAAE,KAAKE,EAAaL,CAAG,EAAA;AAAA,QAE7B,UAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACL;AACJ;"}
|
|
@@ -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_GAPS,\n CONTENT_INSET_VAR,\n CONTENT_MIN_HEIGHT,\n DIVIDER_CLASSES,\n HEADER_HEIGHT,\n} from './constants';\nimport { 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":";;;;;;;;;;;;;AAuDA,MAAMA,IAAW,CAACC,MACdA,EAAO,YAAY,iBAAiBA,EAAO,YAAY,SAErDC,IAAc,CAACC,MACjBA,EAAQ,QAAQ,CAACF,GAAQG,MAAU;AAC/B,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YC;AAAA,MACZ,mBAAiBC;AAAA,MACjB,aAAWT,KAAW;AAAA,MAEtB,UAAA;AAAA,QAAA,gBAAAhB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,qBAAqB6C,CAAe;AAAA,YAC/C,OAAO;AAAA,cACH,QAAQC;AAAA,cACR,oBAAoBlB,IAAU,KAAK;AAAA,cACnC,kBAAkB;AAAA,YAAA;AAAA,YAGtB,UAAA,gBAAA5B;AAAA,cAAC+C;AAAA,cAAA;AAAA,gBACG,OAAOtC;AAAA,gBACP,SAASC;AAAA,gBACT,YAAAC;AAAA,gBACA,cAAcC,KAAS,CAACI,IAAU,SAAY;AAAA,gBAC9C,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACd;AAAA,QAAA;AAAA,QAGHM,sBACI,OAAA,EAAI,WAAWuB,GAAiB,OAAO,EAAE,SAAS,YAAA,GAC/C,4BAACG,GAAA,EAAM,SAAS1B,EAAM,SAAS,MAAMA,EAAM,MAAM,WAAW,IAAO,EAAA,CACvE,IACA;AAAA,QAEJ,gBAAAtB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,OACI;AAAA,cACI,SAAS8B;AAAA,cACT,WAAWmB;AAAA,cACX,KAAKC,EAAa9B,CAAU;AAAA,cAC5B,CAAC+B,CAAiB,GAAGpB;AAAA,YAAA;AAAA,YAI5B,UAAAV,sBACI+B,GAAA,EAAW,OAAO/B,GAAc,KAAKD,GACjC,aACL,IAEAoB;AAAA,UAAA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
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_GAPS,\n CONTENT_INSET_VAR,\n CONTENT_MIN_HEIGHT,\n DIVIDER_CLASSES,\n HEADER_HEIGHT,\n} from './constants';\nimport { 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 form, `medium` a checklist. */\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":";;;;;;;;;;;;;AAuDA,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,GAC3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aAAWT,KAAW;AAAA,MAEtB,UAAA;AAAA,QAAA,gBAAAhB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,qBAAqB6C,CAAe;AAAA,YAC/C,OAAO;AAAA,cACH,QAAQC;AAAA,cACR,oBAAoBlB,IAAU,KAAK;AAAA,cACnC,kBAAkB;AAAA,YAAA;AAAA,YAGtB,UAAA,gBAAA5B;AAAA,cAAC+C;AAAA,cAAA;AAAA,gBACG,OAAOtC;AAAA,gBACP,SAASC;AAAA,gBACT,YAAAC;AAAA,gBACA,cAAcC,KAAS,CAACI,IAAU,SAAY;AAAA,gBAC9C,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACd;AAAA,QAAA;AAAA,QAGHM,sBACI,OAAA,EAAI,WAAWuB,GAAiB,OAAO,EAAE,SAAS,YAAA,GAC/C,4BAACG,GAAA,EAAM,SAAS1B,EAAM,SAAS,MAAMA,EAAM,MAAM,WAAW,IAAO,EAAA,CACvE,IACA;AAAA,QAEJ,gBAAAtB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAU;AAAA,YACV,OACI;AAAA,cACI,SAAS8B;AAAA,cACT,WAAWmB;AAAA,cACX,KAAKC,EAAa9B,CAAU;AAAA,cAC5B,CAAC+B,CAAiB,GAAGpB;AAAA,YAAA;AAAA,YAI5B,UAAAV,sBACI+B,GAAA,EAAW,OAAO/B,GAAc,KAAKD,GACjC,aACL,IAEAoB;AAAA,UAAA;AAAA,QAAA;AAAA,MAER;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1,196 +1,193 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as c, Fragment as j, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import B, { useRef as z } from "react";
|
|
3
|
+
import $ from "./CustomIcons/CheckmarkIcon.js";
|
|
4
4
|
import f from "./Typography/Text.js";
|
|
5
|
-
import { isFocusDropped as
|
|
6
|
-
import { isRenderableNode as
|
|
7
|
-
const
|
|
8
|
-
medium: { padding: { x: 28, y: 16 }, title: "medium", description: "small", childrenGap:
|
|
9
|
-
small: { padding: { x: 20, y: 12 }, title: "small", description: "xsmall", childrenGap:
|
|
10
|
-
},
|
|
5
|
+
import { isFocusDropped as G, focusSection as U, holdsFocus as H } from "./collapseFocus.js";
|
|
6
|
+
import { isRenderableNode as g } from "./renderableNode.js";
|
|
7
|
+
const s = 24, I = 1, W = {
|
|
8
|
+
medium: { padding: { x: 28, y: 16 }, title: "medium", description: "small", childrenGap: 12 },
|
|
9
|
+
small: { padding: { x: 20, y: 12 }, title: "small", description: "xsmall", childrenGap: 8 }
|
|
10
|
+
}, K = {
|
|
11
11
|
complete: "Completed",
|
|
12
12
|
open: void 0,
|
|
13
13
|
locked: "Locked"
|
|
14
|
-
},
|
|
15
|
-
insetInlineStart: t.x +
|
|
16
|
-
top: t.y +
|
|
17
|
-
height: `calc(100% - ${
|
|
18
|
-
}),
|
|
14
|
+
}, Z = (t, r) => ({
|
|
15
|
+
insetInlineStart: t.x + s / 2 - 1,
|
|
16
|
+
top: t.y + s,
|
|
17
|
+
height: `calc(100% - ${s - (r ? I : 0)}px)`
|
|
18
|
+
}), A = "var(--malachite-card-border, rgb(232, 232, 232))", T = "var(--malachite-accent-background, rgb(0, 175, 102))", P = "var(--malachite-accent-foreground, rgb(2, 122, 66))", b = "var(--malachite-text-secondary, rgb(123, 123, 123))", V = "var(--malachite-text-dimmed, rgb(161, 161, 161))", D = 0.4, Y = (t) => `repeating-linear-gradient(to bottom, ${t} 0px, ${t} 4px, transparent 4px, transparent 8px)`, q = {
|
|
19
19
|
complete: "bg-[var(--malachite-accent-background,rgb(0,175,102))] text-white",
|
|
20
20
|
open: "border-[1.5px] border-solid border-[var(--malachite-accent-background,rgb(0,175,102))] bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-accent-foreground,rgb(2,122,66))]",
|
|
21
21
|
locked: "border-[1.5px] border-solid border-[var(--malachite-text-dimmed,rgb(153,153,153))] bg-[var(--malachite-card-background,rgb(255,255,255))] text-[var(--malachite-text-dimmed,rgb(153,153,153))]"
|
|
22
|
-
},
|
|
22
|
+
}, J = ({
|
|
23
23
|
status: t,
|
|
24
24
|
color: r,
|
|
25
|
-
opacity:
|
|
26
|
-
}) => /* @__PURE__ */
|
|
25
|
+
opacity: a
|
|
26
|
+
}) => /* @__PURE__ */ c(
|
|
27
27
|
"span",
|
|
28
28
|
{
|
|
29
29
|
"aria-hidden": "true",
|
|
30
|
-
className: "relative z-[2] box-border flex
|
|
31
|
-
style: { width:
|
|
30
|
+
className: "relative z-[2] box-border flex items-center justify-center rounded-full border-[1.5px] border-solid bg-[var(--malachite-card-background,rgb(255,255,255))]",
|
|
31
|
+
style: { width: s, height: s, borderColor: r, color: r, opacity: a },
|
|
32
32
|
children: [
|
|
33
|
-
t === "complete" && /* @__PURE__ */
|
|
34
|
-
t === "open" && /* @__PURE__ */
|
|
33
|
+
t === "complete" && /* @__PURE__ */ o($, { size: 12 }),
|
|
34
|
+
t === "open" && /* @__PURE__ */ o("span", { className: "size-[10px] rounded-[3px]", style: { background: r } })
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
|
-
),
|
|
38
|
-
(r) => r instanceof HTMLElement &&
|
|
37
|
+
), Q = (t, r) => r ? T : t === "locked" ? V : b, X = (t) => Array.from(t.children).find(
|
|
38
|
+
(r) => r instanceof HTMLElement && H(r, t.getRootNode())
|
|
39
39
|
);
|
|
40
|
-
class
|
|
40
|
+
class ee extends B.Component {
|
|
41
41
|
getSnapshotBeforeUpdate() {
|
|
42
|
-
const r = this.props.listRef.current,
|
|
43
|
-
return
|
|
42
|
+
const r = this.props.listRef.current, a = r ? X(r) : void 0;
|
|
43
|
+
return a ? { row: a, wasCurrent: a === this.props.currentRef.current } : null;
|
|
44
44
|
}
|
|
45
|
-
componentDidUpdate(r,
|
|
46
|
-
if (!
|
|
45
|
+
componentDidUpdate(r, a, d) {
|
|
46
|
+
if (!d || !G(d.row.ownerDocument))
|
|
47
47
|
return;
|
|
48
|
-
const { row:
|
|
49
|
-
(
|
|
48
|
+
const { row: p, wasCurrent: x } = d, h = this.props.currentRef.current, n = [...x ? [h, p] : [p, h], this.props.listRef.current].find(
|
|
49
|
+
(m) => m == null ? void 0 : m.isConnected
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
U(null, n ?? null, { preventScroll: !1 });
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const te = (t, r) => t.key ?? `#${r}`, le = ({
|
|
58
58
|
steps: t,
|
|
59
59
|
size: r = "medium",
|
|
60
|
-
variant:
|
|
61
|
-
dividers:
|
|
62
|
-
completeLabel:
|
|
60
|
+
variant: a = "numbered",
|
|
61
|
+
dividers: d = !1,
|
|
62
|
+
completeLabel: p,
|
|
63
63
|
"aria-label": x,
|
|
64
64
|
"aria-labelledby": h,
|
|
65
|
-
className:
|
|
65
|
+
className: k = ""
|
|
66
66
|
}) => {
|
|
67
|
-
const n =
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
] }), M = t.some(
|
|
71
|
-
(e) =>
|
|
72
|
-
)
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
67
|
+
const n = W[r], m = z(null), R = z(null), C = t.findIndex((e) => e.status === "open"), i = a === "focused", N = i && C !== -1, _ = i ? b : A, L = i ? b : T, v = (e) => !!p && e.status === "complete" && !g(e.action), F = /* @__PURE__ */ c("span", { "aria-hidden": "true", className: "flex items-center gap-[6px]", children: [
|
|
68
|
+
/* @__PURE__ */ o("span", { className: "size-[8px] shrink-0 rounded-full bg-[var(--malachite-text-success,rgb(2,122,66))]" }),
|
|
69
|
+
/* @__PURE__ */ o(f, { size: "small", fontWeight: "semi-bold", color: "success", children: p })
|
|
70
|
+
] }), M = (e, l) => e.status === "complete" && !v(e) ? void 0 : l, S = t.some(
|
|
71
|
+
(e) => g(e.action) || v(e)
|
|
72
|
+
), O = `${s}px minmax(0, 1fr)${S ? " auto" : ""}`;
|
|
73
|
+
return /* @__PURE__ */ c(j, { children: [
|
|
74
|
+
/* @__PURE__ */ o(
|
|
75
75
|
"ol",
|
|
76
76
|
{
|
|
77
|
-
ref:
|
|
77
|
+
ref: m,
|
|
78
78
|
role: "list",
|
|
79
79
|
"aria-label": x,
|
|
80
80
|
"aria-labelledby": h,
|
|
81
|
-
className: `isolate m-0 list-none p-0 ${
|
|
82
|
-
children: t.map((e,
|
|
83
|
-
const
|
|
84
|
-
return /* @__PURE__ */
|
|
81
|
+
className: `isolate m-0 list-none p-0 ${k}`,
|
|
82
|
+
children: t.map((e, l) => {
|
|
83
|
+
const u = l === C, w = !i && e.status === "locked", E = K[e.status], y = i && (N && !u || e.status === "locked") ? D : void 0;
|
|
84
|
+
return /* @__PURE__ */ c(
|
|
85
85
|
"li",
|
|
86
86
|
{
|
|
87
|
-
ref:
|
|
88
|
-
"aria-current":
|
|
87
|
+
ref: u ? R : void 0,
|
|
88
|
+
"aria-current": u ? "step" : void 0,
|
|
89
89
|
style: {
|
|
90
90
|
padding: `${n.padding.y}px ${n.padding.x}px`,
|
|
91
|
-
borderBottom:
|
|
91
|
+
borderBottom: d ? `${I}px solid ${A}` : void 0,
|
|
92
|
+
gridTemplateColumns: O,
|
|
93
|
+
rowGap: n.childrenGap
|
|
92
94
|
},
|
|
93
|
-
className: "relative
|
|
95
|
+
className: "relative grid items-start gap-x-[12px]",
|
|
94
96
|
children: [
|
|
95
|
-
|
|
97
|
+
l < t.length - 1 && /* @__PURE__ */ o(
|
|
96
98
|
"span",
|
|
97
99
|
{
|
|
98
100
|
"aria-hidden": "true",
|
|
99
101
|
className: "absolute z-[1] w-[2px]",
|
|
100
102
|
style: {
|
|
101
|
-
...
|
|
102
|
-
background: e.status === "complete" ?
|
|
103
|
-
opacity: N ?
|
|
103
|
+
...Z(n.padding, d),
|
|
104
|
+
background: e.status === "complete" ? L : Y(_),
|
|
105
|
+
opacity: N ? D : void 0
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
i ? /* @__PURE__ */ o(
|
|
110
|
+
J,
|
|
109
111
|
{
|
|
110
112
|
status: e.status,
|
|
111
|
-
color:
|
|
113
|
+
color: Q(e.status, u),
|
|
112
114
|
opacity: y
|
|
113
115
|
}
|
|
114
|
-
) : /* @__PURE__ */
|
|
116
|
+
) : /* @__PURE__ */ o(
|
|
115
117
|
"span",
|
|
116
118
|
{
|
|
117
119
|
"aria-hidden": "true",
|
|
118
|
-
className: `relative z-[2] box-border flex
|
|
119
|
-
style: { width:
|
|
120
|
-
children: e.status === "complete" ? /* @__PURE__ */
|
|
120
|
+
className: `relative z-[2] box-border flex items-center justify-center rounded-full text-[length:var(--malachite-font-size-xsmall,11px)] [font-weight:600] ${q[e.status]}`,
|
|
121
|
+
style: { width: s, height: s },
|
|
122
|
+
children: e.status === "complete" ? /* @__PURE__ */ o($, { size: 12 }) : l + 1
|
|
121
123
|
}
|
|
122
124
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ c(
|
|
124
126
|
"div",
|
|
125
127
|
{
|
|
126
|
-
className: "flex min-w-0 flex-
|
|
128
|
+
className: "flex min-w-0 flex-col gap-[2px] pt-[2px]",
|
|
127
129
|
style: { opacity: y },
|
|
128
130
|
children: [
|
|
129
|
-
|
|
131
|
+
i && /* @__PURE__ */ o(
|
|
130
132
|
"div",
|
|
131
133
|
{
|
|
132
134
|
"aria-hidden": "true",
|
|
133
|
-
style: { color:
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
+
style: { color: u ? P : b },
|
|
136
|
+
children: /* @__PURE__ */ c(f, { size: "xsmall", fontWeight: "semi-bold", color: "inherit", children: [
|
|
135
137
|
"Step ",
|
|
136
|
-
|
|
138
|
+
l + 1
|
|
137
139
|
] })
|
|
138
140
|
}
|
|
139
141
|
),
|
|
140
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ c(
|
|
141
143
|
f,
|
|
142
144
|
{
|
|
143
145
|
size: n.title,
|
|
144
146
|
fontWeight: "semi-bold",
|
|
145
|
-
color:
|
|
147
|
+
color: w ? "dimmed" : "primary",
|
|
146
148
|
children: [
|
|
147
149
|
e.title,
|
|
148
|
-
|
|
150
|
+
E && /* @__PURE__ */ c("span", { className: "sr-only", children: [
|
|
149
151
|
", ",
|
|
150
|
-
|
|
152
|
+
E
|
|
151
153
|
] })
|
|
152
154
|
]
|
|
153
155
|
}
|
|
154
156
|
),
|
|
155
|
-
|
|
157
|
+
g(e.description) && /* @__PURE__ */ o(
|
|
156
158
|
f,
|
|
157
159
|
{
|
|
158
160
|
size: n.description,
|
|
159
|
-
color:
|
|
161
|
+
color: w ? "dimmed" : "secondary",
|
|
160
162
|
children: e.description
|
|
161
163
|
}
|
|
162
|
-
),
|
|
163
|
-
m && b(e.children) && /* @__PURE__ */ a(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
className: "min-w-0",
|
|
167
|
-
style: { marginTop: n.childrenGap },
|
|
168
|
-
children: e.children
|
|
169
|
-
}
|
|
170
164
|
)
|
|
171
165
|
]
|
|
172
166
|
}
|
|
173
167
|
),
|
|
174
|
-
|
|
168
|
+
S && /* @__PURE__ */ o(
|
|
175
169
|
"span",
|
|
176
170
|
{
|
|
177
171
|
className: "ml-[16px] flex min-w-[120px] items-center justify-end",
|
|
178
|
-
style: {
|
|
179
|
-
|
|
172
|
+
style: {
|
|
173
|
+
opacity: M(e, y)
|
|
174
|
+
},
|
|
175
|
+
children: v(e) ? F : e.action
|
|
180
176
|
}
|
|
181
|
-
)
|
|
177
|
+
),
|
|
178
|
+
u && g(e.children) && /* @__PURE__ */ o("div", { className: "min-w-0", style: { gridColumn: "2 / -1" }, children: e.children })
|
|
182
179
|
]
|
|
183
180
|
},
|
|
184
|
-
|
|
181
|
+
te(e, l)
|
|
185
182
|
);
|
|
186
183
|
})
|
|
187
184
|
}
|
|
188
185
|
),
|
|
189
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ o(ee, { listRef: m, currentRef: R })
|
|
190
187
|
] });
|
|
191
188
|
};
|
|
192
189
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
le as StepList,
|
|
191
|
+
le as default
|
|
195
192
|
};
|
|
196
193
|
//# sourceMappingURL=StepList.js.map
|