@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.
Files changed (87) hide show
  1. package/README.md +11 -7
  2. package/dist/{chunk-hhvp5352.js → chunk-0jb0xgdb.js} +1 -1
  3. package/dist/{chunk-yn3e9w1j.js → chunk-0q6mg89k.js} +1 -1
  4. package/dist/{chunk-jy6nfnbx.js → chunk-0zwxgwr4.js} +2 -2
  5. package/dist/{chunk-3esarnmt.js → chunk-155c0btb.js} +1 -1
  6. package/dist/{chunk-tsekdy3w.js → chunk-1tgrhacr.js} +12 -3
  7. package/dist/{chunk-7g39g3h8.js → chunk-2e4fnx0e.js} +1 -1
  8. package/dist/{chunk-0yqwq0ev.js → chunk-2qxy1r5y.js} +8 -8
  9. package/dist/{chunk-6aqm34nb.js → chunk-38kwkd1a.js} +2 -2
  10. package/dist/{chunk-xvs5y4v7.js → chunk-45kmek5e.js} +1 -1
  11. package/dist/{chunk-rrd9fsz6.js → chunk-6wvtsf2m.js} +4 -4
  12. package/dist/{chunk-zhnwybhq.js → chunk-717ggspf.js} +1 -1
  13. package/dist/{chunk-5h7vkgvz.js → chunk-82cw4kcg.js} +1 -1
  14. package/dist/{chunk-1hbge1cb.js → chunk-82vfgkjv.js} +1 -1
  15. package/dist/{chunk-c6nvc3ft.js → chunk-8x8yxf6x.js} +1 -1
  16. package/dist/{chunk-j5wk4ffj.js → chunk-aewjmzt9.js} +1 -1
  17. package/dist/{chunk-ets9h67e.js → chunk-akaezred.js} +2 -2
  18. package/dist/{chunk-34ndz1gf.js → chunk-c6b2cfw4.js} +1 -1
  19. package/dist/{chunk-fq8taatb.js → chunk-c900175p.js} +1 -1
  20. package/dist/{chunk-dnja1pz5.js → chunk-cre60717.js} +1 -1
  21. package/dist/{chunk-jwajmmfb.js → chunk-dppmqr99.js} +1 -1
  22. package/dist/{chunk-0xrvhezs.js → chunk-f73en61v.js} +1 -1
  23. package/dist/{chunk-0qcknj5n.js → chunk-f8758vjx.js} +2 -2
  24. package/dist/{chunk-avrh238b.js → chunk-fyb0b7bp.js} +1 -1
  25. package/dist/{chunk-1apg76a7.js → chunk-g7v9cqyg.js} +1 -1
  26. package/dist/{chunk-22678d2t.js → chunk-h46mdagy.js} +1 -1
  27. package/dist/{chunk-dd53t01w.js → chunk-k4vvp62d.js} +1 -1
  28. package/dist/{chunk-q9qm7skj.js → chunk-k89xxj12.js} +4 -4
  29. package/dist/{chunk-a6e11wj6.js → chunk-kc4mmrwk.js} +1 -1
  30. package/dist/{chunk-3hvpcsb4.js → chunk-qw7229kj.js} +1 -1
  31. package/dist/{chunk-ha24sd50.js → chunk-r3artnc9.js} +1 -1
  32. package/dist/{chunk-wwfj7ga3.js → chunk-r4fr62ca.js} +1 -1
  33. package/dist/{chunk-erpzgt57.js → chunk-s3b87adw.js} +1 -1
  34. package/dist/chunk-v4yqjvzd.js +114 -0
  35. package/dist/{chunk-fh3nme7f.js → chunk-vpj3vk7v.js} +1 -1
  36. package/dist/{chunk-4gby2v61.js → chunk-waat2ksf.js} +1 -1
  37. package/dist/{chunk-gknaq8ep.js → chunk-wxncy44f.js} +1 -1
  38. package/dist/{chunk-jxwfkmdh.js → chunk-x82x81th.js} +3 -3
  39. package/dist/{chunk-9zyam2cn.js → chunk-z5d2zpnj.js} +1 -1
  40. package/dist/{chunk-h77yk9sn.js → chunk-zhdp6qrb.js} +1 -1
  41. package/dist/components/ButtonLink.d.ts +12 -0
  42. package/dist/components/Card.d.ts +6 -2
  43. package/dist/components/DensityProvider.d.ts +9 -4
  44. package/dist/components/assistant-ui/elements/BackgroundInbox.js +2 -2
  45. package/dist/components/assistant-ui/elements/Chart.js +2 -2
  46. package/dist/components/assistant-ui/elements/CodeDiff.js +2 -2
  47. package/dist/components/assistant-ui/elements/CommandPalette.js +3 -3
  48. package/dist/components/assistant-ui/elements/DataTable.js +2 -2
  49. package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
  50. package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
  51. package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
  52. package/dist/components/assistant-ui/elements/FileTree.js +2 -2
  53. package/dist/components/assistant-ui/elements/FlowGraph.js +2 -2
  54. package/dist/components/assistant-ui/elements/GenerativeUi.js +4 -4
  55. package/dist/components/assistant-ui/elements/Image.js +2 -2
  56. package/dist/components/assistant-ui/elements/ImageGallery.js +2 -2
  57. package/dist/components/assistant-ui/elements/McpServerPanel.js +2 -2
  58. package/dist/components/assistant-ui/elements/MermaidDiagram.js +3 -3
  59. package/dist/components/assistant-ui/elements/MermaidZoom.js +2 -2
  60. package/dist/components/assistant-ui/elements/ModelPicker.js +2 -2
  61. package/dist/components/assistant-ui/elements/ModelSelector.js +9 -9
  62. package/dist/components/assistant-ui/elements/ModelSelectorContent.js +8 -8
  63. package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +3 -3
  64. package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +3 -3
  65. package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +3 -3
  66. package/dist/components/assistant-ui/elements/ModelSelectorItem.js +3 -3
  67. package/dist/components/assistant-ui/elements/ModelSelectorList.js +5 -5
  68. package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +3 -3
  69. package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +3 -3
  70. package/dist/components/assistant-ui/index.js +29 -29
  71. package/dist/components/assistant-ui/native/AssistantModal.js +6 -6
  72. package/dist/components/assistant-ui/native/AssistantSidebar.js +5 -5
  73. package/dist/components/assistant-ui/native/AttachmentPreview.js +2 -2
  74. package/dist/components/assistant-ui/native/McpConfigDialog.js +2 -2
  75. package/dist/components/assistant-ui/native/MermaidDiagram.js +4 -4
  76. package/dist/components/assistant-ui/native/ModelSelector.js +11 -11
  77. package/dist/components/assistant-ui/native/Thread.js +4 -4
  78. package/dist/components/assistant-ui/native/ThreadList.js +1 -1
  79. package/dist/components/assistant-ui/native/ThreadListSidebar.js +3 -3
  80. package/dist/components/assistant-ui/native/index.js +23 -23
  81. package/dist/components/command/index.js +2 -2
  82. package/dist/hooks/useCardSpotlight.d.ts +7 -0
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.js +384 -342
  85. package/dist/theme.css +92 -16
  86. package/package.json +3 -3
  87. 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 manifest uses `shadcn.example.com` as a documentation placeholder. Before using the routed preview, replace both `services.storybook.host` and `services.storybook.env.__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS` in `devhost.toml` with your locally configured hostname. Keep private hostnames out of commits.
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
- devhost start
341
+ just run
340
342
  ```
341
343
 
342
- Open your configured hostname 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`).
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 `bun run storybook` preview remains available on `127.0.0.1:6006`.
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
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandInput2
3
- } from "./chunk-4gby2v61.js";
3
+ } from "./chunk-waat2ksf.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorSearch.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  MermaidSvg,
6
6
  MermaidZoom2
7
- } from "./chunk-wwfj7ga3.js";
7
+ } from "./chunk-r4fr62ca.js";
8
8
 
9
9
  // src/components/assistant-ui/elements/MermaidDiagram.tsx
10
10
  import { useMemo } from "react";
@@ -10,10 +10,10 @@ import {
10
10
  SidebarMenu2,
11
11
  SidebarMenuItem2,
12
12
  SidebarMenuButton2
13
- } from "./chunk-xvs5y4v7.js";
13
+ } from "./chunk-45kmek5e.js";
14
14
  import {
15
15
  ThreadList3
16
- } from "./chunk-tsekdy3w.js";
16
+ } from "./chunk-1tgrhacr.js";
17
17
 
18
18
  // src/components/assistant-ui/native/ThreadListSidebar.tsx
19
19
  import { MessagesSquare } from "lucide-react";
@@ -8,7 +8,7 @@ import {
8
8
  Dialog2,
9
9
  DialogContent2,
10
10
  DialogTitle2
11
- } from "./chunk-zhnwybhq.js";
11
+ } from "./chunk-717ggspf.js";
12
12
  import {
13
13
  safeHref
14
14
  } from "./chunk-xhtsnwnb.js";
@@ -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: () => commit(false),
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(true);
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
  });
@@ -4,7 +4,7 @@ import {
4
4
  CardTitle2,
5
5
  CardDescription2,
6
6
  CardContent2
7
- } from "./chunk-fqekyjkh.js";
7
+ } from "./chunk-v4yqjvzd.js";
8
8
  import {
9
9
  take
10
10
  } from "./chunk-v8ks0cfq.js";
@@ -12,31 +12,31 @@ import {
12
12
  } from "./chunk-h8awhm19.js";
13
13
  import {
14
14
  ModelSelectorFocusAnchor2
15
- } from "./chunk-1hbge1cb.js";
15
+ } from "./chunk-82vfgkjv.js";
16
16
  import {
17
17
  ModelSelectorSearch2
18
- } from "./chunk-hhvp5352.js";
18
+ } from "./chunk-0jb0xgdb.js";
19
19
  import {
20
20
  ModelSelectorEmpty2
21
- } from "./chunk-dnja1pz5.js";
21
+ } from "./chunk-cre60717.js";
22
22
  import {
23
23
  ModelSelectorItem2
24
- } from "./chunk-fh3nme7f.js";
24
+ } from "./chunk-vpj3vk7v.js";
25
25
  import {
26
26
  ModelSelectorList2
27
- } from "./chunk-jxwfkmdh.js";
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-rrd9fsz6.js";
33
+ } from "./chunk-6wvtsf2m.js";
34
34
  import {
35
35
  ModelSelectorGroup2
36
- } from "./chunk-jwajmmfb.js";
36
+ } from "./chunk-dppmqr99.js";
37
37
  import {
38
38
  ModelSelectorSeparator2
39
- } from "./chunk-dd53t01w.js";
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-0qcknj5n.js";
12
+ } from "./chunk-f8758vjx.js";
13
13
  import {
14
14
  ThreadListSearch2,
15
15
  ThreadListRoot2,
16
16
  ThreadListItems2
17
- } from "./chunk-tsekdy3w.js";
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-4gby2v61.js";
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-1hbge1cb.js";
13
+ } from "./chunk-82vfgkjv.js";
14
14
  import {
15
15
  ModelSelectorSearch2
16
- } from "./chunk-hhvp5352.js";
16
+ } from "./chunk-0jb0xgdb.js";
17
17
  import {
18
18
  ModelSelectorList2
19
- } from "./chunk-jxwfkmdh.js";
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,
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  Card2,
6
6
  CardContent2
7
- } from "./chunk-fqekyjkh.js";
7
+ } from "./chunk-v4yqjvzd.js";
8
8
  import {
9
9
  FieldSet2,
10
10
  FieldLegend2,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandInput2
3
- } from "./chunk-4gby2v61.js";
3
+ } from "./chunk-waat2ksf.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorFocusAnchor.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-1x2ch0xc.js";
6
6
  import {
7
7
  Thread2
8
- } from "./chunk-0qcknj5n.js";
8
+ } from "./chunk-f8758vjx.js";
9
9
 
10
10
  // src/components/assistant-ui/native/AssistantSidebar.tsx
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -12,7 +12,7 @@ import {
12
12
  DialogTrigger2,
13
13
  DialogContent2,
14
14
  DialogTitle2
15
- } from "./chunk-zhnwybhq.js";
15
+ } from "./chunk-717ggspf.js";
16
16
  import {
17
17
  Avatar2,
18
18
  AvatarImage2,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  MermaidZoom2
3
- } from "./chunk-wwfj7ga3.js";
3
+ } from "./chunk-r4fr62ca.js";
4
4
  import {
5
5
  MermaidDiagram3
6
- } from "./chunk-yn3e9w1j.js";
6
+ } from "./chunk-0q6mg89k.js";
7
7
 
8
8
  // src/components/assistant-ui/native/MermaidDiagram.tsx
9
9
  import { memo } from "react";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-h8awhm19.js";
7
7
  import {
8
8
  ModelSelectorContent2
9
- } from "./chunk-rrd9fsz6.js";
9
+ } from "./chunk-6wvtsf2m.js";
10
10
 
11
11
  // src/components/assistant-ui/elements/ModelSelector.tsx
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  Card2,
6
6
  CardContent2
7
- } from "./chunk-fqekyjkh.js";
7
+ } from "./chunk-v4yqjvzd.js";
8
8
  import {
9
9
  take
10
10
  } from "./chunk-v8ks0cfq.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandEmpty2
3
- } from "./chunk-4gby2v61.js";
3
+ } from "./chunk-waat2ksf.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorEmpty.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandGroup2
3
- } from "./chunk-4gby2v61.js";
3
+ } from "./chunk-waat2ksf.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorGroup.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-73rkr9ct.js";
13
13
  import {
14
14
  Card2
15
- } from "./chunk-fqekyjkh.js";
15
+ } from "./chunk-v4yqjvzd.js";
16
16
  import {
17
17
  Table2,
18
18
  TableHeader2,
@@ -17,7 +17,7 @@ import {
17
17
  UserMessageAttachments2,
18
18
  ComposerAttachments3,
19
19
  ComposerAddAttachment2
20
- } from "./chunk-j5wk4ffj.js";
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-1apg76a7.js";
30
+ } from "./chunk-g7v9cqyg.js";
31
31
  import {
32
32
  MarkdownText2
33
33
  } from "./chunk-q2ewq67a.js";
@@ -5,7 +5,7 @@ import {
5
5
  Card2,
6
6
  CardContent2,
7
7
  CardFooter2
8
- } from "./chunk-fqekyjkh.js";
8
+ } from "./chunk-v4yqjvzd.js";
9
9
  import {
10
10
  Field2,
11
11
  FieldLabel2
@@ -9,7 +9,7 @@ import {
9
9
  DialogTrigger2,
10
10
  DialogContent2,
11
11
  DialogTitle2
12
- } from "./chunk-zhnwybhq.js";
12
+ } from "./chunk-717ggspf.js";
13
13
  import {
14
14
  safeHref,
15
15
  hostOf
@@ -15,7 +15,7 @@ import {
15
15
  DialogHeader2,
16
16
  DialogTitle2,
17
17
  DialogDescription2
18
- } from "./chunk-zhnwybhq.js";
18
+ } from "./chunk-717ggspf.js";
19
19
  import {
20
20
  Input2
21
21
  } from "./chunk-59p19t57.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandSeparator2
3
- } from "./chunk-4gby2v61.js";
3
+ } from "./chunk-waat2ksf.js";
4
4
 
5
5
  // src/components/assistant-ui/elements/ModelSelectorSeparator.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -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-fqekyjkh.js";
7
+ } from "./chunk-v4yqjvzd.js";
8
+ import {
9
+ cn2
10
+ } from "./chunk-cp2m7y7v.js";
11
11
  import {
12
12
  Chart3,
13
13
  ChartTooltipContent2,
@@ -7,7 +7,7 @@ import {
7
7
  CardTitle2,
8
8
  CardDescription2,
9
9
  CardContent2
10
- } from "./chunk-fqekyjkh.js";
10
+ } from "./chunk-v4yqjvzd.js";
11
11
 
12
12
  // src/components/assistant-ui/elements/BackgroundInbox.tsx
13
13
  import { CheckIcon, Loader2Icon, XIcon } from "lucide-react";
@@ -25,7 +25,7 @@ import {
25
25
  CardDescription2,
26
26
  CardContent2,
27
27
  CardFooter2
28
- } from "./chunk-fqekyjkh.js";
28
+ } from "./chunk-v4yqjvzd.js";
29
29
  import {
30
30
  Switch2
31
31
  } from "./chunk-8ye0k6z7.js";
@@ -6,7 +6,7 @@ import {
6
6
  CommandGroup2,
7
7
  CommandItem2,
8
8
  CommandShortcut2
9
- } from "./chunk-4gby2v61.js";
9
+ } from "./chunk-waat2ksf.js";
10
10
  import {
11
11
  Kbd2
12
12
  } from "./chunk-vyve5wf3.js";
@@ -9,7 +9,7 @@ import {
9
9
  DialogTrigger2,
10
10
  DialogContent2,
11
11
  DialogTitle2
12
- } from "./chunk-zhnwybhq.js";
12
+ } from "./chunk-717ggspf.js";
13
13
 
14
14
  // src/components/assistant-ui/elements/MermaidZoom.tsx
15
15
  import { useRef, useState as useState2 } from "react";
@@ -7,7 +7,7 @@ import {
7
7
  CardTitle2,
8
8
  CardDescription2,
9
9
  CardContent2
10
- } from "./chunk-fqekyjkh.js";
10
+ } from "./chunk-v4yqjvzd.js";
11
11
  import {
12
12
  codeScroll,
13
13
  codeSurface
@@ -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 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommandItem2
3
- } from "./chunk-4gby2v61.js";
3
+ } from "./chunk-waat2ksf.js";
4
4
  import {
5
5
  useModelSelectorContext
6
6
  } from "./chunk-ydfx8r6d.js";
@@ -7,7 +7,7 @@ import {
7
7
  DialogHeader2,
8
8
  DialogTitle2,
9
9
  DialogDescription2
10
- } from "./chunk-zhnwybhq.js";
10
+ } from "./chunk-717ggspf.js";
11
11
  import {
12
12
  InputGroup2,
13
13
  InputGroupAddon2,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ds65prb9.js";
4
4
  import {
5
5
  MermaidDiagram3
6
- } from "./chunk-yn3e9w1j.js";
6
+ } from "./chunk-0q6mg89k.js";
7
7
 
8
8
  // src/components/assistant-ui/elements/GenerativeUi.tsx
9
9
  import ReactMarkdown from "react-markdown";