@stackone/malachite 2.93.1 → 2.94.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
@@ -8,7 +8,7 @@ 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. `Chat.Reasoning` shows what a model reasoned, open while it arrives and shut once it stops, until the reader toggles it. `Chat.ToolCall` mounts its payloads only once opened, since a result can be tens of KB; `blocked` is a call something refused to run, as distinct from `error`. 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` | `blocked`), `callId`, `input` and `output` (an object, or a string shown as it is), `adornment`, `children`, `defaultExpanded`. `Reasoning`: `text`, `streaming`, `title`. `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. An `onClick` row with `trailing` is still clickable across its whole box, padding and the space around the slot included (an `href` row leaves that to its link, so a modified click still opens a new tab), with its focus ring at the row's edge; a click inside the slot (or in a menu it portals out) is the slot's own, and a disabled row drops both the click and the ring. `revealTrailing` shows that control only on hover, keyboard focus or while a menu it opened is open, keeping it in the tab order and always showing it on a touch screen. `tone="muted"` tints a row whose subject is inactive, which `disabled` does not: a muted row stays clickable. `leading` puts the row's own indicator (a presentational `Checkbox`) inside the row button ahead of the children (with `leading` or `dimmed`, pass one child; it fills the row), and `dimmed` fades the children but not `leading` or `trailing`, for a row switched off but still a click from on. _Key props:_ `divider`, `disabled`, `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`.
11
+ - **`SurfaceRow`** — A full-bleed row inside a Surface (used as `Surface.Row`). Owns hover highlight, colour transition and an optional bottom divider. Pass `onClick`/`href` to make the whole row clickable (renders as a real button/anchor, so keyboard nav works). For a selectable row use `role="radio"` + `selected` and put a presentational `<Radio>` inside as the indicator; `selected` then paints the same treatment `Table` gives `selectedRowKey`. Under `role="checkbox"` it only announces — a multi-select row carries its own checkbox, and a highlight marking one of many says nothing when most rows are checked. `selection` overrides that either way (`highlight` / `announce`). `selected="mixed"` marks a partly selected checkbox row (`aria-checked="mixed"`); it never paints or marks a row current, and counts as not selected under any other role. Use `trailing` for a control that must stay interactive — it renders outside the row button, which a nested control could not be. An `onClick` row with `trailing` is still clickable across its whole box, padding and the space around the slot included (an `href` row leaves that to its link, so a modified click still opens a new tab), with its focus ring at the row's edge; a click inside the slot (or in a menu it portals out) is the slot's own, and a disabled row drops both the click and the ring. `revealTrailing` shows that control only on hover, keyboard focus or while a menu it opened is open, keeping it in the tab order and always showing it on a touch screen. `tone="muted"` tints a row whose subject is inactive, which `disabled` does not: a muted row stays clickable. `leading` puts the row's own indicator (a presentational `Checkbox`) inside the row button ahead of the children (with `leading` or `dimmed`, pass one child; it fills the row), and `dimmed` fades the children but not `leading` or `trailing`, for a row switched off but still a click from on. _Key props:_ `divider`, `disabled`, `hover` (default on; `false` leaves the hover to something inside the row), `tone` (`default` | `muted`), `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
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`.
@@ -0,0 +1,6 @@
1
+ import * as e from "react";
2
+ const r = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 256 256", fill: "currentColor", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z", fill: "currentColor" }));
3
+ export {
4
+ r as default
5
+ };
6
+ //# sourceMappingURL=clock.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clock.svg.js","sources":["../../../src/assets/icons/clock.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgClock = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 256 256\", fill: \"currentColor\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z\", fill: \"currentColor\" }));\nexport default SvgClock;\n"],"names":["SvgClock","props","React"],"mappings":";AACK,MAACA,IAAW,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,eAAe,MAAM,gBAAgB,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,+LAA+L,MAAM,gBAAgB,CAAC;"}
@@ -0,0 +1,6 @@
1
+ import * as C from "react";
2
+ const l = (e) => /* @__PURE__ */ C.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 12", fill: "currentColor", ...e }, /* @__PURE__ */ C.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.84411 1.17173C7.60252 0.936615 7.27872 0.805058 6.94161 0.805058C6.6045 0.805058 6.28069 0.936615 6.03911 1.17173L1.22611 5.89173C1.14557 5.97002 1.03768 6.01381 0.925358 6.01381C0.81304 6.01381 0.705149 5.97002 0.624608 5.89173C0.585176 5.85339 0.553832 5.80752 0.53243 5.75685C0.511027 5.70618 0.5 5.65174 0.5 5.59673C0.5 5.54173 0.511027 5.48728 0.53243 5.43661C0.553832 5.38595 0.585176 5.34008 0.624608 5.30173L5.43761 0.581734C5.84022 0.18993 6.37982 -0.0292969 6.94161 -0.0292969C7.50339 -0.0292969 8.043 0.18993 8.44561 0.581734C8.67857 0.808285 8.85457 1.08678 8.9592 1.39443C9.06383 1.70208 9.09413 2.03013 9.04761 2.35173C9.37348 2.30539 9.70565 2.33448 10.0185 2.43677C10.3314 2.53906 10.6166 2.71182 10.8521 2.94173L10.8771 2.96673C11.0743 3.15847 11.231 3.38779 11.338 3.64114C11.445 3.89449 11.5001 4.16671 11.5001 4.44173C11.5001 4.71675 11.445 4.98898 11.338 5.24233C11.231 5.49567 11.0743 5.72499 10.8771 5.91673L6.52411 10.1852C6.51097 10.198 6.50052 10.2133 6.49339 10.2302C6.48626 10.247 6.48259 10.2652 6.48259 10.2835C6.48259 10.3018 6.48626 10.3199 6.49339 10.3368C6.50052 10.3537 6.51097 10.369 6.52411 10.3817L7.41811 11.2587C7.45754 11.2971 7.48888 11.3429 7.51029 11.3936C7.53169 11.4443 7.54272 11.4987 7.54272 11.5537C7.54272 11.6087 7.53169 11.6632 7.51029 11.7139C7.48888 11.7645 7.45754 11.8104 7.41811 11.8487C7.33757 11.927 7.22968 11.9708 7.11736 11.9708C7.00504 11.9708 6.89715 11.927 6.81661 11.8487L5.92261 10.9722C5.83053 10.8828 5.75733 10.7757 5.70735 10.6575C5.65737 10.5392 5.63161 10.4121 5.63161 10.2837C5.63161 10.1553 5.65737 10.0283 5.70735 9.91C5.75733 9.79174 5.83053 9.68471 5.92261 9.59523L10.2756 5.32623C10.3938 5.21115 10.4878 5.07355 10.552 4.92155C10.6162 4.76955 10.6492 4.60623 10.6492 4.44123C10.6492 4.27624 10.6162 4.11292 10.552 3.96092C10.4878 3.80892 10.3938 3.67131 10.2756 3.55623L10.2506 3.53173C10.0093 3.29686 9.68591 3.16532 9.34916 3.16504C9.01241 3.16476 8.68882 3.29576 8.44711 3.53023L4.86111 7.04723L4.86011 7.04823L4.81111 7.09673C4.73054 7.17517 4.62255 7.21906 4.51011 7.21906C4.39767 7.21906 4.28967 7.17517 4.20911 7.09673C4.16968 7.05839 4.13833 7.01252 4.11693 6.96185C4.09553 6.91118 4.0845 6.85674 4.0845 6.80173C4.0845 6.74673 4.09553 6.69228 4.11693 6.64161C4.13833 6.59095 4.16968 6.54508 4.20911 6.50673L7.84561 2.94023C7.96351 2.82508 8.05718 2.68749 8.12108 2.53557C8.18499 2.38365 8.21783 2.22048 8.2177 2.05567C8.21756 1.89086 8.18443 1.72774 8.12027 1.57593C8.05611 1.42412 7.96221 1.28669 7.84411 1.17173Z", fill: "currentColor" }), /* @__PURE__ */ C.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.24255 2.35099C7.28198 2.31265 7.31332 2.26678 7.33472 2.21611C7.35613 2.16544 7.36715 2.111 7.36715 2.05599C7.36715 2.00099 7.35613 1.94654 7.33472 1.89587C7.31332 1.84521 7.28198 1.79934 7.24255 1.76099C7.16198 1.68256 7.05398 1.63867 6.94155 1.63867C6.82911 1.63867 6.72111 1.68256 6.64055 1.76099L3.08105 5.25199C2.88389 5.44373 2.72717 5.67305 2.62016 5.9264C2.51314 6.17975 2.45801 6.45197 2.45801 6.72699C2.45801 7.00201 2.51314 7.27424 2.62016 7.52759C2.72717 7.78093 2.88389 8.01025 3.08105 8.20199C3.48371 8.59368 4.0233 8.81283 4.58505 8.81283C5.14679 8.81283 5.68638 8.59368 6.08905 8.20199L9.64905 4.71099C9.68848 4.67265 9.71982 4.62678 9.74122 4.57611C9.76263 4.52544 9.77365 4.471 9.77365 4.41599C9.77365 4.36099 9.76263 4.30654 9.74122 4.25587C9.71982 4.20521 9.68848 4.15934 9.64905 4.12099C9.56848 4.04256 9.46048 3.99867 9.34805 3.99867C9.23561 3.99867 9.12761 4.04256 9.04705 4.12099L5.48755 7.61199C5.24596 7.84711 4.92216 7.97867 4.58505 7.97867C4.24793 7.97867 3.92413 7.84711 3.68255 7.61199C3.56431 7.49691 3.47034 7.35931 3.40617 7.20731C3.342 7.05531 3.30894 6.89199 3.30894 6.72699C3.30894 6.562 3.342 6.39868 3.40617 6.24668C3.47034 6.09468 3.56431 5.95707 3.68255 5.84199L7.24255 2.35099Z", fill: "currentColor" }));
3
+ export {
4
+ l as default
5
+ };
6
+ //# sourceMappingURL=mcp.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.svg.js","sources":["../../../src/assets/icons/mcp.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgMcp = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 12 12\", fill: \"currentColor\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M7.84411 1.17173C7.60252 0.936615 7.27872 0.805058 6.94161 0.805058C6.6045 0.805058 6.28069 0.936615 6.03911 1.17173L1.22611 5.89173C1.14557 5.97002 1.03768 6.01381 0.925358 6.01381C0.81304 6.01381 0.705149 5.97002 0.624608 5.89173C0.585176 5.85339 0.553832 5.80752 0.53243 5.75685C0.511027 5.70618 0.5 5.65174 0.5 5.59673C0.5 5.54173 0.511027 5.48728 0.53243 5.43661C0.553832 5.38595 0.585176 5.34008 0.624608 5.30173L5.43761 0.581734C5.84022 0.18993 6.37982 -0.0292969 6.94161 -0.0292969C7.50339 -0.0292969 8.043 0.18993 8.44561 0.581734C8.67857 0.808285 8.85457 1.08678 8.9592 1.39443C9.06383 1.70208 9.09413 2.03013 9.04761 2.35173C9.37348 2.30539 9.70565 2.33448 10.0185 2.43677C10.3314 2.53906 10.6166 2.71182 10.8521 2.94173L10.8771 2.96673C11.0743 3.15847 11.231 3.38779 11.338 3.64114C11.445 3.89449 11.5001 4.16671 11.5001 4.44173C11.5001 4.71675 11.445 4.98898 11.338 5.24233C11.231 5.49567 11.0743 5.72499 10.8771 5.91673L6.52411 10.1852C6.51097 10.198 6.50052 10.2133 6.49339 10.2302C6.48626 10.247 6.48259 10.2652 6.48259 10.2835C6.48259 10.3018 6.48626 10.3199 6.49339 10.3368C6.50052 10.3537 6.51097 10.369 6.52411 10.3817L7.41811 11.2587C7.45754 11.2971 7.48888 11.3429 7.51029 11.3936C7.53169 11.4443 7.54272 11.4987 7.54272 11.5537C7.54272 11.6087 7.53169 11.6632 7.51029 11.7139C7.48888 11.7645 7.45754 11.8104 7.41811 11.8487C7.33757 11.927 7.22968 11.9708 7.11736 11.9708C7.00504 11.9708 6.89715 11.927 6.81661 11.8487L5.92261 10.9722C5.83053 10.8828 5.75733 10.7757 5.70735 10.6575C5.65737 10.5392 5.63161 10.4121 5.63161 10.2837C5.63161 10.1553 5.65737 10.0283 5.70735 9.91C5.75733 9.79174 5.83053 9.68471 5.92261 9.59523L10.2756 5.32623C10.3938 5.21115 10.4878 5.07355 10.552 4.92155C10.6162 4.76955 10.6492 4.60623 10.6492 4.44123C10.6492 4.27624 10.6162 4.11292 10.552 3.96092C10.4878 3.80892 10.3938 3.67131 10.2756 3.55623L10.2506 3.53173C10.0093 3.29686 9.68591 3.16532 9.34916 3.16504C9.01241 3.16476 8.68882 3.29576 8.44711 3.53023L4.86111 7.04723L4.86011 7.04823L4.81111 7.09673C4.73054 7.17517 4.62255 7.21906 4.51011 7.21906C4.39767 7.21906 4.28967 7.17517 4.20911 7.09673C4.16968 7.05839 4.13833 7.01252 4.11693 6.96185C4.09553 6.91118 4.0845 6.85674 4.0845 6.80173C4.0845 6.74673 4.09553 6.69228 4.11693 6.64161C4.13833 6.59095 4.16968 6.54508 4.20911 6.50673L7.84561 2.94023C7.96351 2.82508 8.05718 2.68749 8.12108 2.53557C8.18499 2.38365 8.21783 2.22048 8.2177 2.05567C8.21756 1.89086 8.18443 1.72774 8.12027 1.57593C8.05611 1.42412 7.96221 1.28669 7.84411 1.17173Z\", fill: \"currentColor\" }), /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M7.24255 2.35099C7.28198 2.31265 7.31332 2.26678 7.33472 2.21611C7.35613 2.16544 7.36715 2.111 7.36715 2.05599C7.36715 2.00099 7.35613 1.94654 7.33472 1.89587C7.31332 1.84521 7.28198 1.79934 7.24255 1.76099C7.16198 1.68256 7.05398 1.63867 6.94155 1.63867C6.82911 1.63867 6.72111 1.68256 6.64055 1.76099L3.08105 5.25199C2.88389 5.44373 2.72717 5.67305 2.62016 5.9264C2.51314 6.17975 2.45801 6.45197 2.45801 6.72699C2.45801 7.00201 2.51314 7.27424 2.62016 7.52759C2.72717 7.78093 2.88389 8.01025 3.08105 8.20199C3.48371 8.59368 4.0233 8.81283 4.58505 8.81283C5.14679 8.81283 5.68638 8.59368 6.08905 8.20199L9.64905 4.71099C9.68848 4.67265 9.71982 4.62678 9.74122 4.57611C9.76263 4.52544 9.77365 4.471 9.77365 4.41599C9.77365 4.36099 9.76263 4.30654 9.74122 4.25587C9.71982 4.20521 9.68848 4.15934 9.64905 4.12099C9.56848 4.04256 9.46048 3.99867 9.34805 3.99867C9.23561 3.99867 9.12761 4.04256 9.04705 4.12099L5.48755 7.61199C5.24596 7.84711 4.92216 7.97867 4.58505 7.97867C4.24793 7.97867 3.92413 7.84711 3.68255 7.61199C3.56431 7.49691 3.47034 7.35931 3.40617 7.20731C3.342 7.05531 3.30894 6.89199 3.30894 6.72699C3.30894 6.562 3.342 6.39868 3.40617 6.24668C3.47034 6.09468 3.56431 5.95707 3.68255 5.84199L7.24255 2.35099Z\", fill: \"currentColor\" }));\nexport default SvgMcp;\n"],"names":["SvgMcp","props","React"],"mappings":";AACK,MAACA,IAAS,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,aAAa,MAAM,gBAAgB,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,UAAU,WAAW,UAAU,WAAW,GAAG,48EAA48E,MAAM,gBAAgB,GAAmB,gBAAAA,EAAM,cAAc,QAAQ,EAAE,UAAU,WAAW,UAAU,WAAW,GAAG,ysCAAysC,MAAM,gBAAgB,CAAC;"}
@@ -0,0 +1,6 @@
1
+ import * as e from "react";
2
+ const a = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 256 256", fill: "currentColor", ...t }, /* @__PURE__ */ e.createElement("path", { d: "M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z", fill: "currentColor" }));
3
+ export {
4
+ a as default
5
+ };
6
+ //# sourceMappingURL=question.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question.svg.js","sources":["../../../src/assets/icons/question.svg?react"],"sourcesContent":["import * as React from \"react\";\nconst SvgQuestion = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 256 256\", fill: \"currentColor\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z\", fill: \"currentColor\" }));\nexport default SvgQuestion;\n"],"names":["SvgQuestion","props","React"],"mappings":";AACK,MAACA,IAAc,CAACC,MAA0B,gBAAAC,EAAM,cAAc,OAAO,EAAE,OAAO,8BAA8B,SAAS,eAAe,MAAM,gBAAgB,GAAGD,EAAK,GAAoB,gBAAAC,EAAM,cAAc,QAAQ,EAAE,GAAG,0VAA0V,MAAM,gBAAgB,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatModelPicker.js","sources":["../../../src/components/Chat/ChatModelPicker.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useInsertionEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport Avatar from '../Avatar';\nimport CaretDownIcon from '../CustomIcons/CaretDownIcon';\nimport CaretRightIcon from '../CustomIcons/CaretRightIcon';\nimport CaretUpIcon from '../CustomIcons/CaretUpIcon';\nimport CheckIcon from '../CustomIcons/CheckIcon';\nimport PillButton from '../PillButton';\nimport { pushEscapeLayer } from '../escapeLayers';\nimport { usePopupLayer } from '../overlayLayers';\nimport { useOwnedByPopover } from '../popoverTree';\nimport { ensureOverlayStyles } from '../portalOverlay';\nimport { useTopLayer } from '../topLayer';\nimport { useFollowTrigger } from '../useFollowTrigger';\n\nexport interface ChatModelSubOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface ChatModelOption {\n value: string;\n label: string;\n /** The provider's mark. A URL, since providers ship logos rather than icon fonts. */\n iconSrc?: string;\n /** A second choice the model offers, e.g. how long it may think. */\n options?: ChatModelSubOption[];\n}\n\nexport interface ChatModelPickerProps {\n models: ChatModelOption[];\n value: string;\n /** The chosen sub-option, when the current model offers them. */\n optionValue?: string;\n /** Called with the model, and its sub-option when it has them. */\n onChange: (model: string, option?: string) => void;\n disabled?: boolean;\n /**\n * Opens upward. On by default: this sits under a composer at the bottom of a column, so\n * downward is almost always off-screen.\n */\n openUp?: boolean;\n 'aria-label'?: string;\n}\n\nconst VIEWPORT_PADDING = 8;\nconst PANEL_MIN_WIDTH = 220;\nconst SUBMENU_MIN_WIDTH = 240;\n\n/**\n * Inline rather than Tailwind: the panel is portalled to `document.body`, which the scoped\n * shadow stylesheet does not reach. Same reason `ActionMenu` styles its popover inline.\n */\nconst panelStyle = (\n position: { top: number; left: number; maxHeight?: number } | null,\n minWidth: number,\n): React.CSSProperties => ({\n position: 'fixed',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n maxHeight: position?.maxHeight,\n overflowY: position?.maxHeight === undefined ? undefined : 'auto',\n minWidth,\n background: 'var(--malachite-card-background, rgb(255, 255, 255))',\n border: '1px solid var(--malachite-card-border, rgb(232, 232, 232))',\n borderRadius: 12,\n boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.08)',\n padding: 4,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n visibility: position ? 'visible' : 'hidden',\n opacity: position ? 1 : 0,\n});\n\nconst ROW_STYLE: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '6px 10px',\n borderRadius: 8,\n border: 'none',\n background: 'transparent',\n textAlign: 'left',\n width: '100%',\n cursor: 'pointer',\n fontSize: 'var(--malachite-font-size-small, 13px)',\n color: 'var(--malachite-text-primary, rgb(10, 10, 10))',\n};\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n fontSize: 'var(--malachite-font-size-xsmall, 11px)',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n};\n\nconst CHECK_STYLE: React.CSSProperties = {\n marginLeft: 'auto',\n display: 'inline-flex',\n color: 'var(--malachite-text-success, rgb(2, 122, 66))',\n};\n\n/**\n * Which model answers, and how hard it may think.\n *\n * Its own component rather than a `Dropdown`: that one is a form select bound to\n * react-hook-form, and this is a menu whose rows open a second menu. Portalled for the same\n * reason `ActionMenu` is — a panel inside the composer would be clipped by it.\n */\nconst ChatModelPicker: React.FC<ChatModelPickerProps> = ({\n models,\n value,\n optionValue,\n onChange,\n disabled = false,\n openUp = true,\n 'aria-label': ariaLabel = 'Model',\n}) => {\n const [open, setOpen] = useState(false);\n const [position, setPosition] = useState<{\n top: number;\n left: number;\n maxHeight: number;\n } | null>(null);\n const [submenuFor, setSubmenuFor] = useState<string | null>(null);\n const [submenuPosition, setSubmenuPosition] = useState<{ top: number; left: number } | null>(\n null,\n );\n const triggerRef = useRef<HTMLDivElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const submenuRef = useRef<HTMLDivElement>(null);\n const submenuRowRef = useRef<HTMLElement | null>(null);\n const panelIdentity = usePopupLayer('actionmenu', open, panelRef);\n const submenuIdentity = usePopupLayer('actionmenu', open, submenuRef);\n\n useTopLayer(panelRef, open);\n useOwnedByPopover(\n useCallback(() => submenuRef.current, []),\n open,\n );\n\n const selected = models.find((model) => model.value === value);\n\n const place = useCallback(() => {\n const trigger = triggerRef.current;\n const panel = panelRef.current;\n\n if (!trigger) {\n return;\n }\n\n const rect = trigger.getBoundingClientRect();\n const width = panel?.offsetWidth || PANEL_MIN_WIDTH;\n // `scrollHeight`, not `offsetHeight`: once capped, the panel's own height says nothing\n // about whether the whole list would now fit. The difference is its border.\n const height = panel ? panel.scrollHeight + panel.offsetHeight - panel.clientHeight : 0;\n const maxLeft = window.innerWidth - width - VIEWPORT_PADDING;\n const left = Math.max(VIEWPORT_PADDING, Math.min(rect.right - width, maxLeft));\n const roomAbove = rect.top - 4 - VIEWPORT_PADDING;\n const roomBelow = window.innerHeight - rect.bottom - 4 - VIEWPORT_PADDING;\n const preferred = openUp ? roomAbove : roomBelow;\n const other = openUp ? roomBelow : roomAbove;\n // Flips when the chosen side has no room. With no room on either, it takes the side with\n // more and scrolls, so the panel is never off-screen however long the list.\n const flips = height > preferred && other > preferred;\n const goesUp = openUp !== flips;\n const room = goesUp ? roomAbove : roomBelow;\n const top = goesUp ? rect.top - 4 - Math.min(height, room) : rect.bottom + 4;\n\n setPosition({ top, left, maxHeight: room });\n }, [openUp]);\n\n // The submenu is placed from its row once; rather than leave it behind as the panel\n // follows the trigger, it closes, and hovering the row opens it again in place.\n const follow = useCallback(() => {\n setSubmenuFor(null);\n setSubmenuPosition(null);\n place();\n }, [place]);\n const close = useCallback(() => setOpen(false), []);\n\n useFollowTrigger(open, triggerRef, follow, close);\n\n useEffect(() => {\n if (!open) {\n setSubmenuFor(null);\n setSubmenuPosition(null);\n return;\n }\n\n place();\n\n const reposition = () => place();\n const closeOnOutside = (event: MouseEvent) => {\n // `composedPath`, not `event.target`: this listener is on `document`, and the\n // trigger lives in a shadow root, so the target is retargeted to the shadow HOST.\n // `contains` then says the trigger was not clicked, the menu closes on mousedown,\n // and the click that follows toggles it straight back open.\n const path = event.composedPath();\n const insideOwnUi = [triggerRef.current, panelRef.current, submenuRef.current].some(\n (node) => node !== null && path.includes(node),\n );\n\n if (!insideOwnUi) {\n setOpen(false);\n }\n };\n const popEscapeLayer = pushEscapeLayer(() => setOpen(false));\n\n window.addEventListener('resize', reposition);\n document.addEventListener('mousedown', closeOnOutside, true);\n\n return () => {\n window.removeEventListener('resize', reposition);\n document.removeEventListener('mousedown', closeOnOutside, true);\n popEscapeLayer();\n };\n }, [open, place]);\n\n useInsertionEffect(() => {\n if (open) {\n ensureOverlayStyles();\n }\n }, [open]);\n\n const openSubmenu = (model: ChatModelOption, row: HTMLElement) => {\n if (!model.options?.length) {\n setSubmenuFor(null);\n return;\n }\n\n const rect = row.getBoundingClientRect();\n const panelLeft = panelRef.current?.getBoundingClientRect().left ?? rect.left;\n // To the left of the parent panel by default, flipping right when that would clip.\n const toLeft = panelLeft - SUBMENU_MIN_WIDTH - 4;\n const left =\n toLeft >= VIEWPORT_PADDING\n ? toLeft\n : Math.min(\n (panelRef.current?.getBoundingClientRect().right ?? rect.right) + 4,\n window.innerWidth - SUBMENU_MIN_WIDTH - VIEWPORT_PADDING,\n );\n\n submenuRowRef.current = row;\n setSubmenuFor(model.value);\n setSubmenuPosition({ top: rect.top, left });\n };\n\n // The submenu goes with its row, and closes once the row has left the panel. Not closed\n // outright: tabbing to a row out of view opens its submenu and then scrolls it in, and closing\n // on that scroll would leave the row's efforts out of reach of the keyboard.\n const followRowOnScroll = () => {\n const row = submenuRowRef.current?.getBoundingClientRect();\n const panel = panelRef.current?.getBoundingClientRect();\n\n if (!row || !panel || row.top < panel.top || row.bottom > panel.bottom) {\n setSubmenuFor(null);\n setSubmenuPosition(null);\n return;\n }\n\n setSubmenuPosition((current) => current && { ...current, top: row.top });\n };\n\n const choose = (model: ChatModelOption, option?: ChatModelSubOption) => {\n onChange(model.value, option?.value);\n setOpen(false);\n };\n\n const submenuModel = models.find((model) => model.value === submenuFor);\n\n return (\n <>\n <div ref={triggerRef} className=\"inline-flex\">\n <PillButton\n label={selected?.label ?? value}\n icon={\n selected?.iconSrc ? (\n <Avatar src={selected.iconSrc} name={selected.label} size={14} />\n ) : undefined\n }\n trailingIcon={openUp ? <CaretUpIcon size={10} /> : <CaretDownIcon size={10} />}\n shape=\"tab\"\n size=\"small\"\n disabled={disabled}\n onClick={() => setOpen((wasOpen) => !wasOpen)}\n />\n </div>\n {open &&\n createPortal(\n <>\n <div\n ref={panelRef}\n role=\"menu\"\n aria-label={ariaLabel}\n // `actionmenu` rather than a new kind: the identity is a\n // host-facing allow-list, so a new class would need every host to\n // update its CSS, and this panel is an action menu in shape.\n {...panelIdentity}\n style={panelStyle(position, PANEL_MIN_WIDTH)}\n onScroll={followRowOnScroll}\n >\n {models.map((model) => (\n <button\n key={model.value}\n type=\"button\"\n role=\"menuitem\"\n aria-haspopup={model.options?.length ? 'menu' : undefined}\n style={ROW_STYLE}\n onMouseEnter={(event) =>\n openSubmenu(model, event.currentTarget)\n }\n onFocus={(event) => openSubmenu(model, event.currentTarget)}\n onClick={() =>\n model.options?.length\n ? choose(model, model.options[0])\n : choose(model)\n }\n >\n {model.iconSrc ? (\n <Avatar src={model.iconSrc} name={model.label} size={14} />\n ) : null}\n {model.label}\n {model.value === value ? (\n <span style={CHECK_STYLE}>\n <CheckIcon size={11} />\n </span>\n ) : null}\n {model.options?.length ? (\n <span\n style={{\n marginLeft: model.value === value ? 4 : 'auto',\n display: 'inline-flex',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n }}\n >\n <CaretRightIcon size={10} />\n </span>\n ) : null}\n </button>\n ))}\n </div>\n {submenuModel?.options?.length ? (\n <div\n ref={submenuRef}\n role=\"menu\"\n aria-label={`${submenuModel.label} options`}\n {...submenuIdentity}\n style={panelStyle(submenuPosition, SUBMENU_MIN_WIDTH)}\n >\n {submenuModel.options.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n role=\"menuitem\"\n style={{ ...ROW_STYLE, alignItems: 'flex-start' }}\n onClick={() => choose(submenuModel, option)}\n >\n <span\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n }}\n >\n {option.label}\n {option.description ? (\n <span style={DESCRIPTION_STYLE}>\n {option.description}\n </span>\n ) : null}\n </span>\n {submenuModel.value === value &&\n option.value === optionValue ? (\n <span style={CHECK_STYLE}>\n <CheckIcon size={11} />\n </span>\n ) : null}\n </button>\n ))}\n </div>\n ) : null}\n </>,\n document.body,\n )}\n </>\n );\n};\n\nexport default ChatModelPicker;\nexport { ChatModelPicker };\n"],"names":["VIEWPORT_PADDING","PANEL_MIN_WIDTH","SUBMENU_MIN_WIDTH","panelStyle","position","minWidth","ROW_STYLE","DESCRIPTION_STYLE","CHECK_STYLE","ChatModelPicker","models","value","optionValue","onChange","disabled","openUp","ariaLabel","open","setOpen","useState","setPosition","submenuFor","setSubmenuFor","submenuPosition","setSubmenuPosition","triggerRef","useRef","panelRef","submenuRef","submenuRowRef","panelIdentity","usePopupLayer","submenuIdentity","useTopLayer","useOwnedByPopover","useCallback","selected","model","place","trigger","panel","rect","width","height","maxLeft","left","roomAbove","roomBelow","preferred","other","flips","goesUp","room","top","follow","close","useFollowTrigger","useEffect","reposition","closeOnOutside","event","path","node","popEscapeLayer","pushEscapeLayer","useInsertionEffect","ensureOverlayStyles","openSubmenu","row","_a","toLeft","_b","_c","followRowOnScroll","current","choose","option","submenuModel","jsxs","Fragment","jsx","PillButton","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AAC,QAAA,EAAK,OAAOzE,IACR,UAAAqE,EAAO,aACZ,IACA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAEPC,EAAa,UAAUlE,KACxBiE,EAAO,UAAUhE,IACb,gBAAAoE,EAAC,QAAA,EAAK,OAAOxE,GACT,UAAA,gBAAAwE,EAACO,GAAA,EAAU,MAAM,GAAA,CAAI,GACzB,IACA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAzBCX,EAAO;AAAA,YAAA,CA2BnB;AAAA,UAAA;AAAA,QAAA,IAEL;AAAA,MAAA,GACR;AAAA,MACA,SAAS;AAAA,IAAA;AAAA,EACb,GACR;AAER;"}
1
+ {"version":3,"file":"ChatModelPicker.js","sources":["../../../src/components/Chat/ChatModelPicker.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useInsertionEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport Avatar from '../Avatar';\nimport CaretDownIcon from '../CustomIcons/CaretDownIcon';\nimport CaretRightIcon from '../CustomIcons/CaretRightIcon';\nimport CaretUpIcon from '../CustomIcons/CaretUpIcon';\nimport CheckIcon from '../CustomIcons/CheckIcon';\nimport PillButton from '../PillButton';\nimport { pushEscapeLayer } from '../escapeLayers';\nimport { usePopupLayer } from '../overlayLayers';\nimport { useOwnedByPopover } from '../popoverTree';\nimport { ensureOverlayStyles } from '../portalOverlay';\nimport { useTopLayer } from '../topLayer';\nimport { useFollowTrigger } from '../useFollowTrigger';\n\nexport interface ChatModelSubOption {\n value: string;\n label: string;\n description?: string;\n}\n\nexport interface ChatModelOption {\n value: string;\n label: string;\n /** The provider's mark. A URL, since providers ship logos rather than icon fonts. */\n iconSrc?: string;\n /** A second choice the model offers, e.g. how long it may think. */\n options?: ChatModelSubOption[];\n}\n\nexport interface ChatModelPickerProps {\n models: ChatModelOption[];\n value: string;\n /** The chosen sub-option, when the current model offers them. */\n optionValue?: string;\n /** Called with the model, and its sub-option when it has them. */\n onChange: (model: string, option?: string) => void;\n disabled?: boolean;\n /**\n * Opens upward. On by default: this sits under a composer at the bottom of a column, so\n * downward is almost always off-screen.\n */\n openUp?: boolean;\n 'aria-label'?: string;\n}\n\nconst VIEWPORT_PADDING = 8;\nconst PANEL_MIN_WIDTH = 220;\nconst SUBMENU_MIN_WIDTH = 240;\n\n/**\n * Inline rather than Tailwind: the panel is portalled to `document.body`, which the scoped\n * shadow stylesheet does not reach. Same reason `ActionMenu` styles its popover inline.\n */\nconst panelStyle = (\n position: { top: number; left: number; maxHeight?: number } | null,\n minWidth: number,\n): React.CSSProperties => ({\n position: 'fixed',\n top: position?.top ?? 0,\n left: position?.left ?? 0,\n maxHeight: position?.maxHeight,\n overflowY: position?.maxHeight === undefined ? undefined : 'auto',\n minWidth,\n background: 'var(--malachite-card-background, rgb(255, 255, 255))',\n border: '1px solid var(--malachite-card-border, rgb(232, 232, 232))',\n borderRadius: 12,\n boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.08)',\n padding: 4,\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n visibility: position ? 'visible' : 'hidden',\n opacity: position ? 1 : 0,\n});\n\nconst ROW_STYLE: React.CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n padding: '6px 10px',\n borderRadius: 8,\n border: 'none',\n background: 'transparent',\n textAlign: 'left',\n width: '100%',\n cursor: 'pointer',\n fontSize: 'var(--malachite-font-size-small, 13px)',\n color: 'var(--malachite-text-primary, rgb(10, 10, 10))',\n};\n\nconst DESCRIPTION_STYLE: React.CSSProperties = {\n fontSize: 'var(--malachite-font-size-xsmall, 11px)',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n};\n\nconst CHECK_STYLE: React.CSSProperties = {\n marginLeft: 'auto',\n display: 'inline-flex',\n color: 'var(--malachite-text-success, rgb(2, 122, 66))',\n};\n\n/**\n * Which model answers, and how hard it may think.\n *\n * Its own component rather than a `Dropdown`: that one is a form select bound to\n * react-hook-form, and this is a menu whose rows open a second menu. Portalled for the same\n * reason `ActionMenu` is — a panel inside the composer would be clipped by it.\n */\nconst ChatModelPicker: React.FC<ChatModelPickerProps> = ({\n models,\n value,\n optionValue,\n onChange,\n disabled = false,\n openUp = true,\n 'aria-label': ariaLabel = 'Model',\n}) => {\n const [open, setOpen] = useState(false);\n const [position, setPosition] = useState<{\n top: number;\n left: number;\n maxHeight: number;\n } | null>(null);\n const [submenuFor, setSubmenuFor] = useState<string | null>(null);\n const [submenuPosition, setSubmenuPosition] = useState<{ top: number; left: number } | null>(\n null,\n );\n const triggerRef = useRef<HTMLDivElement>(null);\n const panelRef = useRef<HTMLDivElement>(null);\n const submenuRef = useRef<HTMLDivElement>(null);\n const submenuRowRef = useRef<HTMLElement | null>(null);\n const panelIdentity = usePopupLayer('actionmenu', open, panelRef);\n const submenuIdentity = usePopupLayer('actionmenu', open, submenuRef);\n\n useTopLayer(panelRef, open);\n useOwnedByPopover(\n useCallback(() => submenuRef.current, []),\n open,\n );\n\n const selected = models.find((model) => model.value === value);\n\n const place = useCallback(() => {\n const trigger = triggerRef.current;\n const panel = panelRef.current;\n\n if (!trigger) {\n return;\n }\n\n const rect = trigger.getBoundingClientRect();\n const width = panel?.offsetWidth || PANEL_MIN_WIDTH;\n // `scrollHeight`, not `offsetHeight`: once capped, the panel's own height says nothing\n // about whether the whole list would now fit. The difference is its border.\n const height = panel ? panel.scrollHeight + panel.offsetHeight - panel.clientHeight : 0;\n const maxLeft = window.innerWidth - width - VIEWPORT_PADDING;\n const left = Math.max(VIEWPORT_PADDING, Math.min(rect.right - width, maxLeft));\n const roomAbove = rect.top - 4 - VIEWPORT_PADDING;\n const roomBelow = window.innerHeight - rect.bottom - 4 - VIEWPORT_PADDING;\n const preferred = openUp ? roomAbove : roomBelow;\n const other = openUp ? roomBelow : roomAbove;\n // Flips when the chosen side has no room. With no room on either, it takes the side with\n // more and scrolls, so the panel is never off-screen however long the list.\n const flips = height > preferred && other > preferred;\n const goesUp = openUp !== flips;\n const room = goesUp ? roomAbove : roomBelow;\n const top = goesUp ? rect.top - 4 - Math.min(height, room) : rect.bottom + 4;\n\n setPosition({ top, left, maxHeight: room });\n }, [openUp]);\n\n // Rather than leave the submenu behind as the panel follows the trigger, it closes, and\n // hovering the row opens it again in place. Scrolling inside the panel is `followRowOnScroll`.\n const follow = useCallback(() => {\n setSubmenuFor(null);\n setSubmenuPosition(null);\n place();\n }, [place]);\n const close = useCallback(() => setOpen(false), []);\n\n useFollowTrigger(open, triggerRef, follow, close);\n\n useEffect(() => {\n if (!open) {\n setSubmenuFor(null);\n setSubmenuPosition(null);\n return;\n }\n\n place();\n\n const reposition = () => place();\n const closeOnOutside = (event: MouseEvent) => {\n // `composedPath`, not `event.target`: this listener is on `document`, and the\n // trigger lives in a shadow root, so the target is retargeted to the shadow HOST.\n // `contains` then says the trigger was not clicked, the menu closes on mousedown,\n // and the click that follows toggles it straight back open.\n const path = event.composedPath();\n const insideOwnUi = [triggerRef.current, panelRef.current, submenuRef.current].some(\n (node) => node !== null && path.includes(node),\n );\n\n if (!insideOwnUi) {\n setOpen(false);\n }\n };\n const popEscapeLayer = pushEscapeLayer(() => setOpen(false));\n\n window.addEventListener('resize', reposition);\n document.addEventListener('mousedown', closeOnOutside, true);\n\n return () => {\n window.removeEventListener('resize', reposition);\n document.removeEventListener('mousedown', closeOnOutside, true);\n popEscapeLayer();\n };\n }, [open, place]);\n\n useInsertionEffect(() => {\n if (open) {\n ensureOverlayStyles();\n }\n }, [open]);\n\n const openSubmenu = (model: ChatModelOption, row: HTMLElement) => {\n if (!model.options?.length) {\n setSubmenuFor(null);\n return;\n }\n\n const rect = row.getBoundingClientRect();\n const panelLeft = panelRef.current?.getBoundingClientRect().left ?? rect.left;\n // To the left of the parent panel by default, flipping right when that would clip.\n const toLeft = panelLeft - SUBMENU_MIN_WIDTH - 4;\n const left =\n toLeft >= VIEWPORT_PADDING\n ? toLeft\n : Math.min(\n (panelRef.current?.getBoundingClientRect().right ?? rect.right) + 4,\n window.innerWidth - SUBMENU_MIN_WIDTH - VIEWPORT_PADDING,\n );\n\n submenuRowRef.current = row;\n setSubmenuFor(model.value);\n setSubmenuPosition({ top: rect.top, left });\n };\n\n // The submenu goes with its row, and closes once the row has left the panel. Not closed\n // outright: tabbing to a row out of view opens its submenu and then scrolls it in, and closing\n // on that scroll would leave the row's efforts out of reach of the keyboard.\n const followRowOnScroll = () => {\n const row = submenuRowRef.current?.getBoundingClientRect();\n const panel = panelRef.current?.getBoundingClientRect();\n\n if (!row || !panel || row.top < panel.top || row.bottom > panel.bottom) {\n setSubmenuFor(null);\n setSubmenuPosition(null);\n return;\n }\n\n setSubmenuPosition((current) => current && { ...current, top: row.top });\n };\n\n const choose = (model: ChatModelOption, option?: ChatModelSubOption) => {\n onChange(model.value, option?.value);\n setOpen(false);\n };\n\n const submenuModel = models.find((model) => model.value === submenuFor);\n\n return (\n <>\n <div ref={triggerRef} className=\"inline-flex\">\n <PillButton\n label={selected?.label ?? value}\n icon={\n selected?.iconSrc ? (\n <Avatar src={selected.iconSrc} name={selected.label} size={14} />\n ) : undefined\n }\n trailingIcon={openUp ? <CaretUpIcon size={10} /> : <CaretDownIcon size={10} />}\n shape=\"tab\"\n size=\"small\"\n disabled={disabled}\n onClick={() => setOpen((wasOpen) => !wasOpen)}\n />\n </div>\n {open &&\n createPortal(\n <>\n <div\n ref={panelRef}\n role=\"menu\"\n aria-label={ariaLabel}\n // `actionmenu` rather than a new kind: the identity is a\n // host-facing allow-list, so a new class would need every host to\n // update its CSS, and this panel is an action menu in shape.\n {...panelIdentity}\n style={panelStyle(position, PANEL_MIN_WIDTH)}\n onScroll={followRowOnScroll}\n >\n {models.map((model) => (\n <button\n key={model.value}\n type=\"button\"\n role=\"menuitem\"\n aria-haspopup={model.options?.length ? 'menu' : undefined}\n style={ROW_STYLE}\n onMouseEnter={(event) =>\n openSubmenu(model, event.currentTarget)\n }\n onFocus={(event) => openSubmenu(model, event.currentTarget)}\n onClick={() =>\n model.options?.length\n ? choose(model, model.options[0])\n : choose(model)\n }\n >\n {model.iconSrc ? (\n <Avatar src={model.iconSrc} name={model.label} size={14} />\n ) : null}\n {model.label}\n {model.value === value ? (\n <span style={CHECK_STYLE}>\n <CheckIcon size={11} />\n </span>\n ) : null}\n {model.options?.length ? (\n <span\n style={{\n marginLeft: model.value === value ? 4 : 'auto',\n display: 'inline-flex',\n color: 'var(--malachite-text-dimmed, rgb(161, 161, 161))',\n }}\n >\n <CaretRightIcon size={10} />\n </span>\n ) : null}\n </button>\n ))}\n </div>\n {submenuModel?.options?.length ? (\n <div\n ref={submenuRef}\n role=\"menu\"\n aria-label={`${submenuModel.label} options`}\n {...submenuIdentity}\n style={panelStyle(submenuPosition, SUBMENU_MIN_WIDTH)}\n >\n {submenuModel.options.map((option) => (\n <button\n key={option.value}\n type=\"button\"\n role=\"menuitem\"\n style={{ ...ROW_STYLE, alignItems: 'flex-start' }}\n onClick={() => choose(submenuModel, option)}\n >\n <span\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: 2,\n }}\n >\n {option.label}\n {option.description ? (\n <span style={DESCRIPTION_STYLE}>\n {option.description}\n </span>\n ) : null}\n </span>\n {submenuModel.value === value &&\n option.value === optionValue ? (\n <span style={CHECK_STYLE}>\n <CheckIcon size={11} />\n </span>\n ) : null}\n </button>\n ))}\n </div>\n ) : null}\n </>,\n document.body,\n )}\n </>\n );\n};\n\nexport default ChatModelPicker;\nexport { ChatModelPicker };\n"],"names":["VIEWPORT_PADDING","PANEL_MIN_WIDTH","SUBMENU_MIN_WIDTH","panelStyle","position","minWidth","ROW_STYLE","DESCRIPTION_STYLE","CHECK_STYLE","ChatModelPicker","models","value","optionValue","onChange","disabled","openUp","ariaLabel","open","setOpen","useState","setPosition","submenuFor","setSubmenuFor","submenuPosition","setSubmenuPosition","triggerRef","useRef","panelRef","submenuRef","submenuRowRef","panelIdentity","usePopupLayer","submenuIdentity","useTopLayer","useOwnedByPopover","useCallback","selected","model","place","trigger","panel","rect","width","height","maxLeft","left","roomAbove","roomBelow","preferred","other","flips","goesUp","room","top","follow","close","useFollowTrigger","useEffect","reposition","closeOnOutside","event","path","node","popEscapeLayer","pushEscapeLayer","useInsertionEffect","ensureOverlayStyles","openSubmenu","row","_a","toLeft","_b","_c","followRowOnScroll","current","choose","option","submenuModel","jsxs","Fragment","jsx","PillButton","Avatar","CaretUpIcon","CaretDownIcon","wasOpen","createPortal","CheckIcon","CaretRightIcon"],"mappings":";;;;;;;;;;;;;;;AA8CA,MAAMA,IAAmB,GACnBC,IAAkB,KAClBC,IAAoB,KAMpBC,IAAa,CACfC,GACAC,OACuB;AAAA,EACvB,UAAU;AAAA,EACV,MAAKD,KAAA,gBAAAA,EAAU,QAAO;AAAA,EACtB,OAAMA,KAAA,gBAAAA,EAAU,SAAQ;AAAA,EACxB,WAAWA,KAAA,gBAAAA,EAAU;AAAA,EACrB,YAAWA,KAAA,gBAAAA,EAAU,eAAc,SAAY,SAAY;AAAA,EAC3D,UAAAC;AAAA,EACA,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,EACT,eAAe;AAAA,EACf,KAAK;AAAA,EACL,YAAYD,IAAW,YAAY;AAAA,EACnC,SAASA,IAAW,IAAI;AAC5B,IAEME,IAAiC;AAAA,EACnC,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,SAAS;AAAA,EACT,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AACX,GAEMC,KAAyC;AAAA,EAC3C,UAAU;AAAA,EACV,OAAO;AACX,GAEMC,IAAmC;AAAA,EACrC,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,OAAO;AACX,GASMC,KAAkD,CAAC;AAAA,EACrD,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,E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,gBAAAE;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBACG,OAAO;AAAA,wBACH,SAAS;AAAA,wBACT,eAAe;AAAA,wBACf,KAAK;AAAA,sBAAA;AAAA,sBAGR,UAAA;AAAA,wBAAAF,EAAO;AAAA,wBACPA,EAAO,cACJ,gBAAAI,EAAC,QAAA,EAAK,OAAOzE,IACR,UAAAqE,EAAO,aACZ,IACA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBAEPC,EAAa,UAAUlE,KACxBiE,EAAO,UAAUhE,IACb,gBAAAoE,EAAC,QAAA,EAAK,OAAOxE,GACT,UAAA,gBAAAwE,EAACO,GAAA,EAAU,MAAM,GAAA,CAAI,GACzB,IACA;AAAA,gBAAA;AAAA,cAAA;AAAA,cAzBCX,EAAO;AAAA,YAAA,CA2BnB;AAAA,UAAA;AAAA,QAAA,IAEL;AAAA,MAAA,GACR;AAAA,MACA,SAAS;AAAA,IAAA;AAAA,EACb,GACR;AAER;"}
@@ -0,0 +1,16 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import p from "../../assets/icons/clock.svg.js";
3
+ const m = ({ size: o = 16, className: t = "", style: r = {}, onClick: l }) => {
4
+ const n = {
5
+ width: typeof o == "number" ? `${o}px` : o,
6
+ height: typeof o == "number" ? `${o}px` : o,
7
+ display: "inline-block",
8
+ fill: "currentColor",
9
+ ...r
10
+ };
11
+ return /* @__PURE__ */ c(p, { className: t, style: n, onClick: l });
12
+ };
13
+ export {
14
+ m as default
15
+ };
16
+ //# sourceMappingURL=ClockIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClockIcon.js","sources":["../../../src/components/CustomIcons/ClockIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport ClockIconSvg from '../../assets/icons/clock.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst ClockIcon: 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 <ClockIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default ClockIcon;\n"],"names":["ClockIcon","size","className","style","onClick","iconStyle","jsx","ClockIconSvg"],"mappings":";;AAUA,MAAMA,IAAiC,CAAC,EAAE,MAAAC,IAAO,IAAI,WAAAC,IAAY,IAAI,OAAAC,IAAQ,IAAI,SAAAC,QAAc;AAC3F,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,EAAa,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AACnF;"}
@@ -0,0 +1,16 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import c from "../../assets/icons/mcp.svg.js";
3
+ const m = ({ size: o = 16, className: t = "", style: r = {}, onClick: n }) => {
4
+ const p = {
5
+ width: typeof o == "number" ? `${o}px` : o,
6
+ height: typeof o == "number" ? `${o}px` : o,
7
+ display: "inline-block",
8
+ fill: "currentColor",
9
+ ...r
10
+ };
11
+ return /* @__PURE__ */ l(c, { className: t, style: p, onClick: n });
12
+ };
13
+ export {
14
+ m as default
15
+ };
16
+ //# sourceMappingURL=McpIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"McpIcon.js","sources":["../../../src/components/CustomIcons/McpIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport McpIconSvg from '../../assets/icons/mcp.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst McpIcon: 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 <McpIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default McpIcon;\n"],"names":["McpIcon","size","className","style","onClick","iconStyle","jsx","McpIconSvg"],"mappings":";;AAUA,MAAMA,IAA+B,CAAC,EAAE,MAAAC,IAAO,IAAI,WAAAC,IAAY,IAAI,OAAAC,IAAQ,IAAI,SAAAC,QAAc;AACzF,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,EAAW,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AACjF;"}
@@ -0,0 +1,16 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import p from "../../assets/icons/question.svg.js";
3
+ const f = ({ size: o = 16, className: t = "", style: n = {}, onClick: r }) => {
4
+ const e = {
5
+ width: typeof o == "number" ? `${o}px` : o,
6
+ height: typeof o == "number" ? `${o}px` : o,
7
+ display: "inline-block",
8
+ fill: "currentColor",
9
+ ...n
10
+ };
11
+ return /* @__PURE__ */ l(p, { className: t, style: e, onClick: r });
12
+ };
13
+ export {
14
+ f as default
15
+ };
16
+ //# sourceMappingURL=QuestionIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QuestionIcon.js","sources":["../../../src/components/CustomIcons/QuestionIcon.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport QuestionIconSvg from '../../assets/icons/question.svg?react';\n\nexport interface IconProps {\n size?: number | string;\n className?: string;\n style?: CSSProperties;\n onClick?: () => void;\n}\n\nconst QuestionIcon: 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 <QuestionIconSvg className={className} style={iconStyle} onClick={onClick} />;\n};\n\nexport default QuestionIcon;\n"],"names":["QuestionIcon","size","className","style","onClick","iconStyle","jsx","QuestionIconSvg"],"mappings":";;AAUA,MAAMA,IAAoC,CAAC,EAAE,MAAAC,IAAO,IAAI,WAAAC,IAAY,IAAI,OAAAC,IAAQ,IAAI,SAAAC,QAAc;AAC9F,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,EAAgB,WAAAL,GAAsB,OAAOG,GAAW,SAAAD,GAAkB;AACtF;"}