@stackone/malachite 2.95.1 → 2.97.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
@@ -68,6 +68,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
68
68
  - **`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`).
69
69
  - **`FooterNav`** — Footer navigation bar of links. _Key props:_ `FooterNavLink[]`.
70
70
  - **`FooterLinks`** — Inline list of footer links (e.g. terms, privacy, support).
71
+ - **`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"`. `size="small"` is the compact list for a sidebar; `dividers` rules a line under each row for a list that fills its container. For a horizontal progress readout use `Stepper`; for a clickable step header use `StepTabs`. _Key props:_ `steps` (`key`, `title`, `description`, `status`, `action`), `size`, `dividers`, `aria-label`, `aria-labelledby`, `className`.
71
72
  - **`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`.
72
73
  - **`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.
73
74
  - **`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.
@@ -114,6 +115,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
114
115
  - **`LevelMeter`** — Rising bars, shortest first, that picture how much of a scale is on — an access level in a level menu or on a level chip. Each step is `on` (a solid accent-green bar), `partial` (a green outline over a faint tint, for a step only some of whose actions are on) or `off` (an empty grey outline); every step keeps 3:1 against the surface, and colours come from the theme. Styled inline so it still draws inside an `ActionMenu`, which portals outside the shadow root and its stylesheet. Beside text that already names the level it is decorative and hidden from assistive tech; give it a `label` only when it stands alone and it reads as an image of that name. As an `ActionMenu` item `icon` or a `Button` `icon`, leave `label` off: the icon joins the item name, and the text already says the level. _Key props:_ `steps` (`LevelMeterStep[]`: `on` | `partial` | `off`), `label`, `className`.
115
116
  - **`TimeBarChart`** — Counts per time bucket as stacked bars on a UTC axis, the request-volume chart above a log list. Every bucket in `range` takes a slot whether or not it has data, so gaps read as gaps; a zone-less time string is read as UTC. Hover or arrow-key through buckets for a tooltip listing every series and the total; `highlightTime` shades the bucket holding a time from elsewhere on the page, such as the hovered log row. With `onRangeSelect`, dragging across bars reports the whole buckets covered, `end` exclusive so it goes straight back in as `range`, and whether the selection takes in the last bucket. `loading` dims bars already drawn rather than replacing them, and shows a spinner only when there is nothing to dim. Series colours follow the theme’s status tokens by `tone`, and failures always stack above successes whatever order `series` comes in, so position separates them where colour alone might not; a legend names them unless `legend={false}`. A visually hidden table carries the same numbers for screen readers. _Key props:_ `series` (`{ key, label, tone }[]`, stacked by tone with `error` on top; `TimeBarChartTone`: `success` | `error` | `neutral`), `buckets` (`{ start, values }[]`), `interval` (`{ unit, step }`; `TimeBarChartUnit`: `minute` | `hour` | `day` | `week` | `month`), `range` (`end` exclusive, as a selection reports it; at most 2,000 buckets, the newest kept), `TimeBarChartSize` (`small` | `medium` | `large`), `loading`, `error`, `errorTitle`, `errorSubTitle`, `valueLabel`, `legend`, `highlightTime`, `onRangeSelect`, `aria-label`, `aria-labelledby`, `className`, `style`.
116
117
  - **`TimeBarChartSwatch`** — The mark a `TimeBarChart` draws a series in, by its `tone`, for naming the series somewhere other than the chart's legend, such as a count beside the chart standing in for it. It matches the legend and the tooltip, and the bars draw the same colour at 40%; it follows the theme with them. Decorative: the label beside it does the naming. _Key props:_ `tone` (`TimeBarChartTone`).
118
+ - **`Timeline`** — A vertical sequence of steps as an ordered list (`Timeline.Item`): a dot on a connecting line, a title, its timing at the right and a free-form body below, such as what happened to one API call. The dot is painted by `tone` from the theme’s text tokens (`neutral` is secondary text, the rest their status colours), or replaced by a decorative `marker` such as the caller’s logo. `stopped` puts an error badge (`stoppedLabel`, default "Stopped here") after the title of the step a flow ended on and paints its dot `error` unless a `tone` is set; the line ends at the last item. For steps a person works through (complete, open, locked) use `StepList`. _Key props:_ `aria-label`, `aria-labelledby`; on `Timeline.Item`: `title`, `time`, `tone` (`TimelineTone`: `neutral` | `info` | `success` | `warning` | `error`), `marker` (fills the 24px circle in place of the ringed dot), `stopped`, `stoppedLabel`.
117
119
  - **`Table`** — Data table with columns, sizing, pagination and row selection. `column.align` places a column's header as well as its cells. What lands on the aligned edge is the last thing in the header row rather than the title: the sort caret on a sortable column, the info icon on one carrying `info` without a sorter. `headerVariant` picks the header layout, and only `inline` lines header and body up exactly, because both are cells of one `<table>`. `detached` builds them from flex rows, where a sortable header cell is 32px narrower than a non-sortable one — its padding sits on the inner button rather than on the flex item — so its header cells sit 15–17px off their column at any alignment; reach for `inline` where exact alignment matters. Sorting is internal, so the array passed as `data` is not the order rendered once a column is sorted: `onVisibleOrderChange` reports the rows in render order — the whole of `data`, compared by `rowKey` so an equal order never re-fires — for a consumer stepping a master-detail view the way the user sees it. On the detached header, `title`, `subtitle` and `extra` add a title row on the frame above the column headers, the row a `framed` `Card` draws, and it docks with them under `stickyHeaderTop` (with `showHeader={false}` nothing docks and it scrolls with the rows). The inline header has no frame, so it draws none of the three and warns in development. _Key props:_ `TableColumns` (incl. `align`), `TableSize`, `TableType`, `TableRowSelection`, `TablePaginationPosition` (`pagination.position`, in antd naming: a pager on each edge named, aligned as named, 16px from the rows; bottom right by default), `headerVariant`, `title`, `subtitle`, `extra`, `onVisibleOrderChange`, `scrollHeight` (a height, or `"fill"` for the room left in its scroller once the content above and below it fits, so the page itself never scrolls).
118
120
  - **`Statistic`** — Displays a statistic value with a label; primary/secondary sizes. _Key props:_ `StatisticValueSize`.
119
121
  - **`Avatar`** — Logo/initial avatar. Renders the image when available, otherwise a coloured tile with the first letter of `name`, or with `fallback="placeholder"` the generic "no logo available" tile. Encapsulates the fallback colour. _Key props:_ `src`, `name`, `size`, `shape="square" | "circle"`, `fallback="initial" | "placeholder"`.
@@ -0,0 +1,109 @@
1
+ import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
+ import k from "./CustomIcons/CheckmarkIcon.js";
3
+ import p from "./Typography/Text.js";
4
+ import { isRenderableNode as b } from "./renderableNode.js";
5
+ const i = 24, x = 1, v = {
6
+ medium: { padding: { x: 28, y: 16 }, title: "medium", description: "small" },
7
+ small: { padding: { x: 20, y: 12 }, title: "small", description: "xsmall" }
8
+ }, S = {
9
+ complete: "Completed",
10
+ open: void 0,
11
+ locked: "Locked"
12
+ }, E = (t, r) => ({
13
+ insetInlineStart: t.x + i / 2 - 1,
14
+ top: t.y + i,
15
+ height: `calc(100% - ${i - (r ? x : 0)}px)`
16
+ }), c = "var(--malachite-card-border, rgb(232, 232, 232))", $ = "var(--malachite-accent-background, rgb(0, 175, 102))", N = `repeating-linear-gradient(to bottom, ${c} 0px, ${c} 4px, transparent 4px, transparent 8px)`, A = {
17
+ complete: "bg-[var(--malachite-accent-background,rgb(0,175,102))] text-white",
18
+ 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))]",
19
+ 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))]"
20
+ }, I = (t, r) => t.key ?? `#${r}`, L = ({
21
+ steps: t,
22
+ size: r = "medium",
23
+ dividers: s = !1,
24
+ "aria-label": g,
25
+ "aria-labelledby": h,
26
+ className: u = ""
27
+ }) => {
28
+ const o = v[r], f = t.findIndex((e) => e.status === "open"), y = t.some((e) => b(e.action));
29
+ return (
30
+ // `role="list"`: Safari drops the list role from a list styled `list-none`.
31
+ /* @__PURE__ */ a(
32
+ "ol",
33
+ {
34
+ role: "list",
35
+ "aria-label": g,
36
+ "aria-labelledby": h,
37
+ className: `isolate m-0 list-none p-0 ${u}`,
38
+ children: t.map((e, l) => {
39
+ const d = e.status === "locked", m = S[e.status];
40
+ return /* @__PURE__ */ n(
41
+ "li",
42
+ {
43
+ "aria-current": l === f ? "step" : void 0,
44
+ style: {
45
+ padding: `${o.padding.y}px ${o.padding.x}px`,
46
+ borderBottom: s ? `${x}px solid ${c}` : void 0
47
+ },
48
+ className: "relative flex items-start gap-[12px]",
49
+ children: [
50
+ l < t.length - 1 && /* @__PURE__ */ a(
51
+ "span",
52
+ {
53
+ "aria-hidden": "true",
54
+ className: "absolute z-[1] w-[2px]",
55
+ style: {
56
+ ...E(o.padding, s),
57
+ background: e.status === "complete" ? $ : N
58
+ }
59
+ }
60
+ ),
61
+ /* @__PURE__ */ a(
62
+ "span",
63
+ {
64
+ "aria-hidden": "true",
65
+ className: `relative z-[2] box-border flex shrink-0 items-center justify-center rounded-full text-[length:var(--malachite-font-size-xsmall,11px)] [font-weight:600] ${A[e.status]}`,
66
+ style: { width: i, height: i },
67
+ children: e.status === "complete" ? /* @__PURE__ */ a(k, { size: 12 }) : l + 1
68
+ }
69
+ ),
70
+ /* @__PURE__ */ n("span", { className: "flex min-w-0 flex-1 flex-col gap-[2px] pt-[2px]", children: [
71
+ /* @__PURE__ */ n(
72
+ p,
73
+ {
74
+ size: o.title,
75
+ fontWeight: "semi-bold",
76
+ color: d ? "dimmed" : "primary",
77
+ children: [
78
+ e.title,
79
+ m && /* @__PURE__ */ n("span", { className: "sr-only", children: [
80
+ ", ",
81
+ m
82
+ ] })
83
+ ]
84
+ }
85
+ ),
86
+ b(e.description) && /* @__PURE__ */ a(
87
+ p,
88
+ {
89
+ size: o.description,
90
+ color: d ? "dimmed" : "secondary",
91
+ children: e.description
92
+ }
93
+ )
94
+ ] }),
95
+ y && /* @__PURE__ */ a("span", { className: "ml-[16px] flex min-w-[120px] items-center justify-end", children: e.action })
96
+ ]
97
+ },
98
+ I(e, l)
99
+ );
100
+ })
101
+ }
102
+ )
103
+ );
104
+ };
105
+ export {
106
+ L as StepList,
107
+ L as default
108
+ };
109
+ //# sourceMappingURL=StepList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepList.js","sources":["../../src/components/StepList.tsx"],"sourcesContent":["import type React from 'react';\nimport CheckmarkIcon from './CustomIcons/CheckmarkIcon';\nimport Text from './Typography/Text';\nimport { isRenderableNode } from './renderableNode';\n\nexport type StepListStatus = 'complete' | 'open' | 'locked';\n\nexport type StepListSize = 'medium' | 'small';\n\nexport interface StepListItem {\n /** Keys the row; falls back to its position, so pass one when steps come and go. */\n key?: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n /**\n * `complete` fills the marker with a tick, `open` rings it in the accent, and `locked`\n * dims the marker and the text. The first `open` step is the current one.\n */\n status: StepListStatus;\n /**\n * Right of the text, e.g. the step's button. The state is already announced after the\n * title, so a label that repeats it, such as \"Completed\", wants `aria-hidden`.\n */\n action?: React.ReactNode;\n}\n\nexport interface StepListProps {\n steps: StepListItem[];\n /** `small` is the compact list for a sidebar: tighter rows and smaller text. */\n size?: StepListSize;\n /** Rules a line under each row, for a list that fills its container edge to edge. */\n dividers?: boolean;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** On the list. Each connector runs to the next row's marker, so add no gap between rows. */\n className?: string;\n}\n\nconst MARKER_SIZE = 24;\nconst DIVIDER_WIDTH = 1;\n\nconst SIZES: Record<\n StepListSize,\n {\n padding: { x: number; y: number };\n title: 'medium' | 'small';\n description: 'small' | 'xsmall';\n }\n> = {\n medium: { padding: { x: 28, y: 16 }, title: 'medium', description: 'small' },\n small: { padding: { x: 20, y: 12 }, title: 'small', description: 'xsmall' },\n};\n\n// Read out after the title: the marker is hidden, and the dimmed text alone says nothing.\nconst STATUS_LABELS: Record<StepListStatus, string | undefined> = {\n complete: 'Completed',\n open: undefined,\n locked: 'Locked',\n};\n\n// From a marker's foot, through the next row's top padding and any rule, to its marker.\nconst connectorStyle = (\n padding: { x: number; y: number },\n divider: boolean,\n): React.CSSProperties => ({\n insetInlineStart: padding.x + MARKER_SIZE / 2 - 1,\n top: padding.y + MARKER_SIZE,\n height: `calc(100% - ${MARKER_SIZE - (divider ? DIVIDER_WIDTH : 0)}px)`,\n});\n\nconst BORDER = 'var(--malachite-card-border, rgb(232, 232, 232))';\nconst ACCENT = 'var(--malachite-accent-background, rgb(0, 175, 102))';\n\nconst DASHED = `repeating-linear-gradient(to bottom, ${BORDER} 0px, ${BORDER} 4px, transparent 4px, transparent 8px)`;\n\n// White on the accent fill in both themes, as Checkbox draws its tick.\nconst MARKER_CLASSES: Record<StepListStatus, string> = {\n complete: 'bg-[var(--malachite-accent-background,rgb(0,175,102))] text-white',\n 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))]',\n 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))]',\n};\n\n// The position, not the title: two steps may share one. `#` keeps it off consumers' keys.\nconst keyOf = (step: StepListItem, index: number): string => step.key ?? `#${index}`;\n\n/**\n * A numbered, vertical list of setup steps: a marker per step joined by a line that turns\n * solid once a step is done, the step's title and description, and an optional action.\n */\nconst StepList: React.FC<StepListProps> = ({\n steps,\n size = 'medium',\n dividers = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className = '',\n}) => {\n const sizing = SIZES[size];\n const current = steps.findIndex((step) => step.status === 'open');\n // Every row keeps the column once any step has an action, so the text wraps alike.\n const hasActions = steps.some((step) => isRenderableNode(step.action));\n\n return (\n // `role=\"list\"`: Safari drops the list role from a list styled `list-none`.\n <ol\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`isolate m-0 list-none p-0 ${className}`}\n >\n {steps.map((step, index) => {\n const locked = step.status === 'locked';\n const statusLabel = STATUS_LABELS[step.status];\n return (\n <li\n key={keyOf(step, index)}\n aria-current={index === current ? 'step' : undefined}\n style={{\n padding: `${sizing.padding.y}px ${sizing.padding.x}px`,\n borderBottom: dividers\n ? `${DIVIDER_WIDTH}px solid ${BORDER}`\n : undefined,\n }}\n className=\"relative flex items-start gap-[12px]\"\n >\n {index < steps.length - 1 && (\n <span\n aria-hidden=\"true\"\n className=\"absolute z-[1] w-[2px]\"\n style={{\n ...connectorStyle(sizing.padding, dividers),\n background: step.status === 'complete' ? ACCENT : DASHED,\n }}\n />\n )}\n <span\n aria-hidden=\"true\"\n className={`relative z-[2] box-border flex shrink-0 items-center justify-center rounded-full text-[length:var(--malachite-font-size-xsmall,11px)] [font-weight:600] ${MARKER_CLASSES[step.status]}`}\n style={{ width: MARKER_SIZE, height: MARKER_SIZE }}\n >\n {step.status === 'complete' ? <CheckmarkIcon size={12} /> : index + 1}\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col gap-[2px] pt-[2px]\">\n <Text\n size={sizing.title}\n fontWeight=\"semi-bold\"\n color={locked ? 'dimmed' : 'primary'}\n >\n {step.title}\n {statusLabel && <span className=\"sr-only\">, {statusLabel}</span>}\n </Text>\n {isRenderableNode(step.description) && (\n <Text\n size={sizing.description}\n color={locked ? 'dimmed' : 'secondary'}\n >\n {step.description}\n </Text>\n )}\n </span>\n {hasActions && (\n <span className=\"ml-[16px] flex min-w-[120px] items-center justify-end\">\n {step.action}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n );\n};\n\nexport default StepList;\nexport { StepList };\n"],"names":["MARKER_SIZE","DIVIDER_WIDTH","SIZES","STATUS_LABELS","connectorStyle","padding","divider","BORDER","ACCENT","DASHED","MARKER_CLASSES","keyOf","step","index","StepList","steps","size","dividers","ariaLabel","ariaLabelledBy","className","sizing","current","hasActions","isRenderableNode","jsx","locked","statusLabel","jsxs","CheckmarkIcon","Text"],"mappings":";;;;AAsCA,MAAMA,IAAc,IACdC,IAAgB,GAEhBC,IAOF;AAAA,EACA,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,GAAA,GAAM,OAAO,UAAU,aAAa,QAAA;AAAA,EACnE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,MAAM,OAAO,SAAS,aAAa,SAAA;AACrE,GAGMC,IAA4D;AAAA,EAC9D,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AACZ,GAGMC,IAAiB,CACnBC,GACAC,OACuB;AAAA,EACvB,kBAAkBD,EAAQ,IAAIL,IAAc,IAAI;AAAA,EAChD,KAAKK,EAAQ,IAAIL;AAAA,EACjB,QAAQ,eAAeA,KAAeM,IAAUL,IAAgB,EAAE;AACtE,IAEMM,IAAS,oDACTC,IAAS,wDAETC,IAAS,wCAAwCF,CAAM,SA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ography/Text.js";
4
+ const p = {
5
+ neutral: "var(--malachite-text-secondary, rgb(123, 123, 123))",
6
+ info: "var(--malachite-text-info, rgb(12, 88, 174))",
7
+ success: "var(--malachite-text-success, rgb(2, 122, 66))",
8
+ warning: "var(--malachite-text-warning, rgb(150, 88, 10))",
9
+ error: "var(--malachite-text-error, rgb(237, 53, 54))"
10
+ }, f = ({
11
+ title: t,
12
+ time: a,
13
+ tone: n,
14
+ marker: r,
15
+ stopped: i = !1,
16
+ stoppedLabel: s,
17
+ children: m,
18
+ className: d = ""
19
+ }) => {
20
+ const o = n ?? (i ? "error" : "neutral");
21
+ return /* @__PURE__ */ l(
22
+ "li",
23
+ {
24
+ className: `relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${d}`,
25
+ children: [
26
+ /* @__PURE__ */ e(
27
+ "span",
28
+ {
29
+ "data-timeline-line": "",
30
+ "aria-hidden": "true",
31
+ className: "absolute start-[11px] top-[26px] bottom-[2px] w-[2px] bg-[var(--malachite-card-border,rgb(232,232,232))]"
32
+ }
33
+ ),
34
+ /* @__PURE__ */ e(
35
+ "span",
36
+ {
37
+ "aria-hidden": "true",
38
+ className: `flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${r ? "" : "border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]"}`,
39
+ children: r || /* @__PURE__ */ e(
40
+ "span",
41
+ {
42
+ "data-timeline-dot": o,
43
+ className: "h-[8px] w-[8px] rounded-full",
44
+ style: { backgroundColor: p[o] }
45
+ }
46
+ )
47
+ }
48
+ ),
49
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]", children: [
50
+ /* @__PURE__ */ l("div", { className: "flex items-start justify-between gap-[12px]", children: [
51
+ /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]", children: [
52
+ /* @__PURE__ */ e(c, { size: "small", fontWeight: "semi-bold", className: "min-w-0", children: t }),
53
+ i && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
54
+ i && /* @__PURE__ */ e(
55
+ x,
56
+ {
57
+ value: (s == null ? void 0 : s.trim()) || "Stopped here",
58
+ type: "error",
59
+ fontSize: "xsmall",
60
+ textTransform: "none",
61
+ paddingSize: "compact"
62
+ }
63
+ )
64
+ ] }),
65
+ (a || a === 0) && /* @__PURE__ */ e("span", { className: "sr-only", children: ", " }),
66
+ (a || a === 0) && /* @__PURE__ */ e(
67
+ c,
68
+ {
69
+ size: "xsmall",
70
+ color: "secondary",
71
+ font: "mono",
72
+ wrap: !1,
73
+ className: "pt-[2px]",
74
+ children: a
75
+ }
76
+ )
77
+ ] }),
78
+ m
79
+ ] })
80
+ ]
81
+ }
82
+ );
83
+ }, h = ({
84
+ children: t,
85
+ className: a = "",
86
+ "aria-label": n,
87
+ "aria-labelledby": r
88
+ }) => /* @__PURE__ */ e(
89
+ "ol",
90
+ {
91
+ role: "list",
92
+ "aria-label": n,
93
+ "aria-labelledby": r,
94
+ className: `m-0 list-none p-0 ${a}`,
95
+ children: t
96
+ }
97
+ );
98
+ h.Item = f;
99
+ export {
100
+ h as Timeline,
101
+ h as default
102
+ };
103
+ //# sourceMappingURL=Timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.js","sources":["../../src/components/Timeline.tsx"],"sourcesContent":["import React from 'react';\nimport Tag from './Tag';\nimport Text from './Typography/Text';\n\nexport type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';\n\nexport interface TimelineProps {\n children: React.ReactNode;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface TimelineItemProps {\n title: React.ReactNode;\n /** When the step happened, shown at the right of the title, e.g. `+6 ms`. */\n time?: React.ReactNode;\n /**\n * Paints the dot: `error` on a `stopped` step, else `neutral`, unless set. Colour alone, so the\n * title has to say what happened. Ignored when `marker` is set.\n */\n tone?: TimelineTone;\n /** Replaces the ringed dot with a 24px circle of its own, e.g. the caller's logo at size 24. Decorative: hidden from assistive tech. */\n marker?: React.ReactNode;\n /** Marks the step the flow ended on, with a badge after the title. */\n stopped?: boolean;\n /** The badge's text when `stopped`. Empty falls back to \"Stopped here\". */\n stoppedLabel?: string;\n /**\n * The step's detail, below the title: tags, copy, payloads. Each child is a row of its own, 8px\n * apart, and unstyled, so wrap copy in `Typography.Text`.\n */\n children?: React.ReactNode;\n className?: string;\n}\n\n// The light theme's values as fallbacks: the dot paints before the theme reaches `:host`.\nconst DOT_COLOR: Record<TimelineTone, string> = {\n neutral: 'var(--malachite-text-secondary, rgb(123, 123, 123))',\n info: 'var(--malachite-text-info, rgb(12, 88, 174))',\n success: 'var(--malachite-text-success, rgb(2, 122, 66))',\n warning: 'var(--malachite-text-warning, rgb(150, 88, 10))',\n error: 'var(--malachite-text-error, rgb(237, 53, 54))',\n};\n\nconst Item: React.FC<TimelineItemProps> = ({\n title,\n time,\n tone,\n marker,\n stopped = false,\n stoppedLabel,\n children,\n className = '',\n}) => {\n const dotTone = tone ?? (stopped ? 'error' : 'neutral');\n return (\n <li\n className={`relative m-0 flex gap-[14px] pb-[40px] last:pb-0 [&:last-child>[data-timeline-line]]:hidden ${className}`}\n >\n <span\n data-timeline-line=\"\"\n aria-hidden=\"true\"\n className=\"absolute start-[11px] top-[26px] bottom-[2px] w-[2px] bg-[var(--malachite-card-border,rgb(232,232,232))]\"\n />\n <span\n aria-hidden=\"true\"\n // The ring's border would cut into a marker, so a marker gets the full 24px circle instead.\n className={`flex h-[24px] w-[24px] flex-none items-center justify-center overflow-hidden rounded-full ${marker ? '' : 'border border-solid border-[var(--malachite-card-border,rgb(232,232,232))]'}`}\n >\n {marker || (\n <span\n data-timeline-dot={dotTone}\n className=\"h-[8px] w-[8px] rounded-full\"\n style={{ backgroundColor: DOT_COLOR[dotTone] }}\n />\n )}\n </span>\n <div className=\"flex min-w-0 flex-1 flex-col gap-[8px] pt-[2px]\">\n <div className=\"flex items-start justify-between gap-[12px]\">\n <div className=\"flex min-w-0 flex-wrap items-center gap-x-[8px] gap-y-[4px] [overflow-wrap:anywhere]\">\n <Text size=\"small\" fontWeight=\"semi-bold\" className=\"min-w-0\">\n {title}\n </Text>\n {stopped && <span className=\"sr-only\">, </span>}\n {stopped && (\n <Tag\n value={stoppedLabel?.trim() || 'Stopped here'}\n type=\"error\"\n fontSize=\"xsmall\"\n textTransform=\"none\"\n paddingSize=\"compact\"\n />\n )}\n </div>\n {(time || time === 0) && <span className=\"sr-only\">, </span>}\n {(time || time === 0) && (\n <Text\n size=\"xsmall\"\n color=\"secondary\"\n font=\"mono\"\n wrap={false}\n className=\"pt-[2px]\"\n >\n {time}\n </Text>\n )}\n </div>\n {children}\n </div>\n </li>\n );\n};\n\n/** A vertical sequence of steps, each with a dot on a connecting line, a title, its timing and a body. */\nconst Timeline: React.FC<TimelineProps> & { Item: typeof Item } = ({\n children,\n className = '',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}) => (\n <ol\n // list-style: none strips list semantics in WebKit, so VoiceOver would not announce the steps.\n role=\"list\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={`m-0 list-none p-0 ${className}`}\n >\n {children}\n </ol>\n);\n\nTimeline.Item = Item;\n\nexport default Timeline;\nexport { Timeline };\n"],"names":["DOT_COLOR","Item","title","time","tone","marker","stopped","stoppedLabel","children","className","dotTone","jsxs","jsx","Text","Tag","Timeline","ariaLabel","ariaLabelledBy"],"mappings":";;;AAqCA,MAAMA,IAA0C;AAAA,EAC5C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX,GAEMC,IAAoC,CAAC;AAAA,EACvC,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,cAAAC;AAAA,EACA,UAAAC;AAAA,EAC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S,MACf,gBAAAS;AAAA,cAACC;AAAA,cAAA;AAAA,gBACG,MAAK;AAAA,gBACL,OAAM;AAAA,gBACN,MAAK;AAAA,gBACL,MAAM;AAAA,gBACN,WAAU;AAAA,gBAET,UAAAV;AAAA,cAAA;AAAA,YAAA;AAAA,UACL,GAER;AAAA,UACCK;AAAA,QAAA,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ,GAGMO,IAA4D,CAAC;AAAA,EAC/D,UAAAP;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,cAAcO;AAAA,EACd,mBAAmBC;AACvB,MACI,gBAAAL;AAAA,EAAC;AAAA,EAAA;AAAA,IAEG,MAAK;AAAA,IACL,cAAYI;AAAA,IACZ,mBAAiBC;AAAA,IACjB,WAAW,qBAAqBR,CAAS;AAAA,IAExC,UAAAD;AAAA,EAAA;AACL;AAGJO,EAAS,OAAOd;"}
package/dist/index.d.ts CHANGED
@@ -3160,6 +3160,8 @@ declare type InputVariant = 'default' | 'ghost';
3160
3160
 
3161
3161
  export declare const IntegrationsIcon: React.FC<IconProps_65>;
3162
3162
 
3163
+ declare const Item: default_2.FC<TimelineItemProps>;
3164
+
3163
3165
  export declare const Keycap: default_2.FC<KeycapProps>;
3164
3166
 
3165
3167
  export declare interface KeycapProps {
@@ -5239,6 +5241,45 @@ export declare type StatusPillTone = 'success' | 'neutral' | 'warning' | 'error'
5239
5241
 
5240
5242
  export declare const StepCurrentIcon: React.FC<IconProps_108>;
5241
5243
 
5244
+ /**
5245
+ * A numbered, vertical list of setup steps: a marker per step joined by a line that turns
5246
+ * solid once a step is done, the step's title and description, and an optional action.
5247
+ */
5248
+ export declare const StepList: default_2.FC<StepListProps>;
5249
+
5250
+ export declare interface StepListItem {
5251
+ /** Keys the row; falls back to its position, so pass one when steps come and go. */
5252
+ key?: string;
5253
+ title: default_2.ReactNode;
5254
+ description?: default_2.ReactNode;
5255
+ /**
5256
+ * `complete` fills the marker with a tick, `open` rings it in the accent, and `locked`
5257
+ * dims the marker and the text. The first `open` step is the current one.
5258
+ */
5259
+ status: StepListStatus;
5260
+ /**
5261
+ * Right of the text, e.g. the step's button. The state is already announced after the
5262
+ * title, so a label that repeats it, such as "Completed", wants `aria-hidden`.
5263
+ */
5264
+ action?: default_2.ReactNode;
5265
+ }
5266
+
5267
+ export declare interface StepListProps {
5268
+ steps: StepListItem[];
5269
+ /** `small` is the compact list for a sidebar: tighter rows and smaller text. */
5270
+ size?: StepListSize;
5271
+ /** Rules a line under each row, for a list that fills its container edge to edge. */
5272
+ dividers?: boolean;
5273
+ 'aria-label'?: string;
5274
+ 'aria-labelledby'?: string;
5275
+ /** On the list. Each connector runs to the next row's marker, so add no gap between rows. */
5276
+ className?: string;
5277
+ }
5278
+
5279
+ export declare type StepListSize = 'medium' | 'small';
5280
+
5281
+ export declare type StepListStatus = 'complete' | 'open' | 'locked';
5282
+
5242
5283
  export declare const Stepper: default_2.FC<StepperProps | GroupedStepperProps>;
5243
5284
 
5244
5285
  declare interface StepperBaseProps {
@@ -5896,6 +5937,43 @@ export declare type TimeBarChartUnit = 'minute' | 'hour' | 'day' | 'week' | 'mon
5896
5937
 
5897
5938
  declare type TimeInput = string | number | Date;
5898
5939
 
5940
+ /** A vertical sequence of steps, each with a dot on a connecting line, a title, its timing and a body. */
5941
+ export declare const Timeline: default_2.FC<TimelineProps> & {
5942
+ Item: typeof Item;
5943
+ };
5944
+
5945
+ export declare interface TimelineItemProps {
5946
+ title: default_2.ReactNode;
5947
+ /** When the step happened, shown at the right of the title, e.g. `+6 ms`. */
5948
+ time?: default_2.ReactNode;
5949
+ /**
5950
+ * Paints the dot: `error` on a `stopped` step, else `neutral`, unless set. Colour alone, so the
5951
+ * title has to say what happened. Ignored when `marker` is set.
5952
+ */
5953
+ tone?: TimelineTone;
5954
+ /** Replaces the ringed dot with a 24px circle of its own, e.g. the caller's logo at size 24. Decorative: hidden from assistive tech. */
5955
+ marker?: default_2.ReactNode;
5956
+ /** Marks the step the flow ended on, with a badge after the title. */
5957
+ stopped?: boolean;
5958
+ /** The badge's text when `stopped`. Empty falls back to "Stopped here". */
5959
+ stoppedLabel?: string;
5960
+ /**
5961
+ * The step's detail, below the title: tags, copy, payloads. Each child is a row of its own, 8px
5962
+ * apart, and unstyled, so wrap copy in `Typography.Text`.
5963
+ */
5964
+ children?: default_2.ReactNode;
5965
+ className?: string;
5966
+ }
5967
+
5968
+ export declare interface TimelineProps {
5969
+ children: default_2.ReactNode;
5970
+ className?: string;
5971
+ 'aria-label'?: string;
5972
+ 'aria-labelledby'?: string;
5973
+ }
5974
+
5975
+ export declare type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';
5976
+
5899
5977
  export declare interface ToastApi {
5900
5978
  show: (options: ToastOptions) => void;
5901
5979
  }