@stackone/malachite 2.85.0 → 2.87.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 +6 -5
- package/dist/components/Accordion.js +130 -103
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.js +128 -75
- package/dist/components/Card.js.map +1 -1
- package/dist/components/FilterSearch.js +228 -224
- package/dist/components/FilterSearch.js.map +1 -1
- package/dist/components/FrameHeader.js +36 -0
- package/dist/components/FrameHeader.js.map +1 -0
- package/dist/components/LoadingBar.js +5 -5
- package/dist/components/LoadingBar.js.map +1 -1
- package/dist/components/MultiSelect.js +431 -382
- package/dist/components/MultiSelect.js.map +1 -1
- package/dist/components/SplitButton.js.map +1 -1
- package/dist/components/Surface.js +211 -159
- package/dist/components/Surface.js.map +1 -1
- package/dist/components/Table/Table.js +630 -606
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/TimeBarChart/TimeBarChart.js +241 -0
- package/dist/components/TimeBarChart/TimeBarChart.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartAxes.js +49 -0
- package/dist/components/TimeBarChart/TimeBarChartAxes.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartBars.js +58 -0
- package/dist/components/TimeBarChart/TimeBarChartBars.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartLegend.js +29 -0
- package/dist/components/TimeBarChart/TimeBarChartLegend.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartTable.js +33 -0
- package/dist/components/TimeBarChart/TimeBarChartTable.js.map +1 -0
- package/dist/components/TimeBarChart/TimeBarChartTooltip.js +77 -0
- package/dist/components/TimeBarChart/TimeBarChartTooltip.js.map +1 -0
- package/dist/components/TimeBarChart/stackLayout.js +25 -0
- package/dist/components/TimeBarChart/stackLayout.js.map +1 -0
- package/dist/components/TimeBarChart/timeBuckets.js +133 -0
- package/dist/components/TimeBarChart/timeBuckets.js.map +1 -0
- package/dist/components/TimeBarChart/tones.js +10 -0
- package/dist/components/TimeBarChart/tones.js.map +1 -0
- package/dist/components/buttonStyles.js +2 -0
- package/dist/components/buttonStyles.js.map +1 -1
- package/dist/components/dateMath.js +1 -0
- package/dist/components/dateMath.js.map +1 -1
- package/dist/components/filterSearchModel.js +53 -45
- package/dist/components/filterSearchModel.js.map +1 -1
- package/dist/components/focusRing.js +8 -7
- package/dist/components/focusRing.js.map +1 -1
- package/dist/components/frameStyles.js +14 -0
- package/dist/components/frameStyles.js.map +1 -0
- package/dist/components/headerContent.js +10 -0
- package/dist/components/headerContent.js.map +1 -0
- package/dist/index.d.ts +149 -18
- package/dist/index.js +24 -22
- package/dist/index.js.map +1 -1
- package/dist/tailwind.css.js +1 -1
- package/dist/theme.js +340 -340
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
package/COMPONENTS.md
CHANGED
|
@@ -8,10 +8,10 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
8
8
|
|
|
9
9
|
- **`Chat`** — A chat column: `Chat.Thread` scrolls and pins itself to the newest message, `Chat.Composer` keeps its own height and owns the Enter/Shift+Enter convention, and `Chat.Message`, `Chat.ToolCall` and `Chat.Thinking` render one turn each. A user turn sits right and hugs its text; an assistant turn runs full width, and `variant="card"` frames it with its state, copy and rating controls, and a token/model line. `variant="bubble"` is a third treatment, not a repaint of either: tinted bubbles whose flattened corner points at whoever spoke, so authorship reads before the words do. `Chat.Context` lists what the conversation can see — a removable chip per source, and an add affordance only when a handler is given. `Chat.Thinking` and a loading turn draw bars in the shape of the answer rather than a spinner. The row under a composer is `ComposerChip`, `ContextMeter` and `ModelPicker` — PillButton tabs, so it reads as attached to the field; `ModelPicker` opens a portalled menu with a submenu per model. The transcript is a live `log` region, so a streamed reply is announced, and it shows a centred empty state until the first turn. _Key props:_ `Chat`: `children`, `className`. `Thread`: `aria-label`, `emptyTitle`, `emptyDescription`, `emptyIcon`. `Message`: `role`, `variant` (`plain` | `card`), `content`, `children`, `name`, `avatarSrc`, `status` (`streaming` | `completed` | `error`), `loading`, `onCopy`, `onFeedback`, `usage`. `ToolCall`: `name`, `status` (`running` | `completed` | `error`), `callId`, `input`, `output`, `defaultExpanded`. `Thinking`: `label`. `Composer`: `value`, `onChange`, `onSend`, `onStop`, `busy`, `disabled`, `placeholder`, `maxLength`, `rows`, `children`. `ComposerChip`: `label`, `icon`, `trailingIcon`, `onClick`, `disabled`. `ContextMeter`: `used`, `limit`, `cached`, `label`. `ModelPicker`: `models`, `value`, `optionValue`, `onChange`, `openUp`, `disabled`. `Context`: `label`, `items` (`{id, label, onRemove?}`), `onAdd`, `className`.
|
|
10
10
|
- **`Surface`** — Rounded, bordered card container with the standard elevation shadow. Use `overflow="clip"` to keep the rounded clipping while letting a `position: sticky` descendant still pin (`hidden` would trap it); `visible` disables clipping. _Key props:_ `children`, `padding`, `overflow`, `shadow` (`false` sits the card flat, without the elevation shadow), `tone` (`default` | `highlight`; `highlight` paints the warm ground with no border, and sits flat unless `shadow` is passed, for a static block that stands out from the page, such as a hero or a guide's section header; its ground is too close to `Surface.Row`'s hover for clickable rows inside it), `className`, `style`.
|
|
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. `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. _Key props:_ `divider`, `disabled`, `tone` (`default` | `muted`), `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`, `role`, `className`, `style`.
|
|
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, 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`, `tone` (`default` | `muted`), `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.
|
|
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. `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to a framed card. _Key props:_ `variant` (`CardVariant`: `default` | `framed`), `title`, `subtitle`, `extra`, `padding`, `footer`.
|
|
15
15
|
- **`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`.
|
|
16
16
|
- **`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`.
|
|
17
17
|
- **`SplitScreenLayout`** — Two-pane full-screen layout (content + preview/aside) with an optional dismiss button.
|
|
@@ -56,7 +56,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
56
56
|
## Lists, rows & navigation
|
|
57
57
|
|
|
58
58
|
- **`ButtonList`** — Vertical list of pill-style button/link rows with built-in hover/focus/active states. _Key props:_ `buttons[]` (`key`, `children`, `onClick`, `href`), `compact`.
|
|
59
|
-
- **`Accordion`** — Expand/collapse section with a clickable header (disclosure arrow + title/header + trailing slot). Use `header` for rich content and `trailing` for an interactive control (e.g. a Checkbox) — trailing sits outside the toggle button, so a selectable+expandable row is just an Accordion. Controlled or uncontrolled. Pass `stickyHeader` (+ optional `stickyTopOffset`) to pin the header on an opaque ground, keeping its open highlight and hover, while the body scrolls; add `pinnedCorners` for a section at the top of a card on the page ground, so the pinned header takes the rounded top corners of its card (set the `--malachite-ctx-pinned-surround` context variable on an ancestor when the card sits on another ground) — needs a scroll ancestor that clips without trapping sticky (e.g. `<Surface overflow="clip">`). `animate={false}` opens instantly. _Key props:_ `title` or `header`, `leading` (before the title, outside the toggle, e.g. a group's tri-state Checkbox), `trailing`, `arrowPosition` (`start` | `end` | `gutter`; `gutter` puts the arrow before `leading` as its own mouse toggle, as a file tree keeps its caret in the gutter), `highlightExpanded` (default `true`; `false` leaves an open row on the card ground), `bodyIndent` (`none` | `title`; `title` starts the body under the title, 16px short of it so a compact `Surface.Row` inside lands its checkbox there), `disabled`, `isExpanded`/`defaultExpanded`, `onToggle`, `stickyHeader`, `stickyTopOffset`, `animate`.
|
|
59
|
+
- **`Accordion`** — Expand/collapse section with a clickable header (disclosure arrow + title/header + trailing slot). Use `header` for rich content and `trailing` for an interactive control (e.g. a Checkbox) — trailing sits outside the toggle button, so a selectable+expandable row is just an Accordion. Controlled or uncontrolled. Pass `stickyHeader` (+ optional `stickyTopOffset`) to pin the header on an opaque ground, keeping its open highlight and hover, while the body scrolls; add `pinnedCorners` for a section at the top of a card on the page ground, so the pinned header takes the rounded top corners of its card (set the `--malachite-ctx-pinned-surround` context variable on an ancestor when the card sits on another ground) — needs a scroll ancestor that clips without trapping sticky (e.g. `<Surface overflow="clip">`). `animate={false}` opens instantly. `collapsible={false}` makes a section that never closes: the same header, open highlight, sticky pinning and corner caps, with no arrow, hover or toggle, so `title` is plain text and `header` may hold controls; the toggle props (`isExpanded`, `defaultExpanded`, `onToggle`, `arrowPosition`, `disabled`) are ignored while it is `false`, and `animate` still picks how the body is rendered, so flipping `collapsible` keeps the body mounted. _Key props:_ `title` or `header`, `leading` (before the title, outside the toggle, e.g. a group's tri-state Checkbox), `trailing`, `arrowPosition` (`start` | `end` | `gutter`; `gutter` puts the arrow before `leading` as its own mouse toggle, as a file tree keeps its caret in the gutter), `highlightExpanded` (default `true`; `false` leaves an open row on the card ground), `bodyIndent` (`none` | `title`; `title` starts the body under the title, 16px short of it so a compact `Surface.Row` inside lands its checkbox there), `collapsible` (default `true`), `disabled`, `isExpanded`/`defaultExpanded`, `onToggle`, `stickyHeader`, `stickyTopOffset`, `pinnedCorners`, `animate`.
|
|
60
60
|
- **`DefinitionRow`** — Row showing an icon, label, optional tag and description — for definition/detail lists. _Key props:_ `icon`, `label`, `tag`, `description`.
|
|
61
61
|
- **`PreviewTree`** — Nested, indented tree for previewing hierarchical structure.
|
|
62
62
|
- **`PreviewTreeRow`** — A single labelled row within a PreviewTree. _Key props:_ `label`.
|
|
@@ -99,7 +99,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
99
99
|
|
|
100
100
|
## Buttons & actions
|
|
101
101
|
|
|
102
|
-
- **`Button`** — Primary button. Variants: `filled`, `outline`, `surface` (outline's geometry on a ground of its own, for a control sitting on a tinted surface), `assistant` (the violet the assistant is named in — provenance, not a severity: it says who is being asked, not that anything is wrong), `destructive`, `success`, `warning`, `error`, `ghost`, `quiet` (text only in the accent colour, for a secondary action such as Reset beside a primary one — accent, not success, because it is something to press rather than a status), `muted` (a recessed grey with secondary text, for a control whose subject is switched off, such as an account set to Not allowed; it stays clickable), `no-style`. Supports `flush` (pulls a borderless button out by its padding so its label lines up with the text around it), `iconOnly`, `loading`, `tooltip`. `leading` puts something that is not an icon, such as an avatar, before the label at its own size; `contentAlign="start"` starts the label at the leading edge and pins an end `icon` to the far edge, which with `flexGrow` makes a full-width switcher trigger — a project pill whose width comes from its container (e.g. a box `SIDEBAR_POPOVER_WIDTH_PX` wide, so it lines up with the `Sidebar.Panel` it opens). _Key props:_ `variant`, `size`, `icon`, `iconPosition`, `leading`, `contentAlign` (`center` | `start`), `flexGrow` (fills the container), `width` (`auto` | `wide` — a 120px floor for a panel's or dialog's primary action), `iconOnly`, `loading`, `disabled`, `fill`, `tooltip`.
|
|
102
|
+
- **`Button`** — Primary button. Variants: `filled`, `outline`, `surface` (outline's geometry on a ground of its own, for a control sitting on a tinted surface), `assistant` (the violet the assistant is named in — provenance, not a severity: it says who is being asked, not that anything is wrong), `destructive`, `success`, `warning`, `error`, `ghost`, `row-outline` (`ghost` until the `Surface.Row` whose `trailing` slot it sits in is hovered or holds focus, or its menu is open, then `outline`; always `outline` on a touch screen — a row control that stays quiet until its row is in play, in CSS alone), `quiet` (text only in the accent colour, for a secondary action such as Reset beside a primary one — accent, not success, because it is something to press rather than a status), `muted` (a recessed grey with secondary text, for a control whose subject is switched off, such as an account set to Not allowed; it stays clickable), `no-style`. Supports `flush` (pulls a borderless button out by its padding so its label lines up with the text around it), `iconOnly`, `loading`, `tooltip`. `leading` puts something that is not an icon, such as an avatar, before the label at its own size; `contentAlign="start"` starts the label at the leading edge and pins an end `icon` to the far edge, which with `flexGrow` makes a full-width switcher trigger — a project pill whose width comes from its container (e.g. a box `SIDEBAR_POPOVER_WIDTH_PX` wide, so it lines up with the `Sidebar.Panel` it opens). _Key props:_ `variant`, `size`, `icon`, `iconPosition`, `leading`, `contentAlign` (`center` | `start`), `flexGrow` (fills the container), `width` (`auto` | `wide` — a 120px floor for a panel's or dialog's primary action), `iconOnly`, `loading`, `disabled`, `fill`, `tooltip`.
|
|
103
103
|
- **`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`.
|
|
104
104
|
- **`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`.
|
|
105
105
|
- **`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`.
|
|
@@ -111,7 +111,8 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
|
|
|
111
111
|
## Data display
|
|
112
112
|
|
|
113
113
|
- **`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`.
|
|
114
|
-
- **`
|
|
114
|
+
- **`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`.
|
|
115
|
+
- **`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`, `headerVariant`, `title`, `subtitle`, `extra`, `onVisibleOrderChange`.
|
|
115
116
|
- **`Statistic`** — Displays a statistic value with a label; primary/secondary sizes. _Key props:_ `StatisticValueSize`.
|
|
116
117
|
- **`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"`.
|
|
117
118
|
- **`ZoomableImage`** — An image shown inline as a button that enlarges it, for a screenshot too detailed to read at its inline size. The thumbnail is shown at its own width up to the width of its container, never stretched, and stops at 240px tall, cropping a tall image to its top. The enlarged image sits on the scrim with no card, as large as the window allows at its own aspect ratio, up to its natural size, and a click anywhere or ESC closes it. The thumbnail is named `Enlarge image: <alt>` and the dialog is named by `title`, or by `alt` when `title` is missing or empty, so `alt` must be non-empty. `onError` reports a thumbnail that failed to load, so the caller can leave it out rather than show a broken image. The thumbnail loads lazily, so for one below the fold that report comes once it nears the viewport, not on render. _Key props:_ `src`, `alt`, `title`, `onError`.
|
|
@@ -1,162 +1,189 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { DisclosureArrow as
|
|
4
|
-
import
|
|
5
|
-
import { ARROW_PX as
|
|
6
|
-
import { FOCUS_RING as
|
|
7
|
-
import { isRenderableNode as
|
|
8
|
-
import { usePinned as
|
|
9
|
-
const
|
|
10
|
-
title:
|
|
11
|
-
header:
|
|
12
|
-
className:
|
|
13
|
-
children:
|
|
14
|
-
trailing:
|
|
15
|
-
leading:
|
|
16
|
-
arrowPosition:
|
|
17
|
-
highlightExpanded:
|
|
18
|
-
bodyIndent:
|
|
19
|
-
variant:
|
|
20
|
-
defaultExpanded:
|
|
21
|
-
isExpanded:
|
|
22
|
-
onToggle:
|
|
23
|
-
disabled:
|
|
1
|
+
import { jsxs as w, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useId as te, useState as G, useRef as O, useEffect as re } from "react";
|
|
3
|
+
import { DisclosureArrow as y } from "./DisclosureArrow.js";
|
|
4
|
+
import oe from "./PinnedCornerCap.js";
|
|
5
|
+
import { ARROW_PX as C, toggleGapPx as ne, togglePaddingLeftPx as ae, bodyInsetPx as se } from "./accordionBodyInset.js";
|
|
6
|
+
import { FOCUS_RING as de, FOCUS_RING_INSET as ie } from "./focusRing.js";
|
|
7
|
+
import { isRenderableNode as U } from "./renderableNode.js";
|
|
8
|
+
import { usePinned as ce } from "./usePinned.js";
|
|
9
|
+
const le = "--malachite-ctx-pinned-surround", ue = 300, me = { position: "absolute", width: 0, height: 0 }, Ce = ({
|
|
10
|
+
title: F,
|
|
11
|
+
header: M,
|
|
12
|
+
className: K,
|
|
13
|
+
children: d,
|
|
14
|
+
trailing: R,
|
|
15
|
+
leading: B,
|
|
16
|
+
arrowPosition: c = "start",
|
|
17
|
+
highlightExpanded: p = !0,
|
|
18
|
+
bodyIndent: q = "none",
|
|
19
|
+
variant: W = "default",
|
|
20
|
+
defaultExpanded: X = !1,
|
|
21
|
+
isExpanded: f,
|
|
22
|
+
onToggle: b,
|
|
23
|
+
disabled: g = !1,
|
|
24
24
|
stickyHeader: l = !1,
|
|
25
|
-
stickyTopOffset:
|
|
26
|
-
pinnedCorners:
|
|
27
|
-
animate:
|
|
25
|
+
stickyTopOffset: I = 0,
|
|
26
|
+
pinnedCorners: Y = !1,
|
|
27
|
+
animate: i = !0,
|
|
28
|
+
collapsible: n = !0
|
|
28
29
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const h = g || !n, r = W === "sunken", v = `${te()}-body`, [_, S] = G(X);
|
|
31
|
+
!n && !_ && S(!0);
|
|
32
|
+
const e = !n || (f !== void 0 ? f : _), x = n && c === "gutter", J = i || e && !!d, [s, u] = G(!n), L = O(e);
|
|
33
|
+
!e && s ? u(!1) : e && !i && !s && u(!0), re(() => {
|
|
34
|
+
if (!e) {
|
|
35
|
+
L.current = !1;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!i || s || L.current && n)
|
|
39
|
+
return;
|
|
40
|
+
const o = window.setTimeout(() => u(!0), ue);
|
|
41
|
+
return () => window.clearTimeout(o);
|
|
42
|
+
}, [i, e, n, s]);
|
|
43
|
+
const j = O(null), A = !!l && Y && !r, $ = ce(j, I, A), N = U(B), a = q === "title", m = a ? "grid grid-cols-subgrid col-span-4" : "", E = () => {
|
|
44
|
+
const o = !e;
|
|
45
|
+
f === void 0 && S(o), b == null || b(o);
|
|
46
|
+
}, Q = [
|
|
33
47
|
a ? "grid grid-cols-[auto_auto_minmax(0,1fr)_auto]" : "flex flex-col",
|
|
34
48
|
"w-full text-left",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
].filter(Boolean).join(" "),
|
|
49
|
+
r ? "rounded-xl bg-[var(--malachite-card-dimmed-background)] p-[4px]" : "",
|
|
50
|
+
K
|
|
51
|
+
].filter(Boolean).join(" "), V = [
|
|
38
52
|
// `group` only when enabled, so the arrow doesn't darken on hover while disabled.
|
|
39
|
-
|
|
40
|
-
a ?
|
|
53
|
+
h ? "" : "group",
|
|
54
|
+
a ? m : "flex w-full",
|
|
41
55
|
"items-center transition-colors",
|
|
42
|
-
|
|
56
|
+
r ? "" : "border-0 border-b border-solid border-[var(--malachite-card-border)]",
|
|
43
57
|
l ? "sticky z-10" : "",
|
|
44
|
-
|
|
45
|
-
].filter(Boolean).join(" "),
|
|
46
|
-
"flex flex-1 items-center min-w-0
|
|
47
|
-
|
|
58
|
+
r ? "bg-transparent" : l ? e && p || h ? "" : "hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]" : e && p ? "bg-[var(--malachite-buttonlist-hover-background)]" : h ? "bg-transparent" : "bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]"
|
|
59
|
+
].filter(Boolean).join(" "), P = [
|
|
60
|
+
"flex flex-1 items-center min-w-0 text-left",
|
|
61
|
+
r ? "pr-[16px] py-[12px]" : "pr-[16px] py-[16px]",
|
|
48
62
|
a ? "col-start-3" : ""
|
|
49
|
-
].filter(Boolean).join(" "),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
].filter(Boolean).join(" "), Z = [
|
|
64
|
+
P,
|
|
65
|
+
"appearance-none border-0 bg-transparent cursor-pointer select-none disabled:cursor-not-allowed",
|
|
66
|
+
r ? `rounded-lg ${de}` : ie
|
|
67
|
+
].join(" "), D = {
|
|
68
|
+
paddingLeft: ae(N || x),
|
|
69
|
+
gap: ne(r)
|
|
70
|
+
}, T = M ?? /* @__PURE__ */ t("span", { className: "flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]", children: F }), H = !r && e && p, ee = l ? {
|
|
71
|
+
top: `${I}px`,
|
|
72
|
+
backgroundColor: r ? "var(--malachite-card-dimmed-background)" : "var(--malachite-card-background)",
|
|
73
|
+
...H && {
|
|
53
74
|
backgroundImage: "linear-gradient(var(--malachite-buttonlist-hover-background), var(--malachite-buttonlist-hover-background))"
|
|
54
75
|
}
|
|
55
|
-
} : {},
|
|
76
|
+
} : {}, k = se({
|
|
77
|
+
arrowPosition: n ? c : "end",
|
|
78
|
+
hasLeading: N,
|
|
79
|
+
sunken: r
|
|
80
|
+
}), z = a ? /* @__PURE__ */ t(
|
|
56
81
|
"div",
|
|
57
82
|
{
|
|
58
83
|
className: "col-start-3 col-span-2 min-w-0",
|
|
59
|
-
style:
|
|
60
|
-
children:
|
|
84
|
+
style: k < 0 ? { marginLeft: k } : { paddingLeft: k },
|
|
85
|
+
children: d
|
|
61
86
|
}
|
|
62
|
-
) :
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
87
|
+
) : d;
|
|
88
|
+
return /* @__PURE__ */ w("div", { className: Q, children: [
|
|
89
|
+
A && /* @__PURE__ */ t("div", { ref: j, "aria-hidden": "true", style: me }),
|
|
90
|
+
/* @__PURE__ */ w(
|
|
66
91
|
"div",
|
|
67
92
|
{
|
|
68
|
-
className:
|
|
69
|
-
style:
|
|
93
|
+
className: V,
|
|
94
|
+
style: ee,
|
|
70
95
|
"data-accordion-header": "",
|
|
71
|
-
"data-pinned":
|
|
96
|
+
"data-pinned": $ ? "" : void 0,
|
|
72
97
|
children: [
|
|
73
|
-
|
|
74
|
-
|
|
98
|
+
$ && /* @__PURE__ */ t(
|
|
99
|
+
oe,
|
|
75
100
|
{
|
|
76
101
|
radius: "var(--malachite-radius-xxl, 14px)",
|
|
77
|
-
surround: `var(${
|
|
102
|
+
surround: `var(${le}, var(--malachite-card-sunken-background))`
|
|
78
103
|
}
|
|
79
104
|
),
|
|
80
|
-
|
|
105
|
+
x && /* @__PURE__ */ t(
|
|
81
106
|
"button",
|
|
82
107
|
{
|
|
83
108
|
type: "button",
|
|
84
109
|
tabIndex: -1,
|
|
85
110
|
"aria-hidden": "true",
|
|
86
111
|
className: `${a ? "col-start-1" : ""} shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed`,
|
|
87
|
-
onMouseDown: (
|
|
88
|
-
onClick:
|
|
89
|
-
disabled:
|
|
90
|
-
children: /* @__PURE__ */
|
|
112
|
+
onMouseDown: (o) => o.preventDefault(),
|
|
113
|
+
onClick: E,
|
|
114
|
+
disabled: g,
|
|
115
|
+
children: /* @__PURE__ */ t(y, { expanded: e, size: C })
|
|
91
116
|
}
|
|
92
117
|
),
|
|
93
|
-
|
|
118
|
+
N && /* @__PURE__ */ t(
|
|
94
119
|
"div",
|
|
95
120
|
{
|
|
96
|
-
className: `${a ? "col-start-2" : ""} shrink-0 flex items-center ${
|
|
97
|
-
children:
|
|
121
|
+
className: `${a ? "col-start-2" : ""} shrink-0 flex items-center ${x ? "pl-[12px]" : "pl-[16px]"}`,
|
|
122
|
+
children: B
|
|
98
123
|
}
|
|
99
124
|
),
|
|
100
|
-
/* @__PURE__ */
|
|
125
|
+
n ? /* @__PURE__ */ w(
|
|
101
126
|
"button",
|
|
102
127
|
{
|
|
103
128
|
type: "button",
|
|
104
|
-
className:
|
|
105
|
-
style:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"aria-expanded": r,
|
|
111
|
-
"aria-controls": U ? p : void 0,
|
|
112
|
-
disabled: d,
|
|
129
|
+
className: Z,
|
|
130
|
+
style: D,
|
|
131
|
+
onClick: E,
|
|
132
|
+
"aria-expanded": e,
|
|
133
|
+
"aria-controls": J ? v : void 0,
|
|
134
|
+
disabled: g,
|
|
113
135
|
children: [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
136
|
+
c === "start" && /* @__PURE__ */ t(y, { expanded: e, size: C }),
|
|
137
|
+
T,
|
|
138
|
+
c === "end" && /* @__PURE__ */ t(
|
|
139
|
+
y,
|
|
140
|
+
{
|
|
141
|
+
expanded: e,
|
|
142
|
+
size: C,
|
|
143
|
+
className: "ml-auto"
|
|
144
|
+
}
|
|
145
|
+
)
|
|
117
146
|
]
|
|
118
147
|
}
|
|
119
|
-
),
|
|
120
|
-
|
|
148
|
+
) : /* @__PURE__ */ t("div", { className: P, style: D, children: T }),
|
|
149
|
+
U(R) && /* @__PURE__ */ t(
|
|
121
150
|
"div",
|
|
122
151
|
{
|
|
123
152
|
className: `${a ? "col-start-4" : ""} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`,
|
|
124
|
-
children:
|
|
153
|
+
children: R
|
|
125
154
|
}
|
|
126
155
|
)
|
|
127
156
|
]
|
|
128
157
|
}
|
|
129
158
|
),
|
|
130
|
-
|
|
159
|
+
i ? (
|
|
131
160
|
/* Height animates via grid-template-rows (0fr → 1fr); body clips during.
|
|
132
161
|
grid-cols-[minmax(0,1fr)] pins the single column to the track width so
|
|
133
162
|
wide, non-wrapping children (e.g. a table with long cell text) can't grow
|
|
134
163
|
the implicit `auto` column to their max-content and overflow the container;
|
|
135
164
|
the title grid's body cell uses min-w-0 instead. */
|
|
136
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ t(
|
|
137
166
|
"div",
|
|
138
167
|
{
|
|
139
|
-
id:
|
|
168
|
+
id: v,
|
|
140
169
|
className: `grid ${a ? "grid-cols-subgrid col-span-4" : "grid-cols-[minmax(0,1fr)]"} w-full transition-[grid-template-rows] duration-200 ease-in-out`,
|
|
141
|
-
style: { gridTemplateRows:
|
|
142
|
-
onTransitionEnd: (
|
|
143
|
-
|
|
170
|
+
style: { gridTemplateRows: e ? "1fr" : "0fr" },
|
|
171
|
+
onTransitionEnd: (o) => {
|
|
172
|
+
o.target === o.currentTarget && o.propertyName === "grid-template-rows" && u(e);
|
|
144
173
|
},
|
|
145
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ t(
|
|
146
175
|
"div",
|
|
147
176
|
{
|
|
148
|
-
className: [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
].filter(Boolean).join(" "),
|
|
152
|
-
children: s && /* @__PURE__ */ e(
|
|
177
|
+
className: [m, s ? "overflow-visible" : "overflow-hidden"].filter(Boolean).join(" "),
|
|
178
|
+
"data-settled": s ? "" : void 0,
|
|
179
|
+
children: d && /* @__PURE__ */ t(
|
|
153
180
|
"div",
|
|
154
181
|
{
|
|
155
182
|
className: [
|
|
156
|
-
|
|
157
|
-
|
|
183
|
+
m,
|
|
184
|
+
r ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]"
|
|
158
185
|
].filter(Boolean).join(" "),
|
|
159
|
-
children:
|
|
186
|
+
children: z
|
|
160
187
|
}
|
|
161
188
|
)
|
|
162
189
|
}
|
|
@@ -165,22 +192,22 @@ const te = "--malachite-ctx-pinned-surround", ae = { position: "absolute", width
|
|
|
165
192
|
)
|
|
166
193
|
) : (
|
|
167
194
|
/* Instant open — no clip, so a sticky child inside pins immediately. */
|
|
168
|
-
|
|
195
|
+
e && d && /* @__PURE__ */ t(
|
|
169
196
|
"div",
|
|
170
197
|
{
|
|
171
|
-
id:
|
|
198
|
+
id: v,
|
|
172
199
|
className: [
|
|
173
|
-
|
|
174
|
-
|
|
200
|
+
m,
|
|
201
|
+
r ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]"
|
|
175
202
|
].filter(Boolean).join(" "),
|
|
176
|
-
children:
|
|
203
|
+
children: z
|
|
177
204
|
}
|
|
178
205
|
)
|
|
179
206
|
)
|
|
180
207
|
] });
|
|
181
208
|
};
|
|
182
209
|
export {
|
|
183
|
-
|
|
184
|
-
|
|
210
|
+
Ce as Accordion,
|
|
211
|
+
Ce as default
|
|
185
212
|
};
|
|
186
213
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../src/components/Accordion.tsx"],"sourcesContent":["import React, { useId, useRef, useState } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport PinnedCornerCap from './PinnedCornerCap';\nimport { ARROW_PX, bodyInsetPx, toggleGapPx, togglePaddingLeftPx } from './accordionBodyInset';\nimport { FOCUS_RING, FOCUS_RING_INSET } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\nimport { usePinned } from './usePinned';\n\n/** The ground behind a pinned header's card, painted into its corners. A context channel, not a\n * theme token: no palette value, not settable through `applyTheme`, absent from\n * `getCurrentTheme`. Set it on an ancestor when the card does not sit on the page ground. */\nconst PINNED_SURROUND_CHANNEL = '--malachite-ctx-pinned-surround';\n\n// Out of flow with no insets: it rests at the section's top without a cell or a caller's gap.\nconst PIN_MARKER_STYLE: React.CSSProperties = { position: 'absolute', width: 0, height: 0 };\n\ninterface AccordionBaseProps {\n className?: string;\n children?: React.ReactNode;\n /**\n * Visual style. `default` is the flat list row (row dividers, hover background).\n * `sunken` draws the section as a sunken card (dimmed rounded container, no\n * dividers/hover) — used for stacked detail sections in side panels and detail\n * pages (see `CollapsibleSection`). Both lead with the arrow: it is the affordance\n * that says the section opens, and a reader scanning a stack of them finds it in\n * one column rather than at whatever width each header happens to end.\n */\n variant?: 'default' | 'sunken';\n /**\n * Content pinned to the right of the header, OUTSIDE the toggle button — so it may\n * be interactive (e.g. a Checkbox) without nesting a button inside a button.\n */\n trailing?: React.ReactNode;\n /** Before the title, outside the toggle button. */\n leading?: React.ReactNode;\n /** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */\n arrowPosition?: 'start' | 'end' | 'gutter';\n /** `false` keeps an open row on the card ground. */\n highlightExpanded?: boolean;\n /** `title` starts the body under the title, 16px short of it for a compact `Surface.Row`. */\n bodyIndent?: 'none' | 'title';\n defaultExpanded?: boolean;\n isExpanded?: boolean;\n onToggle?: (expanded: boolean) => void;\n /** Disables the toggle (and its hover). Trailing controls manage their own state. */\n disabled?: boolean;\n /**\n * Pin the header row to the top of the nearest scroll container so it stays\n * reachable while the body scrolls. Needs a scroll ancestor that clips without\n * trapping sticky — e.g. a `<Surface overflow=\"clip\">` (`overflow: hidden` traps it).\n */\n stickyHeader?: boolean;\n /** Offset (px) from the top of the scroll container when `stickyHeader` is set. */\n stickyTopOffset?: number;\n /**\n * With `stickyHeader`, rounds the header into its card's top corners once it pins, standing in\n * for the card's top edge. For a section at the top of a card on the page ground; set\n * `--malachite-ctx-pinned-surround` on an ancestor when the card sits on another ground.\n */\n pinnedCorners?: boolean;\n /**\n * Animate the expand/collapse height (default `true`). Set `false` for an instant\n * open — the body isn't clipped, so a `position: sticky` child pins immediately with\n * no post-animation settle.\n */\n animate?: boolean;\n}\n\n/**\n * Requires at least one of `title` (simple text header) or `header` (rich ReactNode\n * content for the toggle area, e.g. avatar + badges) so the toggle is never empty.\n */\ntype AccordionProps = AccordionBaseProps &\n ({ title: string; header?: React.ReactNode } | { title?: string; header: React.ReactNode });\n\nconst Accordion: React.FC<AccordionProps> = ({\n title,\n header,\n className,\n children,\n trailing,\n leading,\n arrowPosition = 'start',\n highlightExpanded = true,\n bodyIndent = 'none',\n variant = 'default',\n defaultExpanded = false,\n isExpanded,\n onToggle,\n disabled = false,\n stickyHeader = false,\n stickyTopOffset = 0,\n pinnedCorners = false,\n animate = true,\n}) => {\n const sunken = variant === 'sunken';\n const instanceId = useId();\n const bodyId = `${instanceId}-body`;\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n\n // Use controlled state if isExpanded is provided, otherwise use internal state\n const expanded = isExpanded !== undefined ? isExpanded : internalExpanded;\n\n // The instant path only renders the body while expanded; don't advertise\n // aria-controls when the referenced element isn't in the DOM.\n const bodyRendered = animate || (expanded && !!children);\n\n // The body clips overflow so the expand/collapse height animation works. Once fully\n // expanded we release the clip (after the transition) so a `position: sticky` child\n // inside can pin — `overflow: hidden` would otherwise trap it.\n //\n // Owned entirely by the transition: the same `onTransitionEnd` that sets it on expand\n // clears it on collapse, so no effect has to mirror `expanded` into it.\n const [bodySettled, setBodySettled] = useState(false);\n const markerRef = useRef<HTMLDivElement>(null);\n const capsCorners = Boolean(stickyHeader) && pinnedCorners && !sunken;\n const pinned = usePinned(markerRef, stickyTopOffset, capsCorners);\n const hasLeading = isRenderableNode(leading);\n\n // One header column per slot, so the body can start at the toggle's.\n const titleGrid = bodyIndent === 'title';\n const subgrid = titleGrid ? 'grid grid-cols-subgrid col-span-4' : '';\n\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n setInternalExpanded(newExpanded);\n }\n onToggle?.(newExpanded);\n };\n\n const containerClasses = [\n titleGrid ? 'grid grid-cols-[auto_auto_minmax(0,1fr)_auto]' : 'flex flex-col',\n 'w-full text-left',\n sunken ? 'rounded-xl bg-[var(--malachite-card-dimmed-background)] p-[4px]' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // The whole header row is a `group` so the disclosure arrow darkens on hover; the\n // hover background and arrow react to hovering anywhere on the row. The sunken\n // variant carries its own card chrome instead of row dividers/hover.\n // A pinned header's hover paints over its inline ground (headerRowStyle), which beats a\n // bg-colour class. Written out in full so Tailwind's scanner generates it.\n const pinnedBackground =\n (expanded && highlightExpanded) || disabled\n ? ''\n : 'hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]';\n const rowBackground = sunken\n ? 'bg-transparent'\n : stickyHeader\n ? pinnedBackground\n : expanded && highlightExpanded\n ? 'bg-[var(--malachite-buttonlist-hover-background)]'\n : disabled\n ? 'bg-transparent'\n : 'bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]';\n const headerRowClasses = [\n // `group` only when enabled, so the arrow doesn't darken on hover while disabled.\n disabled ? '' : 'group',\n titleGrid ? subgrid : 'flex w-full',\n 'items-center transition-colors',\n sunken ? '' : 'border-0 border-b border-solid border-[var(--malachite-card-border)]',\n stickyHeader ? 'sticky z-10' : '',\n rowBackground,\n ]\n .filter(Boolean)\n .join(' ');\n // Full-bleed default rows use an inset ring; the padded sunken toggle fits an outset one.\n const toggleButtonClasses = [\n 'flex flex-1 items-center min-w-0 appearance-none border-0 bg-transparent text-left cursor-pointer select-none disabled:cursor-not-allowed',\n sunken\n ? `pr-[16px] py-[12px] rounded-lg ${FOCUS_RING}`\n : `pr-[16px] py-[16px] ${FOCUS_RING_INSET}`,\n titleGrid ? 'col-start-3' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n // Inline so the offset, the opaque ground and the open highlight apply even where arbitrary\n // classes are not compiled. The ground is the variant's own: a sunken section pinned in card\n // white floats over its grey.\n const highlighted = !sunken && expanded && highlightExpanded;\n const headerRowStyle: React.CSSProperties = stickyHeader\n ? {\n top: `${stickyTopOffset}px`,\n backgroundColor: sunken\n ? 'var(--malachite-card-dimmed-background)'\n : 'var(--malachite-card-background)',\n ...(highlighted && {\n backgroundImage:\n 'linear-gradient(var(--malachite-buttonlist-hover-background), var(--malachite-buttonlist-hover-background))',\n }),\n }\n : {};\n\n const titleInset = bodyInsetPx({ arrowPosition, hasLeading, sunken });\n const bodyChildren = titleGrid ? (\n <div\n className=\"col-start-3 col-span-2 min-w-0\"\n style={titleInset < 0 ? { marginLeft: titleInset } : { paddingLeft: titleInset }}\n >\n {children}\n </div>\n ) : (\n children\n );\n\n return (\n <div className={containerClasses}>\n {capsCorners && <div ref={markerRef} aria-hidden=\"true\" style={PIN_MARKER_STYLE} />}\n <div\n className={headerRowClasses}\n style={headerRowStyle}\n data-accordion-header=\"\"\n data-pinned={pinned ? '' : undefined}\n >\n {pinned && (\n <PinnedCornerCap\n radius=\"var(--malachite-radius-xxl, 14px)\"\n surround={`var(${PINNED_SURROUND_CHANNEL}, var(--malachite-card-sunken-background))`}\n />\n )}\n {arrowPosition === 'gutter' && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className={`${titleGrid ? 'col-start-1' : ''} shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={handleToggle}\n disabled={disabled}\n >\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n </button>\n )}\n {hasLeading && (\n <div\n className={`${titleGrid ? 'col-start-2' : ''} shrink-0 flex items-center ${arrowPosition === 'gutter' ? 'pl-[12px]' : 'pl-[16px]'}`}\n >\n {leading}\n </div>\n )}\n {/* Toggle area — arrow + header/title. Interactive trailing sits outside it. */}\n <button\n type=\"button\"\n className={toggleButtonClasses}\n style={{\n paddingLeft: togglePaddingLeftPx(hasLeading || arrowPosition === 'gutter'),\n gap: toggleGapPx(sunken),\n }}\n onClick={handleToggle}\n aria-expanded={expanded}\n aria-controls={bodyRendered ? bodyId : undefined}\n disabled={disabled}\n >\n {arrowPosition === 'start' && (\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n )}\n {header ?? (\n <span className=\"flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]\">\n {title}\n </span>\n )}\n {arrowPosition === 'end' && (\n <DisclosureArrow expanded={expanded} size={ARROW_PX} className=\"ml-auto\" />\n )}\n </button>\n {isRenderableNode(trailing) && (\n <div\n className={`${titleGrid ? 'col-start-4' : ''} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`}\n >\n {trailing}\n </div>\n )}\n </div>\n\n {animate ? (\n /* Height animates via grid-template-rows (0fr → 1fr); body clips during.\n grid-cols-[minmax(0,1fr)] pins the single column to the track width so\n wide, non-wrapping children (e.g. a table with long cell text) can't grow\n the implicit `auto` column to their max-content and overflow the container;\n the title grid's body cell uses min-w-0 instead. */\n <div\n id={bodyId}\n className={`grid ${titleGrid ? 'grid-cols-subgrid col-span-4' : 'grid-cols-[minmax(0,1fr)]'} w-full transition-[grid-template-rows] duration-200 ease-in-out`}\n style={{ gridTemplateRows: expanded ? '1fr' : '0fr' }}\n onTransitionEnd={(event) => {\n if (event.propertyName === 'grid-template-rows') {\n setBodySettled(expanded);\n }\n }}\n >\n <div\n className={[\n subgrid,\n bodySettled && expanded ? 'overflow-visible' : 'overflow-hidden',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {children && (\n <div\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )}\n </div>\n </div>\n ) : (\n /* Instant open — no clip, so a sticky child inside pins immediately. */\n expanded &&\n children && (\n <div\n id={bodyId}\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )\n )}\n </div>\n );\n};\n\nexport default Accordion;\nexport { Accordion };\nexport type { AccordionProps };\n"],"names":["PINNED_SURROUND_CHANNEL","PIN_MARKER_STYLE","Accordion","title","header","className","children","trailing","leading","arrowPosition","highlightExpanded","bodyIndent","variant","defaultExpanded","isExpanded","onToggle","disabled","stickyHeader","stickyTopOffset","pinnedCorners","animate","sunken","bodyId","useId","internalExpanded","setInternalExpanded","useState","expanded","bodyRendered","bodySettled","setBodySettled","markerRef","useRef","capsCorners","pinned","usePinned","hasLeading","isRenderableNode","titleGrid","subgrid","handleToggle","newExpanded","containerClasses","headerRowClasses","toggleButtonClasses","FOCUS_RING","FOCUS_RING_INSET","highlighted","headerRowStyle","titleInset","bodyInsetPx","bodyChildren","jsx","jsxs","PinnedCornerCap","event","DisclosureArrow","ARROW_PX","togglePaddingLeftPx","toggleGapPx"],"mappings":";;;;;;;;AAWA,MAAMA,KAA0B,mCAG1BC,KAAwC,EAAE,UAAU,YAAY,OAAO,GAAG,QAAQ,EAAA,GA6DlFC,KAAsC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,mBAAAC,IAAoB;AAAA,EACpB,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,iBAAAC,IAAkB;AAAA,EAClB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,iBAAAC,IAAkB;AAAA,EAClB,eAAAC,IAAgB;AAAA,EAChB,SAAAC,IAAU;AACd,MAAM;AACF,QAAMC,IAAST,MAAY,UAErBU,IAAS,GADIC,EAAA,CACS,SACtB,CAACC,GAAkBC,CAAmB,IAAIC,EAASb,CAAe,GAGlEc,IAAWb,MAAe,SAAYA,IAAaU,GAInDI,IAAeR,KAAYO,KAAY,CAAC,CAACrB,GAQzC,CAACuB,GAAaC,CAAc,IAAIJ,EAAS,EAAK,GAC9CK,IAAYC,EAAuB,IAAI,GACvCC,IAAc,EAAQhB,KAAi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O,OAAO,EACd,KAAK,GAAG;AAAA,kBAEZ,UAAA8B;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QAER;AAAA,MAAA;AAAA;AAAA;AAAA,MAIJxB,KACArB,KACI,gBAAA8C;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,IAAI9B;AAAA,UACJ,WAAW;AAAA,YACPiB;AAAA,YACAlB,IACM,aACA;AAAA,UAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,UAEZ,UAAA8B;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EACL,GAGZ;AAER;"}
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../src/components/Accordion.tsx"],"sourcesContent":["import React, { useEffect, useId, useRef, useState } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport PinnedCornerCap from './PinnedCornerCap';\nimport { ARROW_PX, bodyInsetPx, toggleGapPx, togglePaddingLeftPx } from './accordionBodyInset';\nimport { FOCUS_RING, FOCUS_RING_INSET } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\nimport { usePinned } from './usePinned';\n\n/** The ground behind a pinned header's card, painted into its corners. A context channel, not a\n * theme token: no palette value, not settable through `applyTheme`, absent from\n * `getCurrentTheme`. Set it on an ancestor when the card does not sit on the page ground. */\nconst PINNED_SURROUND_CHANNEL = '--malachite-ctx-pinned-surround';\n\nconst SETTLE_FALLBACK_MS = 300;\n\n// Out of flow with no insets: it rests at the section's top without a cell or a caller's gap.\nconst PIN_MARKER_STYLE: React.CSSProperties = { position: 'absolute', width: 0, height: 0 };\n\ninterface AccordionBaseProps {\n className?: string;\n children?: React.ReactNode;\n /**\n * Visual style. `default` is the flat list row (row dividers, hover background).\n * `sunken` draws the section as a sunken card (dimmed rounded container, no\n * dividers/hover) — used for stacked detail sections in side panels and detail\n * pages (see `CollapsibleSection`). Both lead with the arrow: it is the affordance\n * that says the section opens, and a reader scanning a stack of them finds it in\n * one column rather than at whatever width each header happens to end.\n */\n variant?: 'default' | 'sunken';\n /**\n * Content pinned to the right of the header, OUTSIDE the toggle button — so it may\n * be interactive (e.g. a Checkbox) without nesting a button inside a button.\n */\n trailing?: React.ReactNode;\n /** Before the title, outside the toggle button. */\n leading?: React.ReactNode;\n /** `false` keeps an open row on the card ground. */\n highlightExpanded?: boolean;\n /** `title` starts the body under the title, 16px short of it for a compact `Surface.Row`. */\n bodyIndent?: 'none' | 'title';\n /**\n * Pin the header row to the top of the nearest scroll container so it stays\n * reachable while the body scrolls. Needs a scroll ancestor that clips without\n * trapping sticky — e.g. a `<Surface overflow=\"clip\">` (`overflow: hidden` traps it).\n */\n stickyHeader?: boolean;\n /** Offset (px) from the top of the scroll container when `stickyHeader` is set. */\n stickyTopOffset?: number;\n /**\n * With `stickyHeader`, rounds the header into its card's top corners once it pins, standing in\n * for the card's top edge. For a section at the top of a card on the page ground; set\n * `--malachite-ctx-pinned-surround` on an ancestor when the card sits on another ground.\n */\n pinnedCorners?: boolean;\n}\n\ninterface AccordionToggleProps {\n /** `false` is a section that never closes; the toggle props are then ignored. */\n collapsible?: boolean;\n /** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */\n arrowPosition?: 'start' | 'end' | 'gutter';\n defaultExpanded?: boolean;\n isExpanded?: boolean;\n onToggle?: (expanded: boolean) => void;\n /** Disables the toggle (and its hover). Trailing controls manage their own state. */\n disabled?: boolean;\n /**\n * Animate the expand/collapse height (default `true`). Set `false` for an instant\n * open — the body isn't clipped, so a `position: sticky` child pins immediately with\n * no post-animation settle.\n */\n animate?: boolean;\n}\n\n/**\n * Requires at least one of `title` (simple text header) or `header` (rich ReactNode\n * content for the toggle area, e.g. avatar + badges) so the toggle is never empty.\n */\ntype AccordionProps = AccordionBaseProps &\n AccordionToggleProps &\n ({ title: string; header?: React.ReactNode } | { title?: string; header: React.ReactNode });\n\nconst Accordion: React.FC<AccordionProps> = ({\n title,\n header,\n className,\n children,\n trailing,\n leading,\n arrowPosition = 'start',\n highlightExpanded = true,\n bodyIndent = 'none',\n variant = 'default',\n defaultExpanded = false,\n isExpanded,\n onToggle,\n disabled = false,\n stickyHeader = false,\n stickyTopOffset = 0,\n pinnedCorners = false,\n animate = true,\n collapsible = true,\n}) => {\n const quiet = disabled || !collapsible;\n const sunken = variant === 'sunken';\n const instanceId = useId();\n const bodyId = `${instanceId}-body`;\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n if (!collapsible && !internalExpanded) {\n setInternalExpanded(true);\n }\n\n // Use controlled state if isExpanded is provided, otherwise use internal state\n const expanded = !collapsible || (isExpanded !== undefined ? isExpanded : internalExpanded);\n const gutter = collapsible && arrowPosition === 'gutter';\n\n // The instant path only renders the body while expanded; don't advertise\n // aria-controls when the referenced element isn't in the DOM.\n const bodyRendered = animate || (expanded && !!children);\n\n // The body clips overflow so the expand/collapse height animation works. Once fully\n // expanded we release the clip (after the transition) so a `position: sticky` child\n // inside can pin — `overflow: hidden` would otherwise trap it.\n const [bodySettled, setBodySettled] = useState(!collapsible);\n const mountedOpen = useRef(expanded);\n if (!expanded && bodySettled) {\n setBodySettled(false);\n } else if (expanded && !animate && !bodySettled) {\n setBodySettled(true);\n }\n useEffect(() => {\n if (!expanded) {\n mountedOpen.current = false;\n return undefined;\n }\n if (!animate || bodySettled || (mountedOpen.current && collapsible)) {\n return undefined;\n }\n // Not `transitioncancel`: reversing a running transition fires it while the new one runs.\n const fallback = window.setTimeout(() => setBodySettled(true), SETTLE_FALLBACK_MS);\n return () => window.clearTimeout(fallback);\n }, [animate, expanded, collapsible, bodySettled]);\n const markerRef = useRef<HTMLDivElement>(null);\n const capsCorners = Boolean(stickyHeader) && pinnedCorners && !sunken;\n const pinned = usePinned(markerRef, stickyTopOffset, capsCorners);\n const hasLeading = isRenderableNode(leading);\n\n // One header column per slot, so the body can start at the toggle's.\n const titleGrid = bodyIndent === 'title';\n const subgrid = titleGrid ? 'grid grid-cols-subgrid col-span-4' : '';\n\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n setInternalExpanded(newExpanded);\n }\n onToggle?.(newExpanded);\n };\n\n const containerClasses = [\n titleGrid ? 'grid grid-cols-[auto_auto_minmax(0,1fr)_auto]' : 'flex flex-col',\n 'w-full text-left',\n sunken ? 'rounded-xl bg-[var(--malachite-card-dimmed-background)] p-[4px]' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // The whole header row is a `group` so the disclosure arrow darkens on hover; the\n // hover background and arrow react to hovering anywhere on the row. The sunken\n // variant carries its own card chrome instead of row dividers/hover.\n // A pinned header's hover paints over its inline ground (headerRowStyle), which beats a\n // bg-colour class. Written out in full so Tailwind's scanner generates it.\n const pinnedBackground =\n (expanded && highlightExpanded) || quiet\n ? ''\n : 'hover:bg-[image:linear-gradient(var(--malachite-buttonlist-hover-background),var(--malachite-buttonlist-hover-background))]';\n const rowBackground = sunken\n ? 'bg-transparent'\n : stickyHeader\n ? pinnedBackground\n : expanded && highlightExpanded\n ? 'bg-[var(--malachite-buttonlist-hover-background)]'\n : quiet\n ? 'bg-transparent'\n : 'bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]';\n const headerRowClasses = [\n // `group` only when enabled, so the arrow doesn't darken on hover while disabled.\n quiet ? '' : 'group',\n titleGrid ? subgrid : 'flex w-full',\n 'items-center transition-colors',\n sunken ? '' : 'border-0 border-b border-solid border-[var(--malachite-card-border)]',\n stickyHeader ? 'sticky z-10' : '',\n rowBackground,\n ]\n .filter(Boolean)\n .join(' ');\n const titleAreaClasses = [\n 'flex flex-1 items-center min-w-0 text-left',\n sunken ? 'pr-[16px] py-[12px]' : 'pr-[16px] py-[16px]',\n titleGrid ? 'col-start-3' : '',\n ]\n .filter(Boolean)\n .join(' ');\n // Full-bleed default rows use an inset ring; the padded sunken toggle fits an outset one.\n const toggleButtonClasses = [\n titleAreaClasses,\n 'appearance-none border-0 bg-transparent cursor-pointer select-none disabled:cursor-not-allowed',\n sunken ? `rounded-lg ${FOCUS_RING}` : FOCUS_RING_INSET,\n ].join(' ');\n const titleAreaStyle: React.CSSProperties = {\n paddingLeft: togglePaddingLeftPx(hasLeading || gutter),\n gap: toggleGapPx(sunken),\n };\n const titleContent = header ?? (\n <span className=\"flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]\">\n {title}\n </span>\n );\n\n // Inline so the offset, the opaque ground and the open highlight apply even where arbitrary\n // classes are not compiled. The ground is the variant's own: a sunken section pinned in card\n // white floats over its grey.\n const highlighted = !sunken && expanded && highlightExpanded;\n const headerRowStyle: React.CSSProperties = stickyHeader\n ? {\n top: `${stickyTopOffset}px`,\n backgroundColor: sunken\n ? 'var(--malachite-card-dimmed-background)'\n : 'var(--malachite-card-background)',\n ...(highlighted && {\n backgroundImage:\n 'linear-gradient(var(--malachite-buttonlist-hover-background), var(--malachite-buttonlist-hover-background))',\n }),\n }\n : {};\n\n const titleInset = bodyInsetPx({\n arrowPosition: collapsible ? arrowPosition : 'end',\n hasLeading,\n sunken,\n });\n const bodyChildren = titleGrid ? (\n <div\n className=\"col-start-3 col-span-2 min-w-0\"\n style={titleInset < 0 ? { marginLeft: titleInset } : { paddingLeft: titleInset }}\n >\n {children}\n </div>\n ) : (\n children\n );\n\n return (\n <div className={containerClasses}>\n {capsCorners && <div ref={markerRef} aria-hidden=\"true\" style={PIN_MARKER_STYLE} />}\n <div\n className={headerRowClasses}\n style={headerRowStyle}\n data-accordion-header=\"\"\n data-pinned={pinned ? '' : undefined}\n >\n {pinned && (\n <PinnedCornerCap\n radius=\"var(--malachite-radius-xxl, 14px)\"\n surround={`var(${PINNED_SURROUND_CHANNEL}, var(--malachite-card-sunken-background))`}\n />\n )}\n {gutter && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className={`${titleGrid ? 'col-start-1' : ''} shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed`}\n onMouseDown={(event) => event.preventDefault()}\n onClick={handleToggle}\n disabled={disabled}\n >\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n </button>\n )}\n {hasLeading && (\n <div\n className={`${titleGrid ? 'col-start-2' : ''} shrink-0 flex items-center ${gutter ? 'pl-[12px]' : 'pl-[16px]'}`}\n >\n {leading}\n </div>\n )}\n {/* Toggle area — arrow + header/title. Interactive trailing sits outside it. */}\n {collapsible ? (\n <button\n type=\"button\"\n className={toggleButtonClasses}\n style={titleAreaStyle}\n onClick={handleToggle}\n aria-expanded={expanded}\n aria-controls={bodyRendered ? bodyId : undefined}\n disabled={disabled}\n >\n {arrowPosition === 'start' && (\n <DisclosureArrow expanded={expanded} size={ARROW_PX} />\n )}\n {titleContent}\n {arrowPosition === 'end' && (\n <DisclosureArrow\n expanded={expanded}\n size={ARROW_PX}\n className=\"ml-auto\"\n />\n )}\n </button>\n ) : (\n <div className={titleAreaClasses} style={titleAreaStyle}>\n {titleContent}\n </div>\n )}\n {isRenderableNode(trailing) && (\n <div\n className={`${titleGrid ? 'col-start-4' : ''} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`}\n >\n {trailing}\n </div>\n )}\n </div>\n\n {animate ? (\n /* Height animates via grid-template-rows (0fr → 1fr); body clips during.\n grid-cols-[minmax(0,1fr)] pins the single column to the track width so\n wide, non-wrapping children (e.g. a table with long cell text) can't grow\n the implicit `auto` column to their max-content and overflow the container;\n the title grid's body cell uses min-w-0 instead. */\n <div\n id={bodyId}\n className={`grid ${titleGrid ? 'grid-cols-subgrid col-span-4' : 'grid-cols-[minmax(0,1fr)]'} w-full transition-[grid-template-rows] duration-200 ease-in-out`}\n style={{ gridTemplateRows: expanded ? '1fr' : '0fr' }}\n onTransitionEnd={(event) => {\n if (\n event.target === event.currentTarget &&\n event.propertyName === 'grid-template-rows'\n ) {\n setBodySettled(expanded);\n }\n }}\n >\n <div\n className={[subgrid, bodySettled ? 'overflow-visible' : 'overflow-hidden']\n .filter(Boolean)\n .join(' ')}\n data-settled={bodySettled ? '' : undefined}\n >\n {children && (\n <div\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )}\n </div>\n </div>\n ) : (\n /* Instant open — no clip, so a sticky child inside pins immediately. */\n expanded &&\n children && (\n <div\n id={bodyId}\n className={[\n subgrid,\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {bodyChildren}\n </div>\n )\n )}\n </div>\n );\n};\n\nexport default Accordion;\nexport { Accordion };\nexport type { AccordionProps };\n"],"names":["PINNED_SURROUND_CHANNEL","SETTLE_FALLBACK_MS","PIN_MARKER_STYLE","Accordion","title","header","className","children","trailing","leading","arrowPosition","highlightExpanded","bodyIndent","variant","defaultExpanded","isExpanded","onToggle","disabled","stickyHeader","stickyTopOffset","pinnedCorners","animate","collapsible","quiet","sunken","bodyId","useId","internalExpanded","setInternalExpanded","useState","expanded","gutter","bodyRendered","bodySettled","setBodySettled","mountedOpen","useRef","useEffect","fallback","markerRef","capsCorners","pinned","usePinned","hasLeading","isRenderableNode","titleGrid","subgrid","handleToggle","newExpanded","containerClasses","headerRowClasses","titleAreaClasses","toggleButtonClasses","FOCUS_RING","FOCUS_RING_INSET","titleAreaStyle","togglePaddingLeftPx","toggleGapPx","titleContent","jsx","highlighted","headerRowStyle","titleInset","bodyInsetPx","bodyChildren","jsxs","PinnedCornerCap","event","DisclosureArrow","ARROW_PX"],"mappings":";;;;;;;;AAWA,MAAMA,KAA0B,mCAE1BC,KAAqB,KAGrBC,KAAwC,EAAE,UAAU,YAAY,OAAO,GAAG,QAAQ,EAAA,GAmElFC,KAAsC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,e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iB,EACpE,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,cACb,gBAAcA,IAAc,KAAK;AAAA,cAEhC,UAAA1B,KACG,gBAAAoD;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW;AAAA,oBACPb;AAAA,oBACAtB,IACM,aACA;AAAA,kBAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,kBAEZ,UAAAwC;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QAER;AAAA,MAAA;AAAA;AAAA;AAAA,MAIJlC,KACAvB,KACI,gBAAAoD;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,IAAIlC;AAAA,UACJ,WAAW;AAAA,YACPqB;AAAA,YACAtB,IACM,aACA;AAAA,UAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,UAEZ,UAAAwC;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EACL,GAGZ;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/components/Button.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ButtonSpinner from './ButtonSpinner';\nimport Tooltip from './Tooltip';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport {\n getDefaultRadiusClass,\n getIconGapClass,\n getRadiusClass,\n getSizeClasses,\n getVariantClasses,\n} from './buttonStyles';\nimport { resolveRel } from './linkRel';\n\n// Button variant types matching the old component\nexport type ButtonVariant =\n | 'filled'\n | 'outline'\n /**\n * `outline`'s geometry on a ground of its own. For a button sitting on a tinted or\n * patterned surface, where `outline`'s transparent background lets that surface through\n * and the control stops reading as a button.\n */\n | 'surface'\n /**\n * The violet the assistant is named in elsewhere — for a control that hands work to it, or\n * acts on what it produced. Provenance, not a severity: it says who is being asked, not\n * that anything is wrong.\n */\n | 'assistant'\n | 'destructive'\n | 'success'\n | 'warning'\n | 'error'\n | 'ghost'\n /** Text only, in the accent colour, for a secondary action beside a primary one. */\n | 'quiet'\n /**\n * A recessed grey with secondary text, for a control whose subject is switched off, such as\n * an account set to Not allowed. It stays clickable: `disabled` is for a control that is not.\n */\n | 'muted'\n | 'no-style';\n\nexport type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large';\n\nexport type ButtonRadius = 'md' | 'lg' | 'xl';\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant: ButtonVariant;\n size?: ButtonSize;\n radius?: ButtonRadius;\n loading?: boolean;\n disabled?: boolean;\n icon?: React.ReactNode;\n iconPosition?: 'start' | 'end';\n /** Before the label at its own size, never squeezed (an avatar); pairs with an end `icon`. */\n leading?: React.ReactNode;\n /** `start` aligns the label to the leading edge and pins an end `icon` to the far edge. */\n contentAlign?: 'center' | 'start';\n /** Fills the container's width. */\n flexGrow?: boolean;\n /** `wide` holds a 120px floor for a primary action. */\n width?: 'auto' | 'wide';\n fill?: boolean;\n tooltip?: string;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n iconOnly?: boolean;\n /** Pulls a borderless button out by its own padding, so its label lines up with the text around it. */\n flush?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement>;\n /** Renders the button as a real anchor, so a link action is never an <a> nested in a <button>. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\n// The 1px is the transparent border, which `no-style` drops.\nconst FLUSH_MARGIN = '-mx-[calc(var(--btn-px)+1px)]';\nconst FLUSH_MARGIN_BORDERLESS = '-mx-[var(--btn-px)]';\n\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (\n {\n variant,\n size = 'large',\n radius,\n loading = false,\n disabled = false,\n icon,\n iconPosition = 'start',\n leading,\n contentAlign = 'center',\n flexGrow = false,\n width = 'auto',\n fill = false,\n tooltip,\n tooltipPlacement = 'top',\n iconOnly = false,\n flush = false,\n children,\n className = '',\n href,\n target,\n rel,\n ...props\n },\n ref,\n ) => {\n const radiusClass = radius ? getRadiusClass(radius) : getDefaultRadiusClass(size, iconOnly);\n const isInactive = disabled || loading;\n const alignStart = contentAlign === 'start';\n const baseClasses = [\n alignStart\n ? 'flex items-center justify-start text-left'\n : 'flex items-center justify-center',\n iconOnly ? `p-0 ${getIconOnlySizeClasses(size)}` : getSizeClasses(size),\n getVariantClasses(variant, radiusClass),\n flexGrow ? 'w-full' : '',\n width === 'wide' ? 'min-w-[120px]' : '',\n fill ? 'max-w-full' : '',\n isInactive ? 'cursor-not-allowed' : '',\n tooltip && isInactive ? 'pointer-events-none' : '',\n flush && !iconOnly\n ? variant === 'no-style'\n ? FLUSH_MARGIN_BORDERLESS\n : FLUSH_MARGIN\n : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const label = alignStart ? (\n <span className=\"flex min-w-0 flex-1 items-center\">{children}</span>\n ) : (\n children\n );\n\n const leadingSlot = leading ? (\n <span\n className={\n children\n ? 'btn-leading inline-flex shrink-0 items-center me-2'\n : 'btn-leading inline-flex shrink-0 items-center'\n }\n >\n {leading}\n </span>\n ) : null;\n\n const renderContent = () => {\n if (loading) {\n return (\n <>\n {leadingSlot}\n <ButtonSpinner />\n {label}\n </>\n );\n }\n\n const iconWrapperClasses = `inline-flex items-center shrink-0 ${getIconSizeClass(size)}`;\n\n if (icon && iconPosition === 'start') {\n return (\n <>\n {leadingSlot}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'start')}` : ''}`}\n >\n {icon}\n </span>\n {label}\n </>\n );\n }\n\n if (icon && iconPosition === 'end') {\n return (\n <>\n {leadingSlot}\n {label}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'end')}` : ''}`}\n >\n {icon}\n </span>\n </>\n );\n }\n\n return (\n <>\n {leadingSlot}\n {label}\n </>\n );\n };\n\n // An anchor cannot be disabled, so an inactive link still renders as a <button>.\n const button =\n href && !isInactive ? (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n className={baseClasses}\n {...(props as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {renderContent()}\n </a>\n ) : (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n disabled={isInactive}\n className={baseClasses}\n {...props}\n >\n {renderContent()}\n </button>\n );\n\n if (tooltip) {\n const trigger = isInactive ? (\n <span className={`inline-flex cursor-not-allowed${flexGrow ? ' w-full' : ''}`}>\n {button}\n </span>\n ) : (\n button\n );\n return (\n <Tooltip text={tooltip} placement={tooltipPlacement} fill={flexGrow}>\n {trigger}\n </Tooltip>\n );\n }\n\n return button;\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["FLUSH_MARGIN","FLUSH_MARGIN_BORDERLESS","Button","forwardRef","variant","size","radius","loading","disabled","icon","iconPosition","leading","contentAlign","flexGrow","width","fill","tooltip","tooltipPlacement","iconOnly","flush","children","className","href","target","rel","props","ref","radiusClass","getRadiusClass","getDefaultRadiusClass","isInactive","alignStart","baseClasses","getIconOnlySizeClasses","getSizeClasses","getVariantClasses","label","jsx","leadingSlot","renderContent","jsxs","Fragment","ButtonSpinner","iconWrapperClasses","getIconSizeClass","getIconGapClass","button","resolveRel","Tooltip"],"mappings":";;;;;;;AA8EA,MAAMA,IAAe,iCACfC,IAA0B,uBAEnBC,IAASC;AAAA,EAClB,CACI;AAAA,IACI,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,MAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ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button.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ButtonSpinner from './ButtonSpinner';\nimport Tooltip from './Tooltip';\nimport { getIconOnlySizeClasses, getIconSizeClass } from './buttonSizing';\nimport {\n getDefaultRadiusClass,\n getIconGapClass,\n getRadiusClass,\n getSizeClasses,\n getVariantClasses,\n} from './buttonStyles';\nimport { resolveRel } from './linkRel';\n\n// Button variant types matching the old component\nexport type ButtonVariant =\n | 'filled'\n | 'outline'\n /**\n * `outline`'s geometry on a ground of its own. For a button sitting on a tinted or\n * patterned surface, where `outline`'s transparent background lets that surface through\n * and the control stops reading as a button.\n */\n | 'surface'\n /**\n * The violet the assistant is named in elsewhere — for a control that hands work to it, or\n * acts on what it produced. Provenance, not a severity: it says who is being asked, not\n * that anything is wrong.\n */\n | 'assistant'\n | 'destructive'\n | 'success'\n | 'warning'\n | 'error'\n | 'ghost'\n /** `ghost` until its `Surface.Row` is hovered or focused, or its menu opens. For `trailing` only. */\n | 'row-outline'\n /** Text only, in the accent colour, for a secondary action beside a primary one. */\n | 'quiet'\n /**\n * A recessed grey with secondary text, for a control whose subject is switched off, such as\n * an account set to Not allowed. It stays clickable: `disabled` is for a control that is not.\n */\n | 'muted'\n | 'no-style';\n\nexport type ButtonSize = 'xsmall' | 'small' | 'medium' | 'large';\n\nexport type ButtonRadius = 'md' | 'lg' | 'xl';\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant: ButtonVariant;\n size?: ButtonSize;\n radius?: ButtonRadius;\n loading?: boolean;\n disabled?: boolean;\n icon?: React.ReactNode;\n iconPosition?: 'start' | 'end';\n /** Before the label at its own size, never squeezed (an avatar); pairs with an end `icon`. */\n leading?: React.ReactNode;\n /** `start` aligns the label to the leading edge and pins an end `icon` to the far edge. */\n contentAlign?: 'center' | 'start';\n /** Fills the container's width. */\n flexGrow?: boolean;\n /** `wide` holds a 120px floor for a primary action. */\n width?: 'auto' | 'wide';\n fill?: boolean;\n tooltip?: string;\n tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';\n iconOnly?: boolean;\n /** Pulls a borderless button out by its own padding, so its label lines up with the text around it. */\n flush?: boolean;\n children?: React.ReactNode;\n onClick?: React.MouseEventHandler<HTMLButtonElement & HTMLAnchorElement>;\n /** Renders the button as a real anchor, so a link action is never an <a> nested in a <button>. */\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n rel?: string;\n}\n\n// The 1px is the transparent border, which `no-style` drops.\nconst FLUSH_MARGIN = '-mx-[calc(var(--btn-px)+1px)]';\nconst FLUSH_MARGIN_BORDERLESS = '-mx-[var(--btn-px)]';\n\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (\n {\n variant,\n size = 'large',\n radius,\n loading = false,\n disabled = false,\n icon,\n iconPosition = 'start',\n leading,\n contentAlign = 'center',\n flexGrow = false,\n width = 'auto',\n fill = false,\n tooltip,\n tooltipPlacement = 'top',\n iconOnly = false,\n flush = false,\n children,\n className = '',\n href,\n target,\n rel,\n ...props\n },\n ref,\n ) => {\n const radiusClass = radius ? getRadiusClass(radius) : getDefaultRadiusClass(size, iconOnly);\n const isInactive = disabled || loading;\n const alignStart = contentAlign === 'start';\n const baseClasses = [\n alignStart\n ? 'flex items-center justify-start text-left'\n : 'flex items-center justify-center',\n iconOnly ? `p-0 ${getIconOnlySizeClasses(size)}` : getSizeClasses(size),\n getVariantClasses(variant, radiusClass),\n flexGrow ? 'w-full' : '',\n width === 'wide' ? 'min-w-[120px]' : '',\n fill ? 'max-w-full' : '',\n isInactive ? 'cursor-not-allowed' : '',\n tooltip && isInactive ? 'pointer-events-none' : '',\n flush && !iconOnly\n ? variant === 'no-style'\n ? FLUSH_MARGIN_BORDERLESS\n : FLUSH_MARGIN\n : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const label = alignStart ? (\n <span className=\"flex min-w-0 flex-1 items-center\">{children}</span>\n ) : (\n children\n );\n\n const leadingSlot = leading ? (\n <span\n className={\n children\n ? 'btn-leading inline-flex shrink-0 items-center me-2'\n : 'btn-leading inline-flex shrink-0 items-center'\n }\n >\n {leading}\n </span>\n ) : null;\n\n const renderContent = () => {\n if (loading) {\n return (\n <>\n {leadingSlot}\n <ButtonSpinner />\n {label}\n </>\n );\n }\n\n const iconWrapperClasses = `inline-flex items-center shrink-0 ${getIconSizeClass(size)}`;\n\n if (icon && iconPosition === 'start') {\n return (\n <>\n {leadingSlot}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'start')}` : ''}`}\n >\n {icon}\n </span>\n {label}\n </>\n );\n }\n\n if (icon && iconPosition === 'end') {\n return (\n <>\n {leadingSlot}\n {label}\n <span\n className={`${iconWrapperClasses}${children ? ` ${getIconGapClass(size, 'end')}` : ''}`}\n >\n {icon}\n </span>\n </>\n );\n }\n\n return (\n <>\n {leadingSlot}\n {label}\n </>\n );\n };\n\n // An anchor cannot be disabled, so an inactive link still renders as a <button>.\n const button =\n href && !isInactive ? (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={href}\n target={target}\n rel={resolveRel(rel, target)}\n className={baseClasses}\n {...(props as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {renderContent()}\n </a>\n ) : (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n disabled={isInactive}\n className={baseClasses}\n {...props}\n >\n {renderContent()}\n </button>\n );\n\n if (tooltip) {\n const trigger = isInactive ? (\n <span className={`inline-flex cursor-not-allowed${flexGrow ? ' w-full' : ''}`}>\n {button}\n </span>\n ) : (\n button\n );\n return (\n <Tooltip text={tooltip} placement={tooltipPlacement} fill={flexGrow}>\n {trigger}\n </Tooltip>\n );\n }\n\n return button;\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["FLUSH_MARGIN","FLUSH_MARGIN_BORDERLESS","Button","forwardRef","variant","size","radius","loading","disabled","icon","iconPosition","leading","contentAlign","flexGrow","width","fill","tooltip","tooltipPlacement","iconOnly","flush","children","className","href","target","rel","props","ref","radiusClass","getRadiusClass","getDefaultRadiusClass","isInactive","alignStart","baseClasses","getIconOnlySizeClasses","getSizeClasses","getVariantClasses","label","jsx","leadingSlot","renderContent","jsxs","Fragment","ButtonSpinner","iconWrapperClasses","getIconSizeClass","getIconGapClass","button","resolveRel","Tooltip"],"mappings":";;;;;;;AAgFA,MAAMA,IAAe,iCACfC,IAA0B,uBAEnBC,IAASC;AAAA,EAClB,CACI;AAAA,IACI,SAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,MAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,SAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,MAAAC,IAAO;AAAA,IACP,SAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAEPC,MACC;AACD,UAAMC,IAAcrB,IAASsB,EAAetB,CAAM,IAAIuB,EAAsBxB,GAAMa,CAAQ,GACpFY,IAAatB,KAAYD,GACzBwB,IAAanB,MAAiB,SAC9BoB,IAAc;AAAA,MAChBD,IACM,8CACA;AAAA,MACNb,IAAW,OAAOe,EAAuB5B,CAAI,CAAC,KAAK6B,EAAe7B,CAAI;AAAA,MACtE8B,EAAkB/B,GAASuB,CAAW;AAAA,MACtCd,IAAW,WAAW;AAAA,MACtBC,MAAU,SAAS,kBAAkB;AAAA,MACrCC,IAAO,eAAe;AAAA,MACtBe,IAAa,uBAAuB;AAAA,MACpCd,KAAWc,IAAa,wBAAwB;AAAA,MAChDX,KAAS,CAACD,IACJd,MAAY,aACRH,IACAD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