@stackone/malachite 2.126.0 → 2.127.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
@@ -134,7 +134,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
134
134
  - **`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`.
135
135
  - **`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`).
136
136
  - **`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. `titleCode` sets code after the title in the mono face as one phrase with it, such as `n8n called` then `Salesforce | Delete contact`. 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. `icon` keeps the ring and draws a 12-14px glyph inside it in place of the dot, painted by `tone`, such as the call’s source type (MCP, API key, webhook); `skipped` beats `marker`, which beats `icon`. `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. `meta` puts facts about a step in one wrapping row under its title, such as `calls` 2 and `status` 200, each label secondary and its value in the mono face, 18px apart, as a `dl`. `skipped` marks a step that never ran with a grey chevron in place of the dot; the title has to say so. For steps a person works through (complete, open, locked) use `StepList`. _Key props:_ `aria-label`, `aria-labelledby`; on `Timeline.Item`: `title`, `eyebrow` (a short label above the title naming the stage), `titleCode`, `time`, `tone` (`TimelineTone`: `neutral` | `info` | `success` | `warning` | `error`), `marker` (fills the 24px circle in place of the ringed dot), `icon` (a glyph inside the ring, painted by `tone`), `skipped`, `stopped`, `stoppedLabel`, `meta` (`TimelineMetaEntry[]`: `label`, `value`).
137
- - **`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`, and `titleShrinks` for a title that truncates itself in a fixed-width column, inline header only), `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), `rowDensity` (`default`; `compact`, about 30px rows; `snug`, 38px rows with 12px side padding and a tighter header), `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).
137
+ - **`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`, and `titleShrinks` for a title that truncates itself in a fixed-width column, inline header only), `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), `rowDensity` (`default`; `compact`, about 30px rows; `snug`, 38px rows with 12px side padding and a tighter header), `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), `loadingRowCount` (skeleton rows while `loading`, 1 to 50), `aria-label` and `aria-labelledby` (name the inline table, in its loading and error states too).
138
138
  - **`Statistic`** — Displays a statistic value with a label; primary/secondary sizes. _Key props:_ `StatisticValueSize`.
139
139
  - **`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"`.
140
140
  - **`ZoomableImage`** — An image shown inline as a button that enlarges it, for a screenshot too detailed to read at its inline size. The thumbnail is shown at its own width up to the width of its container, never stretched, and stops at 240px tall, cropping a tall image to its top. The enlarged image sits on the scrim with no card, as large as the window allows at its own aspect ratio, up to its natural size, and a click anywhere or ESC closes it. The thumbnail is named `Enlarge image: <alt>` and the dialog is named by `title`, or by `alt` when `title` is missing or empty, so `alt` must be non-empty. `onError` reports a thumbnail that failed to load, so the caller can leave it out rather than show a broken image. The thumbnail loads lazily, so for one below the fold that report comes once it nears the viewport, not on render. Inside a `SidePanel` it enlarges over the panel and its aside instead, on a blurred veil; Escape, the veil or the close button closes it and leaves the panel open. _Key props:_ `src`, `alt`, `title`, `onError`.
@@ -162,4 +162,5 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
162
162
  - **`ThemeScope`** — Pins a subtree to a fixed theme (e.g. a dark island in a light app) via its own shadow root, since theme tokens are scoped per shadow root.
163
163
  - **`CustomIcons`** — Namespace of all built-in icons (`CustomIcons.<Name>Icon`), coloured via `currentColor`.
164
164
  - **`ShadowEscape`** — Renders children into the document (escaping the shadow root) for portals/overlays.
165
+ - **`Invisible`** — Keeps its children's space in the layout while hiding them from sight, the tab order and assistive technology, so a slot with nothing to offer still lines up with its neighbours, such as a column header whose action does not apply. The children stay the layout item (`display: contents`) and stay out of focus and the accessibility tree even if one sets itself visible (`inert`), though such a child still paints. `hidden={false}` shows them without remounting. The opposite of `VisuallyHidden`, which hides from sight only. _Key props:_ `children`, `hidden` (default `true`).
165
166
  - **`VisuallyHidden`** — Text for assistive technology only: painted nowhere, in the light DOM or a shadow root, and still in the accessibility tree, so it names the control or header it sits in and reads as part of the text around it. Prefer it to `aria-label` on a plain span, whose generic role prohibits an accessible name. _Key props:_ `children`.
@@ -0,0 +1,16 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { inertWhen as n } from "./inert.js";
3
+ const o = { display: "contents" }, e = { display: "contents", visibility: "hidden" }, l = ({ children: i, hidden: t = !0 }) => /* @__PURE__ */ s(
4
+ "span",
5
+ {
6
+ style: t ? e : o,
7
+ "aria-hidden": t || void 0,
8
+ ...n(t),
9
+ children: i
10
+ }
11
+ );
12
+ export {
13
+ l as Invisible,
14
+ l as default
15
+ };
16
+ //# sourceMappingURL=Invisible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Invisible.js","sources":["../../src/components/Invisible.tsx"],"sourcesContent":["import type React from 'react';\nimport { inertWhen } from './inert';\n\nexport interface InvisibleProps {\n children: React.ReactNode;\n /** Hides the children while true, so a slot can toggle without remounting them. Defaults to true. */\n hidden?: boolean;\n}\n\nconst SHOWN_STYLE: React.CSSProperties = { display: 'contents' };\nconst HIDDEN_STYLE: React.CSSProperties = { display: 'contents', visibility: 'hidden' };\n\n/** Keeps its children's space while hiding them from sight, focus and assistive technology. */\nconst Invisible: React.FC<InvisibleProps> = ({ children, hidden = true }) => (\n <span\n style={hidden ? HIDDEN_STYLE : SHOWN_STYLE}\n aria-hidden={hidden || undefined}\n {...inertWhen(hidden)}\n >\n {children}\n </span>\n);\n\nexport default Invisible;\nexport { Invisible };\n"],"names":["SHOWN_STYLE","HIDDEN_STYLE","Invisible","children","hidden","jsx","inertWhen"],"mappings":";;AASA,MAAMA,IAAmC,EAAE,SAAS,WAAA,GAC9CC,IAAoC,EAAE,SAAS,YAAY,YAAY,SAAA,GAGvEC,IAAsC,CAAC,EAAE,UAAAC,GAAU,QAAAC,IAAS,SAC9D,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,OAAOD,IAASH,IAAeD;AAAA,IAC/B,eAAaI,KAAU;AAAA,IACtB,GAAGE,EAAUF,CAAM;AAAA,IAEnB,UAAAD;AAAA,EAAA;AACL;"}