@stackone/malachite 2.130.1 → 2.132.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
@@ -33,7 +33,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
33
33
  - **`GuideProgress`** — A progress line that follows the active step of a GuideTimeline. _Key props:_ `sections`, `active`, `className`, `aria-label`.
34
34
  - **`Popover`** — An anchored, non-modal panel for arbitrary content — a workspace switcher, an org flyout. The panel renders in its own shadow root, so malachite components inside it are styled, and joins the top layer like the other overlays. It prefers its `placement` and flips to the opposite side when there is no room, clamping along the other axis. Click-opened panels take focus and hand it back to the trigger on close; `openOn="hover"` also opens on focus and stays open while the pointer or focus is in the panel. A nested Popover counts as inside its parent for outside-press and hover dismissal, and Escape closes the topmost only. A click panel also closes when focus moves somewhere outside it and its trigger, and on close it hands focus back to the trigger only if focus would otherwise fall to the page. _Key props:_ `trigger`, `children`, `open`, `defaultOpen`, `onOpenChange`, `placement` (`bottom-start` | `bottom-end` | `top-start` | `top-end` | `top-center` | `right-start` | `right-end` | `left-start`), `openOn` (`click` | `hover`), `width` (`content` | `trigger`), `padding` (`none` | `small` | `medium`), `anchorRef` (position against another element, e.g. the section a trigger row sits in), `offset` (`small` 8px | `medium` 12px | `large` 14px), `elevation` (`default` | `raised`), `initialFocus` (a ref, or a function read when the panel is shown, for what takes focus in place of the first focusable; it is read again as the panel's content changes, so focus follows content that mounts late or a focused element that is removed, but never leaves an element the user moved to; `initialFocusRef` is its deprecated form, read on open only), `openOnArrowKey` (a click panel also opens, focus inside, on the arrow key its placement points at — ArrowDown for a `bottom-*` placement; a text field trigger keeps its arrow keys), `role` (`dialog` | `menu` | `listbox`; `menu` brings no roving focus of its own), `aria-label` or `aria-labelledby` (one is required), `className`. The panel is capped to the viewport width, and only overlays opened from inside it (menus, dropdowns, modals) count as inside for outside-press dismissal. A side placement stays level with its anchor and scrolls within the room below, sliding up only when under 160px is left. Parts for the panel body: `Popover.Header` (`title`, `action`, `divider` — `false` drops the rule and sits it 4px over the list, as its label), `Popover.Action` (`icon`, `aria-label`, `onClick`, `href` (a link that opens in a new tab on Cmd/Ctrl-click or a middle click; a plain click runs `onClick` when one is given), `disabled`, `tooltip`), `Popover.List` (a scrolling list; `scrollToSelected` scrolls the list, never the page, to its selected row, one marked `aria-current`, `aria-selected` or a checked radio, each time the popover is shown, once that row mounts), `Popover.Section` (a bordered section), `Popover.Empty` (an empty-state line), `Popover.Search` (pads a `Search` above the list without a second rule), `Popover.Note` (a footnote section in small secondary text) and `Popover.Status` (`message`, `tone` (`default` | `error`), `action` (`label`, `onClick`, `pending`), `focusable`): one `status` live region for the panel's life, announcing each message it is given and staying mounted, visually hidden, while there is none, so clear `message` rather than unmounting it. Errors announce through the same region. `focusable` with a ref makes it an `initialFocus` target; resolve to it only while it has a message, since an empty one is invisible. Reach for `Status` when the message changes while the panel is open or carries an action (loading, failed, sign-in needed), and `Empty` for a static line in a list that simply has nothing in it.
35
35
  - **`Modal`** — Centred dialog over a scrim, with header slots (icon/title/subtitle/extra), a scrolling body and a pinned footer. Locks background scroll and dismisses on ESC, the close button, or a scrim click unless `closeOnOverlayClick` is off; `busy` suppresses the two pointer routes while a request is in flight and sets `aria-busy`, so a stray click cannot tear the dialog down mid-write — but never ESC, which is the only guaranteed keyboard exit from a focus trap and so always reaches `onClose`. ESC, the Tab focus trap and `aria-modal` all apply to the topmost overlay only, so these may be stacked — a dialog opened from a panel keeps Tab to itself and the panel stops claiming to be modal. The Tab trap follows focus into a malachite popup portaled out of the dialog’s own tree — a `MultiSelect` listbox or a `Popover` opened from the body — and traps Tab within that popup while it holds focus, so Tab walks and wraps that popup’s own stops rather than being yanked back to the dialog’s first control or escaping the dialog altogether. A `Dropdown` list or an `ActionMenu` is dismissed by Tab rather than trapping it: it closes and focus returns to its trigger, so Tab carries on from there. A consumer’s own portaled popup is not known to the trap and Tab will pull focus out of it. Set `role="alertdialog"` for a consequential choice, which asks assistive tech to announce the body and not just the name, and point `aria-describedby` at whichever element carries it. Width comes from the `size` union (`small` 420px | `medium` 612px | `large` 760px | `fullscreen`, which fills the window in both directions) rather than a raw pixel prop. `titleAdornment` sits immediately after the title behind a hairline divider, for naming the thing being acted on — distinct from `headerExtra`, which pins to the far right. `tray` paints a tinted plate around the card and hangs a `caption` beneath it; the plate is the dialog element itself, so that caption stays inside the `aria-modal` subtree rather than being stranded outside it by the visual nesting, and it is added to `aria-describedby` automatically because it says what the dialog is asking. It takes a tone (`neutral` | `warning` | `error` | `success`) rather than a colour, so no consumer can paint it off-palette — and the tone sets the plate and its caption colour together, so the two cannot disagree. The caption is a `{ label?, message }` pair rather than a node, because its row height, type scale and colour belong to the plate. `size` names the card, and the plate’s 4px ring is added on top. Like `SidePanel` it sits in a z-index band from 1000 — one step per stacked overlay, so what paints on top is what holds the keyboard — and stays out of the browser top layer, so a host app’s own dialogs can still cover it. `callouts` stacks full-bleed `Alert` bands at the top of the body, as on `SidePanel`; they ignore `bodyPadding` and lead `aria-describedby`, ahead of the consumer’s own description and the tray caption. For a confirmation use `ConfirmationDialog`, which is a preset over this. _Key props:_ `open`, `onClose`, `title`, `subtitle`, `icon`, `headerExtra`, `titleAdornment`, `tray`, `callouts`, `renderLink`, `headerDivider`, `footer`, `size`, `showCloseButton`, `closeOnOverlayClick`, `bodyPadding`, `bodyHeight` (`auto` | `tall` — 600px, or the viewport less 160px when smaller, for an embedded iframe at `height: 100%`), `busy`, `role` (`dialog` | `alertdialog`), `aria-label`, `aria-labelledby`, `aria-describedby`.
36
- - **`SidePanel`** — Right-hand slide-in overlay panel (drawer) with header slots (back/icon/title/subtitle/extra), scrollable body and optional footer. `subtitlePlacement="below"` stacks the subtitle on its own line under the title row, so neither truncates the other in a narrow panel. `toolbar` pins content between the header and the scrolling body (16px sides, 16px above, 8px below, no divider), such as a Search over the list it filters. `toolbarPadding="body"` insets it 28px either side instead, level with the body, for a full-width row such as a `KeyValueStrip`. `SidePanel.Tabs`, rendered anywhere in the body, pins its `Tabs` strip under the header and toolbar (arrow keys open the tab they reach), always inset by the panel’s 28px gutter (with `bodyPadding={false}`, pad the panels 28px to line them up), and keeps its panels where it sits, so a child that owns its tabs needs no plumbing; panels mount the first time their tab opens and stay mounted, hidden, until it unmounts, each tab reopens at the scroll position it was left at, and a tabbed body keeps a stable scrollbar gutter so tabs of any length line up. Outside a `SidePanel` it renders as `Tabs`. Locks background scroll and dismisses on ESC, an overlay click or close. ESC and the Tab focus trap apply to the topmost overlay only, so a `Modal` may be stacked over it. The Tab trap follows focus into a malachite popup portaled out of the panel’s own tree — a `MultiSelect` listbox or a `Popover` opened from the body — and traps Tab within that popup while it holds focus, so Tab walks and wraps that popup’s own stops rather than being yanked back to the panel’s first control or escaping the panel altogether. A `Dropdown` list or an `ActionMenu` is dismissed by Tab rather than trapping it: it closes and focus returns to its trigger, so Tab carries on from there. A consumer’s own portaled popup is not known to the trap and Tab will pull focus out of it. `callouts` stacks full-bleed `Alert` bands at the top of the body, above `children` and unaffected by `bodyPadding` — the same band `ConfirmationDialog` gives its `callout` — and `renderLink` routes their root-relative markdown links through the app’s router. The callouts are announced as the panel’s description, ahead of `description`. `aside` opens a full-height column to the left, as wide again as `maxWidth`, for help that sits beside the content — a setup guide beside a form. The panel’s own header, body and footer keep their width and place, and the aside’s `title` (with an optional `headerExtra`, such as a `Stepper`) and `footer` line up with the panel’s header and footer; `bodyPadding` works as the panel’s does. The aside is never narrower than 360px, so a window too narrow for both columns scrolls the panel sideways. `onSubmit` makes the header, body and footer one `<form>` (`noValidate`, default prevented), so Enter in a field submits through a `type="submit"` footer button, as `FormActions` gives, the way a browser form does: not from a textarea, not mid-composition, and not while that button is disabled. Enter in the `toolbar` never submits, and the submit does not reach a form the panel is rendered inside. `sheet` raises a drill-in over the body and footer, dimming the panel’s header above it: its own header (`title`, `headerExtra`, a close button named from its `aria-label`), scrolling body and `footer`, with a shadow and scrim of its own (`shadows.sheet`, `overlay.sheetScrim`). The panel’s header, body, footer and aside are inert while it is up; it takes focus and hands it back to the control that opened it, or to the panel once it has moved on to another record, and ESC or a click on the dimmed panel around it, header included, calls the sheet’s `onClose`. A click on the page around the panel closes the sheet with it; a consumer that closes the panel through `open` clears its own sheet. `aside.layout: 'detached'` draws the aside as a card of its own on the warm ground, tucked behind the panel’s left edge, which slides out from behind it; `aside.open` puts it away and `aside.onOpenChange` adds a collapse button to its header and, while it is away, a tab on the panel’s edge (`aside.tabLabel`, with `aside.tabIcon` before it) to bring it back. `subtitleExtra` puts content at the far end of a `below` subtitle’s row, such as `Next: Preferences`. `progress` (0 to 1) draws an accent line along the foot of the header, for a multi-step form. `subheader` adds a band under the header with a rule below, for a wizard’s step and what comes next, leaving the header at its usual height; `progress` then runs along the band’s foot.
36
+ - **`SidePanel`** — Right-hand slide-in overlay panel (drawer) with header slots (back/icon/title/subtitle/extra), scrollable body and optional footer. `subtitlePlacement="below"` stacks the subtitle on its own line under the title row, so neither truncates the other in a narrow panel. `toolbar` pins content between the header and the scrolling body (16px sides, 16px above, 8px below, no divider), such as a Search over the list it filters. `toolbarPadding="body"` insets it 28px either side instead, level with the body, for a full-width row such as a `KeyValueStrip`. `SidePanel.Tabs`, rendered anywhere in the body, pins its `Tabs` strip under the header and toolbar (arrow keys open the tab they reach), always inset by the panel’s 28px gutter (with `bodyPadding={false}`, pad the panels 28px to line them up), and keeps its panels where it sits, so a child that owns its tabs needs no plumbing; panels mount the first time their tab opens and stay mounted, hidden, until it unmounts, each tab reopens at the scroll position it was left at, and a tabbed body keeps a stable scrollbar gutter so tabs of any length line up. Outside a `SidePanel` it renders as `Tabs`. Locks background scroll and dismisses on ESC, an overlay click or close. ESC and the Tab focus trap apply to the topmost overlay only, so a `Modal` may be stacked over it. The Tab trap follows focus into a malachite popup portaled out of the panel’s own tree — a `MultiSelect` listbox or a `Popover` opened from the body — and traps Tab within that popup while it holds focus, so Tab walks and wraps that popup’s own stops rather than being yanked back to the panel’s first control or escaping the panel altogether. A `Dropdown` list or an `ActionMenu` is dismissed by Tab rather than trapping it: it closes and focus returns to its trigger, so Tab carries on from there. A consumer’s own portaled popup is not known to the trap and Tab will pull focus out of it. `callouts` stacks full-bleed `Alert` bands at the top of the body, above `children` and unaffected by `bodyPadding` — the same band `ConfirmationDialog` gives its `callout` — and `renderLink` routes their root-relative markdown links through the app’s router. The callouts are announced as the panel’s description, ahead of `description`. `aside` opens a full-height column to the left, as wide again as `maxWidth`, for help that sits beside the content — a setup guide beside a form. The panel’s own header, body and footer keep their width and place, and the aside’s `title` (with an optional `headerExtra`, such as a `Stepper`) and `footer` line up with the panel’s header and footer; `bodyPadding` works as the panel’s does. The aside is never narrower than 360px, so a window too narrow for both columns scrolls the panel sideways. `onSubmit` makes the header, body and footer one `<form>` (`noValidate`, default prevented), so Enter in a field submits through a `type="submit"` footer button, as `FormActions` gives, the way a browser form does: not from a textarea, not mid-composition, and not while that button is disabled. Enter in the `toolbar` never submits, and the submit does not reach a form the panel is rendered inside. `sheet` raises a drill-in over the body and footer, dimming the panel’s header above it: its own header (`title`, `headerExtra`, a close button named from its `aria-label`), scrolling body and `footer`, with a shadow and scrim of its own (`shadows.sheet`, `overlay.sheetScrim`). The panel’s header, body, footer and aside are inert while it is up; it takes focus and hands it back to the control that opened it, or to the panel once it has moved on to another record, and ESC or a click on the dimmed panel around it, header included, calls the sheet’s `onClose`. A click on the page around the panel closes the sheet with it; a consumer that closes the panel through `open` clears its own sheet. `aside.layout: 'detached'` draws the aside as a card of its own on the warm ground, tucked behind the panel’s left edge, which slides out from behind it; `aside.open` puts it away and `aside.onOpenChange` adds a collapse button to its header and, while it is away, a tab on the panel’s edge (`aside.tabLabel`, with `aside.tabIcon` before it) to bring it back. `subtitleExtra` puts content at the far end of a `below` subtitle’s row, such as `Next: Preferences`. `progress` (0 to 1) draws an accent line along the foot of the header, for a multi-step form. `subheader` adds a band under the header with a rule below, for a wizard’s step and what comes next, leaving the header at its usual height; `progress` then runs along the band’s foot. `columns` (in place of `children`, typed as `SidePanelColumnsProps`) splits the body into full-height columns side by side, each `{ id, content, share, bodyPadding?, fill?, 'aria-label'? }`: `share` is its part of the width, a rule runs between them, `callouts` stay above them full width, and a `fill` column hands its height to content that scrolls itself (a `Chat`, say) where the others scroll on their own. Where the body is under 576px wide the columns stack, splitting the height by share, each at least 240px tall and scrolling itself, and the stack scrolls once those minimums overflow it, so the panel never scrolls sideways. `tray` is a full-width band between the body and the footer, up to 55% of the space below the header, scrolling itself; it and the columns are inert under a `sheet`.
37
37
  - **`useHasOpenOverlay`** — Hook reporting whether any modal-type overlay - `SidePanel` or `Modal` - is open anywhere in the app. For host chrome that has to get out of an overlay’s way, a floating support widget being the case it was added for: overlays render through a portal, so a host has no DOM signal of its own to read, and reading the library’s internal markers would couple it to something it does not own. Dropdowns and tooltips are deliberately not counted - they do not trap focus, and chrome does not need to move for them. _Key props:_ No arguments. Returns a boolean.
38
38
  - **`SidePanelNavFooter`** — Keyboard-hint footer for SidePanel: up/down keycaps to step between records, optional left/right keycaps to switch tabs, and an esc-to-close hint, with an optional right-aligned actions slot. `navigateLabel` and `escapeLabel` rename the two hints, for a footer that steps through something other than records, such as the steps of a log in a `SidePanel` `sheet`; a `navigateLabel` names the reader's place (`Step 2 of 5`), so it reads in the primary text colour.
39
39
 
@@ -68,7 +68,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
68
68
  - **`BaseFormComponent`** — Low-level base used by form controls; rarely used directly.
69
69
  - **`FormSectionHeading`** — Names a group of fields and rules off the space beside it, the way a long panel or settings page separates what it is asking for into parts. The label never shrinks — letting it flex clips the name long before the rule runs out of room — and it carries the same 8px inset a field label does, so a section name and the labels beneath it stand on one line. Quieter than `Typography.FormSectionTitle`, which titles a form rather than dividing one. `rule={false}` drops the rule, and it announces as a heading at `level`, so a long form can be navigated by section. _Key props:_ `children`, `rule`, `level` (2-6, default 3), `className`, `style`.
70
70
  - **`FieldGroup`** — Fields that follow from an answer given above them — the credentials a chosen authentication type asks for, say — drawn as its children: indented, with a rule down the side of the group. Stretches them to its own width, since a field left to size itself takes only the width of its content. _Key props:_ `children`, `gap` (default 40), `className`, `style`.
71
- - **`FormActions`** — A form’s Cancel and primary pair, end-aligned: a side panel’s footer, or under a settings section. `secondary` is the outline action and always `type="button"`, so a Cancel inside a form never submits it. `primary` is filled, or `tone="destructive"` for an action that deletes; give it `type: 'submit'` inside a form or a `SidePanel` with `onSubmit` and Enter in a field presses it. _Key props:_ `primary` (`label`, `onClick`, `disabled`, `loading`, `tooltip`, `tone`, `type`), `secondary` (`label`, `onClick`, `disabled`, `loading`, `tooltip`), `size` (`small` | `medium`, default medium), `className`.
71
+ - **`FormActions`** — A form’s Cancel and primary pair, end-aligned: a side panel’s footer, or under a settings section. `secondary` is the outline action and always `type="button"`, so a Cancel inside a form never submits it. `primary` is filled, or `tone="destructive"` for an action that deletes; give it `type: 'submit'` inside a form or a `SidePanel` with `onSubmit` and Enter in a field presses it. `note` puts secondary text at the start of the row, such as why the primary is disabled; the buttons stay end-aligned and wrap below it in a narrow row. _Key props:_ `primary` (`label`, `onClick`, `disabled`, `loading`, `tooltip`, `tone`, `type`), `secondary` (`label`, `onClick`, `disabled`, `loading`, `tooltip`), `size` (`small` | `medium`, default medium), `note`, `className`.
72
72
  - **`FieldBlock`** — Something a form has to show but does not ask for — a computed list, a generated value — wearing a field’s anatomy: label, optional `badge` beside it and `action` at the end of the row, content, then helper text, all on a field’s own metrics and inset. A real control brings its anatomy with it; this is for everything that has no control to bring one. _Key props:_ `label`, `badge`, `action`, `helperText`, `variant` (`default` | `field`; `field` sets the content at an input's full width and lines `action` up with an input's end button, for a box such as a list set among inputs), `children`, `className`, `style`.
73
73
  - **`Input`** — Single-line text input. Passing `formControl` is enough to show validation: the resolver's message renders on its own line beneath the field in the destructive colour, politely announced, with `aria-invalid` and `aria-describedby` wired and the in-field error icon standing down once the message carries the meaning, and the control reports its edits back so a rejection clears as the customer fixes the field rather than standing until the next submit. Given a `formControl` the form owns the value: the field paints an explicit `value` first, then the value the form holds, then `defaultValue`, then empty — the ladder react-hook-form's own `useController` computes — so `reset()` and `setValue()` repaint the field and the text on screen cannot drift from the value being validated, which had put a rejection under a field the customer could see was filled. Passing `defaultValue` to a bound field warns in development, naming the component and the field: where the form has an entry for it, it is ignored, and where it has none it paints text the form will never submit. Set it through `useForm({ defaultValues })` instead. A consumer's own `helperText` keeps its line above it and stays dimmed, since it explains the field rather than reporting the fault — replacing one with the other left a field ringed in red with nothing saying what was wrong. An explicit `error` still wins, for a rejection the resolver knows nothing about, and `error={false}` suppresses the resolver outright, message included. `requiredIndicator` switches the label between the library default of naming the optional fields, an `asterisk` on the required ones for designs drawn that way, and `none` for a field whose value is supplied rather than asked for — a locked control is still required, but a marker only sends the reader looking for something to fill in. Visual only: `aria-required` is set from `required` whichever is chosen. Long unbroken text in `helperText`, such as a URL, wraps rather than widening the field. `copyOnClick` makes a click anywhere on a copyable value copy it, under a copy cursor, with the whole value on hover. _Key props:_ `label`, `type`, `InputSize`, `InputVariant` (`default` | `ghost`), `required`, `requiredIndicator`, `error`, `helperText`, `loading`, `formControl`, `value`, `defaultValue`, `showCopyButton`, `showPasswordToggle`, `autoFocus`, `autoComplete` (defaults to `off`), `aria-label`, `aria-labelledby`, `id`.
74
74
  - **`TextArea`** — Multi-line text input. Shows resolver validation from `formControl` on exactly the same terms as `Input`: the message gets its own line beneath any `helperText`, which keeps its own, and the value climbs the same ladder — an explicit `value`, then the value the form holds, then `defaultValue`, then empty — a disabled field included, which used to show `defaultValue` whatever the form or the consumer had said. `requiredIndicator` switches the label between the library default of naming the optional fields, an `asterisk` on the required ones for designs drawn that way, and `none` for a field whose value is supplied rather than asked for — a locked control is still required, but a marker only sends the reader looking for something to fill in. Visual only: `aria-required` is set from `required` whichever is chosen. _Key props:_ `label`, `rows`, `maxLength`, `resize`, `required`, `requiredIndicator`, `error`, `helperText`, `loading`, `formControl`, `value`, `defaultValue`, `aria-label`, `aria-labelledby`, `id`.
@@ -130,8 +130,8 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
130
130
 
131
131
  - **`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`.
132
132
  - **`ScoreMeter`** — A score from 0 to 1 on a track that runs from a low end to a high end through the success, warning and error colours, such as a classifier’s confidence that a response holds a prompt injection. A ringed marker sits at the score, painted by `tone` for the outcome it led to, and an optional line marks the `threshold` where it starts to count as high; leave `threshold` out when it is not known and no line or threshold label is drawn. `lowLabel`, `highLabel` and `thresholdLabel` sit under the track and are hidden from assistive tech, which reads the `meter` by its `label` and `valueText` instead. Scores outside 0 to 1, or not a number, are clamped onto the scale. _Key props:_ `value`, `label`, `valueText`, `threshold`, `thresholdLabel`, `lowLabel`, `highLabel`, `tone` (`ScoreMeterTone`: `neutral` | `success` | `warning` | `error`; default `neutral`), `className`.
133
- - **`Hexagon`** — A filled hexagon in one status tone, the mark for an outcome as a `LinkCard` `icon` and the unit of a `HexagonScale`. Tones fill from the theme: `neutral` grey (`text.dimmed`), `success` green (`text.success`), `caution` pale amber (`warning.fillMuted`), `warning` amber (`warning.fill`), `error` red (`error.background`, as `TimeBarChart` fills it). `dimmed` draws it at 20% for a step of a scale that is not the current one. Always decorative and hidden from assistive tech, so the text beside it has to name the outcome. Styled inline so it still draws outside the shadow root’s stylesheet. _Key props:_ `tone` (`HexagonTone`: `neutral` | `success` | `caution` | `warning` | `error`; default `neutral`), `size` (`HexagonSize`: `small` 16px | `medium` 18px; default `medium`), `dimmed`, `className`.
134
- - **`HexagonScale`** — A row of small hexagons, one per step of an ordered scale, with the `current` step at full strength and the rest dimmed to 20%; with no `current` every step is dimmed. Built for a `LinkCard`’s `trailing` slot, where it places an outcome on a scale such as allowed → redacted → monitored → denied. Beside text that already names the step 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. `stepLabels` names each step in a tooltip on its hexagon, and `currentNote` follows the current step’s name there, such as “High · this call”; the tooltips open on hover only, add no tab stops and need the shadow root’s stylesheet, so leave `stepLabels` off in an `ActionMenu`. Styled inline so it still draws inside an `ActionMenu`, which portals outside the shadow root. _Key props:_ `steps` (`HexagonTone[]`, in order), `current` (index of the step drawn at full strength), `label`, `stepLabels`, `currentNote`, `className`.
133
+ - **`Hexagon`** — A filled hexagon (or, with `shape="shield"`, a shield with a star cut out) in one status tone: the mark for an outcome, or a risk or protection level when a shield, as a `LinkCard` `icon` and the unit of a `HexagonScale`. Tones fill from the theme: `neutral` grey (`text.dimmed`), `success` green (`text.success`), `caution` pale amber (`warning.fillMuted`), `warning` amber (`warning.fill`), `error` red (`error.background`, as `TimeBarChart` fills it). `dimmed` draws it at 20% for a step of a scale that is not the current one. Always decorative and hidden from assistive tech, so the text beside it has to name what it marks. Styled inline so it still draws outside the shadow root’s stylesheet. _Key props:_ `tone` (`HexagonTone`: `neutral` | `success` | `caution` | `warning` | `error`; default `neutral`), `size` (`HexagonSize`: `small` 16px | `medium` 18px; default `medium`), `shape` (`HexagonShape`: `hexagon` | `shield`; default `hexagon`; shields for a risk or protection level), `dimmed`, `className`.
134
+ - **`HexagonScale`** — A row of small hexagons (or shields, with `shape="shield"`, for a risk or protection level), one per step of an ordered scale, with the `current` step at full strength and the rest dimmed to 20%; with no `current` every step is dimmed. Built for a `LinkCard`’s `trailing` slot, where it places an outcome or risk level on a scale such as allowed → redacted → monitored → denied, or low → critical with shields. Beside text that already names the step 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. `stepLabels` names each step in a tooltip on its mark, and `currentNote` follows the current step’s name there, such as “High · this call”; the tooltips open on hover only, add no tab stops and need the shadow root’s stylesheet, so leave `stepLabels` off in an `ActionMenu`. Styled inline so it still draws inside an `ActionMenu`, which portals outside the shadow root. _Key props:_ `steps` (`HexagonTone[]`, in order), `shape` (`HexagonShape`; default `hexagon`), `current` (index of the step drawn at full strength), `label`, `stepLabels`, `currentNote`, `className`.
135
135
  - **`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`.
136
136
  - **`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`).
137
137
  - **`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`).
@@ -144,7 +144,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
144
144
  - **`AppLogo`** — A connector's mark, optionally with its name and version tag. Builds on `Avatar`, so a missing or broken logo falls back to the generic "no logo available" placeholder, a neutral grey tile with a darker square, the same mark stackone-logos.com serves. The gap tightens below 18px so the mark and label still read as one unit. _Key props:_ `src`, `name`, `showName`, `size`, `nameSize`, `nameWeight`, `version`, `truncate`, `className`.
145
145
  - **`ConnectionHeader`** — Two tilted logo tiles (from → to) showing a connection between apps. _Key props:_ `from`, `to` (`ConnectionEndpoint`: `icon`, `label`, `background`).
146
146
  - **`CodeBlock`** — Syntax-styled code block, a JSON tree, or a diff. A `json` tree folds by depth with `collapsed`; `collapseLargerThan` also starts any nested array or object with more entries than the limit collapsed at any depth, so a large payload mounts a row per node rather than per item; a node over the limit gets a keyboard toggle named by its path and size, and a folded one says how many entries it holds. _Key props:_ `code`, `json`, `language` (`yaml` | `cedar`), `collapsed`, `collapseLargerThan`, `diff`, `showLineNumbers`, `wrapLines`, `enableCopy`, `height`, `aria-label`, `aria-labelledby`.
147
- - **`CodePreview`** — A framed payload, such as the raw request or response under a step of a trace: a header naming it with mono `meta` at the right, its first `previewLines` lines (5 by default) with line numbers, and a full-width “Show All N Lines” toggle for the rest that becomes “Show Less”; the toggle carries `aria-expanded`, is described by the title, says how many flagged lines the fold hides, and only appears when there is more to show. The body is a focusable region named by the title, so a keyboard can scroll it. An empty `code` says so. The body scrolls past 360px, folded or open; past `maxRenderedLines` (2,000 by default) the expanded body stops mounting lines and says how many it left out. `highlightLines` flags 1-based lines with the error tint, a rule down their start edge and a visually hidden “Flagged:” for assistive tech; say why nearby. Plain text, no syntax colouring or JSON tree: for those use `CodeBlock`. _Key props:_ `title`, `meta`, `titleHidden` (drops the header, `meta` with it, keeping the title as the body’s accessible name), `code`, `previewLines`, `highlightLines`, `showLineNumbers` (default `true`), `copyable` (a button over the body copies the whole payload), `maxRenderedLines`, `className`.
147
+ - **`CodePreview`** — A framed payload, such as the raw request or response under a step of a trace: a header naming it with mono `meta` at the right, its first `previewLines` lines (5 by default) with line numbers, and a full-width “Show All N Lines” toggle for the rest that becomes “Show Less”; the toggle carries `aria-expanded`, is described by the title, says how many flagged lines the fold hides, and only appears when there is more to show. The body is a focusable region named by the title, so a keyboard can scroll it. An empty `code` says so. The body scrolls past 360px, folded or open; past `maxRenderedLines` (2,000 by default) the expanded body stops mounting lines and says how many it left out. `highlightLines` flags 1-based lines with the error tint, a rule down their start edge and a visually hidden “Flagged:” for assistive tech; say why nearby. `language="json"` colours keys, strings, numbers and `true`/`false`/`null` line by line with the code block theme’s token colours (a line over 10,000 characters stays plain); otherwise plain text. No JSON tree or other languages: for those use `CodeBlock`. _Key props:_ `title`, `meta`, `titleHidden` (drops the header, `meta` with it, keeping the title as the body’s accessible name), `code`, `language` (`json`; default plain), `previewLines`, `highlightLines`, `showLineNumbers` (default `true`), `copyable` (a button over the body copies the whole payload), `maxRenderedLines`, `className`.
148
148
  - **`Stepper`** — Progress dots/segments for a multi-step flow; optionally clickable. `groups` takes a long flow in labelled sections: the active step’s group opens into one bar per step across the full width and every other group folds to a short bar. Folded bars keep a fixed width and the open group shares what is left, so allow about 20px per other group and 12px per step in the open group. With `onChange` each folded bar is a button named after its group. _Key props:_ `steps` or `groups` (`{ label, steps }[]`), `active`, `onChange`.
149
149
  - **`FormSteps`** — Steps in order: each a numbered mark on a rail with its title, an optional `description` line under it, an optional `action` such as Edit at the end of the title row, and its content below. For the parts of a form that build on each other (pass `marker` for letters, so they do not read as the pages of a paged form, and `variant="form"` to space the steps for fields; titles always line up with field labels), or for reviewing a multi-step form before it is submitted; for a guide to follow, use `GuideTimeline`. Not `StepList`, the status checklist (complete, open, locked); the two are to be aligned. _Key props:_ `items` (`{ key, title, description, action, children }[]`), `marker`, `variant`, `aria-label`.
150
150
  - **`GuideTimeline`** — A guide laid out as one scrolling column: each section a heading with a numbered mark, its steps strung on a rail below it and coded `1.1`, `1.2` so a step names its section once its heading has scrolled away; a section without steps is its description alone, coded `2`. Marks before the `active` step show a check. Place it in a scrolling container with no padding of its own, such as a `SidePanel` aside with `bodyPadding: false`. It reports the step scrolled to the top through `onActiveChange` and scrolls to a step when `active` is set to it, so `GuideJumpMenu` and `GuideProgress` can follow and steer it. `guideTimelinePositions` gives the codes. Not `Timeline`, the trace of events; the two are to be aligned. _Key props:_ `sections` (`{ key, title, description, steps: { key, title, children }[] }[]`), `active`, `onActiveChange`, `end`, `aria-label`.
@@ -0,0 +1,6 @@
1
+ import * as e from "react";
2
+ const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M12 2.5l8.2 4.75v9.5L12 21.5l-8.2-4.75v-9.5z", fill: "currentColor" }));
3
+ export {
4
+ l as default
5
+ };
6
+ //# sourceMappingURL=hexagon_fill.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hexagon_fill.svg.js","sources":["../../../src/assets/icons/hexagon_fill.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgHexagonFill = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 24, height: 24, viewBox: \"0 0 24 24\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M12 2.5l8.2 4.75v9.5L12 21.5l-8.2-4.75v-9.5z\", fill: \"currentColor\" }));\nexport default SvgHexagonFill;\n"],"names":["SvgHexagonFill","props","React"],"mappings":";AACK,MAACA,IAAiB,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,gDAAgD,MAAM,eAAc,CAAE,CAAC;"}
@@ -0,0 +1,6 @@
1
+ import * as e from "react";
2
+ const l = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 12 256 256", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-37,87.43-30.31,12.12L158.4,163.2a8,8,0,1,1-12.8,9.6L128,149.33,110.4,172.8a8,8,0,1,1-12.8-9.6l17.74-23.65L85,127.43A8,8,0,1,1,91,112.57l29,11.61V96a8,8,0,0,1,16,0v28.18l29-11.61a8,8,0,1,1,6,14.86Z", fill: "currentColor" }));
3
+ export {
4
+ l as default
5
+ };
6
+ //# sourceMappingURL=shield_star_fill.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shield_star_fill.svg.js","sources":["../../../src/assets/icons/shield_star_fill.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgShieldStarFill = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 12 256 256\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm-37,87.43-30.31,12.12L158.4,163.2a8,8,0,1,1-12.8,9.6L128,149.33,110.4,172.8a8,8,0,1,1-12.8-9.6l17.74-23.65L85,127.43A8,8,0,1,1,91,112.57l29,11.61V96a8,8,0,0,1,16,0v28.18l29-11.61a8,8,0,1,1,6,14.86Z\", fill: \"currentColor\" }));\nexport default SvgShieldStarFill;\n"],"names":["SvgShieldStarFill","props","React"],"mappings":";AACK,MAACA,IAAoB,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,gBAAgB,MAAM,QAAQ,OAAO,8BAA8B,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,0YAA0Y,MAAM,eAAc,CAAE,CAAC;"}
@@ -1,36 +1,36 @@
1
- import { jsxs as A, jsx as c } from "react/jsx-runtime";
2
- import v from "@uiw/react-json-view";
3
- import j from "react";
4
- import M from "./CopyOverlayButton.js";
5
- import { diffHunks as H } from "./codeBlockDiff.js";
6
- import { CodeLine as P } from "./codeBlockLine.js";
7
- import { rowsWrapperStyle as q } from "./codeBlockStyles.js";
8
- import { devWarning as J } from "./devWarning.js";
9
- import { FOCUS_RING_INSET as W, FOCUS_RING as z } from "./focusRing.js";
10
- const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span", { ...r, style: { ...r.style, color: `var(--w-rjv-type-${o}-color)` }, children: e }) : null, E = (e) => e !== null && typeof e == "object" ? Object.keys(e).length : 0, O = (e, o, r) => r.length > 0 && E(o) > e, B = (e) => {
11
- const o = E(e);
1
+ import { jsxs as A, jsx as n } from "react/jsx-runtime";
2
+ import u from "@uiw/react-json-view";
3
+ import C from "react";
4
+ import H from "./CopyOverlayButton.js";
5
+ import { diffHunks as P } from "./codeBlockDiff.js";
6
+ import { CodeLine as q } from "./codeBlockLine.js";
7
+ import { CODE_TOKEN_COLOR as l, rowsWrapperStyle as J } from "./codeBlockStyles.js";
8
+ import { devWarning as W } from "./devWarning.js";
9
+ import { FOCUS_RING_INSET as V, FOCUS_RING as z } from "./focusRing.js";
10
+ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ n("span", { ...r, style: { ...r.style, color: `var(--w-rjv-type-${o}-color)` }, children: e }) : null, K = (e) => e !== null && typeof e == "object" ? Object.keys(e).length : 0, R = (e, o, r) => r.length > 0 && K(o) > e, B = (e) => {
11
+ const o = K(e);
12
12
  return `${o} ${o === 1 ? "item" : "items"}`;
13
- }, V = (e) => e.map((o) => String(o) || '""').join("."), Q = (e) => (o, { value: r, keys: t }) => o || O(e, r, t), X = (e) => (o, { value: r, keys: t }) => {
13
+ }, Q = (e) => e.map((o) => String(o) || '""').join("."), X = (e) => (o, { value: r, keys: t }) => o || R(e, r, t), Y = (e) => (o, { value: r, keys: t }) => {
14
14
  var m;
15
- if (!O(e, r, t ?? []))
15
+ if (!R(e, r, t ?? []))
16
16
  return null;
17
- const k = String(((m = o.style) == null ? void 0 : m.transform) ?? "").includes("-90");
18
- return /* @__PURE__ */ c(
17
+ const p = String(((m = o.style) == null ? void 0 : m.transform) ?? "").includes("-90");
18
+ return /* @__PURE__ */ n(
19
19
  "button",
20
20
  {
21
21
  type: "button",
22
- "aria-expanded": !k,
23
- "aria-label": `${V(t ?? [])}, ${B(r)}`,
22
+ "aria-expanded": !p,
23
+ "aria-label": `${Q(t ?? [])}, ${B(r)}`,
24
24
  className: `${o.className ?? ""} inline-flex cursor-pointer items-center border-0 bg-transparent p-0 text-inherit ${z}`,
25
25
  style: o.style,
26
26
  children: o.children
27
27
  }
28
28
  );
29
- }, Y = (e) => (
29
+ }, Z = (e) => (
30
30
  // This slot gets no `keys`; the root alone has no `keyName`, as the arrow's slot reads it.
31
- ((o, { value: r, keyName: t }) => Reflect.get(o, "data-expanded") && O(e, r, t === void 0 ? [] : [t]) ? (
31
+ ((o, { value: r, keyName: t }) => Reflect.get(o, "data-expanded") && R(e, r, t === void 0 ? [] : [t]) ? (
32
32
  // Its toggle already names the size, so this would say it twice.
33
- /* @__PURE__ */ c(
33
+ /* @__PURE__ */ n(
34
34
  "span",
35
35
  {
36
36
  "aria-hidden": "true",
@@ -39,67 +39,67 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
39
39
  }
40
40
  )
41
41
  ) : null)
42
- ), T = j.lazy(() => import("./CodeBlockHighlighter.js")), Z = {
42
+ ), E = C.lazy(() => import("./CodeBlockHighlighter.js")), L = {
43
43
  added: "var(--malachite-codeblock-diff-added-background)",
44
44
  removed: "var(--malachite-codeblock-diff-removed-background)",
45
45
  context: void 0
46
- }, L = {
46
+ }, ee = {
47
47
  added: "+",
48
48
  removed: "-",
49
49
  context: void 0
50
- }, ee = {
50
+ }, oe = {
51
51
  added: "var(--malachite-codeblock-diff-assistant-background)",
52
52
  removed: "var(--malachite-codeblock-diff-assistant-removed-background)",
53
53
  context: void 0
54
- }, oe = {
54
+ }, re = {
55
55
  added: "✦",
56
56
  // U+2212 minus sign, not a hyphen: the mock is explicit about which glyph.
57
57
  removed: "−",
58
58
  context: "·"
59
- }, re = {
59
+ }, te = {
60
60
  added: "var(--malachite-codeblock-diff-assistant-foreground)",
61
61
  removed: "var(--malachite-codeblock-diff-removed-foreground)",
62
62
  context: "var(--malachite-codeblock-diff-context-foreground)"
63
- }, te = (e) => `⋯ ${e} unchanged ${e === 1 ? "line" : "lines"}`, ce = (e, o, r) => {
63
+ }, ne = (e) => `⋯ ${e} unchanged ${e === 1 ? "line" : "lines"}`, le = (e, o, r) => {
64
64
  const t = r === "assistant";
65
65
  return {
66
- background: t ? ee[e.type] : Z[e.type],
67
- marker: t ? oe[e.type] : L[e.type],
68
- markerColor: t ? re[e.type] : void 0,
66
+ background: t ? oe[e.type] : L[e.type],
67
+ marker: t ? re[e.type] : ee[e.type],
68
+ markerColor: t ? te[e.type] : void 0,
69
69
  // Reserved on unchanged rows too, so the code column does not step in and out.
70
70
  reserveMarker: !0,
71
71
  // Context rows read as de-emphasised, not just unmarked, in the assistant palette.
72
72
  textColor: t && e.type === "context" ? "var(--malachite-codeblock-diff-context-text)" : void 0,
73
73
  strikethrough: t && e.type === "removed",
74
- separatorAbove: e.skippedAbove === void 0 ? void 0 : te(e.skippedAbove),
74
+ separatorAbove: e.skippedAbove === void 0 ? void 0 : ne(e.skippedAbove),
75
75
  // A removed line has no number in the after-text, so it keeps the one it had before.
76
76
  lineNumber: o ? e.afterNumber ?? e.beforeNumber : void 0
77
77
  };
78
- }, ke = ({
78
+ }, pe = ({
79
79
  code: e,
80
80
  json: o,
81
81
  showLineNumbers: r = !0,
82
82
  className: t = "",
83
- style: k = {},
83
+ style: p = {},
84
84
  height: m,
85
- enableCopy: w = !0,
86
- wrapLines: h = !1,
87
- language: f,
88
- collapsed: K = !1,
89
- collapseLargerThan: a,
90
- diff: d,
91
- "aria-label": p,
92
- "aria-labelledby": y
85
+ enableCopy: N = !0,
86
+ wrapLines: k = !1,
87
+ language: y,
88
+ collapsed: U = !1,
89
+ collapseLargerThan: d,
90
+ diff: i,
91
+ "aria-label": h,
92
+ "aria-labelledby": g
93
93
  }) => {
94
- const R = j.useId(), n = a !== void 0 && Number.isInteger(a) && a >= 0 ? a : void 0;
95
- a !== void 0 && n === void 0 && J(
96
- `CodeBlock.collapseLargerThan:${a}`,
97
- `CodeBlock's collapseLargerThan takes a whole count of 0 or more; ${a} is ignored.`
94
+ const _ = C.useId(), a = d !== void 0 && Number.isInteger(d) && d >= 0 ? d : void 0;
95
+ d !== void 0 && a === void 0 && W(
96
+ `CodeBlock.collapseLargerThan:${d}`,
97
+ `CodeBlock's collapseLargerThan takes a whole count of 0 or more; ${d} is ignored.`
98
98
  );
99
- const l = d ? H(d.before, d.after, d.context) : null, g = (l == null ? void 0 : l.map((s) => s.text).join(`
100
- `)) ?? "", _ = (() => {
101
- if (l)
102
- return g;
99
+ const c = i ? P(i.before, i.after, i.context) : null, x = (c == null ? void 0 : c.map((v) => v.text).join(`
100
+ `)) ?? "", F = (() => {
101
+ if (c)
102
+ return x;
103
103
  if (e)
104
104
  return e;
105
105
  if (o !== void 0)
@@ -108,27 +108,27 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
108
108
  } catch {
109
109
  return;
110
110
  }
111
- })(), F = w && _ !== void 0 && /* @__PURE__ */ c(
112
- M,
111
+ })(), D = N && F !== void 0 && /* @__PURE__ */ n(
112
+ H,
113
113
  {
114
- text: _,
115
- ...y ? {
116
- id: R,
114
+ text: F,
115
+ ...g ? {
116
+ id: _,
117
117
  "aria-label": "Copy",
118
- "aria-labelledby": `${R} ${y}`
119
- } : { "aria-label": p ? `Copy ${p}` : "Copy" },
118
+ "aria-labelledby": `${_} ${g}`
119
+ } : { "aria-label": h ? `Copy ${h}` : "Copy" },
120
120
  iconSize: 14,
121
121
  className: `absolute top-2 right-2 z-10 flex items-center justify-center rounded-md border border-solid border-[var(--malachite-codeblock-border)] bg-[var(--malachite-codeblock-background)] p-1.5 transition-colors hover:bg-[var(--malachite-codeblock-border)] ${z}`,
122
122
  style: { color: "var(--malachite-codeblock-line-number)" }
123
123
  }
124
124
  ), b = {
125
125
  role: "region",
126
- "aria-label": y ? p : p ?? "Code",
127
- "aria-labelledby": y,
126
+ "aria-label": g ? h : h ?? "Code",
127
+ "aria-labelledby": g,
128
128
  tabIndex: 0,
129
- className: `box-border h-full overflow-auto ${W}`
129
+ className: `box-border h-full overflow-auto ${V}`
130
130
  };
131
- if (o && !l)
131
+ if (o && !c)
132
132
  return /* @__PURE__ */ A(
133
133
  "div",
134
134
  {
@@ -137,12 +137,12 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
137
137
  backgroundColor: "var(--malachite-codeblock-background)",
138
138
  borderColor: "var(--malachite-codeblock-border)",
139
139
  height: m,
140
- ...k
140
+ ...p
141
141
  },
142
142
  children: [
143
- F,
144
- /* @__PURE__ */ c("div", { ...b, children: /* @__PURE__ */ A(
145
- v,
143
+ D,
144
+ /* @__PURE__ */ n("div", { ...b, children: /* @__PURE__ */ A(
145
+ u,
146
146
  {
147
147
  value: o,
148
148
  style: {
@@ -154,50 +154,50 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
154
154
  lineHeight: "1.5",
155
155
  textAlign: "left",
156
156
  "--w-rjv-color": "var(--malachite-codeblock-foreground)",
157
- "--w-rjv-key-string": "var(--malachite-codeblock-keyword)",
157
+ "--w-rjv-key-string": l.keyword,
158
158
  "--w-rjv-background-color": "var(--malachite-codeblock-background)",
159
159
  "--w-rjv-line-color": "var(--malachite-codeblock-border)",
160
160
  "--w-rjv-arrow-color": "var(--malachite-codeblock-line-number)",
161
- "--w-rjv-edit-color": "var(--malachite-codeblock-keyword)",
161
+ "--w-rjv-edit-color": l.keyword,
162
162
  "--w-rjv-info-color": "var(--malachite-codeblock-line-number)",
163
- "--w-rjv-update-color": "var(--malachite-codeblock-keyword)",
164
- "--w-rjv-copied-color": "var(--malachite-codeblock-string)",
165
- "--w-rjv-copied-success-color": "var(--malachite-codeblock-string)",
163
+ "--w-rjv-update-color": l.keyword,
164
+ "--w-rjv-copied-color": l.string,
165
+ "--w-rjv-copied-success-color": l.string,
166
166
  "--w-rjv-curlybraces-color": "var(--malachite-codeblock-foreground)",
167
167
  "--w-rjv-colon-color": "var(--malachite-codeblock-foreground)",
168
168
  "--w-rjv-brackets-color": "var(--malachite-codeblock-foreground)",
169
- "--w-rjv-quotes-color": "var(--malachite-codeblock-string)",
170
- "--w-rjv-quotes-string-color": "var(--malachite-codeblock-string)",
171
- "--w-rjv-type-string-color": "var(--malachite-codeblock-string)",
172
- "--w-rjv-type-int-color": "var(--malachite-codeblock-number)",
173
- "--w-rjv-type-float-color": "var(--malachite-codeblock-number)",
174
- "--w-rjv-type-bigint-color": "var(--malachite-codeblock-number)",
175
- "--w-rjv-type-boolean-color": "var(--malachite-codeblock-keyword)",
176
- "--w-rjv-type-date-color": "var(--malachite-codeblock-string)",
177
- "--w-rjv-type-url-color": "var(--malachite-codeblock-keyword)",
178
- "--w-rjv-type-null-color": "var(--malachite-codeblock-keyword)",
179
- "--w-rjv-type-nan-color": "var(--malachite-codeblock-keyword)",
180
- "--w-rjv-type-undefined-color": "var(--malachite-codeblock-keyword)"
169
+ "--w-rjv-quotes-color": l.string,
170
+ "--w-rjv-quotes-string-color": l.string,
171
+ "--w-rjv-type-string-color": l.string,
172
+ "--w-rjv-type-int-color": l.number,
173
+ "--w-rjv-type-float-color": l.number,
174
+ "--w-rjv-type-bigint-color": l.number,
175
+ "--w-rjv-type-boolean-color": l.keyword,
176
+ "--w-rjv-type-date-color": l.string,
177
+ "--w-rjv-type-url-color": l.keyword,
178
+ "--w-rjv-type-null-color": l.keyword,
179
+ "--w-rjv-type-nan-color": l.keyword,
180
+ "--w-rjv-type-undefined-color": l.keyword
181
181
  },
182
182
  displayDataTypes: !1,
183
- enableClipboard: w,
184
- collapsed: K,
185
- shouldExpandNodeInitially: n === void 0 ? void 0 : Q(n),
183
+ enableClipboard: N,
184
+ collapsed: U,
185
+ shouldExpandNodeInitially: a === void 0 ? void 0 : X(a),
186
186
  displayObjectSize: !1,
187
187
  children: [
188
- /* @__PURE__ */ c(v.Null, { render: I("null", "null") }),
189
- /* @__PURE__ */ c(v.Undefined, { render: I("undefined", "undefined") }),
190
- /* @__PURE__ */ c(v.Nan, { render: I("NaN", "nan") }),
191
- /* @__PURE__ */ c(
192
- v.Arrow,
188
+ /* @__PURE__ */ n(u.Null, { render: I("null", "null") }),
189
+ /* @__PURE__ */ n(u.Undefined, { render: I("undefined", "undefined") }),
190
+ /* @__PURE__ */ n(u.Nan, { render: I("NaN", "nan") }),
191
+ /* @__PURE__ */ n(
192
+ u.Arrow,
193
193
  {
194
- render: n === void 0 ? void 0 : X(n)
194
+ render: a === void 0 ? void 0 : Y(a)
195
195
  }
196
196
  ),
197
- /* @__PURE__ */ c(
198
- v.Ellipsis,
197
+ /* @__PURE__ */ n(
198
+ u.Ellipsis,
199
199
  {
200
- render: n === void 0 ? void 0 : Y(n)
200
+ render: a === void 0 ? void 0 : Z(a)
201
201
  }
202
202
  )
203
203
  ]
@@ -206,34 +206,34 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
206
206
  ]
207
207
  }
208
208
  );
209
- const N = w && (!!e || !!l), C = (s, i) => {
210
- const S = s.split(`
209
+ const w = N && (!!e || !!c), S = (v, s) => {
210
+ const $ = v.split(`
211
211
  `);
212
- return /* @__PURE__ */ c(
212
+ return /* @__PURE__ */ n(
213
213
  "div",
214
214
  {
215
215
  ...b,
216
216
  className: `${b.className} p-4 text-left`,
217
- style: { paddingRight: N ? 44 : void 0 },
218
- children: /* @__PURE__ */ c("div", { style: q(h), children: S.map((u, $) => {
219
- const x = i == null ? void 0 : i($);
220
- return /* @__PURE__ */ c(
221
- P,
217
+ style: { paddingRight: w ? 44 : void 0 },
218
+ children: /* @__PURE__ */ n("div", { style: J(k), children: $.map((f, O) => {
219
+ const j = s == null ? void 0 : s(O);
220
+ return /* @__PURE__ */ n(
221
+ q,
222
222
  {
223
- line: u,
224
- lineNumber: (x == null ? void 0 : x.lineNumber) ?? (r ? $ + 1 : void 0),
225
- wrap: h,
226
- decoration: x,
227
- children: u
223
+ line: f,
224
+ lineNumber: (j == null ? void 0 : j.lineNumber) ?? (r ? O + 1 : void 0),
225
+ wrap: k,
226
+ decoration: j,
227
+ children: f
228
228
  },
229
- $
229
+ O
230
230
  );
231
231
  }) })
232
232
  }
233
233
  );
234
- }, D = () => e ? C(e) : null, U = (s) => {
235
- if (s.length === 0)
236
- return /* @__PURE__ */ c(
234
+ }, T = () => e ? S(e) : null, G = (v) => {
235
+ if (v.length === 0)
236
+ return /* @__PURE__ */ n(
237
237
  "div",
238
238
  {
239
239
  className: "p-4 text-left",
@@ -241,33 +241,33 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
241
241
  children: "No changes"
242
242
  }
243
243
  );
244
- const i = (S) => {
245
- const u = s[S];
246
- return u ? ce(u, r, d == null ? void 0 : d.origin) : void 0;
244
+ const s = ($) => {
245
+ const f = v[$];
246
+ return f ? le(f, r, i == null ? void 0 : i.origin) : void 0;
247
247
  };
248
- return f ? /* @__PURE__ */ c(j.Suspense, { fallback: C(g, i), children: /* @__PURE__ */ c(
249
- T,
248
+ return y ? /* @__PURE__ */ n(C.Suspense, { fallback: S(x, s), children: /* @__PURE__ */ n(
249
+ E,
250
250
  {
251
- code: g,
252
- language: f,
251
+ code: x,
252
+ language: y,
253
253
  showLineNumbers: r,
254
- wrapLines: h,
255
- copyClearance: N,
256
- decorate: i,
254
+ wrapLines: k,
255
+ copyClearance: w,
256
+ decorate: s,
257
257
  viewportProps: b
258
258
  }
259
- ) }) : C(g, i);
260
- }, G = () => e ? f ? /* @__PURE__ */ c(j.Suspense, { fallback: D(), children: /* @__PURE__ */ c(
261
- T,
259
+ ) }) : S(x, s);
260
+ }, M = () => e ? y ? /* @__PURE__ */ n(C.Suspense, { fallback: T(), children: /* @__PURE__ */ n(
261
+ E,
262
262
  {
263
263
  code: e,
264
- language: f,
264
+ language: y,
265
265
  showLineNumbers: r,
266
- wrapLines: h,
267
- copyClearance: N,
266
+ wrapLines: k,
267
+ copyClearance: w,
268
268
  viewportProps: b
269
269
  }
270
- ) }) : D() : null;
270
+ ) }) : T() : null;
271
271
  return /* @__PURE__ */ A(
272
272
  "div",
273
273
  {
@@ -276,16 +276,16 @@ const I = (e, o) => (r, { type: t }) => t === "value" ? /* @__PURE__ */ c("span"
276
276
  backgroundColor: "var(--malachite-codeblock-background)",
277
277
  borderColor: "var(--malachite-codeblock-border)",
278
278
  height: m,
279
- ...k
279
+ ...p
280
280
  },
281
281
  children: [
282
- F,
283
- l ? U(l) : G()
282
+ D,
283
+ c ? G(c) : M()
284
284
  ]
285
285
  }
286
286
  );
287
287
  };
288
288
  export {
289
- ke as default
289
+ pe as default
290
290
  };
291
291
  //# sourceMappingURL=CodeBlock.js.map