@alexgorbatchev/shadcn 0.0.17 → 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 (88) 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-299wvwy8.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-r9mng3ws.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-5ntb7p4q.js → chunk-f8758vjx.js} +38 -18
  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.d.ts +9 -3
  78. package/dist/components/assistant-ui/native/Thread.js +4 -4
  79. package/dist/components/assistant-ui/native/ThreadList.js +1 -1
  80. package/dist/components/assistant-ui/native/ThreadListSidebar.js +3 -3
  81. package/dist/components/assistant-ui/native/index.js +23 -23
  82. package/dist/components/command/index.js +2 -2
  83. package/dist/hooks/useCardSpotlight.d.ts +7 -0
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.js +384 -342
  86. package/dist/theme.css +92 -16
  87. package/package.json +3 -3
  88. 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-5ntb7p4q.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-5ntb7p4q.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";
@@ -157,7 +157,9 @@ var ThreadHistorySkeleton = () => /* @__PURE__ */ jsxs("div", {
157
157
  function Thread2({
158
158
  components = EMPTY_COMPONENTS,
159
159
  autoFocus = true,
160
- emptyComposerPosition = "center"
160
+ emptyComposerPosition = "center",
161
+ viewportProps,
162
+ composerInputRef
161
163
  }) {
162
164
  const isEmpty = useAuiState(isNewChatView);
163
165
  return /* @__PURE__ */ jsx(ThreadComponentsContext.Provider, {
@@ -165,11 +167,19 @@ function Thread2({
165
167
  children: /* @__PURE__ */ jsx(ThreadRoot, {
166
168
  isEmpty,
167
169
  autoFocus,
168
- emptyComposerPosition
170
+ emptyComposerPosition,
171
+ viewportProps,
172
+ composerInputRef
169
173
  })
170
174
  });
171
175
  }
172
- var ThreadRoot = ({ isEmpty, autoFocus, emptyComposerPosition }) => {
176
+ var ThreadRoot = ({
177
+ isEmpty,
178
+ autoFocus,
179
+ emptyComposerPosition,
180
+ viewportProps,
181
+ composerInputRef
182
+ }) => {
173
183
  const { Welcome = ThreadWelcome } = useContext(ThreadComponentsContext);
174
184
  const isCentered = isEmpty && emptyComposerPosition === "center";
175
185
  return /* @__PURE__ */ jsx(ThreadPrimitive.Root, {
@@ -178,6 +188,7 @@ var ThreadRoot = ({ isEmpty, autoFocus, emptyComposerPosition }) => {
178
188
  }),
179
189
  children: /* @__PURE__ */ jsx(ThreadPrimitive.Viewport, {
180
190
  turnAnchor: "top",
191
+ ...viewportProps,
181
192
  "data-slot": "aui_thread-viewport",
182
193
  render: /* @__PURE__ */ jsx("div", {
183
194
  className: "relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth"
@@ -201,15 +212,20 @@ var ThreadRoot = ({ isEmpty, autoFocus, emptyComposerPosition }) => {
201
212
  children: () => /* @__PURE__ */ jsx(ThreadMessage, {})
202
213
  })
203
214
  }),
215
+ /* @__PURE__ */ jsx("div", {
216
+ "aria-hidden": "true",
217
+ className: cn2(!isCentered && "flex-1")
218
+ }),
204
219
  /* @__PURE__ */ jsxs(ThreadPrimitive.ViewportFooter, {
205
220
  render: /* @__PURE__ */ jsx("div", {
206
- className: cn2("aui-thread-viewport-footer bg-background sticky bottom-0 flex flex-col gap-4 overflow-visible pb-4 md:pb-6", !isCentered && "mt-auto rounded-t-(--composer-radius)")
221
+ className: cn2("aui-thread-viewport-footer bg-background sticky bottom-0 flex flex-col gap-4 overflow-visible pb-4 md:pb-6", !isCentered && "rounded-t-(--composer-radius)")
207
222
  }),
208
223
  children: [
209
224
  /* @__PURE__ */ jsx(ThreadScrollToBottom, {}),
210
225
  /* @__PURE__ */ jsx(ThreadFollowupSuggestions2, {}),
211
226
  /* @__PURE__ */ jsx(Composer, {
212
- autoFocus
227
+ autoFocus,
228
+ inputRef: composerInputRef
213
229
  }),
214
230
  /* @__PURE__ */ jsx(AuiIf, {
215
231
  condition: (s) => isNewChatView(s) && s.composer.isEmpty,
@@ -460,7 +476,7 @@ var ThreadSuggestionItem = () => {
460
476
  })
461
477
  });
462
478
  };
463
- var Composer = ({ autoFocus }) => {
479
+ var Composer = ({ autoFocus, inputRef }) => {
464
480
  return /* @__PURE__ */ jsx(ComposerPrimitive.Root, {
465
481
  render: /* @__PURE__ */ jsx("form", {
466
482
  className: "aui-composer-root relative flex w-full flex-col"
@@ -473,6 +489,7 @@ var Composer = ({ autoFocus }) => {
473
489
  children: [
474
490
  /* @__PURE__ */ jsx(ComposerAttachments3, {}),
475
491
  /* @__PURE__ */ jsx(ComposerPrimitive.Input, {
492
+ ref: inputRef,
476
493
  placeholder: "Send a message...",
477
494
  rows: 1,
478
495
  autoFocus,
@@ -488,6 +505,7 @@ var Composer = ({ autoFocus }) => {
488
505
  });
489
506
  };
490
507
  var ComposerAction = () => {
508
+ const { ComposerActions } = useContext(ThreadComponentsContext);
491
509
  const isSending = useAuiState((s) => s.composer.submission !== undefined && !(s.thread.isRunning && s.thread.capabilities.cancel));
492
510
  return /* @__PURE__ */ jsxs("div", {
493
511
  className: "aui-composer-action-wrapper relative flex items-center justify-between",
@@ -496,6 +514,7 @@ var ComposerAction = () => {
496
514
  /* @__PURE__ */ jsxs("div", {
497
515
  className: "flex items-center gap-1.5",
498
516
  children: [
517
+ ComposerActions && /* @__PURE__ */ jsx(ComposerActions, {}),
499
518
  /* @__PURE__ */ jsxs(AuiIf, {
500
519
  condition: (s) => s.thread.capabilities.dictation,
501
520
  children: [
@@ -504,11 +523,11 @@ var ComposerAction = () => {
504
523
  children: /* @__PURE__ */ jsx(ComposerPrimitive.Dictate, {
505
524
  asChild: true,
506
525
  children: /* @__PURE__ */ jsx(TooltipIconButton2, {
507
- tooltip: "Voice input",
526
+ tooltip: "Voice Input",
508
527
  side: "bottom",
509
528
  type: "button",
510
529
  variant: "ghost",
511
- "aria-label": "Start voice input",
530
+ "aria-label": "Start Voice Input",
512
531
  children: /* @__PURE__ */ jsx(MicIcon, {
513
532
  "aria-hidden": "true",
514
533
  className: "size-4 shrink-0"
@@ -521,11 +540,11 @@ var ComposerAction = () => {
521
540
  children: /* @__PURE__ */ jsx(ComposerPrimitive.StopDictation, {
522
541
  asChild: true,
523
542
  children: /* @__PURE__ */ jsx(TooltipIconButton2, {
524
- tooltip: "Stop dictation",
543
+ tooltip: "Stop Dictation",
525
544
  side: "bottom",
526
545
  type: "button",
527
546
  variant: "ghost",
528
- "aria-label": "Stop voice input",
547
+ "aria-label": "Stop Voice Input",
529
548
  children: /* @__PURE__ */ jsx(SquareIcon, {
530
549
  "aria-hidden": "true",
531
550
  className: "size-3.5 shrink-0 animate-pulse motion-reduce:animate-none"
@@ -540,11 +559,11 @@ var ComposerAction = () => {
540
559
  children: /* @__PURE__ */ jsx(ComposerPrimitive.Send, {
541
560
  asChild: true,
542
561
  children: /* @__PURE__ */ jsx(TooltipIconButton2, {
543
- tooltip: "Send message",
562
+ tooltip: "Send Message",
544
563
  side: "bottom",
545
564
  type: "button",
546
565
  variant: "default",
547
- "aria-label": "Send message",
566
+ "aria-label": "Send Message",
548
567
  children: /* @__PURE__ */ jsx(ArrowUpIcon, {
549
568
  "aria-hidden": "true",
550
569
  className: "size-4 shrink-0"
@@ -557,11 +576,11 @@ var ComposerAction = () => {
557
576
  children: /* @__PURE__ */ jsx(ComposerPrimitive.Resume, {
558
577
  asChild: true,
559
578
  children: /* @__PURE__ */ jsx(TooltipIconButton2, {
560
- tooltip: "Resume generating",
579
+ tooltip: "Resume Generating",
561
580
  side: "bottom",
562
581
  type: "button",
563
582
  variant: "default",
564
- "aria-label": "Resume generating",
583
+ "aria-label": "Resume Generating",
565
584
  children: /* @__PURE__ */ jsx(PlayIcon, {
566
585
  "aria-hidden": "true",
567
586
  className: "size-4 shrink-0"
@@ -576,7 +595,7 @@ var ComposerAction = () => {
576
595
  children: /* @__PURE__ */ jsx(Button2, {
577
596
  type: "button",
578
597
  variant: "default",
579
- "aria-label": isSending ? "Cancel sending" : "Stop generating",
598
+ "aria-label": isSending ? "Cancel Sending" : "Stop Generating",
580
599
  children: /* @__PURE__ */ jsx(SquareIcon, {
581
600
  "aria-hidden": "true",
582
601
  className: "size-3.5 shrink-0"
@@ -874,6 +893,7 @@ var UserImagePart = (part) => /* @__PURE__ */ jsx("div", {
874
893
  })
875
894
  });
876
895
  var UserMessage = () => {
896
+ const { UserText } = useContext(ThreadComponentsContext);
877
897
  return /* @__PURE__ */ jsxs(MessagePrimitive.Root, {
878
898
  "data-slot": "aui_user-message-root",
879
899
  "data-role": "user",
@@ -888,7 +908,7 @@ var UserMessage = () => {
888
908
  /* @__PURE__ */ jsx("div", {
889
909
  className: "aui-user-message-content peer bg-muted text-foreground rounded-(--composer-radius) px-4 py-2 wrap-break-word empty:hidden",
890
910
  children: /* @__PURE__ */ jsx(MessagePrimitive.Parts, {
891
- components: { File: UserFilePart, Image: UserImagePart }
911
+ components: { Text: UserText, File: UserFilePart, Image: UserImagePart }
892
912
  })
893
913
  }),
894
914
  /* @__PURE__ */ jsx("div", {
@@ -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";