@stackone/malachite 2.123.1 → 2.125.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.
Files changed (42) hide show
  1. package/COMPONENTS.md +9 -7
  2. package/dist/components/ActionMenu.js +4 -3
  3. package/dist/components/ActionMenu.js.map +1 -1
  4. package/dist/components/Card.js +85 -75
  5. package/dist/components/Card.js.map +1 -1
  6. package/dist/components/Flex.js +10 -8
  7. package/dist/components/Flex.js.map +1 -1
  8. package/dist/components/FrameHeader.js +26 -19
  9. package/dist/components/FrameHeader.js.map +1 -1
  10. package/dist/components/HexagonScale.js +25 -10
  11. package/dist/components/HexagonScale.js.map +1 -1
  12. package/dist/components/KeyValueStrip.js +57 -41
  13. package/dist/components/KeyValueStrip.js.map +1 -1
  14. package/dist/components/PageLayout/index.js +8 -7
  15. package/dist/components/PageLayout/index.js.map +1 -1
  16. package/dist/components/PageLayout/pageColumns.js +23 -0
  17. package/dist/components/PageLayout/pageColumns.js.map +1 -0
  18. package/dist/components/PillButton.js +68 -45
  19. package/dist/components/PillButton.js.map +1 -1
  20. package/dist/components/ScoreMeter.js +79 -0
  21. package/dist/components/ScoreMeter.js.map +1 -0
  22. package/dist/components/Table/Table.js +491 -472
  23. package/dist/components/Table/Table.js.map +1 -1
  24. package/dist/components/Timeline.js +88 -77
  25. package/dist/components/Timeline.js.map +1 -1
  26. package/dist/components/ToastProvider.js +32 -42
  27. package/dist/components/ToastProvider.js.map +1 -1
  28. package/dist/components/Typography/PathText.js +48 -55
  29. package/dist/components/Typography/PathText.js.map +1 -1
  30. package/dist/components/VisuallyHidden.js +8 -0
  31. package/dist/components/VisuallyHidden.js.map +1 -0
  32. package/dist/components/actionMenuStyles.js +33 -42
  33. package/dist/components/actionMenuStyles.js.map +1 -1
  34. package/dist/components/flexTypes.js +1 -1
  35. package/dist/components/flexTypes.js.map +1 -1
  36. package/dist/components/visuallyHiddenStyle.js +16 -0
  37. package/dist/components/visuallyHiddenStyle.js.map +1 -0
  38. package/dist/index.d.ts +63 -2
  39. package/dist/index.js +396 -392
  40. package/dist/index.js.map +1 -1
  41. package/dist/tailwind.css.js +1 -1
  42. package/package.json +1 -1
package/COMPONENTS.md CHANGED
@@ -11,17 +11,17 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
11
11
  - **`SurfaceRow`** — A full-bleed row inside a Surface (used as `Surface.Row`). Owns hover highlight, colour transition and an optional bottom divider. Pass `onClick`/`href` to make the whole row clickable (renders as a real button/anchor, so keyboard nav works). For a selectable row use `role="radio"` + `selected` and put a presentational `<Radio>` inside as the indicator; `selected` then paints the same treatment `Table` gives `selectedRowKey`. Under `role="checkbox"` it only announces — a multi-select row carries its own checkbox, and a highlight marking one of many says nothing when most rows are checked. `selection` overrides that either way (`highlight` / `announce`). `selected="mixed"` marks a partly selected checkbox row (`aria-checked="mixed"`); it never paints or marks a row current, and counts as not selected under any other role. Use `trailing` for a control that must stay interactive — it renders outside the row button, which a nested control could not be. An `onClick` row with `trailing` is still clickable across its whole box, padding and the space around the slot included (an `href` row leaves that to its link, so a modified click still opens a new tab), with its focus ring at the row's edge; a click inside the slot (or in a menu it portals out) is the slot's own, and a disabled row drops both the click and the ring. `revealTrailing` shows that control only on hover, keyboard focus or while a menu it opened is open, keeping it in the tab order and always showing it on a touch screen. `tone="muted"` tints a row whose subject is inactive, which `disabled` does not: a muted row stays clickable. `leading` puts the row's own indicator (a presentational `Checkbox`) inside the row button ahead of the children (with `leading` or `dimmed`, pass one child; it fills the row), and `dimmed` fades the children but not `leading` or `trailing`, for a row switched off but still a click from on. _Key props:_ `divider`, `disabled`, `hover` (default on; `false` leaves the hover to something inside the row), `tone` (`default` | `muted` | `success` | `warning` | `error`; an outcome tone tints the row and recolours its text with that tag colour), `inset` (`none` | `compact` — the row owns an 8px by 16px inset, wrapping `trailing` too, so its content needs no padding wrapper), `onClick`, `href`, `target`, `rel`, `selected` (`boolean` | `"mixed"`), `selection` (`highlight` | `tint` | `announce`; `tint` paints the selected treatment without the accent bar, for a menu whose choice is already marked inside the row), `trailing`, `revealTrailing`, `leading`, `dimmed`, `role`, `className`, `style`.
12
12
  - **`SurfaceExpandableRow`** — A row that opens to reveal a body (used as `Surface.ExpandableRow`), for a line that carries its own controls. Not `Accordion`, which puts its header inside the toggle button, so a header holding a dropdown or a second button would be invalid: here the row surface takes the click and a cell opts out by wrapping its controls in `ExpandableRow.Controls`, while the arrow stays a real button so the keyboard reaches it. That opt-out is explicit rather than sniffing the event target for an interactive ancestor, because a control rendering into a shadow root retargets the event to its host. `sticky` pins the row while its body scrolls, offset by `stickyTopOffset` for whatever is already pinned above it; it only pins while open, since a closed row has nothing to scroll past. _Key props:_ `header`, `children`, `expanded`, `onToggle`, `sticky`, `stickyTopOffset`, `divider`, `tone`, `aria-label`, `className`, `style`.
13
13
  - **`DisclosureArrow`** — The expand/collapse triangle disclosure UI shares (`Accordion`, `Surface.ExpandableRow`). Owns its colour states so they never drift between usages: `text-primary` when expanded, `text-placeholder` otherwise, and dark on hover inside a `group` ancestor — put `group` on the clickable header or row so that hover state activates. _Key props:_ `expanded`, `size`, `className`.
14
- - **`Card`** — Generic content card. `title` heads it, with dimmed `subtitle` text beside it and `extra` actions at the right of the title row. `variant="framed"` draws the detached `Table`’s frame instead: the title row sits on a grey frame and the children in a bordered section inside it, so a card above a table, such as a chart over a log list, reads as part of the same set. `tone` (`CardTone`, the same `neutral` | `warning` | `error` | `success` as `Modal`’s tray) paints a framed card’s frame in that tray colour, for a verdict card; `neutral` keeps the default grey frame. Tone is colour alone, so the title has to say the outcome. It is a type error on a default card. `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to a framed card. _Key props:_ `variant` (`CardVariant`: `default` | `framed`), `tone` (`CardTone`, framed only), `title`, `subtitle`, `extra`, `padding`, `footer`.
14
+ - **`Card`** — Generic content card. `title` heads it, with dimmed `subtitle` text beside it and `extra` actions at the right of the title row. By default the title and subtitle shrink to whatever `extra` leaves them, and on a framed card are cut short with the full text in a tooltip; `wrapExtra` instead moves `extra` onto a line of its own under them, still at the right, when the title and subtitle together do not fit on one line beside it, and the header grows by that line. On a framed card `wrapExtra` also adds 6px above and below the title row, so an `extra` taller than 32px makes the header taller than 44px even when nothing wraps; use a small or medium control there. Keep text that changes width, such as a live save status, out of a wrapping `extra`, or the header jumps between one line and two as it changes. `variant="framed"` draws the detached `Table`’s frame instead: the title row sits on a grey frame and the children in a bordered section inside it, so a card above a table, such as a chart over a log list, reads as part of the same set. `tone` (`CardTone`, the same `neutral` | `warning` | `error` | `success` as `Modal`’s tray) paints a framed card’s frame in that tray colour, for a verdict card; `neutral` keeps the default grey frame. Tone is colour alone, so the title has to say the outcome. It is a type error on a default card. `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to a framed card. A framed card given no children is its title row alone, such as a question with its answer buttons in `extra`. _Key props:_ `variant` (`CardVariant`: `default` | `framed`), `tone` (`CardTone`, framed only), `title`, `subtitle`, `extra`, `wrapExtra`, `padding`, `footer`.
15
15
  - **`LinkCard`** — A compact card that opens more about one thing elsewhere on the screen, such as another tab of a side panel: an optional icon, a title coloured by `tone`, a one-line description cut with an ellipsis, optional `trailing` content such as a level scale, and an accent “Open →”. The whole card is one button, or an anchor with `href` (an unsafe scheme such as `javascript:` is dropped); with neither `onClick` nor a safe `href` it is a static card without the action. Tone is colour alone, so the title has to say the outcome. For a resource in a new tab use `ResourceCard`; for a row in a list use `Surface.Row`. _Key props:_ `title`, `description`, `tone` (`LinkCardTone`: `neutral` | `success` | `warning` | `error`), `icon`, `trailing` (both decorative; `trailing` sits inside the control, so never interactive), `actionLabel` (default `Open`), `onClick`, `href`, `className`.
16
16
  - **`ResourceCard`** — A card pointing at a resource elsewhere, such as an SDK’s documentation: a muted icon tile, a title, a description clamped to two lines and a link that opens in a new tab. `ResourceCard.Header` is the icon, title and description on their own, all phrasing content, so a section that opens on them, such as an `Accordion` header, can use it inside its button. _Key props:_ `icon`, `title`, `description`, `href`, `linkLabel` (default `Documentation`), `titleAs` (`h3` | `h4`), `className`. `ResourceCard.Header`: `icon`, `title`, `description`; phrasing content only, so its title is never a heading.
17
17
  - **`SelectableCard`** — A card that is one option in a radio group — eyebrow, optional status tag, title, description, a count label and a top-right action slot. Use inside a `CardStrip`. Selection is controlled by the consumer: pass `selected`, which drives both the visual treatment and `aria-checked`. A selected card meets the sheet below the way a browser tab meets its toolbar — its bottom corners flare outward onto the strip’s rule — so its outline is one SVG path rather than borders, which would split into two lines at the tangent. `variant` picks the palette: `profile` (green), `library` (neutral) or `editing` (amber, for a profile with unsaved changes). `actions` stands in the card’s top-right corner, on the eyebrow row, and renders outside the control so a menu or icon button inside it stays clickable and keeps its own tab stop. Nothing else marks that corner: the flared outline, the tint and the green eyebrow already say which card is selected, so a radio there would only repeat them. `onDismiss` adds an x after `actions`, tinted like the eyebrow so it reads as part of the card — for discarding a draft card; `dismissDisabledReason` disables it and explains why in its tooltip. `isDefault` marks the card as the account default with a pin beside the title, named for assistive tech and tooltipped for everyone else — it belongs with the name it qualifies rather than among the actions, which read as things to press. `address` puts a one-line chip above the count for a copyable address such as a server URL: its `label` is cut short with an ellipsis, and its full `value` shows in a tooltip and is copied on click, without selecting the card. It takes the place of `description`, since the card has room for one or the other. For a row-shaped selectable use `Surface.Row` instead. _Key props:_ `value`, `title`, `titleIcon`, `isDefault`, `variant` (`profile` | `library` | `editing`), `eyebrow`, `status` (`label`, `type`, `tooltip`), `description`, `address` (`label`, `value`), `countLabel`, `actions`, `onDismiss` (`dismissLabel`, `dismissDisabledReason`), `selected`, `loading` (`loadingLabel`, `loadingHint`), `disabled`, `dimmed`, `onSelect`, `tabIndex`, `aria-label`, `className`, `style`.
18
18
  - **`CardStrip`** — Horizontally scrolling radio group of cards, with edge arrows that appear only when the content overflows, an edge fade, scroll-snap and arrow-key navigation matching `SegmentedControl`. Owns interaction only: it finds its options by looking for `role="radio"` descendants carrying `data-value`, so any such child works (`SelectableCard` emits both). Pass a non-selectable terminal tile as `CardStrip.AddTile` — it sits inside the group but outside the radio set, and must be a direct child or it scrolls with the cards. Use `leading` to pin a card that should not scroll away; the strip tells the cards which slot they are in, so a pinned `SelectableCard` drops the left rule the scrolling ones draw. A strip too narrow to show a card beside `leading` scrolls it with the cards rather than squeezing them, so the selected card always has its full width. Set `bleed` when the strip sits in a `PageLayout`: the strip stretches past the horizontal padding of the layout so its bottom rule runs the full width of the page card, while the cards stay aligned to the gutter. With no cards at all the strip degenerates to its pinned slots alone — no trough, no scroller and no arrows — with the add tile standing beside `leading` and taking `primary` emphasis automatically, since adding the first card is the only thing on offer. _Key props:_ `value`, `tone` (`profile` | `library` | `editing` — read off the selected card unless set), `onChange`, `children`, `leading`, `arrows`, `fadeEdges`, `snap`, `bleed`, `scrollSelectedIntoView`, `aria-label`, `aria-labelledby`, `className`, `style`. `CardStrip.AddTile`: `label`, `icon`, `onClick`, `disabled`, `emphasis` (`primary` | `secondary` — left to the strip unless set: `primary` while there are no cards, `secondary` once there are), `className`.
19
19
  - **`SplitScreenLayout`** — Two-pane full-screen layout (content + preview/aside) with an optional dismiss button.
20
- - **`PageLayout`** — Standard page chrome: a bordered card holding a breadcrumb bar, an optional alert strip, and a header block (subtitle, title + suffix, description) above the page body. Used as `PageLayout.Regular`; `PageLayout.Empty` is the chrome-only variant for pre-auth and error screens, with `headerActions` and `background` slots. `PageLayout.Column` is the capped, centred column that `contentWidth` uses, on its own; set `standalone` for a page with no layout around it. Actions are declared as data (`buttons`) rather than children, and any that do not fit collapse into an overflow `ActionMenu` via `OverflowRow`. A client-side-routed app must pass `renderLink` so crumbs and the back button go through its router instead of reloading the document. Both layouts render a `main` landmark, demoted via `role` when the app owns its own. Deliberately not a `Surface` — the page card is 16px and carries no shadow. _Key props:_ `PageLayout.Regular`: `breadcrumbLinks`, `breadcrumbActions`, `renderLink`, `title`, `titleSuffix`, `subtitle`, `description`, `buttons`, `loading`, `centered`, `noPadding`, `contentGap` (`small` | `medium` | `large` | `xlarge`, default `small`), `contentWidth` (`narrow`: caps and centres the header and body column for a single-column form), `alert`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Empty`: `title`, `centered`, `uniformPadding`, `headerActions`, `background`, `backgroundImage` (a URL laid over the lower half of the content area, cover-fitted and multiplied onto the card so artwork drawn for white sinks into dark; `background` wins), `standalone` (adds the page inset and page background, for a screen rendered before the app frame), `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Column`: `width` (`narrow`), `gap`, `standalone`, `className`.
20
+ - **`PageLayout`** — Standard page chrome: a bordered card holding a breadcrumb bar, an optional alert strip, and a header block (subtitle, title + suffix, description) above the page body. Used as `PageLayout.Regular`; `PageLayout.Empty` is the chrome-only variant for pre-auth and error screens, with `headerActions` and `background` slots. `PageLayout.Column` is the capped, centred column that `contentWidth` uses, on its own; set `standalone` for a page with no layout around it. `PageLayout.Columns` puts exactly two children side by side as equal columns and stacks them when the content area (not the viewport) is narrower than 768px; it needs a parent with a definite width, such as the page body, and always stacks inside `contentWidth="narrow"`. Actions are declared as data (`buttons`) rather than children, and any that do not fit collapse into an overflow `ActionMenu` via `OverflowRow`. A client-side-routed app must pass `renderLink` so crumbs and the back button go through its router instead of reloading the document. Both layouts render a `main` landmark, demoted via `role` when the app owns its own. Deliberately not a `Surface` — the page card is 16px and carries no shadow. _Key props:_ `PageLayout.Regular`: `breadcrumbLinks`, `breadcrumbActions`, `renderLink`, `title`, `titleSuffix`, `subtitle`, `description`, `buttons`, `loading`, `centered`, `noPadding`, `contentGap` (`small` | `medium` | `large` | `xlarge`, default `small`), `contentWidth` (`narrow`: caps and centres the header and body column for a single-column form), `alert`, `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Empty`: `title`, `centered`, `uniformPadding`, `headerActions`, `background`, `backgroundImage` (a URL laid over the lower half of the content area, cover-fitted and multiplied onto the card so artwork drawn for white sinks into dark; `background` wins), `standalone` (adds the page inset and page background, for a screen rendered before the app frame), `role`, `aria-label`, `aria-labelledby`, `className`, `style`. `PageLayout.Column`: `width` (`narrow`), `gap`, `standalone`, `className`. `PageLayout.Columns`: `gap` (default `xlarge`), `className`.
21
21
  - **`WizardLayout`** — Full-screen wizard scaffold: top bar (back button, right-aligned stepper, trailing slot), pinned `header` slot, centered scrolling content column, and a pinned footer (above sticky body content). `footerGlass` gives the footer a frosted translucent + backdrop-blur treatment. `banner` pins a page-wide notice under the top bar, above `header` and outside the content column, so a warning about the whole page is not squeezed to the column's width — pair it with `Alert layout="banner"`. `topBarSize="large"` draws a 60px top bar with 28px insets (52px and 16px below 640px). `footerAlign="content"` holds the footer to the content column, inside its gutter, so a full-width action lines up with the list above it. `reserveBack={false}` drops the square held for a hidden back button, so `leading` sits at the same inset as `trailing`; the default keeps it so `leading` does not move as the wizard steps. _Key props:_ `showBack`, `onBack`, `reserveBack`, `topBarSize` (`default` | `large`), `footerAlign` (`full` | `content`), `leading`, `stepper`, `trailing`, `banner`, `header`, `footer`, `footerGlass`, `center`, `contentWidth`, `minWidth`.
22
22
  - **`PageActions`** — A page's action buttons, collapsing into an overflow menu as the row narrows. `PageLayout.Regular` renders these from its `buttons` prop; import it directly when a page builds its own header block (e.g. one that scrolls the title away) so the collapse, the dividers and the href handling come with it rather than being hand-rolled. _Key props:_ `buttons` (`PageAction[]`).
23
23
  - **`Toolbar`** — Flat, opaque horizontal bar for a sub-header / filter row (e.g. a Search). Owns its chrome — an opaque ground (`card-background`, or the sunken page ground with `surface="page"` for a bar above a card), so it can pin over scrolling content, plus an optional bottom `divider` — so consumers don’t hand-roll background/border tokens. Its `TOOLBAR_FILTER_WIDTH_PX` / `TOOLBAR_FILTER_MIN_WIDTH_PX` / `TOOLBAR_FILL_BASIS_PX` / `TOOLBAR_FILL_MIN_WIDTH_PX` are exported so a control outside the bar can line up with one inside it without re-typing the number. `sticky` pins it to the top of its scroll container; any other positioning is left to the consumer, as is the gutter when `padding="none"` — use that when the bar must sit flush with the content it pins over. `layout="filters"` makes it own the layout too, which consumers were each re-deriving and getting wrong the same way: a `flex: 1` search with no floor collapses to nothing on a narrow viewport, and a row that cannot wrap runs off the page. Compose it as `Toolbar.Fill` for the search and `Toolbar.Item` per filter, as flat siblings; `grow={false}` stops a slot growing past its basis, for a row that already spaces its children, though it can still shrink toward its `minWidth`. The row packs greedily from its basis widths and each line's spare space is shared out by grow factor, which is deliberately lopsided: the search outweighs the filters a hundred to one, so a shared line leaves them at their 200px while a filter left alone on a wrapped line grows into the whole width instead of stranding beside a gap. A filter drops to the next line once its full 200px basis will not fit, and the filters sharing a line then compress toward a 160px floor. A search and a filter are laid out differently rather than uniformly, because a search field's useful width is "as much as you can spare" where a filter's is the width of a value. _Key props:_ `divider`, `padding` (`none` | `compact` | `default`), `layout` (`plain` | `filters`), `surface` (`card` | `page` — `page` paints the sunken page ground, for a bar that sits above a card rather than inside it), `sticky` (pins it to the top of its scroll container above the rows under it), `className`, `style`. `Fill`: `minWidth`. `Item`: `width`, `minWidth`, `grow`.
24
- - **`Flex`** — Flexbox layout helper with semantic direction/align/justify/gap props. _Key props:_ `FlexDirection`, `FlexAlign`, `FlexJustify`, `FlexGapSize`. `as` (`div` | `span`, the latter for content inside a clickable `Surface.Row`)
24
+ - **`Flex`** — Flexbox layout helper with semantic direction/align/justify/gap props. _Key props:_ `FlexDirection`, `FlexAlign`, `FlexJustify`, `FlexGapSize` (`XXSmall`, `XSmall`, `Small`, `Medium`, `Large`). `shrink` lets it narrow below its content. A `TruncatedTooltip` as a direct child of a horizontal row that can itself narrow (`shrink`) needs no clipping wrapper, as it clips itself. `as` (`div` | `span`, the latter for content inside a clickable `Surface.Row`)
25
25
  - **`Padded`** — Padding wrapper applying consistent design-system spacing.
26
26
  - **`Spacer`** — Empty element that adds fixed spacing between siblings.
27
27
  - **`Divider`** — Separator; supports a dashed line style. Horizontal by default and spanning its container; `orientation="vertical"` draws a rule between inline controls (e.g. groups in a toolbar) and holds its width in a tight flex row. `length` sizes it along its own axis on a fixed scale, and it never shrinks below 1px. `DividerVariant.Muted` is the lighter rule between parts of one card, such as above a card’s footer. _Key props:_ `orientation="horizontal" | "vertical"`, `length` (`small` | `medium` | `large`), `lineStyle="solid" | "dashed"`, `DividerVariant`, `SpacingSize`, `PaddingSize`.
@@ -108,7 +108,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
108
108
  - **`Keycap`** — One key on a keyboard, drawn as a cap — `esc`, `⌘`, a caret, or a sigil a user types to scope a search. Renders a `<kbd>`, or a button as soon as either `onClick` or `disabled` is passed — `disabled={false}` included, since naming the prop at all is the statement that the cap is a control. `SidePanelNavFooter` is built on it.
109
109
  - **`CollapsibleSection`** — Collapsible sunken-card section (title - subtitle header, disclosure arrow right) for stacked detail sections in side panels and detail pages. A preset over `Accordion`’s `sunken` variant.
110
110
  - **`KeyValueList`** — Bordered card of label/value rows (`KeyValueList.Row`) for entity details: fixed-width secondary labels, free-form values, row dividers. `truncate` keeps a long value (an ID) to one line with an ellipsis at the cell width and a tooltip only when it is actually cut off — the value itself when it is text, else the row’s `tooltip` (`null` turns it off). For inline content only: a Tag or AppLogo is clipped without an ellipsis, so use its own truncate, as with `CodeText truncate`. `size="small"` tightens the rows for a list inside a dialog or panel. _Key props:_ `size` (`small` | `medium`), `label`, `truncate`, `tooltip`.
111
- - **`KeyValueStrip`** — Label/value cells side by side in one sunken band, divided by rules (`KeyValueStrip.Item`), for the facts under a side panel’s header. Cells share the width equally and text values are small, in medium weight. `truncate` keeps a value to one line with an ellipsis and, for text, a tooltip only when it is cut off; with `truncate`, a given `tooltip` always shows, since it may say more than the value (a full id behind a shortened one), and `null` turns it off. `prefix` (an icon) and `suffix` (a copy button) stay whole while the value truncates. For a vertical list of rows use `KeyValueList`. _Key props:_ `aria-label`, `label`, `truncate`, `tooltip`, `prefix`, `suffix`.
111
+ - **`KeyValueStrip`** — Label/value cells side by side in one sunken band, divided by rules (`KeyValueStrip.Item`), for the facts under a side panel’s header. Cells share the width equally and text values are small, in medium weight. `truncate` keeps a value to one line with an ellipsis and, for text, a tooltip only when it is cut off; with `truncate`, a given `tooltip` always shows, since it may say more than the value (a full id behind a shortened one), and `null` turns it off. `prefix` (an icon) and `suffix` (a copy button) stay whole while the value truncates. `tone` (`KeyValueStripTone`: `neutral` | `success` | `warning` | `error`) puts a dot before the label in that outcome’s colour, for a strip that summarises the stages of a check; it is colour alone, so the value has to say the outcome. For a vertical list of rows use `KeyValueList`. _Key props:_ `aria-label`, `label`, `tone`, `truncate`, `tooltip`, `prefix`, `suffix`.
112
112
 
113
113
  ## Buttons & actions
114
114
 
@@ -117,7 +117,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
117
117
  - **`SplitButton`** — One pill made of a primary action and a trailing menu trigger, sharing `Button`'s chrome: for an action with a default and a choice behind it, such as authorizing on every connected app or on one. The two segments are two real buttons, each with its own hover, active and keyboard focus, separated by a translucent seam that reads on every variant's ground; `disabled` and `loading` take both out together. The trigger shows a chevron pointing down while closed and up while `menuOpen`, which also sets `aria-expanded`, and is named by `menuLabel` since it shows no text. `trailing` sits after the label at its own size, for an `AvatarGroup` of what the action reaches. To open a `Popover` from the trigger, pass `menuTrigger`: it hands the segment to the Popover as its `trigger`, so the main segment stays a plain action rather than toggling the menu too. The menu itself is composed by the consumer from `Popover` and `Surface.Row`. _Key props:_ `variant` (every `Button` variant, default `filled`), `size` (default `medium`), `children`, `leading`, `trailing`, `onClick`, `type`, `loading`, `disabled`, `flexGrow`, `menuLabel`, `menuOpen`, `onMenuClick`, `menuIcon`, `menuHasPopup`, `menuRef`, `menuTrigger` (`(segment) => node`), `ref`, `className`, `style`.
118
118
  - **`CloseButton`** — The bare X that dismisses a screen, panel or wizard: secondary at rest, primary on hover and keyboard focus, with no box or background at either. Use it instead of a `ghost` `Button` (which draws a hover box) or `no-style` (which has no disabled look). `surface="inverse"` is for a panel that stays dark in every theme, such as `SplitScreenLayout`’s, and reads the `closeButton` theme tokens. `loading` swaps the X for a spinner and sets `aria-busy`. Disabled and loading both use `aria-disabled` rather than `disabled`, so they ignore clicks but stay focusable and can still trigger a `Tooltip` explaining why. Named "Close" unless `aria-label` says otherwise. _Key props:_ `onClick`, `aria-label`, `size` (`small` 24px | `medium` 32px, 12px glyph), `surface` (`default` | `inverse`), `disabled`, `loading`.
119
119
  - **`AccessPills`** — Three toggle pills, R / W / D, saying which effects an account grants (Read, Write, Delete) — on a linked-account row and in the header above the rows. Each pill is a button with `aria-pressed`, named in full by its state (`Write: some actions off`), and a tooltip on hover and focus spells that name out, since a letter alone is cryptic. On paints the effect’s tint (Read in `Tag`’s primary, Write in warning, Delete in error, the colours the dashboard already gives these effects), `"mixed"` (some, not all, of its actions on) an empty pill with a dashed border, off a neutral one. The colours come from the theme and there is no colour prop. It reports only which pill was pressed through `onToggle`: any cascade between effects (Read off turning Write and Delete off, say) and what pressing a mixed pill means belong to the caller. A pill in `disabled` stays focusable with `aria-disabled`, ignores clicks and keys, and its tooltip shows `disabledReason` instead, which is also its accessible description. `size="dense"` draws 24×20 pills in place of 26×24, for a narrow screen. _Key props:_ `value` (`{ read, write, delete }`, each `true` | `false` | `"mixed"`), `onToggle(effect)`, `disabled` (per effect), `disabledReason` (per effect, or one string), `size` (`default` | `dense`), `aria-label`, `aria-labelledby`.
120
- - **`PillButton`** — Pill-shaped button, often used for filters/toggleable chips. `shape="tab"` squares the top corners so a row of them reads as attached to whatever sits above — the controls under a chat composer. Pass `href` and an interactive, non-disabled pill renders a real anchor (cmd-click, copy-link) instead of navigating from `onClick`; a disabled or `interactive={false}` pill stays static, and an unsafe scheme such as `javascript:` is dropped. `target="_blank"` always carries `noopener noreferrer`. _Key props:_ `label`, `icon`, `trailingIcon`, `selected`, `disabled`, `interactive`, `size`, `variant`, `shape` (`pill` | `tab`), `onClick`, `href`, `target`, `rel`.
120
+ - **`PillButton`** — Pill-shaped button, often used for filters/toggleable chips. `shape="tab"` squares the top corners so a row of them reads as attached to whatever sits above — the controls under a chat composer. Pass `href` and an interactive, non-disabled pill renders a real anchor (cmd-click, copy-link) instead of navigating from `onClick`; a disabled or `interactive={false}` pill stays static, and an unsafe scheme such as `javascript:` is dropped. `target="_blank"` always carries `noopener noreferrer`. _Key props:_ `label`, `icon`, `trailingIcon`, `selected`, `pressed` (makes a button pill a toggle: announces `aria-pressed` and paints the selected look while true, in place of `selected`; not on a link pill or the `assistant` tone), `disabled`, `interactive`, `size`, `variant`, `shape` (`pill` | `tab`), `onClick`, `href`, `target`, `rel`.
121
121
  - **`CopyButton`** — The small copy control a copyable `Input` ends with, for a copyable value that is not an input, such as a list of scopes beside its label, so the two read the same. With `value` it copies and shows a check for a second; without, the click is the caller’s. _Key props:_ `value`, `onCopy`, `copied`, `aria-label`, `tooltip`.
122
122
  - **`BannerButton`** — A banner that is one button: the warm ground, an icon in a white tile, a title with one line under it, and an arrow at the end that darkens on hover. For an offer of help beside a form, such as opening its setup guide, that wants more presence than a link and less than a primary button. Pass `aria-expanded` when it opens and closes something. _Key props:_ `icon`, `title`, `description`, `trailing`, `onClick`, `aria-expanded`, `aria-controls`, `aria-label`.
123
123
  - **`Link`** — Styled anchor/link text. Opens in a new tab by default; with `renderLink`, a root-relative href goes through the app's own link component instead (href, classes, children and `onClick` when set; no `target` or `rel`), while any other href keeps the new-tab anchor. _Key props:_ `href`, `color` (`default` | `dimmed` | `inherit`; `inherit` takes the surrounding text colour, for a name in a tinted row, and thickens its underline on hover, a cue that shows on any surface and theme; it is always underlined, whatever `underline` says), `size`, `underline`, `truncate` (as a flex item, shrinks and ellipsizes the label), `onClick`, `renderLink`, `target`, `rel`.
@@ -128,11 +128,12 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
128
128
  ## Data display
129
129
 
130
130
  - **`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`.
131
+ - **`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`.
131
132
  - **`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`.
132
- - **`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. 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`, `className`.
133
+ - **`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
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`.
134
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`).
135
- - **`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`, `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`).
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`).
136
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`), `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
138
  - **`Statistic`** — Displays a statistic value with a label; primary/secondary sizes. _Key props:_ `StatisticValueSize`.
138
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"`.
@@ -161,3 +162,4 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
161
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.
162
163
  - **`CustomIcons`** — Namespace of all built-in icons (`CustomIcons.<Name>Icon`), coloured via `currentColor`.
163
164
  - **`ShadowEscape`** — Renders children into the document (escaping the shadow root) for portals/overlays.
165
+ - **`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`.
@@ -7,7 +7,7 @@ import re from "./CustomIcons/MoreHorizontalIcon.js";
7
7
  import te from "./Typography/EllipsisText.js";
8
8
  import { groupChoices as le, isChoiceItem as ie } from "./actionMenuGroups.js";
9
9
  import { scrollCheckedIntoView as se, focusOpeningItem as ae, scrollFocusedIntoView as ce, edgeForTriggerKey as de, focusEdge as ue, itemForMenuKey as pe, enabledItems as fe } from "./actionMenuKeyboard.js";
10
- import { TRIGGER_SIZES as ye, EMPTY_ITEM_STYLE as he, MENU_COLUMN_STYLE as Ee, menuStyle as me, itemStyle as z, HEADING_ITEM_STYLE as ge, TEXT_ITEM_STYLE as be, TEXT_ITEM_LABEL_STYLE as Te, CHOSEN_ATTR as Ie, isChosen as Se, LABEL_STYLE as ke, VISUALLY_HIDDEN_STYLE as U, INDENT_RULE_STYLE as ve, ITEM_ICON_CLASS as _e, itemIconStyle as Me, ITEM_TEXT_STYLE as Ce, DESCRIPTION_CLASS as Le, descriptionStyle as De, checkSlotStyle as Ne, ITEM_CLASS as we } from "./actionMenuStyles.js";
10
+ import { TRIGGER_SIZES as ye, EMPTY_ITEM_STYLE as he, MENU_COLUMN_STYLE as Ee, menuStyle as me, itemStyle as z, HEADING_ITEM_STYLE as ge, TEXT_ITEM_STYLE as be, TEXT_ITEM_LABEL_STYLE as Te, CHOSEN_ATTR as Ie, isChosen as Se, LABEL_STYLE as ke, INDENT_RULE_STYLE as ve, ITEM_ICON_CLASS as _e, itemIconStyle as Me, ITEM_TEXT_STYLE as Ce, DESCRIPTION_CLASS as Le, descriptionStyle as De, checkSlotStyle as Ne, ITEM_CLASS as we } from "./actionMenuStyles.js";
11
11
  import { getDeepActiveElement as Re } from "./activeElement.js";
12
12
  import { elementRef as Ae, composeRefs as Pe, chainHandler as D } from "./composeRefs.js";
13
13
  import { pushEscapeLayer as xe } from "./escapeLayers.js";
@@ -17,6 +17,7 @@ import { usePopupLayer as $e } from "./overlayLayers.js";
17
17
  import { isRenderableNode as N } from "./renderableNode.js";
18
18
  import { safeHref as Ke } from "./safeHref.js";
19
19
  import { useActionMenuPosition as Be } from "./useActionMenuPosition.js";
20
+ import { VISUALLY_HIDDEN_STYLE as U } from "./visuallyHiddenStyle.js";
20
21
  const Fe = w.lazy(() => import("./ActionMenuTagHost.js")), C = (e) => e.stopPropagation(), ze = ({ item: e, tone: p, highlight: m, onSelect: S, onFollow: g, labelId: u }) => {
21
22
  var _;
22
23
  const f = G();
@@ -104,7 +105,7 @@ const Fe = w.lazy(() => import("./ActionMenuTagHost.js")), C = (e) => e.stopProp
104
105
  children: s
105
106
  }
106
107
  ) : /* @__PURE__ */ r("button", { ...k, type: "button", disabled: e.disabled, onClick: () => S(e), children: s });
107
- }, dn = ({
108
+ }, un = ({
108
109
  items: e,
109
110
  label: p = "More actions",
110
111
  triggerIcon: m,
@@ -269,6 +270,6 @@ const Fe = w.lazy(() => import("./ActionMenuTagHost.js")), C = (e) => e.stopProp
269
270
  ] });
270
271
  };
271
272
  export {
272
- dn as default
273
+ un as default
273
274
  };
274
275
  //# sourceMappingURL=ActionMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActionMenu.js","sources":["../../src/components/ActionMenu.tsx"],"sourcesContent":["import React, { useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport Button from './Button';\nimport type { ButtonVariant } from './Button';\nimport CheckmarkIcon from './CustomIcons/CheckmarkIcon';\nimport MoreHorizontalIcon from './CustomIcons/MoreHorizontalIcon';\nimport EllipsisText from './Typography/EllipsisText';\nimport { groupChoices, isChoiceItem } from './actionMenuGroups';\nimport {\n type MenuEdge,\n edgeForTriggerKey,\n enabledItems,\n focusEdge,\n focusOpeningItem,\n itemForMenuKey,\n scrollCheckedIntoView,\n scrollFocusedIntoView,\n} from './actionMenuKeyboard';\nimport {\n type ActionMenuTone,\n CHOSEN_ATTR,\n DESCRIPTION_CLASS,\n EMPTY_ITEM_STYLE,\n HEADING_ITEM_STYLE,\n INDENT_RULE_STYLE,\n ITEM_CLASS,\n ITEM_ICON_CLASS,\n ITEM_TEXT_STYLE,\n LABEL_STYLE,\n MENU_COLUMN_STYLE,\n TEXT_ITEM_LABEL_STYLE,\n TEXT_ITEM_STYLE,\n TRIGGER_SIZES,\n VISUALLY_HIDDEN_STYLE,\n checkSlotStyle,\n descriptionStyle,\n isChosen,\n itemIconStyle,\n itemStyle,\n menuStyle,\n} from './actionMenuStyles';\nimport type { ActionMenuIntent, ActionMenuItem, ActionMenuPlacement } from './actionMenuTypes';\nimport { getDeepActiveElement } from './activeElement';\nimport { chainHandler, composeRefs, elementRef } from './composeRefs';\nimport { pushEscapeLayer } from './escapeLayers';\nimport type { FloatingOffset } from './floatingMenuGeometry';\nimport { isPlainClick } from './linkClick';\nimport { resolveRel } from './linkRel';\nimport { usePopupLayer } from './overlayLayers';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport { useActionMenuPosition } from './useActionMenuPosition';\n\nexport type { ActionMenuIntent, ActionMenuItem, ActionMenuPlacement, ActionMenuTone };\n\nexport interface ActionMenuProps {\n items: ActionMenuItem[];\n label?: string;\n triggerIcon?: React.ReactNode;\n minWidth?: number;\n size?: 'small' | 'xsmall';\n /**\n * Shows `label` beside the icon instead of leaving it to the accessible name. For a menu\n * that is the point of its corner rather than an overflow for a row that already reads —\n * a kebab nobody can name is only safe when the row it belongs to says what it acts on.\n */\n showLabel?: boolean;\n /** Trigger's Button variant. Defaults to `outline`, the overflow-kebab look. */\n variant?: ButtonVariant;\n trigger?: React.ReactElement;\n placement?: ActionMenuPlacement;\n offset?: FloatingOffset;\n /** `muted` reads items in the secondary text colour, as in a sidebar's menus. */\n tone?: ActionMenuTone;\n /**\n * Styles the menu as a picker: the checked choice of each `group` sits on a light green row\n * with a green check, and the text row whose label is a set's `group` name sits a notch\n * smaller, as its heading.\n */\n highlightChoices?: boolean;\n}\n\ntype TriggerHandlers = {\n onClick?: (event: React.MouseEvent) => void;\n onMouseDown?: (event: React.MouseEvent) => void;\n onKeyDown?: (event: React.KeyboardEvent) => void;\n};\n\n// Loaded only when an item has a tag: its shadow host pulls in the Tailwind sheet, which a menu\n// without tags should not pay for.\nconst ActionMenuTagHost = React.lazy(() => import('./ActionMenuTagHost'));\n\nconst stopPropagation = (event: React.SyntheticEvent) => event.stopPropagation();\n\nconst MenuItemRow: React.FC<{\n item: ActionMenuItem;\n tone: ActionMenuTone;\n highlight: boolean;\n onSelect: (item: ActionMenuItem) => void;\n onFollow: () => void;\n labelId?: string;\n}> = ({ item, tone, highlight, onSelect, onFollow, labelId }) => {\n const descriptionId = useId();\n if (item.type === 'divider') {\n return <div role=\"separator\" style={itemStyle(item)} />;\n }\n if (item.type === 'text') {\n return (\n <div\n id={labelId}\n role=\"menuitem\"\n aria-disabled=\"true\"\n style={labelId && highlight ? HEADING_ITEM_STYLE : TEXT_ITEM_STYLE}\n >\n {typeof item.label === 'string' ? (\n <EllipsisText\n tooltip={item.label}\n tooltipWhenTruncated\n inline\n style={TEXT_ITEM_LABEL_STYLE}\n >\n {item.label}\n </EllipsisText>\n ) : (\n item.label\n )}\n </div>\n );\n }\n const isChoice = isChoiceItem(item);\n const described = isRenderableNode(item.description);\n const tagged = isRenderableNode(item.tag);\n const shared = {\n role: isChoice ? 'menuitemradio' : 'menuitem',\n 'aria-checked': isChoice ? item.checked : undefined,\n 'aria-describedby': described\n ? `${descriptionId}${item.tooltip ? ` ${descriptionId}-tooltip` : ''}`\n : undefined,\n title: item.tooltip,\n 'aria-current': item.current ? ('page' as const) : undefined,\n className: ITEM_CLASS,\n 'data-danger': item.danger === 'hover' ? 'hover' : undefined,\n 'data-tone': tone,\n [CHOSEN_ATTR]: isChosen(item, highlight) ? '' : undefined,\n style: itemStyle(item, tone),\n };\n const href = item.disabled ? undefined : safeHref(item.href);\n const opensNewTab = href !== undefined && item.target?.toLowerCase() === '_blank';\n const label = (\n <span style={LABEL_STYLE}>\n {item.label}\n {opensNewTab && <span style={VISUALLY_HIDDEN_STYLE}> (opens in a new tab)</span>}\n </span>\n );\n const content = (\n <>\n {item.indent ? <span aria-hidden=\"true\" style={INDENT_RULE_STYLE} /> : null}\n {isRenderableNode(item.icon) && (\n <span className={ITEM_ICON_CLASS} style={itemIconStyle(item)}>\n {item.icon}\n </span>\n )}\n {described ? (\n <span style={ITEM_TEXT_STYLE}>\n {label}\n <span\n id={descriptionId}\n aria-hidden=\"true\"\n className={DESCRIPTION_CLASS}\n style={descriptionStyle(item)}\n >\n {item.description}\n </span>\n {item.tooltip ? (\n <span\n id={`${descriptionId}-tooltip`}\n aria-hidden=\"true\"\n style={VISUALLY_HIDDEN_STYLE}\n >\n {item.tooltip}\n </span>\n ) : null}\n </span>\n ) : (\n label\n )}\n {tagged ? (\n <React.Suspense fallback={null}>\n <ActionMenuTagHost>{item.tag}</ActionMenuTagHost>\n </React.Suspense>\n ) : null}\n {isChoice ? (\n <span aria-hidden=\"true\" style={checkSlotStyle(item, highlight)}>\n {item.checked ? <CheckmarkIcon size={14} /> : null}\n </span>\n ) : null}\n </>\n );\n if (href !== undefined) {\n return (\n <a\n {...shared}\n href={href}\n target={item.target}\n rel={resolveRel(undefined, item.target)}\n onClick={(event) => {\n if (isPlainClick(event) && item.onClick) {\n event.preventDefault();\n onSelect(item);\n return;\n }\n onFollow();\n }}\n onAuxClick={(event) => {\n if (event.button === 1) {\n onFollow();\n }\n }}\n >\n {content}\n </a>\n );\n }\n return (\n <button {...shared} type=\"button\" disabled={item.disabled} onClick={() => onSelect(item)}>\n {content}\n </button>\n );\n};\n\n/**\n * ActionMenu is an overflow action menu. The trigger is a three-dot `Button` by default, or\n * your own control via `trigger`. The menu is portaled to document.body, so it escapes any\n * Shadow DOM or overflow:hidden ancestor, which is also why it is styled inline.\n */\nconst ActionMenu: React.FC<ActionMenuProps> = ({\n items,\n label = 'More actions',\n triggerIcon,\n minWidth,\n size = 'small',\n showLabel = false,\n variant = 'outline',\n trigger: customTrigger,\n placement = 'bottom-end',\n offset,\n tone = 'default',\n highlightChoices = false,\n}) => {\n const triggerSize = TRIGGER_SIZES[size];\n const [open, setOpen] = useState(false);\n const headingBase = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const focusOnOpen = useRef<MenuEdge | null>(null);\n const focusInMenu = useRef(false);\n const popupIdentity = usePopupLayer('actionmenu', open, menuRef);\n\n const position = useActionMenuPosition(open, triggerRef, menuRef, {\n minWidth,\n placement,\n offset,\n });\n\n // A hidden item cannot take focus, so wait until the menu is positioned and shown.\n const positioned = position !== null;\n useEffect(() => {\n if (!open || !positioned) {\n return;\n }\n scrollCheckedIntoView(menuRef.current);\n if (focusOnOpen.current) {\n focusOpeningItem(menuRef.current, focusOnOpen.current);\n focusOnOpen.current = null;\n scrollFocusedIntoView(menuRef.current);\n }\n }, [open, positioned]);\n\n useEffect(() => {\n if (!open) {\n return;\n }\n const closeOnOutsidePress = (event: MouseEvent) => {\n const path = event.composedPath();\n const inside = [triggerRef.current, menuRef.current].some(\n (node) => node && path.includes(node),\n );\n if (!inside) {\n focusInMenu.current = false;\n setOpen(false);\n }\n };\n document.addEventListener('mousedown', closeOnOutsidePress, true);\n const popEscapeLayer = pushEscapeLayer(() => setOpen(false));\n return () => {\n document.removeEventListener('mousedown', closeOnOutsidePress, true);\n popEscapeLayer();\n const active = getDeepActiveElement();\n if (focusInMenu.current && (!active || active === document.body)) {\n triggerRef.current?.focus({ preventScroll: true });\n }\n focusInMenu.current = false;\n };\n }, [open]);\n\n const toggleFromTrigger = (event: React.MouseEvent) => {\n event.stopPropagation();\n const openedFromKeyboard = !open && event.detail === 0;\n focusOnOpen.current = openedFromKeyboard ? 'first' : null;\n setOpen((v) => !v);\n };\n\n const handleTriggerKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Tab' && open) {\n setOpen(false);\n return;\n }\n const edge = edgeForTriggerKey(event.key, placement);\n if (!edge) {\n return;\n }\n event.preventDefault();\n if (open) {\n focusEdge(menuRef.current, edge);\n return;\n }\n focusOnOpen.current = edge;\n setOpen(true);\n };\n\n const handleMenuKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Tab') {\n focusInMenu.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n setOpen(false);\n return;\n }\n if (event.key === ' ' && event.target instanceof HTMLAnchorElement) {\n event.preventDefault();\n event.target.click();\n return;\n }\n const target = itemForMenuKey(enabledItems(menuRef.current), event.target, event.key);\n if (target) {\n event.preventDefault();\n target.focus();\n }\n };\n\n const selectItem = (item: ActionMenuItem) => {\n if (item.type === 'divider' || item.type === 'text' || item.disabled) {\n return;\n }\n item.onClick?.();\n setOpen(false);\n };\n\n const ownTriggerRef = customTrigger ? elementRef<HTMLElement>(customTrigger) : undefined;\n const composedTriggerRef = useMemo(\n () => composeRefs(ownTriggerRef, triggerRef),\n [ownTriggerRef],\n );\n const customHandlers = customTrigger?.props as TriggerHandlers | undefined;\n\n const triggerElement = customTrigger ? (\n React.cloneElement(customTrigger, {\n ref: composedTriggerRef,\n 'aria-haspopup': 'menu',\n 'aria-expanded': open,\n onClick: chainHandler(customHandlers?.onClick, toggleFromTrigger),\n onMouseDown: chainHandler(customHandlers?.onMouseDown, stopPropagation),\n onKeyDown: chainHandler(customHandlers?.onKeyDown, handleTriggerKeyDown),\n } as Record<string, unknown>)\n ) : (\n <Button\n ref={triggerRef as React.RefObject<HTMLButtonElement>}\n type=\"button\"\n variant={variant}\n size={size}\n iconOnly={!showLabel}\n aria-label={showLabel ? undefined : label}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className={`shrink-0${showLabel ? ' gap-2' : ''}`}\n onClick={toggleFromTrigger}\n onMouseDown={stopPropagation}\n onKeyDown={handleTriggerKeyDown}\n >\n <span className={`inline-flex items-center justify-center ${triggerSize.iconBox}`}>\n {triggerIcon ?? <MoreHorizontalIcon size={triggerSize.icon} />}\n </span>\n {showLabel && <span>{label}</span>}\n </Button>\n );\n\n const entries = useMemo(() => groupChoices(items), [items]);\n const closeMenu = () => setOpen(false);\n const headingIdOf = (index: number) => `${headingBase}-${index}`;\n const renderRow = (item: ActionMenuItem, labelId?: string, key = item.key) => (\n <MenuItemRow\n key={key}\n item={item}\n tone={tone}\n highlight={highlightChoices}\n onSelect={selectItem}\n onFollow={closeMenu}\n labelId={labelId}\n />\n );\n\n return (\n <>\n {triggerElement}\n {open &&\n createPortal(\n <div\n ref={menuRef}\n role=\"menu\"\n tabIndex={-1}\n aria-label={label}\n {...popupIdentity}\n style={menuStyle(position)}\n onMouseDown={stopPropagation}\n onClick={stopPropagation}\n onKeyDown={handleMenuKeyDown}\n onFocus={() => {\n focusInMenu.current = true;\n }}\n onBlur={(e) => {\n if (!menuRef.current?.contains(e.relatedTarget as Node | null)) {\n focusInMenu.current = false;\n }\n }}\n >\n {items.length === 0 && (\n <div role=\"menuitem\" aria-disabled=\"true\" style={EMPTY_ITEM_STYLE}>\n No actions available\n </div>\n )}\n {entries.map((entry, index) =>\n entry.kind === 'item' ? (\n renderRow(\n entry.item,\n entry.labelsNext ? headingIdOf(index) : undefined,\n `item:${entry.item.key}`,\n )\n ) : (\n <div\n key={`group:${entry.items[0]?.key}`}\n role=\"group\"\n aria-labelledby={\n entry.labelledByPrevious\n ? headingIdOf(index - 1)\n : undefined\n }\n aria-label={entry.labelledByPrevious ? undefined : entry.name}\n style={MENU_COLUMN_STYLE}\n >\n {entry.items.map((item) => renderRow(item))}\n </div>\n ),\n )}\n </div>,\n document.body,\n )}\n </>\n );\n};\n\nexport default ActionMenu;\n"],"names":["ActionMenuTagHost","React","stopPropagation","event","MenuItemRow","item","tone","highlight","onSelect","onFollow","labelId","descriptionId","useId","itemStyle","jsx","HEADING_ITEM_STYLE","TEXT_ITEM_STYLE","EllipsisText","TEXT_ITEM_LABEL_STYLE","isChoice","isChoiceItem","described","isRenderableNode","tagged","shared","ITEM_CLASS","CHOSEN_ATTR","isChosen","href","safeHref","opensNewTab","_a","label","jsxs","LABEL_STYLE","VISUALLY_HIDDEN_STYLE","content","Fragment","INDENT_RULE_STYLE","ITEM_ICON_CLASS","itemIconStyle","ITEM_TEXT_STYLE","DESCRIPTION_CLASS","descriptionStyle","checkSlotStyle","CheckmarkIcon","resolveRel","isPlainClick","ActionMenu","items","triggerIcon","minWidth","size","showLabel","variant","customTrigger","placement","offset","highlightChoices","triggerSize","TRIGGER_SIZES","open","setOpen","useState","headingBase","triggerRef","useRef","menuRef","focusOnOpen","focusInMenu","popupIdentity","usePopupLayer","position","useActionMenuPosition","positioned","useEffect","scrollCheckedIntoView","focusOpeningItem","scrollFocusedIntoView","closeOnOutsidePress","path","node","popEscapeLayer","pushEscapeLayer","active","getDeepActiveElement","toggleFromTrigger","openedFromKeyboard","v","handleTriggerKeyDown","edge","edgeForTriggerKey","focusEdge","handleMenuKeyDown","target","itemForMenuKey","enabledItems","selectItem","ownTriggerRef","elementRef","composedTriggerRef","useMemo","composeRefs","customHandlers","triggerElement","chainHandler","Button","MoreHorizontalIcon","entries","groupChoices","closeMenu","headingIdOf","index","renderRow","key","createPortal","menuStyle","e","EMPTY_ITEM_STYLE","entry","MENU_COLUMN_STYLE"],"mappings":";;;;;;;;;;;;;;;;;;;AA0FA,MAAMA,KAAoBC,EAAM,KAAK,MAAM,OAAO,wBAAqB,CAAC,GAElEC,IAAkB,CAACC,MAAgCA,EAAM,gBAAA,GAEzDC,KAOD,CAAC,EAAE,MAAAC,GAAM,MAAAC,GAAM,WAAAC,GAAW,UAAAC,GAAU,UAAAC,GAAU,SAAAC,QAAc;;AAC7D,QAAMC,IAAgBC,EAAA;AACtB,MAAIP,EAAK,SAAS;AACd,6BAAQ,OAAA,EAAI,MAAK,aAAY,OAAOQ,EAAUR,CAAI,GAAG;AAEzD,MAAIA,EAAK,SAAS;AACd,WACI,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,IAAIJ;AAAA,QACJ,MAAK;AAAA,QACL,iBAAc;AAAA,QACd,OAAOA,KAAWH,IAAYQ,KAAqBC;AAAA,QAElD,UAAA,OAAOX,EAAK,SAAU,WACnB,gBAAAS;AAAA,UAACG;AAAA,UAAA;AAAA,YACG,SAASZ,EAAK;AAAA,YACd,sBAAoB;AAAA,YACpB,QAAM;AAAA,YACN,OAAOa;AAAA,YAEN,UAAAb,EAAK;AAAA,UAAA;AAAA,QAAA,IAGVA,EAAK;AAAA,MAAA;AAAA,IAAA;AAKrB,QAAMc,IAAWC,GAAaf,CAAI,GAC5BgB,IAAYC,EAAiBjB,EAAK,WAAW,GAC7CkB,IAASD,EAAiBjB,EAAK,GAAG,GAClCmB,IAAS;AAAA,IACX,MAAML,IAAW,kBAAkB;AAAA,IACnC,gBAAgBA,IAAWd,EAAK,UAAU;AAAA,IAC1C,oB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,GAAG;AAAA,gBAAA,IAG1B,gBAAAzG;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBAEG,MAAK;AAAA,oBACL,mBACIyG,EAAM,qBACAR,EAAYC,IAAQ,CAAC,IACrB;AAAA,oBAEV,cAAYO,EAAM,qBAAqB,SAAYA,EAAM;AAAA,oBACzD,OAAOC;AAAA,oBAEN,YAAM,MAAM,IAAI,CAACnH,MAAS4G,EAAU5G,CAAI,CAAC;AAAA,kBAAA;AAAA,kBAVrC,UAAS0B,IAAAwF,EAAM,MAAM,CAAC,MAAb,gBAAAxF,EAAgB,GAAG;AAAA,gBAAA;AAAA;AAAA,YAWrC;AAAA,UAER;AAAA,QAAA;AAAA,MAAA;AAAA,MAEJ,SAAS;AAAA,IAAA;AAAA,EACb,GACR;AAER;"}
1
+ {"version":3,"file":"ActionMenu.js","sources":["../../src/components/ActionMenu.tsx"],"sourcesContent":["import React, { useEffect, useId, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport Button from './Button';\nimport type { ButtonVariant } from './Button';\nimport CheckmarkIcon from './CustomIcons/CheckmarkIcon';\nimport MoreHorizontalIcon from './CustomIcons/MoreHorizontalIcon';\nimport EllipsisText from './Typography/EllipsisText';\nimport { groupChoices, isChoiceItem } from './actionMenuGroups';\nimport {\n type MenuEdge,\n edgeForTriggerKey,\n enabledItems,\n focusEdge,\n focusOpeningItem,\n itemForMenuKey,\n scrollCheckedIntoView,\n scrollFocusedIntoView,\n} from './actionMenuKeyboard';\nimport {\n type ActionMenuTone,\n CHOSEN_ATTR,\n DESCRIPTION_CLASS,\n EMPTY_ITEM_STYLE,\n HEADING_ITEM_STYLE,\n INDENT_RULE_STYLE,\n ITEM_CLASS,\n ITEM_ICON_CLASS,\n ITEM_TEXT_STYLE,\n LABEL_STYLE,\n MENU_COLUMN_STYLE,\n TEXT_ITEM_LABEL_STYLE,\n TEXT_ITEM_STYLE,\n TRIGGER_SIZES,\n checkSlotStyle,\n descriptionStyle,\n isChosen,\n itemIconStyle,\n itemStyle,\n menuStyle,\n} from './actionMenuStyles';\nimport type { ActionMenuIntent, ActionMenuItem, ActionMenuPlacement } from './actionMenuTypes';\nimport { getDeepActiveElement } from './activeElement';\nimport { chainHandler, composeRefs, elementRef } from './composeRefs';\nimport { pushEscapeLayer } from './escapeLayers';\nimport type { FloatingOffset } from './floatingMenuGeometry';\nimport { isPlainClick } from './linkClick';\nimport { resolveRel } from './linkRel';\nimport { usePopupLayer } from './overlayLayers';\nimport { isRenderableNode } from './renderableNode';\nimport { safeHref } from './safeHref';\nimport { useActionMenuPosition } from './useActionMenuPosition';\nimport { VISUALLY_HIDDEN_STYLE } from './visuallyHiddenStyle';\n\nexport type { ActionMenuIntent, ActionMenuItem, ActionMenuPlacement, ActionMenuTone };\n\nexport interface ActionMenuProps {\n items: ActionMenuItem[];\n label?: string;\n triggerIcon?: React.ReactNode;\n minWidth?: number;\n size?: 'small' | 'xsmall';\n /**\n * Shows `label` beside the icon instead of leaving it to the accessible name. For a menu\n * that is the point of its corner rather than an overflow for a row that already reads —\n * a kebab nobody can name is only safe when the row it belongs to says what it acts on.\n */\n showLabel?: boolean;\n /** Trigger's Button variant. Defaults to `outline`, the overflow-kebab look. */\n variant?: ButtonVariant;\n trigger?: React.ReactElement;\n placement?: ActionMenuPlacement;\n offset?: FloatingOffset;\n /** `muted` reads items in the secondary text colour, as in a sidebar's menus. */\n tone?: ActionMenuTone;\n /**\n * Styles the menu as a picker: the checked choice of each `group` sits on a light green row\n * with a green check, and the text row whose label is a set's `group` name sits a notch\n * smaller, as its heading.\n */\n highlightChoices?: boolean;\n}\n\ntype TriggerHandlers = {\n onClick?: (event: React.MouseEvent) => void;\n onMouseDown?: (event: React.MouseEvent) => void;\n onKeyDown?: (event: React.KeyboardEvent) => void;\n};\n\n// Loaded only when an item has a tag: its shadow host pulls in the Tailwind sheet, which a menu\n// without tags should not pay for.\nconst ActionMenuTagHost = React.lazy(() => import('./ActionMenuTagHost'));\n\nconst stopPropagation = (event: React.SyntheticEvent) => event.stopPropagation();\n\nconst MenuItemRow: React.FC<{\n item: ActionMenuItem;\n tone: ActionMenuTone;\n highlight: boolean;\n onSelect: (item: ActionMenuItem) => void;\n onFollow: () => void;\n labelId?: string;\n}> = ({ item, tone, highlight, onSelect, onFollow, labelId }) => {\n const descriptionId = useId();\n if (item.type === 'divider') {\n return <div role=\"separator\" style={itemStyle(item)} />;\n }\n if (item.type === 'text') {\n return (\n <div\n id={labelId}\n role=\"menuitem\"\n aria-disabled=\"true\"\n style={labelId && highlight ? HEADING_ITEM_STYLE : TEXT_ITEM_STYLE}\n >\n {typeof item.label === 'string' ? (\n <EllipsisText\n tooltip={item.label}\n tooltipWhenTruncated\n inline\n style={TEXT_ITEM_LABEL_STYLE}\n >\n {item.label}\n </EllipsisText>\n ) : (\n item.label\n )}\n </div>\n );\n }\n const isChoice = isChoiceItem(item);\n const described = isRenderableNode(item.description);\n const tagged = isRenderableNode(item.tag);\n const shared = {\n role: isChoice ? 'menuitemradio' : 'menuitem',\n 'aria-checked': isChoice ? item.checked : undefined,\n 'aria-describedby': described\n ? `${descriptionId}${item.tooltip ? ` ${descriptionId}-tooltip` : ''}`\n : undefined,\n title: item.tooltip,\n 'aria-current': item.current ? ('page' as const) : undefined,\n className: ITEM_CLASS,\n 'data-danger': item.danger === 'hover' ? 'hover' : undefined,\n 'data-tone': tone,\n [CHOSEN_ATTR]: isChosen(item, highlight) ? '' : undefined,\n style: itemStyle(item, tone),\n };\n const href = item.disabled ? undefined : safeHref(item.href);\n const opensNewTab = href !== undefined && item.target?.toLowerCase() === '_blank';\n const label = (\n <span style={LABEL_STYLE}>\n {item.label}\n {opensNewTab && <span style={VISUALLY_HIDDEN_STYLE}> (opens in a new tab)</span>}\n </span>\n );\n const content = (\n <>\n {item.indent ? <span aria-hidden=\"true\" style={INDENT_RULE_STYLE} /> : null}\n {isRenderableNode(item.icon) && (\n <span className={ITEM_ICON_CLASS} style={itemIconStyle(item)}>\n {item.icon}\n </span>\n )}\n {described ? (\n <span style={ITEM_TEXT_STYLE}>\n {label}\n <span\n id={descriptionId}\n aria-hidden=\"true\"\n className={DESCRIPTION_CLASS}\n style={descriptionStyle(item)}\n >\n {item.description}\n </span>\n {item.tooltip ? (\n <span\n id={`${descriptionId}-tooltip`}\n aria-hidden=\"true\"\n style={VISUALLY_HIDDEN_STYLE}\n >\n {item.tooltip}\n </span>\n ) : null}\n </span>\n ) : (\n label\n )}\n {tagged ? (\n <React.Suspense fallback={null}>\n <ActionMenuTagHost>{item.tag}</ActionMenuTagHost>\n </React.Suspense>\n ) : null}\n {isChoice ? (\n <span aria-hidden=\"true\" style={checkSlotStyle(item, highlight)}>\n {item.checked ? <CheckmarkIcon size={14} /> : null}\n </span>\n ) : null}\n </>\n );\n if (href !== undefined) {\n return (\n <a\n {...shared}\n href={href}\n target={item.target}\n rel={resolveRel(undefined, item.target)}\n onClick={(event) => {\n if (isPlainClick(event) && item.onClick) {\n event.preventDefault();\n onSelect(item);\n return;\n }\n onFollow();\n }}\n onAuxClick={(event) => {\n if (event.button === 1) {\n onFollow();\n }\n }}\n >\n {content}\n </a>\n );\n }\n return (\n <button {...shared} type=\"button\" disabled={item.disabled} onClick={() => onSelect(item)}>\n {content}\n </button>\n );\n};\n\n/**\n * ActionMenu is an overflow action menu. The trigger is a three-dot `Button` by default, or\n * your own control via `trigger`. The menu is portaled to document.body, so it escapes any\n * Shadow DOM or overflow:hidden ancestor, which is also why it is styled inline.\n */\nconst ActionMenu: React.FC<ActionMenuProps> = ({\n items,\n label = 'More actions',\n triggerIcon,\n minWidth,\n size = 'small',\n showLabel = false,\n variant = 'outline',\n trigger: customTrigger,\n placement = 'bottom-end',\n offset,\n tone = 'default',\n highlightChoices = false,\n}) => {\n const triggerSize = TRIGGER_SIZES[size];\n const [open, setOpen] = useState(false);\n const headingBase = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const focusOnOpen = useRef<MenuEdge | null>(null);\n const focusInMenu = useRef(false);\n const popupIdentity = usePopupLayer('actionmenu', open, menuRef);\n\n const position = useActionMenuPosition(open, triggerRef, menuRef, {\n minWidth,\n placement,\n offset,\n });\n\n // A hidden item cannot take focus, so wait until the menu is positioned and shown.\n const positioned = position !== null;\n useEffect(() => {\n if (!open || !positioned) {\n return;\n }\n scrollCheckedIntoView(menuRef.current);\n if (focusOnOpen.current) {\n focusOpeningItem(menuRef.current, focusOnOpen.current);\n focusOnOpen.current = null;\n scrollFocusedIntoView(menuRef.current);\n }\n }, [open, positioned]);\n\n useEffect(() => {\n if (!open) {\n return;\n }\n const closeOnOutsidePress = (event: MouseEvent) => {\n const path = event.composedPath();\n const inside = [triggerRef.current, menuRef.current].some(\n (node) => node && path.includes(node),\n );\n if (!inside) {\n focusInMenu.current = false;\n setOpen(false);\n }\n };\n document.addEventListener('mousedown', closeOnOutsidePress, true);\n const popEscapeLayer = pushEscapeLayer(() => setOpen(false));\n return () => {\n document.removeEventListener('mousedown', closeOnOutsidePress, true);\n popEscapeLayer();\n const active = getDeepActiveElement();\n if (focusInMenu.current && (!active || active === document.body)) {\n triggerRef.current?.focus({ preventScroll: true });\n }\n focusInMenu.current = false;\n };\n }, [open]);\n\n const toggleFromTrigger = (event: React.MouseEvent) => {\n event.stopPropagation();\n const openedFromKeyboard = !open && event.detail === 0;\n focusOnOpen.current = openedFromKeyboard ? 'first' : null;\n setOpen((v) => !v);\n };\n\n const handleTriggerKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'Tab' && open) {\n setOpen(false);\n return;\n }\n const edge = edgeForTriggerKey(event.key, placement);\n if (!edge) {\n return;\n }\n event.preventDefault();\n if (open) {\n focusEdge(menuRef.current, edge);\n return;\n }\n focusOnOpen.current = edge;\n setOpen(true);\n };\n\n const handleMenuKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'Tab') {\n focusInMenu.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n setOpen(false);\n return;\n }\n if (event.key === ' ' && event.target instanceof HTMLAnchorElement) {\n event.preventDefault();\n event.target.click();\n return;\n }\n const target = itemForMenuKey(enabledItems(menuRef.current), event.target, event.key);\n if (target) {\n event.preventDefault();\n target.focus();\n }\n };\n\n const selectItem = (item: ActionMenuItem) => {\n if (item.type === 'divider' || item.type === 'text' || item.disabled) {\n return;\n }\n item.onClick?.();\n setOpen(false);\n };\n\n const ownTriggerRef = customTrigger ? elementRef<HTMLElement>(customTrigger) : undefined;\n const composedTriggerRef = useMemo(\n () => composeRefs(ownTriggerRef, triggerRef),\n [ownTriggerRef],\n );\n const customHandlers = customTrigger?.props as TriggerHandlers | undefined;\n\n const triggerElement = customTrigger ? (\n React.cloneElement(customTrigger, {\n ref: composedTriggerRef,\n 'aria-haspopup': 'menu',\n 'aria-expanded': open,\n onClick: chainHandler(customHandlers?.onClick, toggleFromTrigger),\n onMouseDown: chainHandler(customHandlers?.onMouseDown, stopPropagation),\n onKeyDown: chainHandler(customHandlers?.onKeyDown, handleTriggerKeyDown),\n } as Record<string, unknown>)\n ) : (\n <Button\n ref={triggerRef as React.RefObject<HTMLButtonElement>}\n type=\"button\"\n variant={variant}\n size={size}\n iconOnly={!showLabel}\n aria-label={showLabel ? undefined : label}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n className={`shrink-0${showLabel ? ' gap-2' : ''}`}\n onClick={toggleFromTrigger}\n onMouseDown={stopPropagation}\n onKeyDown={handleTriggerKeyDown}\n >\n <span className={`inline-flex items-center justify-center ${triggerSize.iconBox}`}>\n {triggerIcon ?? <MoreHorizontalIcon size={triggerSize.icon} />}\n </span>\n {showLabel && <span>{label}</span>}\n </Button>\n );\n\n const entries = useMemo(() => groupChoices(items), [items]);\n const closeMenu = () => setOpen(false);\n const headingIdOf = (index: number) => `${headingBase}-${index}`;\n const renderRow = (item: ActionMenuItem, labelId?: string, key = item.key) => (\n <MenuItemRow\n key={key}\n item={item}\n tone={tone}\n highlight={highlightChoices}\n onSelect={selectItem}\n onFollow={closeMenu}\n labelId={labelId}\n />\n );\n\n return (\n <>\n {triggerElement}\n {open &&\n createPortal(\n <div\n ref={menuRef}\n role=\"menu\"\n tabIndex={-1}\n aria-label={label}\n {...popupIdentity}\n style={menuStyle(position)}\n onMouseDown={stopPropagation}\n onClick={stopPropagation}\n onKeyDown={handleMenuKeyDown}\n onFocus={() => {\n focusInMenu.current = true;\n }}\n onBlur={(e) => {\n if (!menuRef.current?.contains(e.relatedTarget as Node | null)) {\n focusInMenu.current = false;\n }\n }}\n >\n {items.length === 0 && (\n <div role=\"menuitem\" aria-disabled=\"true\" style={EMPTY_ITEM_STYLE}>\n No actions available\n </div>\n )}\n {entries.map((entry, index) =>\n entry.kind === 'item' ? (\n renderRow(\n entry.item,\n entry.labelsNext ? headingIdOf(index) : undefined,\n `item:${entry.item.key}`,\n )\n ) : (\n <div\n key={`group:${entry.items[0]?.key}`}\n role=\"group\"\n aria-labelledby={\n entry.labelledByPrevious\n ? headingIdOf(index - 1)\n : undefined\n }\n aria-label={entry.labelledByPrevious ? undefined : entry.name}\n style={MENU_COLUMN_STYLE}\n >\n {entry.items.map((item) => renderRow(item))}\n </div>\n ),\n )}\n </div>,\n document.body,\n )}\n </>\n );\n};\n\nexport default ActionMenu;\n"],"names":["ActionMenuTagHost","React","stopPropagation","event","MenuItemRow","item","tone","highlight","onSelect","onFollow","labelId","descriptionId","useId","itemStyle","jsx","HEADING_ITEM_STYLE","TEXT_ITEM_STYLE","EllipsisText","TEXT_ITEM_LABEL_STYLE","isChoice","isChoiceItem","described","isRenderableNode","tagged","shared","ITEM_CLASS","CHOSEN_ATTR","isChosen","href","safeHref","opensNewTab","_a","label","jsxs","LABEL_STYLE","VISUALLY_HIDDEN_STYLE","content","Fragment","INDENT_RULE_STYLE","ITEM_ICON_CLASS","itemIconStyle","ITEM_TEXT_STYLE","DESCRIPTION_CLASS","descriptionStyle","checkSlotStyle","CheckmarkIcon","resolveRel","isPlainClick","ActionMenu","items","triggerIcon","minWidth","size","showLabel","variant","customTrigger","placement","offset","highlightChoices","triggerSize","TRIGGER_SIZES","open","setOpen","useState","headingBase","triggerRef","useRef","menuRef","focusOnOpen","focusInMenu","popupIdentity","usePopupLayer","position","useActionMenuPosition","positioned","useEffect","scrollCheckedIntoView","focusOpeningItem","scrollFocusedIntoView","closeOnOutsidePress","path","node","popEscapeLayer","pushEscapeLayer","active","getDeepActiveElement","toggleFromTrigger","openedFromKeyboard","v","handleTriggerKeyDown","edge","edgeForTriggerKey","focusEdge","handleMenuKeyDown","target","itemForMenuKey","enabledItems","selectItem","ownTriggerRef","elementRef","composedTriggerRef","useMemo","composeRefs","customHandlers","triggerElement","chainHandler","Button","MoreHorizontalIcon","entries","groupChoices","closeMenu","headingIdOf","index","renderRow","key","createPortal","menuStyle","e","EMPTY_ITEM_STYLE","entry","MENU_COLUMN_STYLE"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0FA,MAAMA,KAAoBC,EAAM,KAAK,MAAM,OAAO,wBAAqB,CAAC,GAElEC,IAAkB,CAACC,MAAgCA,EAAM,gBAAA,GAEzDC,KAOD,CAAC,EAAE,MAAAC,GAAM,MAAAC,GAAM,WAAAC,GAAW,UAAAC,GAAU,UAAAC,GAAU,SAAAC,QAAc;;AAC7D,QAAMC,IAAgBC,EAAA;AACtB,MAAIP,EAAK,SAAS;AACd,6BAAQ,OAAA,EAAI,MAAK,aAAY,OAAOQ,EAAUR,CAAI,GAAG;AAEzD,MAAIA,EAAK,SAAS;AACd,WACI,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,IAAIJ;AAAA,QACJ,MAAK;AAAA,QACL,iBAAc;AAAA,QACd,OAAOA,KAAWH,IAAYQ,KAAqBC;AAAA,QAElD,UAAA,OAAOX,EAAK,SAAU,WACnB,gBAAAS;AAAA,UAACG;AAAA,UAAA;AAAA,YACG,SAASZ,EAAK;AAAA,YACd,sBAAoB;AAAA,YACpB,QAAM;AAAA,YACN,OAAOa;AAAA,YAEN,UAAAb,EAAK;AAAA,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AAAnC,EAAC,OAAA,EAAI,MAAK,YAAW,iBAAc,QAAO,OAAOwG,IAAkB,UAAA,uBAAA,CAEnE;AAAA,YAEHV,EAAQ;AAAA,cAAI,CAACW,GAAOP,MAAA;;AACjB,uBAAAO,EAAM,SAAS,SACXN;AAAA,kBACIM,EAAM;AAAA,kBACNA,EAAM,aAAaR,EAAYC,CAAK,IAAI;AAAA,kBACxC,QAAQO,EAAM,KAAK,GAAG;AAAA,gBAAA,IAG1B,gBAAAzG;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBAEG,MAAK;AAAA,oBACL,mBACIyG,EAAM,qBACAR,EAAYC,IAAQ,CAAC,IACrB;AAAA,oBAEV,cAAYO,EAAM,qBAAqB,SAAYA,EAAM;AAAA,oBACzD,OAAOC;AAAA,oBAEN,YAAM,MAAM,IAAI,CAACnH,MAAS4G,EAAU5G,CAAI,CAAC;AAAA,kBAAA;AAAA,kBAVrC,UAAS0B,IAAAwF,EAAM,MAAM,CAAC,MAAb,gBAAAxF,EAAgB,GAAG;AAAA,gBAAA;AAAA;AAAA,YAWrC;AAAA,UAER;AAAA,QAAA;AAAA,MAAA;AAAA,MAEJ,SAAS;AAAA,IAAA;AAAA,EACb,GACR;AAER;"}
@@ -1,13 +1,13 @@
1
- import { jsxs as A, jsx as n } from "react/jsx-runtime";
2
- import { useRef as h, useState as j, useEffect as G } from "react";
3
- import P, { HeaderRow as F } from "./FrameHeader.js";
4
- import { FRAME_CLASS as M, FRAME_SECTION_STYLE as U, frameToneBackground as W } from "./frameStyles.js";
5
- import { GLASS_SURFACE_STYLE as Y } from "./glassSurface.js";
6
- import { hasHeaderContent as B } from "./headerContent.js";
7
- import { FOREGROUND_RESET as C } from "./selectedRow.js";
8
- const V = /^\d*\.?\d+(px|rem|em)$/, q = (f) => {
1
+ import { jsxs as B, jsx as n } from "react/jsx-runtime";
2
+ import { useRef as G, useState as P, useEffect as h } from "react";
3
+ import F, { HeaderRow as M } from "./FrameHeader.js";
4
+ import { FRAME_CLASS as U, FRAME_SECTION_STYLE as W, frameToneBackground as Y } from "./frameStyles.js";
5
+ import { GLASS_SURFACE_STYLE as C } from "./glassSurface.js";
6
+ import { hasHeaderContent as T } from "./headerContent.js";
7
+ import { FOREGROUND_RESET as V } from "./selectedRow.js";
8
+ const q = /^\d*\.?\d+(px|rem|em)$/, J = (f) => {
9
9
  const d = f.trim().split(/\s+/);
10
- if (d.length > 4 || !d.every((i) => V.test(i)))
10
+ if (d.length > 4 || !d.every((i) => q.test(i)))
11
11
  return;
12
12
  const [l, t = l, , o = t] = d;
13
13
  return parseFloat(o) > 0 && parseFloat(t) > 0 ? { paddingLeft: o, paddingRight: t } : void 0;
@@ -17,120 +17,130 @@ const V = /^\d*\.?\d+(px|rem|em)$/, q = (f) => {
17
17
  title: l,
18
18
  subtitle: t,
19
19
  extra: o,
20
- children: i,
20
+ wrapExtra: i = !1,
21
+ children: v,
21
22
  padding: c = "20px",
22
- size: u = "default",
23
- width: y,
24
- minWidth: R,
25
- dimmed: T = !1,
26
- direction: p,
27
- align: S,
23
+ size: y = "default",
24
+ width: R,
25
+ minWidth: S,
26
+ dimmed: H = !1,
27
+ direction: m,
28
+ align: N,
28
29
  fullHeight: x = !1,
29
- border: v = "base",
30
+ border: u = "base",
30
31
  alignSelf: E,
31
- height: r,
32
+ height: s,
32
33
  footer: e,
33
- glassFooter: s = !1,
34
- className: N = "",
34
+ glassFooter: r = !1,
35
+ className: b = "",
35
36
  style: w = {},
36
37
  headerConfig: a = {}
37
38
  }) => {
38
- const m = h(null), [b, L] = j(0);
39
- G(() => {
40
- if (s && e && m.current) {
41
- const _ = new ResizeObserver((O) => {
42
- for (const $ of O)
43
- L($.contentRect.height);
39
+ const p = G(null), [L, I] = P(0);
40
+ h(() => {
41
+ if (r && e && p.current) {
42
+ const A = new ResizeObserver(($) => {
43
+ for (const j of $)
44
+ I(j.contentRect.height);
44
45
  });
45
- return _.observe(m.current), L(m.current.offsetHeight), () => _.disconnect();
46
+ return A.observe(p.current), I(p.current.offsetHeight), () => A.disconnect();
46
47
  }
47
- }, [s, e]);
48
- const H = [
48
+ }, [r, e]);
49
+ const k = [
49
50
  "card-base",
50
- T ? "card-dimmed" : "",
51
- v === "rounded" ? "card-rounded" : "",
51
+ H ? "card-dimmed" : "",
52
+ u === "rounded" ? "card-rounded" : "",
52
53
  x ? "h-full" : "",
53
- r ? "flex flex-col" : "",
54
- u === "small" ? "text-sm" : "",
55
- N
56
- ].filter(Boolean).join(" "), I = a != null && a.padding ? void 0 : q(c), k = parseInt(c) || 20, z = {
54
+ s ? "flex flex-col" : "",
55
+ y === "small" ? "text-sm" : "",
56
+ b
57
+ ].filter(Boolean).join(" "), _ = a != null && a.padding ? void 0 : J(c), z = parseInt(c) || 20, D = {
57
58
  padding: c,
58
59
  // The card clips overflow, so a long token in flowing text breaks rather than vanishing.
59
60
  // Flex and grid items keep their min-content width; those need their own wrapping.
60
61
  overflowWrap: "break-word",
61
- display: p ? "flex" : void 0,
62
- flexDirection: p,
63
- alignItems: S,
64
- ...r && { overflow: "auto", height: "100%" },
65
- ...s && e && b > 0 && {
66
- paddingBottom: `${k + b + 10}px`
62
+ display: m ? "flex" : void 0,
63
+ flexDirection: m,
64
+ alignItems: N,
65
+ ...s && { overflow: "auto", height: "100%" },
66
+ ...r && e && L > 0 && {
67
+ paddingBottom: `${z + L + 10}px`
67
68
  }
68
69
  };
69
70
  if (f === "framed")
70
- return /* @__PURE__ */ A(
71
+ return /* @__PURE__ */ B(
71
72
  "div",
72
73
  {
73
- className: `${M} flex flex-col ${N}`,
74
+ className: `${U} flex flex-col ${b}`,
74
75
  style: {
75
76
  // The frame drops `card-base`, which carried the text colour.
76
- ...C,
77
- backgroundColor: W(d),
78
- width: y,
79
- minWidth: R,
77
+ ...V,
78
+ backgroundColor: Y(d),
79
+ width: R,
80
+ minWidth: S,
80
81
  alignSelf: E,
81
82
  ...x && { height: "100%" },
82
- ...r && { height: r },
83
+ ...s && { height: s },
83
84
  ...w
84
85
  },
85
86
  children: [
86
- B({ title: l, subtitle: t, extra: o }) && /* @__PURE__ */ n(P, { title: l, subtitle: t, extra: o }),
87
- /* @__PURE__ */ n(
87
+ T({ title: l, subtitle: t, extra: o }) && /* @__PURE__ */ n(
88
+ F,
89
+ {
90
+ title: l,
91
+ subtitle: t,
92
+ extra: o,
93
+ wrapExtra: i
94
+ }
95
+ ),
96
+ v !== void 0 && /* @__PURE__ */ n(
88
97
  "div",
89
98
  {
90
99
  className: "min-h-0 flex-1",
91
100
  style: {
92
- ...U,
101
+ ...W,
93
102
  padding: c,
94
103
  overflowWrap: "break-word",
95
- display: p ? "flex" : void 0,
96
- flexDirection: p,
97
- alignItems: S,
98
- ...r && { overflow: "auto" }
104
+ display: m ? "flex" : void 0,
105
+ flexDirection: m,
106
+ alignItems: N,
107
+ ...s && { overflow: "auto" }
99
108
  },
100
- children: i
109
+ children: v
101
110
  }
102
111
  ),
103
112
  e && /* @__PURE__ */ n("div", { className: "px-4 py-3", children: e })
104
113
  ]
105
114
  }
106
115
  );
107
- const D = {
108
- width: y,
109
- minWidth: R,
116
+ const O = {
117
+ width: R,
118
+ minWidth: S,
110
119
  alignSelf: E,
111
120
  ...x && { height: "100%" },
112
- ...r && { height: r, display: "flex", flexDirection: "column" },
113
- ...s && e && { position: "relative" },
121
+ ...s && { height: s, display: "flex", flexDirection: "column" },
122
+ ...r && e && { position: "relative" },
114
123
  overflow: "hidden",
115
124
  ...w
116
125
  };
117
- return /* @__PURE__ */ A("div", { className: H, style: D, children: [
118
- B({ title: l, subtitle: t, extra: o }) && /* @__PURE__ */ n(
126
+ return /* @__PURE__ */ B("div", { className: k, style: O, children: [
127
+ T({ title: l, subtitle: t, extra: o }) && /* @__PURE__ */ n(
119
128
  "div",
120
129
  {
121
- className: I ? "card-header py-2" : "card-header px-3 py-2",
130
+ className: _ ? "card-header py-2" : "card-header px-3 py-2",
122
131
  style: {
123
132
  marginBottom: "1px",
124
- fontSize: u === "small" ? "12px" : "13px",
133
+ fontSize: y === "small" ? "12px" : "13px",
125
134
  fontWeight: "normal",
126
- ...a != null && a.padding ? { padding: a.padding } : I
135
+ ...a != null && a.padding ? { padding: a.padding } : _
127
136
  },
128
137
  children: /* @__PURE__ */ n(
129
- F,
138
+ M,
130
139
  {
131
140
  title: l,
132
141
  subtitle: t,
133
142
  extra: o,
143
+ wrapExtra: i,
134
144
  titleClassName: "font-normal overflow-visible"
135
145
  }
136
146
  )
@@ -141,25 +151,25 @@ const V = /^\d*\.?\d+(px|rem|em)$/, q = (f) => {
141
151
  {
142
152
  className: "flex-1",
143
153
  style: {
144
- ...z,
145
- ...s && e && { position: "relative" }
154
+ ...D,
155
+ ...r && e && { position: "relative" }
146
156
  },
147
- children: i
157
+ children: v
148
158
  }
149
159
  ),
150
160
  e && /* @__PURE__ */ n(
151
161
  "div",
152
162
  {
153
- ref: s ? m : void 0,
163
+ ref: r ? p : void 0,
154
164
  className: "card-footer px-4 py-3",
155
- style: s ? {
156
- ...Y,
165
+ style: r ? {
166
+ ...C,
157
167
  position: "absolute",
158
168
  bottom: 0,
159
169
  left: 0,
160
170
  right: 0,
161
- borderBottomLeftRadius: v === "rounded" ? "20px" : "12px",
162
- borderBottomRightRadius: v === "rounded" ? "20px" : "12px"
171
+ borderBottomLeftRadius: u === "rounded" ? "20px" : "12px",
172
+ borderBottomRightRadius: u === "rounded" ? "20px" : "12px"
163
173
  } : void 0,
164
174
  children: e
165
175
  }