@stackone/malachite 2.78.0 → 2.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/COMPONENTS.md CHANGED
@@ -7,7 +7,7 @@ The catalog of components exported from `@stackone/malachite`. **Reach for one o
7
7
  ## Layout & containers
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
- - **`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`, `className`, `style`.
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), `className`, `style`.
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. `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`.
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`.
@@ -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 while the body scrolls — 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), `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 while the body scrolls — 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`.
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`.
@@ -0,0 +1,6 @@
1
+ import * as C from "react";
2
+ const t = (e) => /* @__PURE__ */ C.createElement("svg", { width: 12, height: 12, viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M3.78516 7.28589L7.28516 3.78589C7.3462 3.72484 7.41867 3.67642 7.49843 3.64338C7.57819 3.61035 7.66367 3.59334 7.75 3.59334C7.83633 3.59334 7.92182 3.61035 8.00157 3.64338C8.08133 3.67642 8.1538 3.72484 8.21485 3.78589C8.27589 3.84693 8.32431 3.9194 8.35735 3.99916C8.39039 4.07892 8.40739 4.1644 8.40739 4.25073C8.40739 4.33706 8.39039 4.42255 8.35735 4.5023C8.32431 4.58206 8.27589 4.65453 8.21485 4.71558L4.71484 8.21558C4.59156 8.33886 4.42435 8.40812 4.25 8.40812C4.07565 8.40812 3.90844 8.33886 3.78516 8.21558C3.66187 8.09229 3.59261 7.92508 3.59261 7.75073C3.59261 7.57638 3.66187 7.40917 3.78516 7.28589ZM10.9492 1.05151C10.3333 0.436943 9.49867 0.0917969 8.62856 0.0917969C7.75844 0.0917969 6.92385 0.436943 6.30789 1.05151L4.6607 2.69706C4.53742 2.82034 4.46816 2.98755 4.46816 3.1619C4.46816 3.24823 4.48516 3.33372 4.5182 3.41348C4.55124 3.49323 4.59966 3.5657 4.6607 3.62675C4.72175 3.68779 4.79422 3.73621 4.87398 3.76925C4.95373 3.80229 5.03922 3.81929 5.12555 3.81929C5.2999 3.81929 5.46711 3.75003 5.59039 3.62675L7.23485 1.98284C7.60412 1.6135 8.10499 1.40597 8.62727 1.40592C9.14955 1.40587 9.65046 1.6133 10.0198 1.98257C10.3892 2.35184 10.5967 2.85271 10.5967 3.37499C10.5968 3.89727 10.3894 4.39818 10.0201 4.76753L8.37344 6.41089C8.31239 6.47193 8.26397 6.5444 8.23094 6.62416C8.1979 6.70392 8.18089 6.7894 8.18089 6.87573C8.18089 6.96206 8.1979 7.04755 8.23094 7.1273C8.26397 7.20706 8.31239 7.27953 8.37344 7.34058C8.43448 7.40162 8.50695 7.45004 8.58671 7.48308C8.66647 7.51612 8.75195 7.53312 8.83828 7.53312C8.92461 7.53312 9.0101 7.51612 9.08985 7.48308C9.16961 7.45004 9.24208 7.40162 9.30313 7.34058L10.9481 5.69667C11.563 5.08033 11.9082 4.24518 11.9079 3.37457C11.9076 2.50396 11.5618 1.66906 10.9465 1.05315L10.9492 1.05151ZM6.41125 8.37308L4.7668 10.0181C4.58392 10.2009 4.36681 10.346 4.12788 10.4449C3.88895 10.5438 3.63287 10.5947 3.37426 10.5947C3.11565 10.5947 2.85958 10.5437 2.62067 10.4447C2.38176 10.3458 2.16468 10.2007 1.98184 10.0178C1.61256 9.64846 1.40514 9.14755 1.40519 8.62527C1.40524 8.10298 1.61277 7.60211 1.98211 7.23284L3.62602 5.58839C3.68706 5.52734 3.73548 5.45487 3.76852 5.37512C3.80156 5.29536 3.81856 5.20987 3.81856 5.12355C3.81856 5.03722 3.80156 4.95173 3.76852 4.87197C3.73548 4.79221 3.68706 4.71975 3.62602 4.6587C3.56497 4.59766 3.4925 4.54923 3.41274 4.5162C3.33299 4.48316 3.2475 4.46616 3.16117 4.46616C3.07484 4.46616 2.98936 4.48316 2.9096 4.5162C2.82984 4.54923 2.75737 4.59766 2.69633 4.6587L1.05352 6.30479C0.748763 6.60958 0.507026 6.97142 0.342108 7.36963C0.17719 7.76784 0.0923208 8.19464 0.0923462 8.62565C0.0923975 9.49612 0.438239 10.3309 1.05379 10.9464C1.66934 11.5619 2.50418 11.9076 3.37465 11.9076C4.24512 11.9075 5.07991 11.5617 5.69539 10.9461L7.3393 9.30167C7.46258 9.17839 7.53184 9.01118 7.53184 8.83683C7.53184 8.66248 7.46258 8.49527 7.3393 8.37198C7.21601 8.2487 7.0488 8.17944 6.87445 8.17944C6.7001 8.17944 6.5329 8.2487 6.40961 8.37198L6.41125 8.37308Z", fill: "currentColor" }));
3
+ export {
4
+ t as default
5
+ };
6
+ //# sourceMappingURL=chain_link.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain_link.svg.js","sources":["../../../src/assets/icons/chain_link.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgChainLink = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 12, height: 12, viewBox: \"0 0 12 12\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M3.78516 7.28589L7.28516 3.78589C7.3462 3.72484 7.41867 3.67642 7.49843 3.64338C7.57819 3.61035 7.66367 3.59334 7.75 3.59334C7.83633 3.59334 7.92182 3.61035 8.00157 3.64338C8.08133 3.67642 8.1538 3.72484 8.21485 3.78589C8.27589 3.84693 8.32431 3.9194 8.35735 3.99916C8.39039 4.07892 8.40739 4.1644 8.40739 4.25073C8.40739 4.33706 8.39039 4.42255 8.35735 4.5023C8.32431 4.58206 8.27589 4.65453 8.21485 4.71558L4.71484 8.21558C4.59156 8.33886 4.42435 8.40812 4.25 8.40812C4.07565 8.40812 3.90844 8.33886 3.78516 8.21558C3.66187 8.09229 3.59261 7.92508 3.59261 7.75073C3.59261 7.57638 3.66187 7.40917 3.78516 7.28589ZM10.9492 1.05151C10.3333 0.436943 9.49867 0.0917969 8.62856 0.0917969C7.75844 0.0917969 6.92385 0.436943 6.30789 1.05151L4.6607 2.69706C4.53742 2.82034 4.46816 2.98755 4.46816 3.1619C4.46816 3.24823 4.48516 3.33372 4.5182 3.41348C4.55124 3.49323 4.59966 3.5657 4.6607 3.62675C4.72175 3.68779 4.79422 3.73621 4.87398 3.76925C4.95373 3.80229 5.03922 3.81929 5.12555 3.81929C5.2999 3.81929 5.46711 3.75003 5.59039 3.62675L7.23485 1.98284C7.60412 1.6135 8.10499 1.40597 8.62727 1.40592C9.14955 1.40587 9.65046 1.6133 10.0198 1.98257C10.3892 2.35184 10.5967 2.85271 10.5967 3.37499C10.5968 3.89727 10.3894 4.39818 10.0201 4.76753L8.37344 6.41089C8.31239 6.47193 8.26397 6.5444 8.23094 6.62416C8.1979 6.70392 8.18089 6.7894 8.18089 6.87573C8.18089 6.96206 8.1979 7.04755 8.23094 7.1273C8.26397 7.20706 8.31239 7.27953 8.37344 7.34058C8.43448 7.40162 8.50695 7.45004 8.58671 7.48308C8.66647 7.51612 8.75195 7.53312 8.83828 7.53312C8.92461 7.53312 9.0101 7.51612 9.08985 7.48308C9.16961 7.45004 9.24208 7.40162 9.30313 7.34058L10.9481 5.69667C11.563 5.08033 11.9082 4.24518 11.9079 3.37457C11.9076 2.50396 11.5618 1.66906 10.9465 1.05315L10.9492 1.05151ZM6.41125 8.37308L4.7668 10.0181C4.58392 10.2009 4.36681 10.346 4.12788 10.4449C3.88895 10.5438 3.63287 10.5947 3.37426 10.5947C3.11565 10.5947 2.85958 10.5437 2.62067 10.4447C2.38176 10.3458 2.16468 10.2007 1.98184 10.0178C1.61256 9.64846 1.40514 9.14755 1.40519 8.62527C1.40524 8.10298 1.61277 7.60211 1.98211 7.23284L3.62602 5.58839C3.68706 5.52734 3.73548 5.45487 3.76852 5.37512C3.80156 5.29536 3.81856 5.20987 3.81856 5.12355C3.81856 5.03722 3.80156 4.95173 3.76852 4.87197C3.73548 4.79221 3.68706 4.71975 3.62602 4.6587C3.56497 4.59766 3.4925 4.54923 3.41274 4.5162C3.33299 4.48316 3.2475 4.46616 3.16117 4.46616C3.07484 4.46616 2.98936 4.48316 2.9096 4.5162C2.82984 4.54923 2.75737 4.59766 2.69633 4.6587L1.05352 6.30479C0.748763 6.60958 0.507026 6.97142 0.342108 7.36963C0.17719 7.76784 0.0923208 8.19464 0.0923462 8.62565C0.0923975 9.49612 0.438239 10.3309 1.05379 10.9464C1.66934 11.5619 2.50418 11.9076 3.37465 11.9076C4.24512 11.9075 5.07991 11.5617 5.69539 10.9461L7.3393 9.30167C7.46258 9.17839 7.53184 9.01118 7.53184 8.83683C7.53184 8.66248 7.46258 8.49527 7.3393 8.37198C7.21601 8.2487 7.0488 8.17944 6.87445 8.17944C6.7001 8.17944 6.5329 8.2487 6.40961 8.37198L6.41125 8.37308Z\", fill: \"currentColor\" }));\nexport default SvgChainLink;\n"],"names":["SvgChainLink","props","React"],"mappings":";AACK,MAACA,IAAe,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,+4FAA+4F,MAAM,eAAc,CAAE,CAAC;"}
@@ -0,0 +1,6 @@
1
+ import * as C from "react";
2
+ const e = (L) => /* @__PURE__ */ C.createElement("svg", { width: 11, height: 12, viewBox: "0 0 11 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...L }, /* @__PURE__ */ C.createElement("path", { d: "M10.4418 4.62485C10.3885 4.46042 10.2876 4.31548 10.152 4.2084C10.0163 4.10131 9.85185 4.03689 9.67953 4.02329L7.24793 3.82692L6.3095 1.55774C6.24354 1.39737 6.13142 1.26021 5.98736 1.16368C5.8433 1.06716 5.6738 1.01562 5.50039 1.01562C5.32699 1.01562 5.15749 1.06716 5.01343 1.16368C4.86937 1.26021 4.75724 1.39737 4.69129 1.55774L3.75371 3.82735L1.32211 4.02329C1.14947 4.03753 0.984895 4.10247 0.849057 4.20997C0.713218 4.31746 0.612182 4.46271 0.558645 4.62745C0.505108 4.7922 0.501458 4.96909 0.548154 5.1359C0.59485 5.30271 0.689809 5.452 0.821097 5.56501L2.67649 7.16516L2.1093 9.55853C2.06793 9.72727 2.07772 9.9045 2.13741 10.0677C2.19711 10.2308 2.30401 10.3725 2.44451 10.4747C2.585 10.5769 2.75274 10.635 2.92635 10.6416C3.09997 10.6481 3.27161 10.6029 3.41942 10.5116L5.50039 9.23067L7.58137 10.5116C7.72914 10.6023 7.9005 10.6471 8.07375 10.6403C8.247 10.6336 8.41436 10.5756 8.55463 10.4737C8.69491 10.3718 8.8018 10.2306 8.86176 10.0679C8.92172 9.9052 8.93207 9.72838 8.89149 9.55981L8.3243 7.16645L10.1797 5.5663C10.3118 5.45302 10.4072 5.30304 10.4539 5.13542C10.5005 4.9678 10.4963 4.79009 10.4418 4.62485ZM7.41379 6.58852C7.34225 6.6502 7.28902 6.73035 7.25993 6.82022C7.23083 6.91009 7.22698 7.00623 7.24879 7.09813L7.80266 9.43735L5.77067 8.18782C5.68939 8.1378 5.59583 8.11131 5.50039 8.11131C5.40496 8.11131 5.3114 8.1378 5.23012 8.18782L3.19813 9.43735L3.752 7.09985C3.77381 7.00794 3.76996 6.91181 3.74086 6.82194C3.71177 6.73207 3.65854 6.65192 3.587 6.59024L1.77071 5.02188L4.15118 4.82981C4.24591 4.8222 4.33669 4.78856 4.4135 4.7326C4.49031 4.67664 4.55017 4.60054 4.58645 4.5127L5.50039 2.29981L6.41434 4.5127C6.45062 4.60054 6.51048 4.67664 6.58729 4.7326C6.6641 4.78856 6.75488 4.8222 6.84961 4.82981L9.23008 5.02188L7.41379 6.58852Z", fill: "currentColor" }));
3
+ export {
4
+ e as default
5
+ };
6
+ //# sourceMappingURL=suggested.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggested.svg.js","sources":["../../../src/assets/icons/suggested.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgSuggested = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 11, height: 12, viewBox: \"0 0 11 12\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M10.4418 4.62485C10.3885 4.46042 10.2876 4.31548 10.152 4.2084C10.0163 4.10131 9.85185 4.03689 9.67953 4.02329L7.24793 3.82692L6.3095 1.55774C6.24354 1.39737 6.13142 1.26021 5.98736 1.16368C5.8433 1.06716 5.6738 1.01562 5.50039 1.01562C5.32699 1.01562 5.15749 1.06716 5.01343 1.16368C4.86937 1.26021 4.75724 1.39737 4.69129 1.55774L3.75371 3.82735L1.32211 4.02329C1.14947 4.03753 0.984895 4.10247 0.849057 4.20997C0.713218 4.31746 0.612182 4.46271 0.558645 4.62745C0.505108 4.7922 0.501458 4.96909 0.548154 5.1359C0.59485 5.30271 0.689809 5.452 0.821097 5.56501L2.67649 7.16516L2.1093 9.55853C2.06793 9.72727 2.07772 9.9045 2.13741 10.0677C2.19711 10.2308 2.30401 10.3725 2.44451 10.4747C2.585 10.5769 2.75274 10.635 2.92635 10.6416C3.09997 10.6481 3.27161 10.6029 3.41942 10.5116L5.50039 9.23067L7.58137 10.5116C7.72914 10.6023 7.9005 10.6471 8.07375 10.6403C8.247 10.6336 8.41436 10.5756 8.55463 10.4737C8.69491 10.3718 8.8018 10.2306 8.86176 10.0679C8.92172 9.9052 8.93207 9.72838 8.89149 9.55981L8.3243 7.16645L10.1797 5.5663C10.3118 5.45302 10.4072 5.30304 10.4539 5.13542C10.5005 4.9678 10.4963 4.79009 10.4418 4.62485ZM7.41379 6.58852C7.34225 6.6502 7.28902 6.73035 7.25993 6.82022C7.23083 6.91009 7.22698 7.00623 7.24879 7.09813L7.80266 9.43735L5.77067 8.18782C5.68939 8.1378 5.59583 8.11131 5.50039 8.11131C5.40496 8.11131 5.3114 8.1378 5.23012 8.18782L3.19813 9.43735L3.752 7.09985C3.77381 7.00794 3.76996 6.91181 3.74086 6.82194C3.71177 6.73207 3.65854 6.65192 3.587 6.59024L1.77071 5.02188L4.15118 4.82981C4.24591 4.8222 4.33669 4.78856 4.4135 4.7326C4.49031 4.67664 4.55017 4.60054 4.58645 4.5127L5.50039 2.29981L6.41434 4.5127C6.45062 4.60054 6.51048 4.67664 6.58729 4.7326C6.6641 4.78856 6.75488 4.8222 6.84961 4.82981L9.23008 5.02188L7.41379 6.58852Z\", fill: \"currentColor\" }));\nexport default SvgSuggested;\n"],"names":["SvgSuggested","props","React"],"mappings":";AACK,MAACA,IAAe,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,MAAM,QAAQ,OAAO,8BAA8B,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,0uDAA0uD,MAAM,eAAc,CAAE,CAAC;"}
@@ -1,111 +1,139 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { useId as G, useState as v } from "react";
3
- import { DisclosureArrow as p } from "./DisclosureArrow.js";
4
- import { FOCUS_RING as O, FOCUS_RING_INSET as U } from "./focusRing.js";
5
- import { isRenderableNode as g } from "./renderableNode.js";
6
- const T = ({
7
- title: N,
8
- header: k,
9
- className: w,
10
- children: o,
11
- trailing: m,
12
- leading: u,
13
- arrowPosition: n = "start",
14
- highlightExpanded: y = !0,
15
- variant: I = "default",
16
- defaultExpanded: C = !1,
17
- isExpanded: d,
18
- onToggle: l,
19
- disabled: s = !1,
20
- stickyHeader: b = !1,
21
- stickyTopOffset: B = 0,
22
- animate: x = !0
1
+ import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
+ import { useId as W, useState as w } from "react";
3
+ import { DisclosureArrow as f } from "./DisclosureArrow.js";
4
+ import { ARROW_PX as x, toggleGapPx as X, togglePaddingLeftPx as q, bodyInsetPx as J } from "./accordionBodyInset.js";
5
+ import { FOCUS_RING as K, FOCUS_RING_INSET as P } from "./focusRing.js";
6
+ import { isRenderableNode as I } from "./renderableNode.js";
7
+ const re = ({
8
+ title: B,
9
+ header: C,
10
+ className: R,
11
+ children: s,
12
+ trailing: g,
13
+ leading: h,
14
+ arrowPosition: o = "start",
15
+ highlightExpanded: $ = !0,
16
+ bodyIndent: j = "none",
17
+ variant: S = "default",
18
+ defaultExpanded: _ = !1,
19
+ isExpanded: i,
20
+ onToggle: c,
21
+ disabled: d = !1,
22
+ stickyHeader: v = !1,
23
+ stickyTopOffset: L = 0,
24
+ animate: y = !0
23
25
  }) => {
24
- const t = I === "sunken", c = `${G()}-body`, [R, S] = v(C), e = d !== void 0 ? d : R, j = x || e && !!o, [$, D] = v(!1), f = () => {
25
- const a = !e;
26
- d === void 0 && S(a), l == null || l(a);
27
- }, E = [
28
- "flex flex-col w-full text-left",
29
- t ? "rounded-xl bg-[var(--malachite-card-dimmed-background)] p-[4px]" : "",
30
- w
31
- ].filter(Boolean).join(" "), _ = [
26
+ const r = S === "sunken", p = `${W()}-body`, [z, G] = w(_), t = i !== void 0 ? i : z, A = y || t && !!s, [D, E] = w(!1), m = I(h), a = j === "title", l = a ? "grid grid-cols-subgrid col-span-4" : "", N = () => {
27
+ const n = !t;
28
+ i === void 0 && G(n), c == null || c(n);
29
+ }, O = [
30
+ a ? "grid grid-cols-[auto_auto_minmax(0,1fr)_auto]" : "flex flex-col",
31
+ "w-full text-left",
32
+ r ? "rounded-xl bg-[var(--malachite-card-dimmed-background)] p-[4px]" : "",
33
+ R
34
+ ].filter(Boolean).join(" "), F = [
32
35
  // `group` only when enabled, so the arrow doesn't darken on hover while disabled.
33
- s ? "" : "group",
34
- "flex items-center w-full transition-colors",
35
- t ? "" : "border-0 border-b border-solid border-[var(--malachite-card-border)]",
36
- b ? "sticky z-10" : "",
37
- t ? "bg-transparent" : e && y ? "bg-[var(--malachite-buttonlist-hover-background)]" : s ? "bg-transparent" : "bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]"
38
- ].filter(Boolean).join(" "), h = g(u), A = [
36
+ d ? "" : "group",
37
+ a ? l : "flex w-full",
38
+ "items-center transition-colors",
39
+ r ? "" : "border-0 border-b border-solid border-[var(--malachite-card-border)]",
40
+ v ? "sticky z-10" : "",
41
+ r ? "bg-transparent" : t && $ ? "bg-[var(--malachite-buttonlist-hover-background)]" : d ? "bg-transparent" : "bg-transparent hover:bg-[var(--malachite-buttonlist-hover-background)]"
42
+ ].filter(Boolean).join(" "), U = [
39
43
  "flex flex-1 items-center min-w-0 appearance-none border-0 bg-transparent text-left cursor-pointer select-none disabled:cursor-not-allowed",
40
- t ? `gap-[16px] px-[16px] py-[12px] rounded-lg ${O}` : `gap-[12px] p-[16px] ${U}`,
41
- h || n === "gutter" ? "!pl-[12px]" : ""
42
- ].filter(Boolean).join(" "), F = b ? {
43
- top: `${B}px`,
44
- backgroundColor: t ? "var(--malachite-card-dimmed-background)" : "var(--malachite-card-background)"
45
- } : {};
46
- return /* @__PURE__ */ i("div", { className: E, children: [
47
- /* @__PURE__ */ i("div", { className: _, style: F, "data-accordion-header": "", children: [
48
- n === "gutter" && /* @__PURE__ */ r(
44
+ r ? `pr-[16px] py-[12px] rounded-lg ${K}` : `pr-[16px] py-[16px] ${P}`,
45
+ a ? "col-start-3" : ""
46
+ ].filter(Boolean).join(" "), M = v ? {
47
+ top: `${L}px`,
48
+ backgroundColor: r ? "var(--malachite-card-dimmed-background)" : "var(--malachite-card-background)"
49
+ } : {}, u = J({ arrowPosition: o, hasLeading: m, sunken: r }), k = a ? /* @__PURE__ */ e(
50
+ "div",
51
+ {
52
+ className: "col-start-3 col-span-2 min-w-0",
53
+ style: u < 0 ? { marginLeft: u } : { paddingLeft: u },
54
+ children: s
55
+ }
56
+ ) : s;
57
+ return /* @__PURE__ */ b("div", { className: O, children: [
58
+ /* @__PURE__ */ b("div", { className: F, style: M, "data-accordion-header": "", children: [
59
+ o === "gutter" && /* @__PURE__ */ e(
49
60
  "button",
50
61
  {
51
62
  type: "button",
52
63
  tabIndex: -1,
53
64
  "aria-hidden": "true",
54
- className: "shrink-0 self-stretch flex items-center pl-[16px] appearance-none border-0 bg-transparent cursor-pointer disabled:cursor-not-allowed",
55
- onMouseDown: (a) => a.preventDefault(),
56
- onClick: f,
57
- disabled: s,
58
- children: /* @__PURE__ */ r(p, { expanded: e })
65
+ 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`,
66
+ onMouseDown: (n) => n.preventDefault(),
67
+ onClick: N,
68
+ disabled: d,
69
+ children: /* @__PURE__ */ e(f, { expanded: t, size: x })
59
70
  }
60
71
  ),
61
- h && /* @__PURE__ */ r(
72
+ m && /* @__PURE__ */ e(
62
73
  "div",
63
74
  {
64
- className: `shrink-0 flex items-center ${n === "gutter" ? "pl-[12px]" : "pl-[16px]"}`,
65
- children: u
75
+ className: `${a ? "col-start-2" : ""} shrink-0 flex items-center ${o === "gutter" ? "pl-[12px]" : "pl-[16px]"}`,
76
+ children: h
66
77
  }
67
78
  ),
68
- /* @__PURE__ */ i(
79
+ /* @__PURE__ */ b(
69
80
  "button",
70
81
  {
71
82
  type: "button",
72
- className: A,
73
- onClick: f,
74
- "aria-expanded": e,
75
- "aria-controls": j ? c : void 0,
76
- disabled: s,
83
+ className: U,
84
+ style: {
85
+ paddingLeft: q(m || o === "gutter"),
86
+ gap: X(r)
87
+ },
88
+ onClick: N,
89
+ "aria-expanded": t,
90
+ "aria-controls": A ? p : void 0,
91
+ disabled: d,
77
92
  children: [
78
- n === "start" && /* @__PURE__ */ r(p, { expanded: e }),
79
- k ?? /* @__PURE__ */ r("span", { className: "flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]", children: N }),
80
- n === "end" && /* @__PURE__ */ r(p, { expanded: e, className: "ml-auto" })
93
+ o === "start" && /* @__PURE__ */ e(f, { expanded: t, size: x }),
94
+ C ?? /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 truncate font-medium text-[13px] tracking-[0.13px] text-[var(--malachite-text-primary)]", children: B }),
95
+ o === "end" && /* @__PURE__ */ e(f, { expanded: t, size: x, className: "ml-auto" })
81
96
  ]
82
97
  }
83
98
  ),
84
- g(m) && /* @__PURE__ */ r("div", { className: "shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]", children: m })
99
+ I(g) && /* @__PURE__ */ e(
100
+ "div",
101
+ {
102
+ className: `${a ? "col-start-4" : ""} shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]`,
103
+ children: g
104
+ }
105
+ )
85
106
  ] }),
86
- x ? (
107
+ y ? (
87
108
  /* Height animates via grid-template-rows (0fr → 1fr); body clips during.
88
109
  grid-cols-[minmax(0,1fr)] pins the single column to the track width so
89
110
  wide, non-wrapping children (e.g. a table with long cell text) can't grow
90
- the implicit `auto` column to their max-content and overflow the container. */
91
- /* @__PURE__ */ r(
111
+ the implicit `auto` column to their max-content and overflow the container;
112
+ the title grid's body cell uses min-w-0 instead. */
113
+ /* @__PURE__ */ e(
92
114
  "div",
93
115
  {
94
- id: c,
95
- className: "grid grid-cols-[minmax(0,1fr)] w-full transition-[grid-template-rows] duration-200 ease-in-out",
96
- style: { gridTemplateRows: e ? "1fr" : "0fr" },
97
- onTransitionEnd: (a) => {
98
- a.propertyName === "grid-template-rows" && D(e);
116
+ id: p,
117
+ 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`,
118
+ style: { gridTemplateRows: t ? "1fr" : "0fr" },
119
+ onTransitionEnd: (n) => {
120
+ n.propertyName === "grid-template-rows" && E(t);
99
121
  },
100
- children: /* @__PURE__ */ r(
122
+ children: /* @__PURE__ */ e(
101
123
  "div",
102
124
  {
103
- className: $ && e ? "overflow-visible" : "overflow-hidden",
104
- children: o && /* @__PURE__ */ r(
125
+ className: [
126
+ l,
127
+ D && t ? "overflow-visible" : "overflow-hidden"
128
+ ].filter(Boolean).join(" "),
129
+ children: s && /* @__PURE__ */ e(
105
130
  "div",
106
131
  {
107
- className: t ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]",
108
- children: o
132
+ className: [
133
+ l,
134
+ r ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]"
135
+ ].filter(Boolean).join(" "),
136
+ children: k
109
137
  }
110
138
  )
111
139
  }
@@ -114,19 +142,22 @@ const T = ({
114
142
  )
115
143
  ) : (
116
144
  /* Instant open — no clip, so a sticky child inside pins immediately. */
117
- e && o && /* @__PURE__ */ r(
145
+ t && s && /* @__PURE__ */ e(
118
146
  "div",
119
147
  {
120
- id: c,
121
- className: t ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]",
122
- children: o
148
+ id: p,
149
+ className: [
150
+ l,
151
+ r ? "pt-[4px]" : "border-b border-solid border-[var(--malachite-card-border)]"
152
+ ].filter(Boolean).join(" "),
153
+ children: k
123
154
  }
124
155
  )
125
156
  )
126
157
  ] });
127
158
  };
128
159
  export {
129
- T as Accordion,
130
- T as default
160
+ re as Accordion,
161
+ re as default
131
162
  };
132
163
  //# sourceMappingURL=Accordion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.js","sources":["../../src/components/Accordion.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { FOCUS_RING, FOCUS_RING_INSET } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\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 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 * 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 variant = 'default',\n defaultExpanded = false,\n isExpanded,\n onToggle,\n disabled = false,\n stickyHeader = false,\n stickyTopOffset = 0,\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\n const handleToggle = () => {\n const newExpanded = !expanded;\n if (isExpanded === undefined) {\n setInternalExpanded(newExpanded);\n }\n onToggle?.(newExpanded);\n };\n\n const containerClasses = [\n 'flex flex-col 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 const rowBackground = sunken\n ? 'bg-transparent'\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 'flex items-center w-full 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 hasLeading = isRenderableNode(leading);\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 ? `gap-[16px] px-[16px] py-[12px] rounded-lg ${FOCUS_RING}`\n : `gap-[12px] p-[16px] ${FOCUS_RING_INSET}`,\n hasLeading || arrowPosition === 'gutter' ? '!pl-[12px]' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n // A pinned header needs an opaque background so the scrolling body doesn't bleed\n // through. Inline (not a Tailwind arbitrary class) so the offset always applies. It is\n // the variant's own ground, not the card's: a sunken section pinned in card white is a\n // white bar floating over the grey it belongs to.\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 }\n : {};\n\n return (\n <div className={containerClasses}>\n <div className={headerRowClasses} style={headerRowStyle} data-accordion-header=\"\">\n {arrowPosition === 'gutter' && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-hidden=\"true\"\n className=\"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} />\n </button>\n )}\n {hasLeading && (\n <div\n className={`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 onClick={handleToggle}\n aria-expanded={expanded}\n aria-controls={bodyRendered ? bodyId : undefined}\n disabled={disabled}\n >\n {arrowPosition === 'start' && <DisclosureArrow expanded={expanded} />}\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} className=\"ml-auto\" />\n )}\n </button>\n {isRenderableNode(trailing) && (\n <div className=\"shrink-0 flex items-center pr-[16px] text-[var(--malachite-text-secondary)]\">\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 <div\n id={bodyId}\n className=\"grid 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={bodySettled && expanded ? 'overflow-visible' : 'overflow-hidden'}\n >\n {children && (\n <div\n className={\n sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]'\n }\n >\n {children}\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 sunken\n ? 'pt-[4px]'\n : 'border-b border-solid border-[var(--malachite-card-border)]'\n }\n >\n {children}\n </div>\n )\n )}\n </div>\n );\n};\n\nexport default Accordion;\nexport { Accordion };\nexport type { AccordionProps };\n"],"names":["Accordion","title","header","className","children","trailing","leading","arrowPosition","highlightExpanded","variant","defaultExpanded","isExpanded","onToggle","disabled","stickyHeader","stickyTopOffset","animate","sunken","bodyId","useId","internalExpanded","setInternalExpanded","useState","expanded","bodyRendered","bodySettled","setBodySettled","handleToggle","newExpanded","containerClasses","headerRowClasses","hasLeading","isRenderableNode","toggleButtonClasses","FOCUS_RING","FOCUS_RING_INSET","headerRowStyle","jsxs","jsx","event","DisclosureArrow"],"mappings":";;;;;AAwDA,MAAMA,IAAsC,CAAC;AAAA,EACzC,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAA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IAECW;AAAA;AAAA;AAAA;AAAA;AAAA,MAKG,gBAAAsB;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,IAAIpB;AAAA,UACJ,WAAU;AAAA,UACV,OAAO,EAAE,kBAAkBK,IAAW,QAAQ,MAAA;AAAA,UAC9C,iBAAiB,CAACgB,MAAU;AACxB,YAAIA,EAAM,iBAAiB,wBACvBb,EAAeH,CAAQ;AAAA,UAE/B;AAAA,UAEA,UAAA,gBAAAe;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,WAAWb,KAAeF,IAAW,qBAAqB;AAAA,cAEzD,UAAAnB,KACG,gBAAAkC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WACIrB,IACM,aACA;AAAA,kBAGT,UAAAb;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QAER;AAAA,MAAA;AAAA;AAAA;AAAA,MAIJmB,KACAnB,KACI,gBAAAkC;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,IAAIpB;AAAA,UACJ,WACID,IACM,aACA;AAAA,UAGT,UAAAb;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EACL,GAGZ;AAER;"}
1
+ {"version":3,"file":"Accordion.js","sources":["../../src/components/Accordion.tsx"],"sourcesContent":["import React, { useId, useState } from 'react';\nimport DisclosureArrow from './DisclosureArrow';\nimport { ARROW_PX, bodyInsetPx, toggleGapPx, togglePaddingLeftPx } from './accordionBodyInset';\nimport { FOCUS_RING, FOCUS_RING_INSET } from './focusRing';\nimport { isRenderableNode } from './renderableNode';\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 * 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 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 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 const rowBackground = sunken\n ? 'bg-transparent'\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 // A pinned header needs an opaque background so the scrolling body doesn't bleed\n // through. Inline (not a Tailwind arbitrary class) so the offset always applies. It is\n // the variant's own ground, not the card's: a sunken section pinned in card white is a\n // white bar floating over the grey it belongs to.\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 }\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 <div className={headerRowClasses} style={headerRowStyle} data-accordion-header=\"\">\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":["Accordion","title","header","className","children","trailing","leading","arrowPosition","highlightExpanded","bodyIndent","variant","defaultExpanded","isExpanded","onToggle","disabled","stickyHeader","stickyTopOffset","animate","sunken","bodyId","useId","internalExpanded","setInternalExpanded","useState","expanded","bodyRendered","bodySettled","setBodySettled","hasLeading","isRenderableNode","titleGrid","subgrid","handleToggle","newExpanded","containerClasses","headerRowClasses","toggleButtonClasses","FOCUS_RING","FOCUS_RING_INSET","headerRowStyle","titleInset","bodyInsetPx","bodyChildren","jsx","jsxs","event","DisclosureArrow","ARROW_PX","togglePaddingLeftPx","toggleGapPx"],"mappings":";;;;;;AA2DA,MAAMA,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,SAAAC,IAAU;AACd,MAAM;AACF,QAAMC,IAASR,MAAY,UAErBS,IAAS,GADIC,EAAA,CACS,SACtB,CAACC,GAAkBC,CAAmB,IAAIC,EAASZ,CAAe,GAGlEa,IAAWZ,MAAe,SAAYA,IAAaS,GAInDI,IAAeR,KAAYO,KAAY,CAAC,CAACpB,GAQzC,CAACsB,GAAaC,CAAc,IAAIJ,EAAS,EAAK,GAC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AAAA,QAAA;AAAA,UACG,WAAW,GAAGb,IAAY,gBAAgB,EAAE;AAAA,UAE3C,UAAAzB;AAAA,QAAA;AAAA,MAAA;AAAA,IACL,GAER;AAAA,IAECY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMG,gBAAA0B;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,IAAIxB;AAAA,UACJ,WAAW,QAAQW,IAAY,iCAAiC,2BAA2B;AAAA,UAC3F,OAAO,EAAE,kBAAkBN,IAAW,QAAQ,MAAA;AAAA,UAC9C,iBAAiB,CAACqB,MAAU;AACxB,YAAIA,EAAM,iBAAiB,wBACvBlB,EAAeH,CAAQ;AAAA,UAE/B;AAAA,UAEA,UAAA,gBAAAmB;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,WAAW;AAAA,gBACPZ;AAAA,gBACAL,KAAeF,IAAW,qBAAqB;AAAA,cAAA,EAE9C,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,cAEZ,UAAApB,KACG,gBAAAuC;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACG,WAAW;AAAA,oBACPZ;AAAA,oBACAb,IACM,aACA;AAAA,kBAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,kBAEZ,UAAAwB;AAAA,gBAAA;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QAER;AAAA,MAAA;AAAA;AAAA;AAAA,MAIJlB,KACApB,KACI,gBAAAuC;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,IAAIxB;AAAA,UACJ,WAAW;AAAA,YACPY;AAAA,YACAb,IACM,aACA;AAAA,UAAA,EAEL,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,UAEZ,UAAAwB;AAAA,QAAA;AAAA,MAAA;AAAA;AAAA,EACL,GAGZ;AAER;"}
@@ -0,0 +1,16 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import p from "../../assets/icons/chain_link.svg.js";
3
+ const f = ({ size: n = 16, className: o = "", style: t = {}, onClick: r }) => {
4
+ const l = {
5
+ width: typeof n == "number" ? `${n}px` : n,
6
+ height: typeof n == "number" ? `${n}px` : n,
7
+ display: "inline-block",
8
+ fill: "currentColor",
9
+ ...t
10
+ };
11
+ return /* @__PURE__ */ i(p, { className: o, style: l, onClick: r });
12
+ };
13
+ export {
14
+ f as default
15
+ };
16
+ //# sourceMappingURL=ChainLinkIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChainLinkIcon.js","sources":["../../../src/components/CustomIcons/ChainLinkIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport ChainLinkIconSvg from '../../assets/icons/chain_link.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst ChainLinkIcon: React.FC<IconProps> = ({ size = 16, className = '', style = {}, onClick }) => {\n const iconStyle: CSSProperties = {\n width: typeof size === 'number' ? `${size}px` : size,\n height: typeof size === 'number' ? `${size}px` : size,\n display: 'inline-block',\n fill: 'currentColor',\n ...style,\n };\n\n return <ChainLinkIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default ChainLinkIcon;\n"],"names":["ChainLinkIcon","size","className","style","onClick","iconStyle","jsx","ChainLinkIconSvg"],"mappings":";;AAUA,MAAMA,IAAqC,CAAC,EAAE,MAAAC,IAAO,IAAI,WAAAC,IAAY,IAAI,OAAAC,IAAQ,IAAI,SAAAC,QAAc;AAC/F,QAAMC,IAA2B;AAAA,IAC7B,OAAO,OAAOJ,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IAChD,QAAQ,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IACjD,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAGE;AAAA,EAAA;AAGP,SAAO,gBAAAG,EAACC,GAAA,EAAiB,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AACvF;"}
@@ -0,0 +1,16 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import p from "../../assets/icons/suggested.svg.js";
3
+ const f = ({ size: t = 16, className: o = "", style: r = {}, onClick: e }) => {
4
+ const n = {
5
+ width: typeof t == "number" ? `${t}px` : t,
6
+ height: typeof t == "number" ? `${t}px` : t,
7
+ display: "inline-block",
8
+ fill: "currentColor",
9
+ ...r
10
+ };
11
+ return /* @__PURE__ */ l(p, { className: o, style: n, onClick: e });
12
+ };
13
+ export {
14
+ f as default
15
+ };
16
+ //# sourceMappingURL=SuggestedIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuggestedIcon.js","sources":["../../../src/components/CustomIcons/SuggestedIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport SuggestedIconSvg from '../../assets/icons/suggested.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst SuggestedIcon: React.FC<IconProps> = ({ size = 16, className = '', style = {}, onClick }) => {\n const iconStyle: CSSProperties = {\n width: typeof size === 'number' ? `${size}px` : size,\n height: typeof size === 'number' ? `${size}px` : size,\n display: 'inline-block',\n fill: 'currentColor',\n ...style,\n };\n\n return <SuggestedIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default SuggestedIcon;\n"],"names":["SuggestedIcon","size","className","style","onClick","iconStyle","jsx","SuggestedIconSvg"],"mappings":";;AAUA,MAAMA,IAAqC,CAAC,EAAE,MAAAC,IAAO,IAAI,WAAAC,IAAY,IAAI,OAAAC,IAAQ,IAAI,SAAAC,QAAc;AAC/F,QAAMC,IAA2B;AAAA,IAC7B,OAAO,OAAOJ,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IAChD,QAAQ,OAAOA,KAAS,WAAW,GAAGA,CAAI,OAAOA;AAAA,IACjD,SAAS;AAAA,IACT,MAAM;AAAA,IACN,GAAGE;AAAA,EAAA;AAGP,SAAO,gBAAAG,EAACC,GAAA,EAAiB,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AACvF;"}