@alexgorbatchev/shadcn 0.0.18 → 0.0.19
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 +11 -7
- package/dist/{chunk-hhvp5352.js → chunk-0jb0xgdb.js} +1 -1
- package/dist/{chunk-yn3e9w1j.js → chunk-0q6mg89k.js} +1 -1
- package/dist/{chunk-jy6nfnbx.js → chunk-0zwxgwr4.js} +2 -2
- package/dist/{chunk-3esarnmt.js → chunk-155c0btb.js} +1 -1
- package/dist/{chunk-tsekdy3w.js → chunk-1tgrhacr.js} +12 -3
- package/dist/{chunk-7g39g3h8.js → chunk-2e4fnx0e.js} +1 -1
- package/dist/{chunk-0yqwq0ev.js → chunk-2qxy1r5y.js} +8 -8
- package/dist/{chunk-6aqm34nb.js → chunk-38kwkd1a.js} +2 -2
- package/dist/{chunk-xvs5y4v7.js → chunk-45kmek5e.js} +1 -1
- package/dist/{chunk-rrd9fsz6.js → chunk-6wvtsf2m.js} +4 -4
- package/dist/{chunk-zhnwybhq.js → chunk-717ggspf.js} +1 -1
- package/dist/{chunk-5h7vkgvz.js → chunk-82cw4kcg.js} +1 -1
- package/dist/{chunk-1hbge1cb.js → chunk-82vfgkjv.js} +1 -1
- package/dist/{chunk-c6nvc3ft.js → chunk-8x8yxf6x.js} +1 -1
- package/dist/{chunk-j5wk4ffj.js → chunk-aewjmzt9.js} +1 -1
- package/dist/{chunk-ets9h67e.js → chunk-akaezred.js} +2 -2
- package/dist/{chunk-34ndz1gf.js → chunk-c6b2cfw4.js} +1 -1
- package/dist/{chunk-fq8taatb.js → chunk-c900175p.js} +1 -1
- package/dist/{chunk-dnja1pz5.js → chunk-cre60717.js} +1 -1
- package/dist/{chunk-jwajmmfb.js → chunk-dppmqr99.js} +1 -1
- package/dist/{chunk-0xrvhezs.js → chunk-f73en61v.js} +1 -1
- package/dist/{chunk-0qcknj5n.js → chunk-f8758vjx.js} +2 -2
- package/dist/{chunk-avrh238b.js → chunk-fyb0b7bp.js} +1 -1
- package/dist/{chunk-1apg76a7.js → chunk-g7v9cqyg.js} +1 -1
- package/dist/{chunk-22678d2t.js → chunk-h46mdagy.js} +1 -1
- package/dist/{chunk-dd53t01w.js → chunk-k4vvp62d.js} +1 -1
- package/dist/{chunk-q9qm7skj.js → chunk-k89xxj12.js} +4 -4
- package/dist/{chunk-a6e11wj6.js → chunk-kc4mmrwk.js} +1 -1
- package/dist/{chunk-3hvpcsb4.js → chunk-qw7229kj.js} +1 -1
- package/dist/{chunk-ha24sd50.js → chunk-r3artnc9.js} +1 -1
- package/dist/{chunk-wwfj7ga3.js → chunk-r4fr62ca.js} +1 -1
- package/dist/{chunk-erpzgt57.js → chunk-s3b87adw.js} +1 -1
- package/dist/chunk-v4yqjvzd.js +114 -0
- package/dist/{chunk-fh3nme7f.js → chunk-vpj3vk7v.js} +1 -1
- package/dist/{chunk-4gby2v61.js → chunk-waat2ksf.js} +1 -1
- package/dist/{chunk-gknaq8ep.js → chunk-wxncy44f.js} +1 -1
- package/dist/{chunk-jxwfkmdh.js → chunk-x82x81th.js} +3 -3
- package/dist/{chunk-9zyam2cn.js → chunk-z5d2zpnj.js} +1 -1
- package/dist/{chunk-h77yk9sn.js → chunk-zhdp6qrb.js} +1 -1
- package/dist/components/ButtonLink.d.ts +12 -0
- package/dist/components/Card.d.ts +6 -2
- package/dist/components/DensityProvider.d.ts +9 -4
- package/dist/components/assistant-ui/elements/BackgroundInbox.js +2 -2
- package/dist/components/assistant-ui/elements/Chart.js +2 -2
- package/dist/components/assistant-ui/elements/CodeDiff.js +2 -2
- package/dist/components/assistant-ui/elements/CommandPalette.js +3 -3
- package/dist/components/assistant-ui/elements/DataTable.js +2 -2
- package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
- package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/FileTree.js +2 -2
- package/dist/components/assistant-ui/elements/FlowGraph.js +2 -2
- package/dist/components/assistant-ui/elements/GenerativeUi.js +4 -4
- package/dist/components/assistant-ui/elements/Image.js +2 -2
- package/dist/components/assistant-ui/elements/ImageGallery.js +2 -2
- package/dist/components/assistant-ui/elements/McpServerPanel.js +2 -2
- package/dist/components/assistant-ui/elements/MermaidDiagram.js +3 -3
- package/dist/components/assistant-ui/elements/MermaidZoom.js +2 -2
- package/dist/components/assistant-ui/elements/ModelPicker.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelector.js +9 -9
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +8 -8
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +3 -3
- package/dist/components/assistant-ui/index.js +29 -29
- package/dist/components/assistant-ui/native/AssistantModal.js +6 -6
- package/dist/components/assistant-ui/native/AssistantSidebar.js +5 -5
- package/dist/components/assistant-ui/native/AttachmentPreview.js +2 -2
- package/dist/components/assistant-ui/native/McpConfigDialog.js +2 -2
- package/dist/components/assistant-ui/native/MermaidDiagram.js +4 -4
- package/dist/components/assistant-ui/native/ModelSelector.js +11 -11
- package/dist/components/assistant-ui/native/Thread.js +4 -4
- package/dist/components/assistant-ui/native/ThreadList.js +1 -1
- package/dist/components/assistant-ui/native/ThreadListSidebar.js +3 -3
- package/dist/components/assistant-ui/native/index.js +23 -23
- package/dist/components/command/index.js +2 -2
- package/dist/hooks/useCardSpotlight.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +384 -342
- package/dist/theme.css +92 -16
- package/package.json +3 -3
- package/dist/chunk-fqekyjkh.js +0 -65
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# How it Really Works
|
|
17
17
|
|
|
18
18
|
1. The stylesheet supplies semantic tokens and base body styling. Your Tailwind build scans the installed package to generate component utilities. Font loading is optional; importing `fonts.css` serves JetBrains Mono through your app's asset pipeline.
|
|
19
|
-
2. Theme preference persists in browser local storage, and system mode follows the operating system color preference. The theme provider sets `data-theme` and `color-scheme` on the document root, so dialogs and menus share that palette. Use one provider per document. Density also follows components into their portals. A component's `density` prop overrides its own presentation; nest a `DensityProvider` to change a subtree and its popups together. `useTheme()` throws outside `ThemeProvider`.
|
|
19
|
+
2. Theme preference persists in browser local storage, and system mode follows the operating system color preference. The theme provider sets `data-theme` and `color-scheme` on the document root, so dialogs and menus share that palette. Use one provider per document. Density also follows components into their portals. A component's `density` prop overrides its own presentation; nest a `DensityProvider` to change a subtree and its popups together. A provider declares every density token, so its subtree keeps its density whatever an ancestor or a host page declares. It renders a `div` by default; pass `render`, such as `render={<section aria-label="Tools" className="flex gap-2" />}`, to make your own element the density root instead of adding a wrapper. `useTheme()` throws outside `ThemeProvider`.
|
|
20
20
|
3. Storybook's Theme and Density toolbars change the component examples. Docs backgrounds and example frames follow the selected palette; the preview starts in dark mode with comfortable density.
|
|
21
21
|
|
|
22
22
|
# Prerequisites
|
|
@@ -177,7 +177,7 @@ Override tokens after the theme imports. This example uses the existing success
|
|
|
177
177
|
|
|
178
178
|
| Area | Components |
|
|
179
179
|
| :----------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
-
| Actions and status | Alert, Badge, Button, ButtonGroup, Sonner, Toast, Toggle, ToggleGroup
|
|
180
|
+
| Actions and status | Alert, Badge, Button, ButtonGroup, ButtonLink, Sonner, Toast, Toggle, ToggleGroup |
|
|
181
181
|
| Forms and selections | Calendar, Checkbox, Combobox, Command, Field, Input, InputGroup, InputOTP, Label, NativeSelect, Questionnaire, RadioGroup, Select, Slider, Switch, Textarea |
|
|
182
182
|
| Structure and navigation | Accordion, AspectRatio, Avatar, Breadcrumb, Card, Carousel, Chart, Collapsible, Empty, Item, Kbd, Menubar, NavigationMenu, Pagination, Resizable, ScrollArea, Separator, Sidebar, Table, Tabs |
|
|
183
183
|
| Overlays | AlertDialog, ContextMenu, Dialog, Drawer, DropdownMenu, HoverCard, Popover, Sheet, Tooltip |
|
|
@@ -189,6 +189,8 @@ Use the composed parts exported from the package root, such as `DialogTrigger`,
|
|
|
189
189
|
|
|
190
190
|
`ScrollArea` supplies a native scroll viewport and one vertical `ScrollBar` by default. Set `scrollbars={<ScrollBar orientation="horizontal" />}` for a wide horizontal layout, or supply a fragment containing vertical and horizontal parts for both axes. The tracks stay outside the viewport and reserve their shared corner. `keepMounted` belongs to `ScrollBar`; root and track className callbacks receive native overflow/scroll state. Focus the viewport for native keyboard scrolling.
|
|
191
191
|
|
|
192
|
+
`ButtonLink` renders a native anchor with Button's `variant`, `size`, `align`, `truncate`, `fullWidth`, and `density` options, so navigation keeps the link role, Enter activation, and browser link behavior without `role="button"`. Pass `href` for a plain link, or a router link element through `render`, such as `<ButtonLink variant="outline" render={<Link to="/settings" />}>Settings</ButtonLink>`; class names, children, handlers, and refs merge with the rendered element. Its render callback receives typed slot and density state. Mark icons with `data-icon="inline-start"` or `data-icon="inline-end"` as in Button. Use `Button` for actions that do not navigate.
|
|
193
|
+
|
|
192
194
|
`Badge` renders a span by default. Use `render={<a href="https://base-ui.com/" />}` for navigation or a native button for actions; handlers and refs merge with the rendered element. Its render callback receives typed variant, density, and slot state. Mark icons with `data-icon="inline-start"` or `data-icon="inline-end"`; their spacing follows inline direction. Use the success and warning variants for those statuses.
|
|
193
195
|
|
|
194
196
|
Compose `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, and `CardFooter` inside `Card`. Use a native heading inside `CardTitle` when the title belongs in the document outline. The `size="sm"` option reduces spacing; density controls the base inset. A leading image meets the frame without top padding, and cards without footers retain bottom padding. The `--card-spacing` CSS variable adjusts both section gaps and insets.
|
|
@@ -221,7 +223,7 @@ For rendered HTML or Markdown output, import `@alexgorbatchev/shadcn/typeset.css
|
|
|
221
223
|
|
|
222
224
|
Compose data tables with the exported Table parts and `@tanstack/react-table@9.2.8`, installed directly in your app. `Table dir="rtl"` sets both column direction and the overflow container's reading edge; headers align to the inline start. The Table catalog demonstrates TanStack v9's native `useTable` with sorting, filtering, pagination, column visibility, selection across pages, and row actions that copy invoice IDs or open invoice details. Pass the checkbox's original event to the row-selection handler to retain Shift range selection. There is no separate `DataTable` export. Both the [TanStack v9 quick start](https://tanstack.com/table/latest/docs/framework/react/quick-start) and [shadcn composition guide](https://ui.shadcn.com/docs/components/base/data-table) use the v9 API.
|
|
223
225
|
|
|
224
|
-
Compose `Sidebar` and `SidebarInset` inside `SidebarProvider`. Use Header, Content, Group, Menu, and Footer parts to organize navigation, and `SidebarTrigger` or `SidebarRail` to toggle it. `useSidebar` exposes desktop and mobile state. Desktop collapse supports `offcanvas`, `icon`, and `none`; the mobile panel uses a titled Sheet with Escape dismissal and focus restoration. Menu buttons accept native custom elements through `render`; use anchors for navigation and keep their accessible text when collapsed. Cmd/Ctrl+B toggles the sidebar while focus is inside its provider. Set `open`/`onOpenChange` for controlled desktop state, or observe changes without supplying `open`. Persist changes in your application through `onOpenChange`, and restore them through `defaultOpen` or controlled `open`. Set widths through the typed `SidebarStyle` variables `--sidebar-width`, `--sidebar-width-mobile`, and `--sidebar-width-icon`.
|
|
226
|
+
Compose `Sidebar` and `SidebarInset` inside `SidebarProvider`. Use Header, Content, Group, Menu, and Footer parts to organize navigation, and `SidebarTrigger` or `SidebarRail` to toggle it. `useSidebar` exposes desktop and mobile state. Desktop collapse supports `offcanvas`, `icon`, and `none`; the mobile panel uses a titled Sheet with Escape dismissal and focus restoration. Menu buttons accept native custom elements through `render`; use anchors for navigation and keep their accessible text when collapsed. Cmd/Ctrl+B toggles the sidebar while focus is inside its provider. Set `open`/`onOpenChange` for controlled desktop state, or observe changes without supplying `open`. Persist changes in your application through `onOpenChange`, and restore them through `defaultOpen` or controlled `open`. Set widths through the typed `SidebarStyle` variables `--sidebar-width`, `--sidebar-width-mobile`, and `--sidebar-width-icon`. Sidebar colors follow the palette of the subtree they render in; set `--sidebar`, `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-primary-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, or `--sidebar-ring` to give the sidebar its own colors.
|
|
225
227
|
|
|
226
228
|
`InputOTP` uses one real input for typing, selection, paste, and autofill. Compose its visual slots inside `InputOTPGroup`; supply `maxLength` and an accessible label. Use `defaultValue` to initialize an uncontrolled code, or `value` and `onChange` to control it. Changing `defaultValue` after mounting preserves the current input. Import the OTP parts together from `@alexgorbatchev/shadcn/input-otp`; its bundled implementation owns their context. `Calendar` supports single, multiple, and range selection. `ResizablePanelGroup` sizes use explicit percentage strings such as `defaultSize="50%"`; numeric sizes are pixels. `CommandDialog` supplies the modal title and description; set `Command`'s `label` to name its search input.
|
|
227
229
|
|
|
@@ -331,17 +333,19 @@ The preview shows compact individual badges, up to five labels followed by `+N m
|
|
|
331
333
|
|
|
332
334
|
# Devhost Preview
|
|
333
335
|
|
|
334
|
-
The
|
|
336
|
+
The routed preview serves Storybook at `shadcn.localhost` through devhost. To use a different hostname, copy [.env.example](./.env.example) to `.env.local` and set `SHADCN_DEV_HOST_SUFFIX`; the Storybook host becomes `shadcn` followed by that suffix. Exported environment variables take precedence over `.env.local`, which stays untracked.
|
|
335
337
|
|
|
336
338
|
From this repository, start the configured Storybook service:
|
|
337
339
|
|
|
338
340
|
```sh
|
|
339
|
-
|
|
341
|
+
just run
|
|
340
342
|
```
|
|
341
343
|
|
|
342
|
-
|
|
344
|
+
`just run` loads `.env.local`, applies the `.localhost` default, and runs `devhost start`. Running `devhost start` directly requires `SHADCN_DEV_HOST_SUFFIX` in the environment; devhost rejects the manifest when it is undefined.
|
|
345
|
+
|
|
346
|
+
Open the hostname printed by devhost over HTTPS. The manifest allocates a port automatically and serves Storybook through the shared devhost HTTPS proxy. The hostname must resolve to the machine running devhost, and the managed Caddy instance must be running (`devhost caddy start`).
|
|
343
347
|
|
|
344
|
-
Storybook binds to IPv4 loopback and allows the configured hostname in both Storybook and Vite. Caddy listens on all interfaces and serves HTTP as well as HTTPS, so the external devbox gateway can reach it. The direct `
|
|
348
|
+
Storybook binds to IPv4 loopback and allows the configured hostname in both Storybook and Vite. Caddy listens on all interfaces and serves HTTP as well as HTTPS, so the external devbox gateway can reach it. The direct `just storybook` preview remains available on `127.0.0.1:6006`.
|
|
345
349
|
|
|
346
350
|
# Troubleshooting
|
|
347
351
|
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
SidebarMenu2,
|
|
11
11
|
SidebarMenuItem2,
|
|
12
12
|
SidebarMenuButton2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-45kmek5e.js";
|
|
14
14
|
import {
|
|
15
15
|
ThreadList3
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-1tgrhacr.js";
|
|
17
17
|
|
|
18
18
|
// src/components/assistant-ui/native/ThreadListSidebar.tsx
|
|
19
19
|
import { MessagesSquare } from "lucide-react";
|
|
@@ -301,6 +301,7 @@ var ThreadListItemRename = ({ onDone }) => {
|
|
|
301
301
|
const [value, setValue] = useState(title);
|
|
302
302
|
const inputRef = useRef(null);
|
|
303
303
|
const settledRef = useRef(false);
|
|
304
|
+
const keyboardActionRef = useRef(null);
|
|
304
305
|
useEffect(() => {
|
|
305
306
|
inputRef.current?.select();
|
|
306
307
|
}, []);
|
|
@@ -332,16 +333,24 @@ var ThreadListItemRename = ({ onDone }) => {
|
|
|
332
333
|
"aria-label": "Rename thread",
|
|
333
334
|
value,
|
|
334
335
|
onChange: (event) => setValue(event.target.value),
|
|
335
|
-
onBlur: () =>
|
|
336
|
+
onBlur: () => {
|
|
337
|
+
if (keyboardActionRef.current === "cancel")
|
|
338
|
+
cancel();
|
|
339
|
+
else
|
|
340
|
+
commit(keyboardActionRef.current === "commit");
|
|
341
|
+
keyboardActionRef.current = null;
|
|
342
|
+
},
|
|
336
343
|
onKeyDown: (event) => {
|
|
337
344
|
if (event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229)
|
|
338
345
|
return;
|
|
339
346
|
if (event.key === "Enter") {
|
|
340
347
|
event.preventDefault();
|
|
341
|
-
commit
|
|
348
|
+
keyboardActionRef.current = "commit";
|
|
349
|
+
event.currentTarget.blur();
|
|
342
350
|
} else if (event.key === "Escape") {
|
|
343
351
|
event.preventDefault();
|
|
344
|
-
cancel
|
|
352
|
+
keyboardActionRef.current = "cancel";
|
|
353
|
+
event.currentTarget.blur();
|
|
345
354
|
}
|
|
346
355
|
}
|
|
347
356
|
});
|
|
@@ -12,31 +12,31 @@ import {
|
|
|
12
12
|
} from "./chunk-h8awhm19.js";
|
|
13
13
|
import {
|
|
14
14
|
ModelSelectorFocusAnchor2
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-82vfgkjv.js";
|
|
16
16
|
import {
|
|
17
17
|
ModelSelectorSearch2
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-0jb0xgdb.js";
|
|
19
19
|
import {
|
|
20
20
|
ModelSelectorEmpty2
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-cre60717.js";
|
|
22
22
|
import {
|
|
23
23
|
ModelSelectorItem2
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-vpj3vk7v.js";
|
|
25
25
|
import {
|
|
26
26
|
ModelSelectorList2
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-x82x81th.js";
|
|
28
28
|
import {
|
|
29
29
|
ModelSelectorEffort2
|
|
30
30
|
} from "./chunk-r07v9c4f.js";
|
|
31
31
|
import {
|
|
32
32
|
ModelSelectorContent2
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-6wvtsf2m.js";
|
|
34
34
|
import {
|
|
35
35
|
ModelSelectorGroup2
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-dppmqr99.js";
|
|
37
37
|
import {
|
|
38
38
|
ModelSelectorSeparator2
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-k4vvp62d.js";
|
|
40
40
|
|
|
41
41
|
// src/components/assistant-ui/native/ModelSelector.tsx
|
|
42
42
|
import { memo, useEffect } from "react";
|
|
@@ -9,12 +9,12 @@ import {
|
|
|
9
9
|
} from "./chunk-q40gqpwh.js";
|
|
10
10
|
import {
|
|
11
11
|
Thread2
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-f8758vjx.js";
|
|
13
13
|
import {
|
|
14
14
|
ThreadListSearch2,
|
|
15
15
|
ThreadListRoot2,
|
|
16
16
|
ThreadListItems2
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-1tgrhacr.js";
|
|
18
18
|
|
|
19
19
|
// src/components/assistant-ui/native/AssistantModal.tsx
|
|
20
20
|
import { BotIcon, ChevronDownIcon, HistoryIcon, PlusIcon } from "lucide-react";
|
|
@@ -528,7 +528,7 @@ var sidebarMenuButtonVariants = cva("peer/menu-button group/menu-button flex w-f
|
|
|
528
528
|
variants: {
|
|
529
529
|
variant: {
|
|
530
530
|
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
531
|
-
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
531
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border,var(--border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent,var(--accent))]"
|
|
532
532
|
},
|
|
533
533
|
size: {
|
|
534
534
|
default: "h-control text-sm",
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
} from "./chunk-x7z9jzyf.js";
|
|
5
5
|
import {
|
|
6
6
|
Command2
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-waat2ksf.js";
|
|
8
8
|
import {
|
|
9
9
|
useModelSelectorContext
|
|
10
10
|
} from "./chunk-ydfx8r6d.js";
|
|
11
11
|
import {
|
|
12
12
|
ModelSelectorFocusAnchor2
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-82vfgkjv.js";
|
|
14
14
|
import {
|
|
15
15
|
ModelSelectorSearch2
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-0jb0xgdb.js";
|
|
17
17
|
import {
|
|
18
18
|
ModelSelectorList2
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-x82x81th.js";
|
|
20
20
|
import {
|
|
21
21
|
ModelSelectorEffort2
|
|
22
22
|
} from "./chunk-r07v9c4f.js";
|
|
@@ -68,7 +68,7 @@ function DialogContent2({
|
|
|
68
68
|
dir: direction,
|
|
69
69
|
"data-density": resolvedDensity,
|
|
70
70
|
"data-slot": "dialog-content",
|
|
71
|
-
className: (state) => cn2("fixed grid w-full gap-panel bg-popover p-panel text-sm text-popover-foreground border border-frame-edge shadow-frame duration-120 outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none", size === "fullscreen" ? "inset-0 h-dvh max-h-dvh max-w-none rounded-none" : cn2("top-1/2 left-1/2 max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-md", size === "wide" ? "sm:max-w-xl" : size === "narrow" ? "sm:max-w-48" : "sm:max-w-sm"), typeof className === "function" ? className(state) : className),
|
|
71
|
+
className: (state) => cn2("fixed grid w-full gap-panel overflow-y-auto overscroll-contain bg-popover p-panel text-sm text-popover-foreground border border-frame-edge shadow-frame duration-120 outline-none data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none", size === "fullscreen" ? "inset-0 h-dvh max-h-dvh max-w-none rounded-none" : cn2("top-1/2 left-1/2 max-h-[calc(100dvh-2rem)] max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 rounded-md", size === "wide" ? "sm:max-w-xl" : size === "narrow" ? "sm:max-w-48" : "sm:max-w-sm"), typeof className === "function" ? className(state) : className),
|
|
72
72
|
...props,
|
|
73
73
|
children: [
|
|
74
74
|
children,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MermaidZoom2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-r4fr62ca.js";
|
|
4
4
|
import {
|
|
5
5
|
MermaidDiagram3
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-0q6mg89k.js";
|
|
7
7
|
|
|
8
8
|
// src/components/assistant-ui/native/MermaidDiagram.tsx
|
|
9
9
|
import { memo } from "react";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
UserMessageAttachments2,
|
|
18
18
|
ComposerAttachments3,
|
|
19
19
|
ComposerAddAttachment2
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-aewjmzt9.js";
|
|
21
21
|
import {
|
|
22
22
|
getFileHref,
|
|
23
23
|
File2
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-c2vcrwjp.js";
|
|
28
28
|
import {
|
|
29
29
|
Image2
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-g7v9cqyg.js";
|
|
31
31
|
import {
|
|
32
32
|
MarkdownText2
|
|
33
33
|
} from "./chunk-q2ewq67a.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn2
|
|
3
|
-
} from "./chunk-cp2m7y7v.js";
|
|
4
1
|
import {
|
|
5
2
|
Card2,
|
|
6
3
|
CardHeader2,
|
|
7
4
|
CardTitle2,
|
|
8
5
|
CardDescription2,
|
|
9
6
|
CardContent2
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-v4yqjvzd.js";
|
|
8
|
+
import {
|
|
9
|
+
cn2
|
|
10
|
+
} from "./chunk-cp2m7y7v.js";
|
|
11
11
|
import {
|
|
12
12
|
Chart3,
|
|
13
13
|
ChartTooltipContent2,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn2
|
|
3
|
+
} from "./chunk-cp2m7y7v.js";
|
|
4
|
+
|
|
5
|
+
// src/components/Card.tsx
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
|
|
9
|
+
// src/hooks/useCardSpotlight.ts
|
|
10
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
11
|
+
var SPOTLIGHT_X = "--card-spotlight-x";
|
|
12
|
+
var SPOTLIGHT_Y = "--card-spotlight-y";
|
|
13
|
+
function useCardSpotlight() {
|
|
14
|
+
const frameRef = useRef(0);
|
|
15
|
+
const pointerRef = useRef({ clientX: 0, clientY: 0 });
|
|
16
|
+
useEffect(() => () => cancelAnimationFrame(frameRef.current), []);
|
|
17
|
+
const onPointerMove = useCallback((event) => {
|
|
18
|
+
pointerRef.current = { clientX: event.clientX, clientY: event.clientY };
|
|
19
|
+
if (frameRef.current !== 0) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const element = event.currentTarget;
|
|
23
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
24
|
+
frameRef.current = 0;
|
|
25
|
+
const { clientX, clientY } = pointerRef.current;
|
|
26
|
+
const bounds = element.getBoundingClientRect();
|
|
27
|
+
element.style.setProperty(SPOTLIGHT_X, `${Math.round(clientX - bounds.left)}px`);
|
|
28
|
+
element.style.setProperty(SPOTLIGHT_Y, `${Math.round(clientY - bounds.top)}px`);
|
|
29
|
+
});
|
|
30
|
+
}, []);
|
|
31
|
+
const onPointerLeave = useCallback((event) => {
|
|
32
|
+
cancelAnimationFrame(frameRef.current);
|
|
33
|
+
frameRef.current = 0;
|
|
34
|
+
event.currentTarget.style.removeProperty(SPOTLIGHT_X);
|
|
35
|
+
event.currentTarget.style.removeProperty(SPOTLIGHT_Y);
|
|
36
|
+
}, []);
|
|
37
|
+
return { onPointerMove, onPointerLeave };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/components/Card.tsx
|
|
41
|
+
import { jsx } from "react/jsx-runtime";
|
|
42
|
+
var cardVariants = cva("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-md bg-card py-(--card-spacing) text-sm text-card-foreground border [--card-spacing:var(--ag-panel-padding)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:var(--ag-panel-padding-sm)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-md *:[img:last-child]:rounded-b-md", {
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
default: "border-border",
|
|
46
|
+
hero: "card-spotlight"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
defaultVariants: {
|
|
50
|
+
variant: "default"
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
function Card2({ density, className, size = "default", variant = "default", ...props }) {
|
|
54
|
+
const spotlight = useCardSpotlight();
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
"data-density": density,
|
|
57
|
+
"data-slot": "card",
|
|
58
|
+
"data-size": size,
|
|
59
|
+
...mergeProps({
|
|
60
|
+
className: cn2(cardVariants({ variant }), className),
|
|
61
|
+
...variant === "hero" ? spotlight : undefined
|
|
62
|
+
}, props)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function CardHeader2({ density, className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx("div", {
|
|
67
|
+
"data-density": density,
|
|
68
|
+
"data-slot": "card-header",
|
|
69
|
+
className: cn2("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-md px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function CardTitle2({ density, className, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx("div", {
|
|
75
|
+
"data-density": density,
|
|
76
|
+
"data-slot": "card-title",
|
|
77
|
+
className: cn2("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className),
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function CardDescription2({ density, className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx("div", {
|
|
83
|
+
"data-density": density,
|
|
84
|
+
"data-slot": "card-description",
|
|
85
|
+
className: cn2("text-sm text-muted-foreground", className),
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function CardAction2({ density, className, ...props }) {
|
|
90
|
+
return /* @__PURE__ */ jsx("div", {
|
|
91
|
+
"data-density": density,
|
|
92
|
+
"data-slot": "card-action",
|
|
93
|
+
className: cn2("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function CardContent2({ density, className, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsx("div", {
|
|
99
|
+
"data-density": density,
|
|
100
|
+
"data-slot": "card-content",
|
|
101
|
+
className: cn2("px-(--card-spacing)", className),
|
|
102
|
+
...props
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function CardFooter2({ density, className, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx("div", {
|
|
107
|
+
"data-density": density,
|
|
108
|
+
"data-slot": "card-footer",
|
|
109
|
+
className: cn2("flex items-center rounded-b-md border-t bg-muted/50 p-(--card-spacing)", className),
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { Card2, CardHeader2, CardTitle2, CardDescription2, CardAction2, CardContent2, CardFooter2 };
|