@vvedantb/ui 0.79.0 → 0.81.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/README.md +3 -2
- package/dist/shell/src/DockArrow.js +187 -0
- package/dist/shell/src/SidePanelTabs.js +65 -147
- package/dist/src/ai-elements/prompt-input.js +2 -2
- package/dist/src/ai-elements/shimmer.js +6 -5
- package/dist/src/client.js +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/ui/empty-state.js +214 -256
- package/dist/tokens/src/css/motion.css +70 -0
- package/package.json +1 -1
- package/shell/src/DockArrow.tsx +125 -0
- package/shell/src/SidePanelTabs.tsx +8 -78
- package/src/ai-elements/prompt-input.tsx +2 -2
- package/src/ai-elements/shimmer.tsx +6 -5
- package/src/client.ts +2 -0
- package/src/index.ts +2 -0
- package/src/ui/empty-state.tsx +23 -83
- package/tokens/src/css/motion.css +70 -0
package/README.md
CHANGED
|
@@ -1289,6 +1289,7 @@ Rail-variant pieces (all work without the rail variant too, except the first):
|
|
|
1289
1289
|
- **Dock motion of the sidebar panel.** In `variant="rail"` the panel shrinks into the `RailCollapseTile` on hide and grows back out on show, and the main content slides with the sidebar width. `panelMotion="none"` on `AppShell` turns it off (a rail-only input: a type error on `"floating"`). For a toggle of your own (a hotkey, a context setter) call `toggleShellPanel(collapsed, toggle)`, or `popOutShellPanel(hide)` and `popInShellPanelNextFrame()`. For a tile of your own, spread `shellDockTileProps` on it.
|
|
1290
1290
|
- **`dockPopIn`, `dockNudge`, `dockPopOut`, `slideWith`, `slideNextResize`** (`DockEdge`, `DOCK_MOTION_EVENT`, `DockMotionEvent`, `dockMotionOff`): the same motion for any panel that docks into a tile. All of it stops with `MotionProvider reducedMotion` and `PageMotionProvider disabled`: a show is instant and a hide runs at once.
|
|
1291
1291
|
- **`ButtonTrack`** (`buttonTrackClass`): a trough for a group of flat buttons, for page header actions (`direction="row"`, default) or tools under a side rail (`direction="column"`). It renders nothing visible when empty.
|
|
1292
|
+
- **`DockArrow`** and **`useDockArrow`**: the arrow `SidePanelTabs.Frame` draws, for any dock card. `<DockArrow ref={arrowRef} edge="left" hairline />` renders the 16 px rotated square (`bg-surface` fill; set another with a `bg-*` class). `hairline` adds a 0.5 px line on the two outer sides, matching `Card`'s inset ring, so it shows no seam on a `Card`. `useDockArrow({ frameRef, cardRef, arrowRef, tile, edge, watch })` puts it on the card's `edge` (`"left"` or `"right"`, the edge that touches the rail), level with the tile `tile(frame)` returns, and slides it in step with the tab pill. It runs `dockPopIn` when the card opens (the arrow fades in once the card lands) and `dockSwitch` when the tile changes. Close with `dockPopOut(card, tile, edge, hide, arrow)`. Motion stops under page motion off and reduced motion.
|
|
1292
1293
|
- **`SidePanelTabs`**: tabs on a rail beside a content card, for a side panel. `SidePanelTabs.Frame({ collapsed, rail })` holds a `SidePanelTabs.Rail` with a `SidePanelTabs.List({ value, onValueChange })` of `SidePanelTabs.Tab({ value, label, icon, activeIcon, layout, count, indicator, onReselect })`. From `md` up the rail is on the right edge and an arrow on the card points at the active tab; below `md` the tabs are a strip on top. `collapsed` hides the card and leaves the rail (`SIDE_PANEL_RAIL_WIDTH_PX`, 44; `SIDE_PANEL_RAIL_LABELLED_WIDTH_PX`, 76). Close it with `popOutSidePanel(root, collapse)`. It does not depend on the `AppShell` variant. The rail is on the right only. The card is `bg-surface md:rounded-surface`. The tab trough is `bg-default`, and in dark (and `.dark.neutral`) it takes the card tone (`dark:bg-surface`) so the `bg-segment` pill stands out; `Sidebar.RailGroup` and `ButtonTrack` troughs do the same.
|
|
1293
1294
|
|
|
1294
1295
|
```tsx
|
|
@@ -1818,13 +1819,13 @@ const config = {
|
|
|
1818
1819
|
```
|
|
1819
1820
|
|
|
1820
1821
|
The app owns the reply state and the scroll. `MessageHoverActions` needs a `relative` `Message` (the `actions` prop sets it).
|
|
1821
|
-
- `PromptInput`: `classes.group` (the input group, default `overflow-hidden`), `classes.groupIdle` / `classes.groupDragOver` (added while no drag / an accepted drag is over the form), `classes.groupDefault` (added when no `containerClassName` is given), `classes.textarea`, `classes.footer`, `classes.submit`, `classes.tabItem`; `submitIcons.<send|submitted|streaming|error>`, `submitCrossfade` (cross-fade the submit icon on status change) and `menuTriggerAsChild` (default `true`: `PromptInputActionMenuTrigger` is the Radix trigger; `false` nests a button inside it). New `PromptInput` props: `dataDrop` (`{ type, onDrop }`: a non-file drag of that MIME type counts as a drag over the form and `onDrop` gets its string payload) and `inputGroupClassName` (same as `containerClassName`). The attachments context adds `replace(id, file)`; `accept` now matches extension patterns such as `.html` by file name; `useOptionalPromptInputController` is exported.
|
|
1822
|
+
- `PromptInput`: `classes.group` (the input group, default `overflow-hidden`), `classes.groupIdle` / `classes.groupDragOver` (added while no drag / an accepted drag is over the form), `classes.groupDefault` (added when no `containerClassName` is given), `classes.textarea`, `classes.footer`, `classes.submit`, `classes.tabItem`; `submitIcons.<send|submitted|streaming|error>`, `submitCrossfade` (default `true`: cross-fade the submit icon on status change; `false` swaps it at once) and `menuTriggerAsChild` (default `true`: `PromptInputActionMenuTrigger` is the Radix trigger; `false` nests a button inside it). New `PromptInput` props: `dataDrop` (`{ type, onDrop }`: a non-file drag of that MIME type counts as a drag over the form and `onDrop` gets its string payload) and `inputGroupClassName` (same as `containerClassName`). The attachments context adds `replace(id, file)`; `accept` now matches extension patterns such as `.html` by file name; `useOptionalPromptInputController` is exported.
|
|
1822
1823
|
- `PromptInputSubmit`: new prop `queued` (0.30.0). Set it when a send would join a queue (the agent is still working). The send icon becomes `SendQueueIcon`, an up arrow that morphs into a stack of bars while `queued` is `true`. Leave it unset to keep `submitIcons.send`. `SendQueueIcon` (`queued`, `className` default `size-4`) is exported for other send buttons. It uses `m`, so `queued` needs the app's `LazyMotion`.
|
|
1823
1824
|
- `PromptInputSettings` (new): an overflow menu with a "Model" submenu (one radio list, or a submenu per provider). Entry: `providerLabel(provider)` (default the id), `providerIcon(provider)` (default none), `classes.trigger`.
|
|
1824
1825
|
- `TraitsPanel` (new, with `isUltrathinkPrompt`, `applyUltrathinkPrefix`): reasoning, speed, context and thinking segments for a model picker; inside a `PromptInputProvider` it offers "Ultrathink" by editing the prompt. Entry: `classes.label`, `classes.empty`, `classes.option`, `classes.optionSelected`, `classes.optionIdle`, `classes.note`.
|
|
1825
1826
|
- `PromptInputSpeech`, `useSpeechRecognition`, `getSpeechRecognition` (new): Web Speech API dictation; the button renders nothing without the API.
|
|
1826
1827
|
- `Queue`: one family, used in one of two ways. The queued-messages widget is unchanged: `Queue` with `count`, `QueueHeader`, `QueueList` (`open`) and `QueueItem` with `text` (`model`, `personalityName`, `personaName`, `personaImage`, `onEdit`, `onRemove`). The composable parts (the AI Elements `Queue`, new): `Queue` without `count` (a plain root), `QueueSection`, `QueueSectionTrigger`, `QueueSectionLabel`, `QueueSectionContent`, `QueueList` (inside a composable `Queue`: a list capped at `max-h-48`), `QueueItem` without `text` (an `li`, takes `ref`), `QueueItemIndicator`, `QueueItemContent`, `QueueItemActions`, `QueueItemAction`. The composable parts render no `motion.*`, so they work under `<LazyMotion strict>`. Entry `Queue`: `classes.sectionTrigger`.
|
|
1827
|
-
- `Shimmer`: `mode`, `as`, `classes.base`, `classes.overlay`, `classes.band`, `classes.copy`.
|
|
1828
|
+
- `Shimmer`: `mode`, `as`, `classes.base`, `classes.overlay`, `classes.band`, `classes.copy`. `mode`: `"mask"` (default) sweeps a masked copy of the text with transforms only (no repaint, paused offscreen); `"gradient"` animates `background-position`. `motion.css` (part of `tokens.css`) styles `.shimmer-overlay`, `.shimmer-band` and `.shimmer-copy`, so an app defines nothing; the sweep stops under page motion off and reduced motion.
|
|
1828
1829
|
- `CodeBlock`: `plain`, `copyButtonSize`, `copyLabel` (a screen-reader label on the copy button; without it the icon-only button gets `aria-label="Copy code"`), `copyEveryClick` (the copy button copies on every click, also while it shows the check; by default those clicks do nothing until it resets after `timeout`), `classes.container`, `classes.pre`, `classes.copyButton`, `classes.copyIcon` (a class in place of `size={14}`). New props: `plain` (no shiki: a `pre` with the code, and `children` replace that `pre` instead of sitting above it); `language` is now optional.
|
|
1829
1830
|
- `Artifact`: `classes.root`, `classes.header`, `classes.title`, `classes.description`, `classes.actions`, `classes.action` (`ArtifactAction` and `ArtifactClose`), `classes.actionIcon`, `classes.content`, `actionSize`, `actionLabel` (`"sr-only"` names actions with a hidden span instead of `aria-label`). `ArtifactAction`: `tooltip` is optional (no tooltip, no wrapper) and `icon` also takes an icon component (`icon={IconCopy}`). New `ArtifactClose` (an action with an X, `label` default `"Close"`).
|
|
1830
1831
|
- `Attachments`: `classes.item.<variant>`, `classes.preview.<variant>`, `classes.remove.<variant>` replace the variant classes of `Attachment`, `AttachmentPreview` and `AttachmentRemove`.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
|
+
import { dockPopIn, dockSwitch } from "../../src/motion/dock-motion.js";
|
|
4
|
+
import { cn } from "../../src/utils/cn.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const ARROW_HALF_PX = 8;
|
|
7
|
+
/**
|
|
8
|
+
* The 16 px rotated square a dock card draws to point at its rail tile. Place
|
|
9
|
+
* it in the same positioned parent as the card and pass its ref to
|
|
10
|
+
* `useDockArrow`, which moves it. The fill is `bg-surface`: set another with a
|
|
11
|
+
* `bg-*` class in `className`. Hide it with `className` when the card is
|
|
12
|
+
* hidden (the hook already fades it out when the card has no width).
|
|
13
|
+
*/
|
|
14
|
+
export function DockArrow(t0) {
|
|
15
|
+
const $ = _c(12);
|
|
16
|
+
let className;
|
|
17
|
+
let props;
|
|
18
|
+
let t1;
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({
|
|
22
|
+
edge: t1,
|
|
23
|
+
hairline: t2,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
} = t0);
|
|
27
|
+
$[0] = t0;
|
|
28
|
+
$[1] = className;
|
|
29
|
+
$[2] = props;
|
|
30
|
+
$[3] = t1;
|
|
31
|
+
$[4] = t2;
|
|
32
|
+
} else {
|
|
33
|
+
className = $[1];
|
|
34
|
+
props = $[2];
|
|
35
|
+
t1 = $[3];
|
|
36
|
+
t2 = $[4];
|
|
37
|
+
}
|
|
38
|
+
const edge = t1 === undefined ? "right" : t1;
|
|
39
|
+
const hairline = t2 === undefined ? false : t2;
|
|
40
|
+
const t3 = hairline && (edge === "right" ? "border-t-[0.5px] border-r-[0.5px]" : "border-b-[0.5px] border-l-[0.5px]");
|
|
41
|
+
const t4 = hairline && "border-black/[0.06] dark:border-white/[0.08]";
|
|
42
|
+
let t5;
|
|
43
|
+
if ($[5] !== className || $[6] !== t3 || $[7] !== t4) {
|
|
44
|
+
t5 = cn("t-side-panel-arrow pointer-events-none absolute top-0 size-4 rounded-xs bg-surface opacity-0", t3, t4, className);
|
|
45
|
+
$[5] = className;
|
|
46
|
+
$[6] = t3;
|
|
47
|
+
$[7] = t4;
|
|
48
|
+
$[8] = t5;
|
|
49
|
+
} else {
|
|
50
|
+
t5 = $[8];
|
|
51
|
+
}
|
|
52
|
+
let t6;
|
|
53
|
+
if ($[9] !== props || $[10] !== t5) {
|
|
54
|
+
t6 = /*#__PURE__*/_jsx("div", {
|
|
55
|
+
"aria-hidden": true,
|
|
56
|
+
"data-dock-arrow": "",
|
|
57
|
+
...props,
|
|
58
|
+
className: t5
|
|
59
|
+
});
|
|
60
|
+
$[9] = props;
|
|
61
|
+
$[10] = t5;
|
|
62
|
+
$[11] = t6;
|
|
63
|
+
} else {
|
|
64
|
+
t6 = $[11];
|
|
65
|
+
}
|
|
66
|
+
return t6;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Places `arrowRef` at the card's `edge`, level with the active tile, and
|
|
70
|
+
* slides it to the next tile in step with the tab pill (`t-side-panel-arrow`).
|
|
71
|
+
* When the card opens it runs `dockPopIn` (the card grows out of the tile and
|
|
72
|
+
* the arrow fades in once it lands); when the tile changes it runs
|
|
73
|
+
* `dockSwitch`. Close with `dockPopOut(card, tile, edge, hide, arrow)`. The
|
|
74
|
+
* arrow hides while the card has no width or the tile is outside the card's
|
|
75
|
+
* height.
|
|
76
|
+
*/
|
|
77
|
+
export function useDockArrow(t0) {
|
|
78
|
+
const $ = _c(8);
|
|
79
|
+
const {
|
|
80
|
+
frameRef,
|
|
81
|
+
cardRef,
|
|
82
|
+
arrowRef,
|
|
83
|
+
tile,
|
|
84
|
+
edge: t1,
|
|
85
|
+
watch
|
|
86
|
+
} = t0;
|
|
87
|
+
const edge = t1 === undefined ? "right" : t1;
|
|
88
|
+
let t2;
|
|
89
|
+
let t3;
|
|
90
|
+
if ($[0] !== arrowRef || $[1] !== cardRef || $[2] !== edge || $[3] !== frameRef || $[4] !== tile || $[5] !== watch) {
|
|
91
|
+
t2 = () => {
|
|
92
|
+
const frame = frameRef.current;
|
|
93
|
+
const card = cardRef.current;
|
|
94
|
+
const arrow = arrowRef.current;
|
|
95
|
+
if (!frame || !card || !arrow) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
let placed = false;
|
|
99
|
+
let wasOpen = card.getBoundingClientRect().width > 0;
|
|
100
|
+
let lastTab = tile(frame);
|
|
101
|
+
const sync = () => {
|
|
102
|
+
const tab = tile(frame);
|
|
103
|
+
const f = frame.getBoundingClientRect();
|
|
104
|
+
const c = card.getBoundingClientRect();
|
|
105
|
+
const open = c.width > 0;
|
|
106
|
+
const opened = open && !wasOpen;
|
|
107
|
+
const switched = open && wasOpen && tab !== null && tab !== lastTab;
|
|
108
|
+
const previousTab = lastTab;
|
|
109
|
+
wasOpen = open;
|
|
110
|
+
if (tab) {
|
|
111
|
+
lastTab = tab;
|
|
112
|
+
}
|
|
113
|
+
if (!tab || !open) {
|
|
114
|
+
arrow.style.opacity = "0";
|
|
115
|
+
placed = false;
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const t = tab.getBoundingClientRect();
|
|
119
|
+
const centre = t.top + t.height / 2;
|
|
120
|
+
const inCard = centre > c.top + 2 * ARROW_HALF_PX && centre < c.bottom - 2 * ARROW_HALF_PX;
|
|
121
|
+
if (!inCard) {
|
|
122
|
+
arrow.style.opacity = "0";
|
|
123
|
+
} else {
|
|
124
|
+
if (!placed) {
|
|
125
|
+
arrow.style.transition = "none";
|
|
126
|
+
}
|
|
127
|
+
const x = edge === "right" ? c.right - f.left - ARROW_HALF_PX - 1 : c.left - f.left - ARROW_HALF_PX + 1;
|
|
128
|
+
arrow.style.left = `${x}px`;
|
|
129
|
+
arrow.style.transform = `translateY(${centre - f.top - ARROW_HALF_PX}px) rotate(45deg)`;
|
|
130
|
+
arrow.style.opacity = "1";
|
|
131
|
+
if (!placed) {
|
|
132
|
+
arrow.style.transition = "";
|
|
133
|
+
placed = true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (opened) {
|
|
137
|
+
dockPopIn(card, tab, edge, arrow);
|
|
138
|
+
} else {
|
|
139
|
+
if (switched) {
|
|
140
|
+
dockSwitch(card, previousTab, tab);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
sync();
|
|
145
|
+
if (typeof ResizeObserver === "undefined") {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const resize = new ResizeObserver(sync);
|
|
149
|
+
resize.observe(frame);
|
|
150
|
+
resize.observe(card);
|
|
151
|
+
const mutation = new MutationObserver(sync);
|
|
152
|
+
mutation.observe(frame, {
|
|
153
|
+
subtree: true,
|
|
154
|
+
attributes: true,
|
|
155
|
+
attributeFilter: ["data-state", "aria-selected"]
|
|
156
|
+
});
|
|
157
|
+
const list = watch?.(frame);
|
|
158
|
+
if (list) {
|
|
159
|
+
resize.observe(list);
|
|
160
|
+
}
|
|
161
|
+
const settle = ["scroll", "animationend", "transitionend"];
|
|
162
|
+
for (const type of settle) {
|
|
163
|
+
frame.addEventListener(type, sync, true);
|
|
164
|
+
}
|
|
165
|
+
return () => {
|
|
166
|
+
resize.disconnect();
|
|
167
|
+
mutation.disconnect();
|
|
168
|
+
for (const type_0 of settle) {
|
|
169
|
+
frame.removeEventListener(type_0, sync, true);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
t3 = [frameRef, cardRef, arrowRef, tile, edge, watch];
|
|
174
|
+
$[0] = arrowRef;
|
|
175
|
+
$[1] = cardRef;
|
|
176
|
+
$[2] = edge;
|
|
177
|
+
$[3] = frameRef;
|
|
178
|
+
$[4] = tile;
|
|
179
|
+
$[5] = watch;
|
|
180
|
+
$[6] = t2;
|
|
181
|
+
$[7] = t3;
|
|
182
|
+
} else {
|
|
183
|
+
t2 = $[6];
|
|
184
|
+
t3 = $[7];
|
|
185
|
+
}
|
|
186
|
+
useLayoutEffect(t2, t3);
|
|
187
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { dockPopOut } from "../../src/motion/dock-motion.js";
|
|
4
|
+
import { DockArrow, useDockArrow } from "./DockArrow.js";
|
|
4
5
|
import { Tabs, TabsList, TabsTrigger } from "../../src/ui/tabs.js";
|
|
5
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../src/ui/tooltip.js";
|
|
6
7
|
import { cn } from "../../src/utils/cn.js";
|
|
@@ -10,7 +11,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
10
11
|
export const SIDE_PANEL_RAIL_WIDTH_PX = 44;
|
|
11
12
|
/** Width of the rail with a label under each icon (`labelled`). */
|
|
12
13
|
export const SIDE_PANEL_RAIL_LABELLED_WIDTH_PX = 76;
|
|
13
|
-
const ARROW_HALF_PX = 8;
|
|
14
14
|
const RAIL_TABLIST_SELECTOR = ':scope > [data-side-panel-rail] [role="tablist"]';
|
|
15
15
|
const ACTIVE_TAB_SELECTOR = `${RAIL_TABLIST_SELECTOR} [role="tab"][data-state="active"]`;
|
|
16
16
|
const CARD_SELECTOR = "[data-side-panel-card]";
|
|
@@ -31,106 +31,10 @@ export function popOutSidePanel(root, collapse) {
|
|
|
31
31
|
const card = root?.querySelector(CARD_SELECTOR) ?? null;
|
|
32
32
|
dockPopOut(card, card ? activeTabOf(card) : null, "right", collapse, card ? arrowOf(card) : null);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
let t0;
|
|
37
|
-
let t1;
|
|
38
|
-
if ($[0] !== arrowRef || $[1] !== cardRef || $[2] !== frameRef) {
|
|
39
|
-
t0 = () => {
|
|
40
|
-
const frame = frameRef.current;
|
|
41
|
-
const card = cardRef.current;
|
|
42
|
-
const arrow = arrowRef.current;
|
|
43
|
-
if (!frame || !card || !arrow) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
let placed = false;
|
|
47
|
-
let wasOpen = card.getBoundingClientRect().width > 0;
|
|
48
|
-
let lastTab = frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
49
|
-
const sync = () => {
|
|
50
|
-
const tab = frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
51
|
-
const f = frame.getBoundingClientRect();
|
|
52
|
-
const c = card.getBoundingClientRect();
|
|
53
|
-
const open = c.width > 0;
|
|
54
|
-
const opened = open && !wasOpen;
|
|
55
|
-
const switched = open && wasOpen && tab !== null && tab !== lastTab;
|
|
56
|
-
const previousTab = lastTab;
|
|
57
|
-
wasOpen = open;
|
|
58
|
-
if (tab) {
|
|
59
|
-
lastTab = tab;
|
|
60
|
-
}
|
|
61
|
-
if (!tab || !open) {
|
|
62
|
-
arrow.style.opacity = "0";
|
|
63
|
-
placed = false;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const t = tab.getBoundingClientRect();
|
|
67
|
-
const centre = t.top + t.height / 2;
|
|
68
|
-
const inCard = centre > c.top + 2 * ARROW_HALF_PX && centre < c.bottom - 2 * ARROW_HALF_PX;
|
|
69
|
-
if (!inCard) {
|
|
70
|
-
arrow.style.opacity = "0";
|
|
71
|
-
} else {
|
|
72
|
-
if (!placed) {
|
|
73
|
-
arrow.style.transition = "none";
|
|
74
|
-
}
|
|
75
|
-
arrow.style.left = `${c.right - f.left - ARROW_HALF_PX - 1}px`;
|
|
76
|
-
arrow.style.transform = `translateY(${centre - f.top - ARROW_HALF_PX}px) rotate(45deg)`;
|
|
77
|
-
arrow.style.opacity = "1";
|
|
78
|
-
if (!placed) {
|
|
79
|
-
arrow.style.transition = "";
|
|
80
|
-
placed = true;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (opened) {
|
|
84
|
-
dockPopIn(card, tab, "right", arrow);
|
|
85
|
-
} else {
|
|
86
|
-
if (switched) {
|
|
87
|
-
dockSwitch(card, previousTab, tab);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
sync();
|
|
92
|
-
if (typeof ResizeObserver === "undefined") {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const resize = new ResizeObserver(sync);
|
|
96
|
-
resize.observe(frame);
|
|
97
|
-
resize.observe(card);
|
|
98
|
-
const mutation = new MutationObserver(sync);
|
|
99
|
-
mutation.observe(frame, {
|
|
100
|
-
subtree: true,
|
|
101
|
-
attributes: true,
|
|
102
|
-
attributeFilter: ["data-state"]
|
|
103
|
-
});
|
|
104
|
-
const list = frame.querySelector(RAIL_TABLIST_SELECTOR);
|
|
105
|
-
if (list) {
|
|
106
|
-
resize.observe(list);
|
|
107
|
-
}
|
|
108
|
-
const settle = ["scroll", "animationend", "transitionend"];
|
|
109
|
-
for (const type of settle) {
|
|
110
|
-
frame.addEventListener(type, sync, true);
|
|
111
|
-
}
|
|
112
|
-
return () => {
|
|
113
|
-
resize.disconnect();
|
|
114
|
-
mutation.disconnect();
|
|
115
|
-
for (const type_0 of settle) {
|
|
116
|
-
frame.removeEventListener(type_0, sync, true);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
t1 = [frameRef, cardRef, arrowRef];
|
|
121
|
-
$[0] = arrowRef;
|
|
122
|
-
$[1] = cardRef;
|
|
123
|
-
$[2] = frameRef;
|
|
124
|
-
$[3] = t0;
|
|
125
|
-
$[4] = t1;
|
|
126
|
-
} else {
|
|
127
|
-
t0 = $[3];
|
|
128
|
-
t1 = $[4];
|
|
129
|
-
}
|
|
130
|
-
useLayoutEffect(t0, t1);
|
|
131
|
-
}
|
|
34
|
+
const activeTabIn = frame => frame.querySelector(ACTIVE_TAB_SELECTOR);
|
|
35
|
+
const railListIn = frame => frame.querySelector(RAIL_TABLIST_SELECTOR);
|
|
132
36
|
function Frame(t0) {
|
|
133
|
-
const $ = _c(
|
|
37
|
+
const $ = _c(19);
|
|
134
38
|
const {
|
|
135
39
|
collapsed: t1,
|
|
136
40
|
rail,
|
|
@@ -143,78 +47,92 @@ function Frame(t0) {
|
|
|
143
47
|
const frameRef = useRef(null);
|
|
144
48
|
const cardRef = useRef(null);
|
|
145
49
|
const arrowRef = useRef(null);
|
|
146
|
-
useActiveTabArrow(frameRef, cardRef, arrowRef);
|
|
147
50
|
let t2;
|
|
148
|
-
if ($[0]
|
|
149
|
-
t2 =
|
|
150
|
-
|
|
151
|
-
|
|
51
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
52
|
+
t2 = {
|
|
53
|
+
frameRef,
|
|
54
|
+
cardRef,
|
|
55
|
+
arrowRef,
|
|
56
|
+
tile: activeTabIn,
|
|
57
|
+
edge: "right",
|
|
58
|
+
watch: railListIn
|
|
59
|
+
};
|
|
60
|
+
$[0] = t2;
|
|
152
61
|
} else {
|
|
153
|
-
t2 = $[
|
|
62
|
+
t2 = $[0];
|
|
154
63
|
}
|
|
155
|
-
|
|
156
|
-
let
|
|
157
|
-
if ($[
|
|
158
|
-
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[4] = t4;
|
|
64
|
+
useDockArrow(t2);
|
|
65
|
+
let t3;
|
|
66
|
+
if ($[1] !== className) {
|
|
67
|
+
t3 = cn("relative flex h-full min-h-0 flex-col md:flex-row-reverse", className);
|
|
68
|
+
$[1] = className;
|
|
69
|
+
$[2] = t3;
|
|
162
70
|
} else {
|
|
163
|
-
|
|
71
|
+
t3 = $[2];
|
|
164
72
|
}
|
|
73
|
+
const t4 = collapsed && "md:hidden";
|
|
165
74
|
let t5;
|
|
166
|
-
if ($[
|
|
167
|
-
t5 =
|
|
75
|
+
if ($[3] !== arrowClassName || $[4] !== t4) {
|
|
76
|
+
t5 = cn("hidden md:block", t4, arrowClassName);
|
|
77
|
+
$[3] = arrowClassName;
|
|
78
|
+
$[4] = t4;
|
|
79
|
+
$[5] = t5;
|
|
80
|
+
} else {
|
|
81
|
+
t5 = $[5];
|
|
82
|
+
}
|
|
83
|
+
let t6;
|
|
84
|
+
if ($[6] !== t5) {
|
|
85
|
+
t6 = /*#__PURE__*/_jsx(DockArrow, {
|
|
168
86
|
ref: arrowRef,
|
|
169
|
-
"
|
|
87
|
+
edge: "right",
|
|
170
88
|
"data-side-panel-arrow": "",
|
|
171
|
-
className:
|
|
89
|
+
className: t5
|
|
172
90
|
});
|
|
173
|
-
$[5] = t4;
|
|
174
91
|
$[6] = t5;
|
|
92
|
+
$[7] = t6;
|
|
175
93
|
} else {
|
|
176
|
-
|
|
94
|
+
t6 = $[7];
|
|
177
95
|
}
|
|
178
|
-
const
|
|
179
|
-
let
|
|
180
|
-
if ($[
|
|
181
|
-
|
|
182
|
-
$[
|
|
183
|
-
$[8] = t6;
|
|
96
|
+
const t7 = collapsed && "md:hidden";
|
|
97
|
+
let t8;
|
|
98
|
+
if ($[8] !== cardClassName || $[9] !== t7) {
|
|
99
|
+
t8 = cn("relative min-h-0 min-w-0 flex-1 overflow-hidden bg-surface md:my-2 md:mr-1.5 md:rounded-surface", t7, cardClassName);
|
|
100
|
+
$[8] = cardClassName;
|
|
184
101
|
$[9] = t7;
|
|
102
|
+
$[10] = t8;
|
|
185
103
|
} else {
|
|
186
|
-
|
|
104
|
+
t8 = $[10];
|
|
187
105
|
}
|
|
188
|
-
let
|
|
189
|
-
if ($[
|
|
190
|
-
|
|
106
|
+
let t9;
|
|
107
|
+
if ($[11] !== children || $[12] !== t8) {
|
|
108
|
+
t9 = /*#__PURE__*/_jsx("div", {
|
|
191
109
|
ref: cardRef,
|
|
192
110
|
"data-side-panel-card": "",
|
|
193
|
-
className:
|
|
111
|
+
className: t8,
|
|
194
112
|
children: children
|
|
195
113
|
});
|
|
196
|
-
$[
|
|
197
|
-
$[11] = t7;
|
|
114
|
+
$[11] = children;
|
|
198
115
|
$[12] = t8;
|
|
116
|
+
$[13] = t9;
|
|
199
117
|
} else {
|
|
200
|
-
|
|
118
|
+
t9 = $[13];
|
|
201
119
|
}
|
|
202
|
-
let
|
|
203
|
-
if ($[
|
|
204
|
-
|
|
120
|
+
let t10;
|
|
121
|
+
if ($[14] !== rail || $[15] !== t3 || $[16] !== t6 || $[17] !== t9) {
|
|
122
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
205
123
|
ref: frameRef,
|
|
206
|
-
className:
|
|
207
|
-
children: [rail,
|
|
124
|
+
className: t3,
|
|
125
|
+
children: [rail, t6, t9]
|
|
208
126
|
});
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[16] = t8;
|
|
127
|
+
$[14] = rail;
|
|
128
|
+
$[15] = t3;
|
|
129
|
+
$[16] = t6;
|
|
213
130
|
$[17] = t9;
|
|
131
|
+
$[18] = t10;
|
|
214
132
|
} else {
|
|
215
|
-
|
|
133
|
+
t10 = $[18];
|
|
216
134
|
}
|
|
217
|
-
return
|
|
135
|
+
return t10;
|
|
218
136
|
}
|
|
219
137
|
function Rail(t0) {
|
|
220
138
|
const $ = _c(10);
|
|
@@ -45,7 +45,7 @@ const convertBlobUrlToDataUrl = async url => {
|
|
|
45
45
|
* (added while no drag / an accepted drag is over the form), `groupDefault`
|
|
46
46
|
* (added when no `containerClassName` is given), `textarea`, `footer`,
|
|
47
47
|
* `submit` and `tabItem`. `submitIcons` replace the submit
|
|
48
|
-
* button's icon per status; `submitCrossfade` cross-fades between them.
|
|
48
|
+
* button's icon per status; `submitCrossfade` (default `true`) cross-fades between them.
|
|
49
49
|
* `menuTriggerAsChild` (default `true`) makes `PromptInputActionMenuTrigger`
|
|
50
50
|
* the trigger itself; `false` nests its button inside the menu's trigger
|
|
51
51
|
* button (invalid HTML).
|
|
@@ -1874,7 +1874,7 @@ export const PromptInputSubmit = t0 => {
|
|
|
1874
1874
|
const t8 = isGenerating && onStop ? "button" : "submit";
|
|
1875
1875
|
let t9;
|
|
1876
1876
|
if ($[27] !== Icon || $[28] !== children || $[29] !== config?.submitCrossfade || $[30] !== iconKey) {
|
|
1877
|
-
t9 = children ?? (config?.submitCrossfade ? /*#__PURE__*/_jsx(CrossfadeIconSlot, {
|
|
1877
|
+
t9 = children ?? (config?.submitCrossfade ?? true ? /*#__PURE__*/_jsx(CrossfadeIconSlot, {
|
|
1878
1878
|
iconKey: iconKey,
|
|
1879
1879
|
children: Icon
|
|
1880
1880
|
}) : Icon);
|
|
@@ -5,10 +5,11 @@ import { useAnimOffscreenRef } from "../utils/runtimeVisibility.js";
|
|
|
5
5
|
import { useCn, useUiConfig } from "../ui/ui-config.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* `UiConfig.Shimmer`. `mode: "mask"` sweeps a masked copy of the
|
|
9
|
-
* compositor (no repaint per frame, paused offscreen) instead of
|
|
10
|
-
* `background-position
|
|
11
|
-
*
|
|
8
|
+
* `UiConfig.Shimmer`. `mode: "mask"` (default) sweeps a masked copy of the
|
|
9
|
+
* text on the compositor (no repaint per frame, paused offscreen) instead of
|
|
10
|
+
* animating a `background-position` (`mode: "gradient"`). The package CSS
|
|
11
|
+
* (`motion.css`) styles the default `shimmer-overlay`, `shimmer-band` and
|
|
12
|
+
* `shimmer-copy` classes; `classes.overlay`, `band` and `copy` replace them.
|
|
12
13
|
*/
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
function Shimmer(t0) {
|
|
@@ -35,7 +36,7 @@ function Shimmer(t0) {
|
|
|
35
36
|
const Component = as ?? config?.as ?? "span";
|
|
36
37
|
let t1;
|
|
37
38
|
if ($[4] !== Component || $[5] !== config?.mode || $[6] !== mode || $[7] !== props) {
|
|
38
|
-
t1 = (mode ?? config?.mode) === "mask" ? /*#__PURE__*/_jsx(MaskShimmer, {
|
|
39
|
+
t1 = (mode ?? config?.mode ?? "mask") === "mask" ? /*#__PURE__*/_jsx(MaskShimmer, {
|
|
39
40
|
as: Component,
|
|
40
41
|
...props
|
|
41
42
|
}) : /*#__PURE__*/_jsx(GradientShimmer, {
|
package/dist/src/client.js
CHANGED
|
@@ -147,6 +147,7 @@ export { useAppShellVariant } from "../shell/src/shell-variant.js";
|
|
|
147
147
|
export { popInShellPanelNextFrame, popOutShellPanel, toggleShellPanel } from "../shell/src/shell-panel-motion.js";
|
|
148
148
|
export { ButtonTrack, buttonTrackClass } from "../shell/src/ButtonTrack.js";
|
|
149
149
|
export { SidePanelTabs, popOutSidePanel, SIDE_PANEL_RAIL_WIDTH_PX, SIDE_PANEL_RAIL_LABELLED_WIDTH_PX } from "../shell/src/SidePanelTabs.js";
|
|
150
|
+
export { DockArrow, useDockArrow } from "../shell/src/DockArrow.js";
|
|
150
151
|
export { AppSidebar } from "../shell/src/AppSidebar.js";
|
|
151
152
|
export * from "../shell/src/Sidebar.js";
|
|
152
153
|
export { SidebarRail, RailTile, RailDivider, RailCollapseTile, shellDockTileProps, useInRailGroup } from "../shell/src/SidebarRail.js";
|
package/dist/src/index.js
CHANGED
|
@@ -148,6 +148,7 @@ export { useAppShellVariant } from "../shell/src/shell-variant.js";
|
|
|
148
148
|
export { popInShellPanelNextFrame, popOutShellPanel, toggleShellPanel } from "../shell/src/shell-panel-motion.js";
|
|
149
149
|
export { ButtonTrack, buttonTrackClass } from "../shell/src/ButtonTrack.js";
|
|
150
150
|
export { SidePanelTabs, popOutSidePanel, SIDE_PANEL_RAIL_WIDTH_PX, SIDE_PANEL_RAIL_LABELLED_WIDTH_PX } from "../shell/src/SidePanelTabs.js";
|
|
151
|
+
export { DockArrow, useDockArrow } from "../shell/src/DockArrow.js";
|
|
151
152
|
export { AppSidebar } from "../shell/src/AppSidebar.js";
|
|
152
153
|
export * from "../shell/src/Sidebar.js";
|
|
153
154
|
export { SidebarRail, RailTile, RailDivider, RailCollapseTile, shellDockTileProps, useInRailGroup } from "../shell/src/SidebarRail.js";
|