@burtson-labs/ui 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/components/alert-dialog.js +2 -2
  3. package/dist/components/alert-dialog.js.map +1 -1
  4. package/dist/components/composer.d.ts +30 -0
  5. package/dist/components/composer.js +95 -0
  6. package/dist/components/composer.js.map +1 -0
  7. package/dist/components/conversation.d.ts +14 -0
  8. package/dist/components/conversation.js +78 -0
  9. package/dist/components/conversation.js.map +1 -0
  10. package/dist/components/dialog.js +2 -2
  11. package/dist/components/dialog.js.map +1 -1
  12. package/dist/components/markdown.d.ts +33 -0
  13. package/dist/components/markdown.js +177 -0
  14. package/dist/components/markdown.js.map +1 -0
  15. package/dist/components/message.d.ts +21 -0
  16. package/dist/components/message.js +56 -0
  17. package/dist/components/message.js.map +1 -0
  18. package/dist/components/navigation-menu.js +2 -2
  19. package/dist/components/navigation-menu.js.map +1 -1
  20. package/dist/components/popover.d.ts +1 -1
  21. package/dist/components/popover.js +1 -1
  22. package/dist/components/popover.js.map +1 -1
  23. package/dist/components/reasoning.d.ts +14 -0
  24. package/dist/components/reasoning.js +61 -0
  25. package/dist/components/reasoning.js.map +1 -0
  26. package/dist/components/sheet.d.ts +4 -2
  27. package/dist/components/sheet.js +5 -3
  28. package/dist/components/sheet.js.map +1 -1
  29. package/dist/components/tabs.js +1 -1
  30. package/dist/components/tabs.js.map +1 -1
  31. package/dist/components/toast.js +1 -1
  32. package/dist/components/toast.js.map +1 -1
  33. package/dist/components/tool-call.d.ts +32 -0
  34. package/dist/components/tool-call.js +152 -0
  35. package/dist/components/tool-call.js.map +1 -0
  36. package/dist/components/tooltip.js +1 -1
  37. package/dist/components/tooltip.js.map +1 -1
  38. package/dist/index.d.ts +6 -0
  39. package/dist/index.js +8 -2
  40. package/dist/styles.css +1 -1
  41. package/dist/theme.css +22 -11
  42. package/dist/tokens.d.ts +167 -0
  43. package/dist/tokens.js +53 -1
  44. package/dist/tokens.js.map +1 -1
  45. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/message.tsx
5
+ /**
6
+ * One turn in a conversation. User turns sit on the right in a quiet bubble,
7
+ * assistant turns read full width with an optional avatar, and system notes
8
+ * are centred and small.
9
+ */
10
+ function Message({ from, avatar, name, meta, actions, children, className, ...props }) {
11
+ if (from === "system") return /* @__PURE__ */ jsx("div", {
12
+ "data-slot": "message",
13
+ "data-role": "system",
14
+ className: cn("mx-auto max-w-prose text-center text-xs text-muted-foreground", className),
15
+ ...props,
16
+ children
17
+ });
18
+ const user = from === "user";
19
+ return /* @__PURE__ */ jsxs("div", {
20
+ "data-slot": "message",
21
+ "data-role": from,
22
+ className: cn("group/message flex animate-in gap-3", user ? "justify-end" : "justify-start", className),
23
+ ...props,
24
+ children: [!user && avatar && /* @__PURE__ */ jsx("div", {
25
+ className: "mt-0.5 grid size-7 shrink-0 place-items-center overflow-hidden rounded-md border border-brand/15 bg-brand-soft text-brand [&_svg]:size-4",
26
+ children: avatar
27
+ }), /* @__PURE__ */ jsxs("div", {
28
+ className: cn("grid min-w-0 gap-1.5", user ? "max-w-[85%] justify-items-end" : "flex-1"),
29
+ children: [
30
+ (name || meta) && /* @__PURE__ */ jsxs("div", {
31
+ className: "flex items-baseline gap-2 text-xs",
32
+ children: [name && /* @__PURE__ */ jsx("span", {
33
+ className: "font-semibold text-foreground",
34
+ children: name
35
+ }), meta && /* @__PURE__ */ jsx("span", {
36
+ className: "text-muted-foreground",
37
+ children: meta
38
+ })]
39
+ }),
40
+ /* @__PURE__ */ jsx("div", {
41
+ "data-slot": "message-body",
42
+ className: cn("min-w-0 text-sm leading-6", user && "rounded-lg rounded-tr-xs bg-secondary px-3.5 py-2 text-secondary-foreground"),
43
+ children
44
+ }),
45
+ actions && /* @__PURE__ */ jsx("div", {
46
+ className: "flex gap-1 opacity-0 transition-opacity group-focus-within/message:opacity-100 group-hover/message:opacity-100 max-md:opacity-100",
47
+ children: actions
48
+ })
49
+ ]
50
+ })]
51
+ });
52
+ }
53
+ //#endregion
54
+ export { Message };
55
+
56
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","names":[],"sources":["../../src/components/message.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport type MessageRole = 'user' | 'assistant' | 'system';\n\nexport interface MessageProps extends React.ComponentProps<'div'> {\n /** Who wrote it. (Not `role`, which is the ARIA attribute.) */\n from: MessageRole;\n /** Avatar or agent mark beside assistant messages. */\n avatar?: React.ReactNode;\n /** Sender name shown above the message, e.g. the agent's name. */\n name?: React.ReactNode;\n /** Timestamp or status text. */\n meta?: React.ReactNode;\n /** Actions such as copy and retry, shown on hover and focus. */\n actions?: React.ReactNode;\n}\n\n/**\n * One turn in a conversation. User turns sit on the right in a quiet bubble,\n * assistant turns read full width with an optional avatar, and system notes\n * are centred and small.\n */\nfunction Message({\n from,\n avatar,\n name,\n meta,\n actions,\n children,\n className,\n ...props\n}: MessageProps) {\n if (from === 'system') {\n return (\n <div\n data-slot=\"message\"\n data-role=\"system\"\n className={cn('mx-auto max-w-prose text-center text-xs text-muted-foreground', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n const user = from === 'user';\n return (\n <div\n data-slot=\"message\"\n data-role={from}\n className={cn(\n 'group/message flex animate-in gap-3',\n user ? 'justify-end' : 'justify-start',\n className,\n )}\n {...props}\n >\n {!user && avatar && (\n <div className=\"mt-0.5 grid size-7 shrink-0 place-items-center overflow-hidden rounded-md border border-brand/15 bg-brand-soft text-brand [&_svg]:size-4\">\n {avatar}\n </div>\n )}\n <div\n className={cn('grid min-w-0 gap-1.5', user ? 'max-w-[85%] justify-items-end' : 'flex-1')}\n >\n {(name || meta) && (\n <div className=\"flex items-baseline gap-2 text-xs\">\n {name && <span className=\"font-semibold text-foreground\">{name}</span>}\n {meta && <span className=\"text-muted-foreground\">{meta}</span>}\n </div>\n )}\n <div\n data-slot=\"message-body\"\n className={cn(\n 'min-w-0 text-sm leading-6',\n user && 'rounded-lg rounded-tr-xs bg-secondary px-3.5 py-2 text-secondary-foreground',\n )}\n >\n {children}\n </div>\n {actions && (\n <div className=\"flex gap-1 opacity-0 transition-opacity group-focus-within/message:opacity-100 group-hover/message:opacity-100 max-md:opacity-100\">\n {actions}\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport { Message };\n"],"mappings":";;;;;;;;;AAwBA,SAAS,QAAQ,EACf,MACA,QACA,MACA,MACA,SACA,UACA,WACA,GAAG,SACY;CACf,IAAI,SAAS,UACX,OACE,oBAAC,OAAD;EACE,aAAU;EACV,aAAU;EACV,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;EAEH;CACE,CAAA;CAGT,MAAM,OAAO,SAAS;CACtB,OACE,qBAAC,OAAD;EACE,aAAU;EACV,aAAW;EACX,WAAW,GACT,uCACA,OAAO,gBAAgB,iBACvB,SACF;EACA,GAAI;EARN,UAAA,CAUG,CAAC,QAAQ,UACR,oBAAC,OAAD;GAAK,WAAU;GACZ,UAAA;EACE,CAAA,GAEP,qBAAC,OAAD;GACE,WAAW,GAAG,wBAAwB,OAAO,kCAAkC,QAAQ;GADzF,UAAA;KAGI,QAAQ,SACR,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACG,QAAQ,oBAAC,QAAD;MAAM,WAAU;MAAiC,UAAA;KAAW,CAAA,GACpE,QAAQ,oBAAC,QAAD;MAAM,WAAU;MAAyB,UAAA;KAAW,CAAA,CAC1D;;IAEP,oBAAC,OAAD;KACE,aAAU;KACV,WAAW,GACT,6BACA,QAAQ,6EACV;KAEC;IACE,CAAA;IACJ,WACC,oBAAC,OAAD;KAAK,WAAU;KACZ,UAAA;IACE,CAAA;GAEJ;EACF,CAAA,CAAA;;AAET"}
@@ -48,7 +48,7 @@ function NavigationMenuTrigger({ className, children, ...props }) {
48
48
  function NavigationMenuContent({ className, ...props }) {
49
49
  return /* @__PURE__ */ jsx(NavigationMenu.Content, {
50
50
  "data-slot": "navigation-menu-content",
51
- className: cn("top-0 left-0 w-full p-2 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out", className),
51
+ className: cn("top-0 left-0 w-full p-2 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion=from-end]:[--bl-tx:24px] data-[motion=from-start]:[--bl-tx:-24px] data-[motion=to-end]:[--bl-tx:24px] data-[motion=to-start]:[--bl-tx:-24px] [--bl-scale:1]", className),
52
52
  ...props
53
53
  });
54
54
  }
@@ -57,7 +57,7 @@ function NavigationMenuViewport({ className, ...props }) {
57
57
  className: "absolute top-full left-0 z-50 flex justify-center",
58
58
  children: /* @__PURE__ */ jsx(NavigationMenu.Viewport, {
59
59
  "data-slot": "navigation-menu-viewport",
60
- className: cn("relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[state=open]:animate-in md:w-(--radix-navigation-menu-viewport-width)", className),
60
+ className: cn("relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] transition-[width,height] duration-200 [--bl-ty:-6px] data-[state=closed]:animate-out data-[state=open]:animate-in md:w-(--radix-navigation-menu-viewport-width)", className),
61
61
  ...props
62
62
  })
63
63
  });
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-menu.js","names":["NavigationMenu","NavigationMenuPrimitive"],"sources":["../../src/components/navigation-menu.tsx"],"sourcesContent":["import ChevronDown from '@burtson-labs/icons/react/chevron-down';\nimport { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\n/**\n * Site navigation with dropdown panels (a products menu, docs sections).\n * Keyboard and screen-reader behaviour come from Radix; the panel renders in\n * a shared viewport under the bar, sized to its content.\n */\nfunction NavigationMenu({\n className,\n children,\n viewport = true,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & { viewport?: boolean }) {\n return (\n <NavigationMenuPrimitive.Root\n data-slot=\"navigation-menu\"\n data-viewport={viewport}\n className={cn(\n 'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',\n className,\n )}\n {...props}\n >\n {children}\n {viewport && <NavigationMenuViewport />}\n </NavigationMenuPrimitive.Root>\n );\n}\n\nfunction NavigationMenuList({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {\n return (\n <NavigationMenuPrimitive.List\n data-slot=\"navigation-menu-list\"\n className={cn('group flex flex-1 list-none items-center justify-center gap-1', className)}\n {...props}\n />\n );\n}\n\nfunction NavigationMenuItem({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {\n return (\n <NavigationMenuPrimitive.Item\n data-slot=\"navigation-menu-item\"\n className={cn('relative', className)}\n {...props}\n />\n );\n}\n\n/** The look of a top-level entry, for links that sit beside triggers. */\nconst navigationMenuTriggerStyle =\n 'group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 text-sm font-semibold text-foreground/80 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 data-[active]:text-foreground data-[state=open]:bg-muted data-[state=open]:text-foreground';\n\nfunction NavigationMenuTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {\n return (\n <NavigationMenuPrimitive.Trigger\n data-slot=\"navigation-menu-trigger\"\n className={cn(navigationMenuTriggerStyle, className)}\n {...props}\n >\n {children}\n <ChevronDown\n aria-hidden\n className=\"relative top-px size-3.5 transition-transform duration-200 group-data-[state=open]:rotate-180\"\n />\n </NavigationMenuPrimitive.Trigger>\n );\n}\n\nfunction NavigationMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {\n return (\n <NavigationMenuPrimitive.Content\n data-slot=\"navigation-menu-content\"\n className={cn(\n 'top-0 left-0 w-full p-2 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction NavigationMenuViewport({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {\n return (\n <div className=\"absolute top-full left-0 z-50 flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n data-slot=\"navigation-menu-viewport\"\n className={cn(\n 'relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[state=open]:animate-in md:w-(--radix-navigation-menu-viewport-width)',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction NavigationMenuLink({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {\n return (\n <NavigationMenuPrimitive.Link\n data-slot=\"navigation-menu-link\"\n className={cn(\n \"flex flex-col gap-1 rounded-sm p-2 text-sm outline-none transition-colors hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/20 data-[active=true]:bg-muted data-[active=true]:shadow-[inset_2px_0_0_var(--color-brand)] [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction NavigationMenuIndicator({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {\n return (\n <NavigationMenuPrimitive.Indicator\n data-slot=\"navigation-menu-indicator\"\n className={cn(\n 'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=visible]:animate-in',\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border-strong\" />\n </NavigationMenuPrimitive.Indicator>\n );\n}\n\nexport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuIndicator,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n NavigationMenuViewport,\n};\n"],"mappings":";;;;;;;;;;;AAWA,SAASA,iBAAe,EACtB,WACA,UACA,WAAW,MACX,GAAG,SACkF;CACrF,OACE,qBAACC,eAAwB,MAAzB;EACE,aAAU;EACV,iBAAe;EACf,WAAW,GACT,oFACA,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACA,YAAY,oBAAC,wBAAD,CAAyB,CAAA,CACV;;AAElC;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAACA,eAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAACA,eAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GAAG,YAAY,SAAS;EACnC,GAAI;CACL,CAAA;AAEL;;AAGA,IAAM,6BACJ;AAEF,SAAS,sBAAsB,EAC7B,WACA,UACA,GAAG,SAC4D;CAC/D,OACE,qBAACA,eAAwB,SAAzB;EACE,aAAU;EACV,WAAW,GAAG,4BAA4B,SAAS;EACnD,GAAI;EAHN,UAAA,CAKG,UACD,oBAAC,aAAD;GACE,eAAA;GACA,WAAU;EACX,CAAA,CAC8B;;AAErC;AAEA,SAAS,sBAAsB,EAC7B,WACA,GAAG,SAC4D;CAC/D,OACE,oBAACA,eAAwB,SAAzB;EACE,aAAU;EACV,WAAW,GACT,gHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,oBAACA,eAAwB,UAAzB;GACE,aAAU;GACV,WAAW,GACT,kUACA,SACF;GACA,GAAI;EACL,CAAA;CACE,CAAA;AAET;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAACA,eAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GACT,kUACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,wBAAwB,EAC/B,WACA,GAAG,SAC8D;CACjE,OACE,oBAACA,eAAwB,WAAzB;EACE,aAAU;EACV,WAAW,GACT,sIACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,OAAD,EAAK,WAAU,qEAAsE,CAAA;CACpD,CAAA;AAEvC"}
1
+ {"version":3,"file":"navigation-menu.js","names":["NavigationMenu","NavigationMenuPrimitive"],"sources":["../../src/components/navigation-menu.tsx"],"sourcesContent":["import ChevronDown from '@burtson-labs/icons/react/chevron-down';\nimport { NavigationMenu as NavigationMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\n/**\n * Site navigation with dropdown panels (a products menu, docs sections).\n * Keyboard and screen-reader behaviour come from Radix; the panel renders in\n * a shared viewport under the bar, sized to its content.\n */\nfunction NavigationMenu({\n className,\n children,\n viewport = true,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & { viewport?: boolean }) {\n return (\n <NavigationMenuPrimitive.Root\n data-slot=\"navigation-menu\"\n data-viewport={viewport}\n className={cn(\n 'group/navigation-menu relative flex max-w-max flex-1 items-center justify-center',\n className,\n )}\n {...props}\n >\n {children}\n {viewport && <NavigationMenuViewport />}\n </NavigationMenuPrimitive.Root>\n );\n}\n\nfunction NavigationMenuList({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {\n return (\n <NavigationMenuPrimitive.List\n data-slot=\"navigation-menu-list\"\n className={cn('group flex flex-1 list-none items-center justify-center gap-1', className)}\n {...props}\n />\n );\n}\n\nfunction NavigationMenuItem({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {\n return (\n <NavigationMenuPrimitive.Item\n data-slot=\"navigation-menu-item\"\n className={cn('relative', className)}\n {...props}\n />\n );\n}\n\n/** The look of a top-level entry, for links that sit beside triggers. */\nconst navigationMenuTriggerStyle =\n 'group inline-flex h-9 w-max items-center justify-center gap-1 rounded-md px-3 text-sm font-semibold text-foreground/80 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 data-[active]:text-foreground data-[state=open]:bg-muted data-[state=open]:text-foreground';\n\nfunction NavigationMenuTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {\n return (\n <NavigationMenuPrimitive.Trigger\n data-slot=\"navigation-menu-trigger\"\n className={cn(navigationMenuTriggerStyle, className)}\n {...props}\n >\n {children}\n <ChevronDown\n aria-hidden\n className=\"relative top-px size-3.5 transition-transform duration-200 group-data-[state=open]:rotate-180\"\n />\n </NavigationMenuPrimitive.Trigger>\n );\n}\n\nfunction NavigationMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {\n return (\n <NavigationMenuPrimitive.Content\n data-slot=\"navigation-menu-content\"\n className={cn(\n 'top-0 left-0 w-full p-2 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion=from-end]:[--bl-tx:24px] data-[motion=from-start]:[--bl-tx:-24px] data-[motion=to-end]:[--bl-tx:24px] data-[motion=to-start]:[--bl-tx:-24px] [--bl-scale:1]',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction NavigationMenuViewport({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {\n return (\n <div className=\"absolute top-full left-0 z-50 flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n data-slot=\"navigation-menu-viewport\"\n className={cn(\n 'relative mt-2 h-(--radix-navigation-menu-viewport-height) w-full origin-top overflow-hidden rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] transition-[width,height] duration-200 [--bl-ty:-6px] data-[state=closed]:animate-out data-[state=open]:animate-in md:w-(--radix-navigation-menu-viewport-width)',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction NavigationMenuLink({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {\n return (\n <NavigationMenuPrimitive.Link\n data-slot=\"navigation-menu-link\"\n className={cn(\n \"flex flex-col gap-1 rounded-sm p-2 text-sm outline-none transition-colors hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/20 data-[active=true]:bg-muted data-[active=true]:shadow-[inset_2px_0_0_var(--color-brand)] [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction NavigationMenuIndicator({\n className,\n ...props\n}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {\n return (\n <NavigationMenuPrimitive.Indicator\n data-slot=\"navigation-menu-indicator\"\n className={cn(\n 'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=visible]:animate-in',\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] size-2 rotate-45 rounded-tl-sm bg-border-strong\" />\n </NavigationMenuPrimitive.Indicator>\n );\n}\n\nexport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuIndicator,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n NavigationMenuViewport,\n};\n"],"mappings":";;;;;;;;;;;AAWA,SAASA,iBAAe,EACtB,WACA,UACA,WAAW,MACX,GAAG,SACkF;CACrF,OACE,qBAACC,eAAwB,MAAzB;EACE,aAAU;EACV,iBAAe;EACf,WAAW,GACT,oFACA,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACA,YAAY,oBAAC,wBAAD,CAAyB,CAAA,CACV;;AAElC;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAACA,eAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GAAG,iEAAiE,SAAS;EACxF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAACA,eAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GAAG,YAAY,SAAS;EACnC,GAAI;CACL,CAAA;AAEL;;AAGA,IAAM,6BACJ;AAEF,SAAS,sBAAsB,EAC7B,WACA,UACA,GAAG,SAC4D;CAC/D,OACE,qBAACA,eAAwB,SAAzB;EACE,aAAU;EACV,WAAW,GAAG,4BAA4B,SAAS;EACnD,GAAI;EAHN,UAAA,CAKG,UACD,oBAAC,aAAD;GACE,eAAA;GACA,WAAU;EACX,CAAA,CAC8B;;AAErC;AAEA,SAAS,sBAAsB,EAC7B,WACA,GAAG,SAC4D;CAC/D,OACE,oBAACA,eAAwB,SAAzB;EACE,aAAU;EACV,WAAW,GACT,yRACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,oBAACA,eAAwB,UAAzB;GACE,aAAU;GACV,WAAW,GACT,wXACA,SACF;GACA,GAAI;EACL,CAAA;CACE,CAAA;AAET;AAEA,SAAS,mBAAmB,EAC1B,WACA,GAAG,SACyD;CAC5D,OACE,oBAACA,eAAwB,MAAzB;EACE,aAAU;EACV,WAAW,GACT,kUACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,wBAAwB,EAC/B,WACA,GAAG,SAC8D;CACjE,OACE,oBAACA,eAAwB,WAAzB;EACE,aAAU;EACV,WAAW,GACT,sIACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,OAAD,EAAK,WAAU,qEAAsE,CAAA;CACpD,CAAA;AAEvC"}
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  * The floating surface shared by popovers, menus and select lists: raised,
5
5
  * with a strong border, and the one place a heavy shadow is allowed.
6
6
  */
7
- export declare const surfaceClasses = "z-50 animate-in rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out";
7
+ export declare const surfaceClasses = "z-50 animate-in rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[side=bottom]:[--bl-ty:-6px] data-[side=top]:[--bl-ty:6px] data-[side=left]:[--bl-tx:6px] data-[side=right]:[--bl-tx:-6px]";
8
8
  declare function Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
9
9
  declare function PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
10
10
  declare function PopoverAnchor(props: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  * The floating surface shared by popovers, menus and select lists: raised,
8
8
  * with a strong border, and the one place a heavy shadow is allowed.
9
9
  */
10
- var surfaceClasses = "z-50 animate-in rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out";
10
+ var surfaceClasses = "z-50 animate-in rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[side=bottom]:[--bl-ty:-6px] data-[side=top]:[--bl-ty:6px] data-[side=left]:[--bl-tx:6px] data-[side=right]:[--bl-tx:-6px]";
11
11
  function Popover$1(props) {
12
12
  return /* @__PURE__ */ jsx(Popover.Root, {
13
13
  "data-slot": "popover",
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":["Popover","PopoverPrimitive"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\n/**\n * The floating surface shared by popovers, menus and select lists: raised,\n * with a strong border, and the one place a heavy shadow is allowed.\n */\nexport const surfaceClasses =\n 'z-50 animate-in rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out';\n\nfunction Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverAnchor(props: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 6,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n surfaceClasses,\n 'w-72 origin-(--radix-popover-content-transform-origin) p-4 outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };\n"],"mappings":";;;;;;;;;AASA,IAAa,iBACX;AAEF,SAASA,UAAQ,OAA2D;CAC1E,OAAO,oBAACC,QAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ,CAAA;AAChE;AAEA,SAAS,eAAe,OAA8D;CACpF,OAAO,oBAACA,QAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAEA,SAAS,cAAc,OAA6D;CAClF,OAAO,oBAACA,QAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,aAAa,GACb,GAAG,SACqD;CACxD,OACE,oBAACA,QAAiB,QAAlB,EAAA,UACE,oBAACA,QAAiB,SAAlB;EACE,aAAU;EACH;EACK;EACZ,WAAW,GACT,gBACA,6EACA,SACF;EACA,GAAI;CACL,CAAA,EACsB,CAAA;AAE7B"}
1
+ {"version":3,"file":"popover.js","names":["Popover","PopoverPrimitive"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\n/**\n * The floating surface shared by popovers, menus and select lists: raised,\n * with a strong border, and the one place a heavy shadow is allowed.\n */\nexport const surfaceClasses =\n 'z-50 animate-in rounded-lg border border-border-strong bg-surface-raised text-popover-foreground shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[side=bottom]:[--bl-ty:-6px] data-[side=top]:[--bl-ty:6px] data-[side=left]:[--bl-tx:6px] data-[side=right]:[--bl-tx:-6px]';\n\nfunction Popover(props: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverAnchor(props: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = 'center',\n sideOffset = 6,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n surfaceClasses,\n 'w-72 origin-(--radix-popover-content-transform-origin) p-4 outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };\n"],"mappings":";;;;;;;;;AASA,IAAa,iBACX;AAEF,SAASA,UAAQ,OAA2D;CAC1E,OAAO,oBAACC,QAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAI;CAAQ,CAAA;AAChE;AAEA,SAAS,eAAe,OAA8D;CACpF,OAAO,oBAACA,QAAiB,SAAlB;EAA0B,aAAU;EAAkB,GAAI;CAAQ,CAAA;AAC3E;AAEA,SAAS,cAAc,OAA6D;CAClF,OAAO,oBAACA,QAAiB,QAAlB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,eAAe,EACtB,WACA,QAAQ,UACR,aAAa,GACb,GAAG,SACqD;CACxD,OACE,oBAACA,QAAiB,QAAlB,EAAA,UACE,oBAACA,QAAiB,SAAlB;EACE,aAAU;EACH;EACK;EACZ,WAAW,GACT,gBACA,6EACA,SACF;EACA,GAAI;CACL,CAAA,EACsB,CAAA;AAE7B"}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ export interface ReasoningProps extends React.ComponentProps<'div'> {
3
+ /** True while the model is still thinking. */
4
+ streaming?: boolean;
5
+ durationMs?: number;
6
+ defaultOpen?: boolean;
7
+ }
8
+ /** A model's reasoning, collapsed to one line ("Thought for 3s") unless opened. */
9
+ declare function Reasoning({ streaming, durationMs, defaultOpen, children, className, ...props }: ReasoningProps): React.JSX.Element;
10
+ /** Three pulsing dots while a reply is on its way. Still under reduced motion. */
11
+ declare function StreamingIndicator({ className, label, ...props }: React.ComponentProps<'span'> & {
12
+ label?: string;
13
+ }): React.JSX.Element;
14
+ export { Reasoning, StreamingIndicator };
@@ -0,0 +1,61 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { Collapsible } from "radix-ui";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import ChevronRight from "@burtson-labs/icons/react/chevron-right";
6
+ import Lightbulb from "@burtson-labs/icons/react/lightbulb";
7
+ //#region src/components/reasoning.tsx
8
+ /** A model's reasoning, collapsed to one line ("Thought for 3s") unless opened. */
9
+ function Reasoning({ streaming = false, durationMs, defaultOpen = false, children, className, ...props }) {
10
+ const label = streaming ? "Thinking…" : durationMs !== void 0 ? `Thought for ${Math.max(1, Math.round(durationMs / 1e3))}s` : "Reasoning";
11
+ return /* @__PURE__ */ jsx(Collapsible.Root, {
12
+ defaultOpen,
13
+ children: /* @__PURE__ */ jsxs("div", {
14
+ "data-slot": "reasoning",
15
+ className: cn("grid gap-1.5", className),
16
+ ...props,
17
+ children: [/* @__PURE__ */ jsxs(Collapsible.Trigger, {
18
+ className: "group/reasoning inline-flex w-fit items-center gap-1.5 rounded-sm text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20",
19
+ children: [
20
+ /* @__PURE__ */ jsx(Lightbulb, {
21
+ className: cn("size-3.5", streaming && "animate-pulse"),
22
+ "aria-hidden": true
23
+ }),
24
+ label,
25
+ /* @__PURE__ */ jsx(ChevronRight, {
26
+ "aria-hidden": true,
27
+ className: "size-3.5 transition-transform group-data-[state=open]/reasoning:rotate-90"
28
+ })
29
+ ]
30
+ }), /* @__PURE__ */ jsx(Collapsible.Content, {
31
+ className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
32
+ children: /* @__PURE__ */ jsx("div", {
33
+ className: "border-l-2 border-border-strong pl-3 text-[13px] leading-6 text-muted-foreground",
34
+ children
35
+ })
36
+ })]
37
+ })
38
+ });
39
+ }
40
+ /** Three pulsing dots while a reply is on its way. Still under reduced motion. */
41
+ function StreamingIndicator({ className, label = "Assistant is typing", ...props }) {
42
+ return /* @__PURE__ */ jsx("span", {
43
+ "data-slot": "streaming-indicator",
44
+ role: "status",
45
+ "aria-label": label,
46
+ className: cn("inline-flex h-5 items-center gap-1", className),
47
+ ...props,
48
+ children: [
49
+ 0,
50
+ 150,
51
+ 300
52
+ ].map((delay) => /* @__PURE__ */ jsx("span", {
53
+ className: "size-1.5 animate-bounce rounded-full bg-muted-foreground motion-reduce:animate-none",
54
+ style: { animationDelay: `${delay}ms` }
55
+ }, delay))
56
+ });
57
+ }
58
+ //#endregion
59
+ export { Reasoning, StreamingIndicator };
60
+
61
+ //# sourceMappingURL=reasoning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning.js","names":["CollapsiblePrimitive"],"sources":["../../src/components/reasoning.tsx"],"sourcesContent":["import ChevronRight from '@burtson-labs/icons/react/chevron-right';\nimport Lightbulb from '@burtson-labs/icons/react/lightbulb';\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport interface ReasoningProps extends React.ComponentProps<'div'> {\n /** True while the model is still thinking. */\n streaming?: boolean;\n durationMs?: number;\n defaultOpen?: boolean;\n}\n\n/** A model's reasoning, collapsed to one line (\"Thought for 3s\") unless opened. */\nfunction Reasoning({\n streaming = false,\n durationMs,\n defaultOpen = false,\n children,\n className,\n ...props\n}: ReasoningProps) {\n const label = streaming\n ? 'Thinking…'\n : durationMs !== undefined\n ? `Thought for ${Math.max(1, Math.round(durationMs / 1000))}s`\n : 'Reasoning';\n return (\n <CollapsiblePrimitive.Root defaultOpen={defaultOpen}>\n <div data-slot=\"reasoning\" className={cn('grid gap-1.5', className)} {...props}>\n <CollapsiblePrimitive.Trigger className=\"group/reasoning inline-flex w-fit items-center gap-1.5 rounded-sm text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20\">\n <Lightbulb className={cn('size-3.5', streaming && 'animate-pulse')} aria-hidden />\n {label}\n <ChevronRight\n aria-hidden\n className=\"size-3.5 transition-transform group-data-[state=open]/reasoning:rotate-90\"\n />\n </CollapsiblePrimitive.Trigger>\n <CollapsiblePrimitive.Content className=\"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down\">\n <div className=\"border-l-2 border-border-strong pl-3 text-[13px] leading-6 text-muted-foreground\">\n {children}\n </div>\n </CollapsiblePrimitive.Content>\n </div>\n </CollapsiblePrimitive.Root>\n );\n}\n\n/** Three pulsing dots while a reply is on its way. Still under reduced motion. */\nfunction StreamingIndicator({\n className,\n label = 'Assistant is typing',\n ...props\n}: React.ComponentProps<'span'> & { label?: string }) {\n return (\n <span\n data-slot=\"streaming-indicator\"\n role=\"status\"\n aria-label={label}\n className={cn('inline-flex h-5 items-center gap-1', className)}\n {...props}\n >\n {[0, 150, 300].map((delay) => (\n <span\n key={delay}\n className=\"size-1.5 animate-bounce rounded-full bg-muted-foreground motion-reduce:animate-none\"\n style={{ animationDelay: `${delay}ms` }}\n />\n ))}\n </span>\n );\n}\n\nexport { Reasoning, StreamingIndicator };\n"],"mappings":";;;;;;;;AAeA,SAAS,UAAU,EACjB,YAAY,OACZ,YACA,cAAc,OACd,UACA,WACA,GAAG,SACc;CACjB,MAAM,QAAQ,YACV,cACA,eAAe,KAAA,IACb,eAAe,KAAK,IAAI,GAAG,KAAK,MAAM,aAAa,GAAI,CAAC,EAAE,KAC1D;CACN,OACE,oBAACA,YAAqB,MAAtB;EAAwC;EACtC,UAAA,qBAAC,OAAD;GAAK,aAAU;GAAY,WAAW,GAAG,gBAAgB,SAAS;GAAG,GAAI;GAAzE,UAAA,CACE,qBAACA,YAAqB,SAAtB;IAA8B,WAAU;IAAxC,UAAA;KACE,oBAAC,WAAD;MAAW,WAAW,GAAG,YAAY,aAAa,eAAe;MAAG,eAAA;KAAa,CAAA;KAChF;KACD,oBAAC,cAAD;MACE,eAAA;MACA,WAAU;KACX,CAAA;IAC2B;GAC9B,CAAA,GAAA,oBAACA,YAAqB,SAAtB;IAA8B,WAAU;IACtC,UAAA,oBAAC,OAAD;KAAK,WAAU;KACZ;IACE,CAAA;GACuB,CAAA,CAC3B;;CACoB,CAAA;AAE/B;;AAGA,SAAS,mBAAmB,EAC1B,WACA,QAAQ,uBACR,GAAG,SACiD;CACpD,OACE,oBAAC,QAAD;EACE,aAAU;EACV,MAAK;EACL,cAAY;EACZ,WAAW,GAAG,sCAAsC,SAAS;EAC7D,GAAI;EAEH,UAAA;GAAC;GAAG;GAAK;EAAG,CAAC,CAAC,KAAK,UAClB,oBAAC,QAAD;GAEE,WAAU;GACV,OAAO,EAAE,gBAAgB,GAAG,MAAM,IAAI;EACvC,GAHM,KAGN,CACF;CACG,CAAA;AAEV"}
@@ -4,8 +4,10 @@ declare function Sheet(props: React.ComponentProps<typeof SheetPrimitive.Root>):
4
4
  declare function SheetTrigger(props: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
5
5
  declare function SheetClose(props: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
6
6
  declare const sideClasses: {
7
- readonly right: "inset-y-0 right-0 h-full w-3/4 border-l [--bl-sheet-from:100%] sm:max-w-sm";
8
- readonly left: "inset-y-0 left-0 h-full w-3/4 border-r [--bl-sheet-from:-100%] sm:max-w-sm";
7
+ readonly right: "inset-y-0 right-0 h-full w-3/4 border-l [--bl-sheet-x:100%] sm:max-w-sm";
8
+ readonly left: "inset-y-0 left-0 h-full w-3/4 border-r [--bl-sheet-x:-100%] sm:max-w-sm";
9
+ readonly top: "inset-x-0 top-0 max-h-[85dvh] rounded-b-xl border-b [--bl-sheet-x:0] [--bl-sheet-y:-100%]";
10
+ readonly bottom: "inset-x-0 bottom-0 max-h-[85dvh] rounded-t-xl border-t [--bl-sheet-x:0] [--bl-sheet-y:100%]";
9
11
  };
10
12
  declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
11
13
  side?: keyof typeof sideClasses;
@@ -23,13 +23,15 @@ function SheetClose(props) {
23
23
  });
24
24
  }
25
25
  var sideClasses = {
26
- right: "inset-y-0 right-0 h-full w-3/4 border-l [--bl-sheet-from:100%] sm:max-w-sm",
27
- left: "inset-y-0 left-0 h-full w-3/4 border-r [--bl-sheet-from:-100%] sm:max-w-sm"
26
+ right: "inset-y-0 right-0 h-full w-3/4 border-l [--bl-sheet-x:100%] sm:max-w-sm",
27
+ left: "inset-y-0 left-0 h-full w-3/4 border-r [--bl-sheet-x:-100%] sm:max-w-sm",
28
+ top: "inset-x-0 top-0 max-h-[85dvh] rounded-b-xl border-b [--bl-sheet-x:0] [--bl-sheet-y:-100%]",
29
+ bottom: "inset-x-0 bottom-0 max-h-[85dvh] rounded-t-xl border-t [--bl-sheet-x:0] [--bl-sheet-y:100%]"
28
30
  };
29
31
  function SheetContent({ className, children, side = "right", ...props }) {
30
32
  return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
31
33
  "data-slot": "sheet-overlay",
32
- className: "fixed inset-0 z-50 bg-black/55 backdrop-blur-[3px] data-[state=closed]:animate-out data-[state=open]:animate-in"
34
+ className: "fixed inset-0 z-50 bg-black/55 backdrop-blur-[3px] data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in"
33
35
  }), /* @__PURE__ */ jsxs(Dialog.Content, {
34
36
  "data-slot": "sheet-content",
35
37
  className: cn("fixed z-50 flex flex-col gap-4 border-border-strong bg-surface-raised text-foreground shadow-[0_24px_80px_rgb(0_0_0_/_0.28)] outline-none data-[state=closed]:animate-sheet-out data-[state=open]:animate-sheet-in", sideClasses[side], className),
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","names":["SheetPrimitive"],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import X from '@burtson-labs/icons/react/x';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Sheet(props: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\nfunction SheetTrigger(props: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose(props: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nconst sideClasses = {\n right: 'inset-y-0 right-0 h-full w-3/4 border-l [--bl-sheet-from:100%] sm:max-w-sm',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r [--bl-sheet-from:-100%] sm:max-w-sm',\n} as const;\n\nfunction SheetContent({\n className,\n children,\n side = 'right',\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & { side?: keyof typeof sideClasses }) {\n return (\n <SheetPrimitive.Portal>\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className=\"fixed inset-0 z-50 bg-black/55 backdrop-blur-[3px] data-[state=closed]:animate-out data-[state=open]:animate-in\"\n />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n 'fixed z-50 flex flex-col gap-4 border-border-strong bg-surface-raised text-foreground shadow-[0_24px_80px_rgb(0_0_0_/_0.28)] outline-none data-[state=closed]:animate-sheet-out data-[state=open]:animate-sheet-in',\n sideClasses[side],\n className,\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close className=\"absolute top-3.5 right-3.5 grid size-8 place-items-center rounded-md text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20 [&_svg]:size-4\">\n <X aria-hidden />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPrimitive.Portal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn('flex flex-col gap-1.5 p-4', className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn('text-base font-semibold tracking-[-0.02em] text-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n};\n"],"mappings":";;;;;;AAMA,SAAS,MAAM,OAAyD;CACtE,OAAO,oBAACA,OAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,SAAS,aAAa,OAA4D;CAChF,OAAO,oBAACA,OAAe,SAAhB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,WAAW,OAA0D;CAC5E,OAAO,oBAACA,OAAe,OAAhB;EAAsB,aAAU;EAAc,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAM,cAAc;CAClB,OAAO;CACP,MAAM;AACR;AAEA,SAAS,aAAa,EACpB,WACA,UACA,OAAO,SACP,GAAG,SACyF;CAC5F,OACE,qBAACA,OAAe,QAAhB,EAAA,UAAA,CACE,oBAACA,OAAe,SAAhB;EACE,aAAU;EACV,WAAU;CACX,CAAA,GACD,qBAACA,OAAe,SAAhB;EACE,aAAU;EACV,WAAW,GACT,sNACA,YAAY,OACZ,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACD,qBAACA,OAAe,OAAhB;GAAsB,WAAU;GAAhC,UAAA,CACE,oBAAC,GAAD,EAAG,eAAA,KAAa,CAAA,GAChB,oBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAW,CAAA,CACjB;EACA,CAAA,CAAA;CACH,CAAA,CAAA,EAAA,CAAA;AAE3B;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA4D;CAC9F,OACE,oBAACA,OAAe,OAAhB;EACE,aAAU;EACV,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EACxB,WACA,GAAG,SACuD;CAC1D,OACE,oBAACA,OAAe,aAAhB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"sheet.js","names":["SheetPrimitive"],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import X from '@burtson-labs/icons/react/x';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Sheet(props: React.ComponentProps<typeof SheetPrimitive.Root>) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\nfunction SheetTrigger(props: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose(props: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nconst sideClasses = {\n right: 'inset-y-0 right-0 h-full w-3/4 border-l [--bl-sheet-x:100%] sm:max-w-sm',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r [--bl-sheet-x:-100%] sm:max-w-sm',\n // Top and bottom sheets are the mobile drawers.\n top: 'inset-x-0 top-0 max-h-[85dvh] rounded-b-xl border-b [--bl-sheet-x:0] [--bl-sheet-y:-100%]',\n bottom:\n 'inset-x-0 bottom-0 max-h-[85dvh] rounded-t-xl border-t [--bl-sheet-x:0] [--bl-sheet-y:100%]',\n} as const;\n\nfunction SheetContent({\n className,\n children,\n side = 'right',\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & { side?: keyof typeof sideClasses }) {\n return (\n <SheetPrimitive.Portal>\n <SheetPrimitive.Overlay\n data-slot=\"sheet-overlay\"\n className=\"fixed inset-0 z-50 bg-black/55 backdrop-blur-[3px] data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in\"\n />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n className={cn(\n 'fixed z-50 flex flex-col gap-4 border-border-strong bg-surface-raised text-foreground shadow-[0_24px_80px_rgb(0_0_0_/_0.28)] outline-none data-[state=closed]:animate-sheet-out data-[state=open]:animate-sheet-in',\n sideClasses[side],\n className,\n )}\n {...props}\n >\n {children}\n <SheetPrimitive.Close className=\"absolute top-3.5 right-3.5 grid size-8 place-items-center rounded-md text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20 [&_svg]:size-4\">\n <X aria-hidden />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPrimitive.Portal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn('flex flex-col gap-1.5 p-4', className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn('text-base font-semibold tracking-[-0.02em] text-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n};\n"],"mappings":";;;;;;AAMA,SAAS,MAAM,OAAyD;CACtE,OAAO,oBAACA,OAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,SAAS,aAAa,OAA4D;CAChF,OAAO,oBAACA,OAAe,SAAhB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;AAEA,SAAS,WAAW,OAA0D;CAC5E,OAAO,oBAACA,OAAe,OAAhB;EAAsB,aAAU;EAAc,GAAI;CAAQ,CAAA;AACnE;AAEA,IAAM,cAAc;CAClB,OAAO;CACP,MAAM;CAEN,KAAK;CACL,QACE;AACJ;AAEA,SAAS,aAAa,EACpB,WACA,UACA,OAAO,SACP,GAAG,SACyF;CAC5F,OACE,qBAACA,OAAe,QAAhB,EAAA,UAAA,CACE,oBAACA,OAAe,SAAhB;EACE,aAAU;EACV,WAAU;CACX,CAAA,GACD,qBAACA,OAAe,SAAhB;EACE,aAAU;EACV,WAAW,GACT,sNACA,YAAY,OACZ,SACF;EACA,GAAI;EAPN,UAAA,CASG,UACD,qBAACA,OAAe,OAAhB;GAAsB,WAAU;GAAhC,UAAA,CACE,oBAAC,GAAD,EAAG,eAAA,KAAa,CAAA,GAChB,oBAAC,QAAD;IAAM,WAAU;IAAU,UAAA;GAAW,CAAA,CACjB;EACA,CAAA,CAAA;CACH,CAAA,CAAA,EAAA,CAAA;AAE3B;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA4D;CAC9F,OACE,oBAACA,OAAe,OAAhB;EACE,aAAU;EACV,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EACxB,WACA,GAAG,SACuD;CAC1D,OACE,oBAACA,OAAe,aAAhB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
@@ -27,7 +27,7 @@ function TabsTrigger({ className, ...props }) {
27
27
  function TabsContent({ className, ...props }) {
28
28
  return /* @__PURE__ */ jsx(Tabs.Content, {
29
29
  "data-slot": "tabs-content",
30
- className: cn("min-w-0 flex-1 outline-none", className),
30
+ className: cn("min-w-0 flex-1 outline-none data-[state=active]:animate-fade-in", className),
31
31
  ...props
32
32
  });
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","names":["Tabs","TabsPrimitive"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import { Tabs as TabsPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'inline-flex h-9 w-fit items-center gap-0.5 rounded-md border border-border bg-surface-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-sm px-2.5 text-[13px] font-semibold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-xs hover:text-foreground [&_svg]:size-3.5',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('min-w-0 flex-1 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"],"mappings":";;;;;AAKA,SAASA,OAAK,EAAE,WAAW,GAAG,SAA0D;CACtF,OACE,oBAACC,KAAc,MAAf;EACE,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA0D;CAC1F,OACE,oBAACA,KAAc,MAAf;EACE,aAAU;EACV,WAAW,GACT,yHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,KAAc,SAAf;EACE,aAAU;EACV,WAAW,GACT,saACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,KAAc,SAAf;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,SAAS;EACtD,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"tabs.js","names":["Tabs","TabsPrimitive"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["import { Tabs as TabsPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nfunction Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-3', className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'inline-flex h-9 w-fit items-center gap-0.5 rounded-md border border-border bg-surface-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n 'inline-flex h-7 min-w-0 items-center justify-center gap-1.5 rounded-sm px-2.5 text-[13px] font-semibold whitespace-nowrap outline-none transition-[background-color,color,box-shadow] focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface data-[state=active]:text-foreground data-[state=active]:shadow-xs hover:text-foreground [&_svg]:size-3.5',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('min-w-0 flex-1 outline-none data-[state=active]:animate-fade-in', className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"],"mappings":";;;;;AAKA,SAASA,OAAK,EAAE,WAAW,GAAG,SAA0D;CACtF,OACE,oBAACC,KAAc,MAAf;EACE,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,SAAS,EAAE,WAAW,GAAG,SAA0D;CAC1F,OACE,oBAACA,KAAc,MAAf;EACE,aAAU;EACV,WAAW,GACT,yHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,KAAc,SAAf;EACE,aAAU;EACV,WAAW,GACT,saACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,KAAc,SAAf;EACE,aAAU;EACV,WAAW,GAAG,mEAAmE,SAAS;EAC1F,GAAI;CACL,CAAA;AAEL"}
@@ -18,7 +18,7 @@ function ToastViewport({ className, ...props }) {
18
18
  ...props
19
19
  });
20
20
  }
21
- var toastVariants = cva("group pointer-events-auto relative grid w-full grid-cols-[1fr_auto] items-start gap-x-3 gap-y-1 overflow-hidden rounded-lg border p-4 pr-10 text-sm shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none", {
21
+ var toastVariants = cva("group pointer-events-auto relative grid w-full grid-cols-[1fr_auto] items-start gap-x-3 gap-y-1 overflow-hidden rounded-lg border p-4 pr-10 text-sm shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] [--bl-ty:12px] [--bl-scale:0.98] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none", {
22
22
  variants: { variant: {
23
23
  default: "border-border-strong bg-surface-raised text-foreground",
24
24
  success: "border-success/30 bg-surface-raised text-foreground [&_[data-slot=toast-title]]:text-success",
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","names":["ToastPrimitive","Toast"],"sources":["../../src/components/toast.tsx"],"sourcesContent":["import X from '@burtson-labs/icons/react/x';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\n/**\n * Brief, non-blocking notices (\"Message sent\", \"Update available\"). Put one\n * `ToastProvider` + `ToastViewport` near the root and render `Toast`s with\n * `open` state; Radix handles timing, swipe-to-dismiss and the live region.\n */\nconst ToastProvider = ToastPrimitive.Provider;\n\nfunction ToastViewport({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitive.Viewport>) {\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n className={cn(\n 'fixed right-0 bottom-0 z-[100] flex max-h-dvh w-full flex-col-reverse gap-2 p-4 outline-none sm:max-w-sm',\n className,\n )}\n {...props}\n />\n );\n}\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative grid w-full grid-cols-[1fr_auto] items-start gap-x-3 gap-y-1 overflow-hidden rounded-lg border p-4 pr-10 text-sm shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none',\n {\n variants: {\n variant: {\n default: 'border-border-strong bg-surface-raised text-foreground',\n success:\n 'border-success/30 bg-surface-raised text-foreground [&_[data-slot=toast-title]]:text-success',\n destructive:\n 'border-destructive/30 bg-surface-raised text-foreground [&_[data-slot=toast-title]]:text-destructive',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nfunction Toast({\n className,\n variant,\n ...props\n}: React.ComponentProps<typeof ToastPrimitive.Root> & VariantProps<typeof toastVariants>) {\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nfunction ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Title>) {\n return (\n <ToastPrimitive.Title\n data-slot=\"toast-title\"\n className={cn('col-start-1 font-semibold tracking-[-0.01em]', className)}\n {...props}\n />\n );\n}\n\nfunction ToastDescription({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitive.Description>) {\n return (\n <ToastPrimitive.Description\n data-slot=\"toast-description\"\n className={cn('col-start-1 text-[13px] leading-5 text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\n/** A button inside the toast; `altText` tells screen readers how to do it without the toast. */\nfunction ToastAction({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Action>) {\n return (\n <ToastPrimitive.Action\n data-slot=\"toast-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 inline-flex h-8 shrink-0 items-center justify-center self-center rounded-md border border-border-strong bg-surface px-3 text-[13px] font-semibold transition-colors outline-none hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/20',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Close>) {\n return (\n <ToastPrimitive.Close\n data-slot=\"toast-close\"\n aria-label=\"Dismiss\"\n className={cn(\n 'absolute top-3 right-3 grid size-6 place-items-center rounded-sm text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20 [&_svg]:size-3.5',\n className,\n )}\n {...props}\n >\n <X aria-hidden />\n </ToastPrimitive.Close>\n );\n}\n\nexport {\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n toastVariants,\n ToastViewport,\n};\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,gBAAgBA,MAAe;AAErC,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,MAAe,UAAhB;EACE,aAAU;EACV,WAAW,GACT,4GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,gBAAgB,IACpB,mbACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,SACE;EACF,aACE;CACJ,EACF;CACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CACF;AAEA,SAASC,QAAM,EACb,WACA,SACA,GAAG,SACqF;CACxF,OACE,oBAACD,MAAe,MAAhB;EACE,aAAU;EACV,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA4D;CAC9F,OACE,oBAACA,MAAe,OAAhB;EACE,aAAU;EACV,WAAW,GAAG,gDAAgD,SAAS;EACvE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EACxB,WACA,GAAG,SACuD;CAC1D,OACE,oBAACA,MAAe,aAAhB;EACE,aAAU;EACV,WAAW,GAAG,2DAA2D,SAAS;EAClF,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,MAAe,QAAhB;EACE,aAAU;EACV,WAAW,GACT,0RACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA4D;CAC9F,OACE,oBAACA,MAAe,OAAhB;EACE,aAAU;EACV,cAAW;EACX,WAAW,GACT,mOACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,GAAD,EAAG,eAAA,KAAa,CAAA;CACI,CAAA;AAE1B"}
1
+ {"version":3,"file":"toast.js","names":["ToastPrimitive","Toast"],"sources":["../../src/components/toast.tsx"],"sourcesContent":["import X from '@burtson-labs/icons/react/x';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\n/**\n * Brief, non-blocking notices (\"Message sent\", \"Update available\"). Put one\n * `ToastProvider` + `ToastViewport` near the root and render `Toast`s with\n * `open` state; Radix handles timing, swipe-to-dismiss and the live region.\n */\nconst ToastProvider = ToastPrimitive.Provider;\n\nfunction ToastViewport({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitive.Viewport>) {\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n className={cn(\n 'fixed right-0 bottom-0 z-[100] flex max-h-dvh w-full flex-col-reverse gap-2 p-4 outline-none sm:max-w-sm',\n className,\n )}\n {...props}\n />\n );\n}\n\nconst toastVariants = cva(\n 'group pointer-events-auto relative grid w-full grid-cols-[1fr_auto] items-start gap-x-3 gap-y-1 overflow-hidden rounded-lg border p-4 pr-10 text-sm shadow-[0_16px_48px_rgb(0_0_0_/_0.18)] [--bl-ty:12px] [--bl-scale:0.98] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none',\n {\n variants: {\n variant: {\n default: 'border-border-strong bg-surface-raised text-foreground',\n success:\n 'border-success/30 bg-surface-raised text-foreground [&_[data-slot=toast-title]]:text-success',\n destructive:\n 'border-destructive/30 bg-surface-raised text-foreground [&_[data-slot=toast-title]]:text-destructive',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nfunction Toast({\n className,\n variant,\n ...props\n}: React.ComponentProps<typeof ToastPrimitive.Root> & VariantProps<typeof toastVariants>) {\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nfunction ToastTitle({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Title>) {\n return (\n <ToastPrimitive.Title\n data-slot=\"toast-title\"\n className={cn('col-start-1 font-semibold tracking-[-0.01em]', className)}\n {...props}\n />\n );\n}\n\nfunction ToastDescription({\n className,\n ...props\n}: React.ComponentProps<typeof ToastPrimitive.Description>) {\n return (\n <ToastPrimitive.Description\n data-slot=\"toast-description\"\n className={cn('col-start-1 text-[13px] leading-5 text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\n/** A button inside the toast; `altText` tells screen readers how to do it without the toast. */\nfunction ToastAction({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Action>) {\n return (\n <ToastPrimitive.Action\n data-slot=\"toast-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 inline-flex h-8 shrink-0 items-center justify-center self-center rounded-md border border-border-strong bg-surface px-3 text-[13px] font-semibold transition-colors outline-none hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/20',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ToastClose({ className, ...props }: React.ComponentProps<typeof ToastPrimitive.Close>) {\n return (\n <ToastPrimitive.Close\n data-slot=\"toast-close\"\n aria-label=\"Dismiss\"\n className={cn(\n 'absolute top-3 right-3 grid size-6 place-items-center rounded-sm text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/20 [&_svg]:size-3.5',\n className,\n )}\n {...props}\n >\n <X aria-hidden />\n </ToastPrimitive.Close>\n );\n}\n\nexport {\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n toastVariants,\n ToastViewport,\n};\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,gBAAgBA,MAAe;AAErC,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,MAAe,UAAhB;EACE,aAAU;EACV,WAAW,GACT,4GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,gBAAgB,IACpB,odACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,SACE;EACF,aACE;CACJ,EACF;CACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CACF;AAEA,SAASC,QAAM,EACb,WACA,SACA,GAAG,SACqF;CACxF,OACE,oBAACD,MAAe,MAAhB;EACE,aAAU;EACV,WAAW,GAAG,cAAc,EAAE,QAAQ,CAAC,GAAG,SAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA4D;CAC9F,OACE,oBAACA,MAAe,OAAhB;EACE,aAAU;EACV,WAAW,GAAG,gDAAgD,SAAS;EACvE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,iBAAiB,EACxB,WACA,GAAG,SACuD;CAC1D,OACE,oBAACA,MAAe,aAAhB;EACE,aAAU;EACV,WAAW,GAAG,2DAA2D,SAAS;EAClF,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA6D;CAChG,OACE,oBAACA,MAAe,QAAhB;EACE,aAAU;EACV,WAAW,GACT,0RACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAA4D;CAC9F,OACE,oBAACA,MAAe,OAAhB;EACE,aAAU;EACV,cAAW;EACX,WAAW,GACT,mOACA,SACF;EACA,GAAI;EAEJ,UAAA,oBAAC,GAAD,EAAG,eAAA,KAAa,CAAA;CACI,CAAA;AAE1B"}
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ export type ToolCallStatus = 'pending' | 'running' | 'success' | 'error';
3
+ export interface ToolCallProps extends Omit<React.ComponentProps<'div'>, 'title'> {
4
+ /** The tool's name, e.g. `get_load`. */
5
+ name: string;
6
+ status: ToolCallStatus;
7
+ /** Arguments the agent passed; shown as formatted JSON. */
8
+ args?: unknown;
9
+ /** What the tool returned; shown as formatted JSON. */
10
+ result?: unknown;
11
+ /** Error message when the call failed. */
12
+ error?: string;
13
+ durationMs?: number;
14
+ defaultOpen?: boolean;
15
+ }
16
+ /** A tool call an agent made: name, live status, and collapsible arguments and result. */
17
+ declare function ToolCall({ name, status, args, result, error, durationMs, defaultOpen, className, ...props }: ToolCallProps): React.JSX.Element;
18
+ export interface ToolApprovalProps extends Omit<React.ComponentProps<'div'>, 'title'> {
19
+ name: string;
20
+ /** What will happen, in plain words, e.g. "Approve L-1042 and send it to Gravitate". */
21
+ description: React.ReactNode;
22
+ args?: unknown;
23
+ /** `pending` shows the buttons; the others record the decision. */
24
+ state?: 'pending' | 'approved' | 'denied';
25
+ onApprove?: () => void;
26
+ onDeny?: () => void;
27
+ approveLabel?: string;
28
+ denyLabel?: string;
29
+ }
30
+ /** A gate before an agent runs a tool with side effects: the person approves or denies it. */
31
+ declare function ToolApproval({ name, description, args, state, onApprove, onDeny, approveLabel, denyLabel, className, ...props }: ToolApprovalProps): React.JSX.Element;
32
+ export { ToolApproval, ToolCall };
@@ -0,0 +1,152 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { Button } from "./button.js";
3
+ import { StatusDot } from "./status.js";
4
+ import { Collapsible } from "radix-ui";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import ChevronRight from "@burtson-labs/icons/react/chevron-right";
8
+ import Wrench from "@burtson-labs/icons/react/wrench";
9
+ //#region src/components/tool-call.tsx
10
+ var statusText = {
11
+ pending: "Queued",
12
+ running: "Running",
13
+ success: "Done",
14
+ error: "Failed"
15
+ };
16
+ var statusDot = {
17
+ pending: "neutral",
18
+ running: "brand",
19
+ success: "success",
20
+ error: "danger"
21
+ };
22
+ var json = (v) => typeof v === "string" ? v : JSON.stringify(v, null, 2);
23
+ /** A tool call an agent made: name, live status, and collapsible arguments and result. */
24
+ function ToolCall({ name, status, args, result, error, durationMs, defaultOpen = false, className, ...props }) {
25
+ const hasDetail = args !== void 0 || result !== void 0 || Boolean(error);
26
+ return /* @__PURE__ */ jsx(Collapsible.Root, {
27
+ defaultOpen,
28
+ disabled: !hasDetail,
29
+ children: /* @__PURE__ */ jsxs("div", {
30
+ "data-slot": "tool-call",
31
+ "data-status": status,
32
+ className: cn("animate-in overflow-hidden rounded-md border bg-surface text-[13px]", status === "error" && "border-destructive/30", className),
33
+ ...props,
34
+ children: [/* @__PURE__ */ jsxs(Collapsible.Trigger, {
35
+ className: "group/tool flex h-9 w-full items-center gap-2 px-3 text-left outline-none hover:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-default disabled:hover:bg-transparent",
36
+ children: [
37
+ /* @__PURE__ */ jsx(Wrench, {
38
+ className: "size-3.5 shrink-0 text-muted-foreground",
39
+ "aria-hidden": true
40
+ }),
41
+ /* @__PURE__ */ jsx("span", {
42
+ className: "min-w-0 flex-1 truncate font-mono text-[12.5px]",
43
+ children: name
44
+ }),
45
+ /* @__PURE__ */ jsxs("span", {
46
+ className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground",
47
+ children: [
48
+ /* @__PURE__ */ jsx(StatusDot, {
49
+ status: statusDot[status],
50
+ pulse: status === "running"
51
+ }),
52
+ statusText[status],
53
+ durationMs !== void 0 && status !== "running" && /* @__PURE__ */ jsxs("span", {
54
+ className: "tabular-nums",
55
+ children: [
56
+ "· ",
57
+ (durationMs / 1e3).toFixed(1),
58
+ "s"
59
+ ]
60
+ })
61
+ ]
62
+ }),
63
+ hasDetail && /* @__PURE__ */ jsx(ChevronRight, {
64
+ "aria-hidden": true,
65
+ className: "size-3.5 text-muted-foreground transition-transform group-data-[state=open]/tool:rotate-90"
66
+ })
67
+ ]
68
+ }), /* @__PURE__ */ jsx(Collapsible.Content, {
69
+ className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
70
+ children: /* @__PURE__ */ jsxs("div", {
71
+ className: "grid gap-2 border-t p-3",
72
+ children: [args !== void 0 && /* @__PURE__ */ jsxs("section", {
73
+ className: "grid gap-1",
74
+ children: [/* @__PURE__ */ jsx("h4", {
75
+ className: "text-[11px] font-semibold tracking-[0.06em] text-muted-foreground uppercase",
76
+ children: "Arguments"
77
+ }), /* @__PURE__ */ jsx("pre", {
78
+ className: "overflow-x-auto rounded-sm bg-muted/60 p-2 font-mono text-[12px] leading-5",
79
+ children: json(args)
80
+ })]
81
+ }), error ? /* @__PURE__ */ jsx("p", {
82
+ role: "alert",
83
+ className: "text-xs font-medium text-destructive",
84
+ children: error
85
+ }) : result !== void 0 && /* @__PURE__ */ jsxs("section", {
86
+ className: "grid gap-1",
87
+ children: [/* @__PURE__ */ jsx("h4", {
88
+ className: "text-[11px] font-semibold tracking-[0.06em] text-muted-foreground uppercase",
89
+ children: "Result"
90
+ }), /* @__PURE__ */ jsx("pre", {
91
+ className: "max-h-64 overflow-auto rounded-sm bg-muted/60 p-2 font-mono text-[12px] leading-5",
92
+ children: json(result)
93
+ })]
94
+ })]
95
+ })
96
+ })]
97
+ })
98
+ });
99
+ }
100
+ /** A gate before an agent runs a tool with side effects: the person approves or denies it. */
101
+ function ToolApproval({ name, description, args, state = "pending", onApprove, onDeny, approveLabel = "Approve", denyLabel = "Deny", className, ...props }) {
102
+ return /* @__PURE__ */ jsxs("div", {
103
+ "data-slot": "tool-approval",
104
+ "data-state": state,
105
+ className: cn("grid animate-in gap-3 rounded-md border p-3 text-[13px]", state === "pending" ? "border-warning/40 bg-warning/5" : "bg-surface", className),
106
+ ...props,
107
+ children: [
108
+ /* @__PURE__ */ jsxs("div", {
109
+ className: "flex items-center gap-2",
110
+ children: [
111
+ /* @__PURE__ */ jsx(Wrench, {
112
+ className: "size-3.5 text-muted-foreground",
113
+ "aria-hidden": true
114
+ }),
115
+ /* @__PURE__ */ jsx("span", {
116
+ className: "font-mono text-[12.5px]",
117
+ children: name
118
+ }),
119
+ /* @__PURE__ */ jsx("span", {
120
+ className: "ml-auto text-xs text-muted-foreground",
121
+ children: state === "pending" ? "Needs your approval" : state === "approved" ? "Approved" : "Denied"
122
+ })
123
+ ]
124
+ }),
125
+ /* @__PURE__ */ jsx("p", {
126
+ className: "text-sm",
127
+ children: description
128
+ }),
129
+ args !== void 0 && /* @__PURE__ */ jsx("pre", {
130
+ className: "overflow-x-auto rounded-sm bg-muted/60 p-2 font-mono text-[12px] leading-5",
131
+ children: json(args)
132
+ }),
133
+ state === "pending" && /* @__PURE__ */ jsxs("div", {
134
+ className: "flex justify-end gap-2",
135
+ children: [/* @__PURE__ */ jsx(Button, {
136
+ size: "sm",
137
+ variant: "outline",
138
+ onClick: onDeny,
139
+ children: denyLabel
140
+ }), /* @__PURE__ */ jsx(Button, {
141
+ size: "sm",
142
+ onClick: onApprove,
143
+ children: approveLabel
144
+ })]
145
+ })
146
+ ]
147
+ });
148
+ }
149
+ //#endregion
150
+ export { ToolApproval, ToolCall };
151
+
152
+ //# sourceMappingURL=tool-call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-call.js","names":["CollapsiblePrimitive"],"sources":["../../src/components/tool-call.tsx"],"sourcesContent":["import ChevronRight from '@burtson-labs/icons/react/chevron-right';\nimport Wrench from '@burtson-labs/icons/react/wrench';\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nimport { Button } from './button';\nimport { StatusDot } from './status';\n\nexport type ToolCallStatus = 'pending' | 'running' | 'success' | 'error';\n\nconst statusText: Record<ToolCallStatus, string> = {\n pending: 'Queued',\n running: 'Running',\n success: 'Done',\n error: 'Failed',\n};\nconst statusDot = {\n pending: 'neutral',\n running: 'brand',\n success: 'success',\n error: 'danger',\n} as const;\n\nconst json = (v: unknown) => (typeof v === 'string' ? v : JSON.stringify(v, null, 2));\n\nexport interface ToolCallProps extends Omit<React.ComponentProps<'div'>, 'title'> {\n /** The tool's name, e.g. `get_load`. */\n name: string;\n status: ToolCallStatus;\n /** Arguments the agent passed; shown as formatted JSON. */\n args?: unknown;\n /** What the tool returned; shown as formatted JSON. */\n result?: unknown;\n /** Error message when the call failed. */\n error?: string;\n durationMs?: number;\n defaultOpen?: boolean;\n}\n\n/** A tool call an agent made: name, live status, and collapsible arguments and result. */\nfunction ToolCall({\n name,\n status,\n args,\n result,\n error,\n durationMs,\n defaultOpen = false,\n className,\n ...props\n}: ToolCallProps) {\n const hasDetail = args !== undefined || result !== undefined || Boolean(error);\n return (\n <CollapsiblePrimitive.Root defaultOpen={defaultOpen} disabled={!hasDetail}>\n <div\n data-slot=\"tool-call\"\n data-status={status}\n className={cn(\n 'animate-in overflow-hidden rounded-md border bg-surface text-[13px]',\n status === 'error' && 'border-destructive/30',\n className,\n )}\n {...props}\n >\n <CollapsiblePrimitive.Trigger className=\"group/tool flex h-9 w-full items-center gap-2 px-3 text-left outline-none hover:bg-muted/60 focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-default disabled:hover:bg-transparent\">\n <Wrench className=\"size-3.5 shrink-0 text-muted-foreground\" aria-hidden />\n <span className=\"min-w-0 flex-1 truncate font-mono text-[12.5px]\">{name}</span>\n <span className=\"inline-flex items-center gap-1.5 text-xs text-muted-foreground\">\n <StatusDot status={statusDot[status]} pulse={status === 'running'} />\n {statusText[status]}\n {durationMs !== undefined && status !== 'running' && (\n <span className=\"tabular-nums\">· {(durationMs / 1000).toFixed(1)}s</span>\n )}\n </span>\n {hasDetail && (\n <ChevronRight\n aria-hidden\n className=\"size-3.5 text-muted-foreground transition-transform group-data-[state=open]/tool:rotate-90\"\n />\n )}\n </CollapsiblePrimitive.Trigger>\n <CollapsiblePrimitive.Content className=\"overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down\">\n <div className=\"grid gap-2 border-t p-3\">\n {args !== undefined && (\n <section className=\"grid gap-1\">\n <h4 className=\"text-[11px] font-semibold tracking-[0.06em] text-muted-foreground uppercase\">\n Arguments\n </h4>\n <pre className=\"overflow-x-auto rounded-sm bg-muted/60 p-2 font-mono text-[12px] leading-5\">\n {json(args)}\n </pre>\n </section>\n )}\n {error ? (\n <p role=\"alert\" className=\"text-xs font-medium text-destructive\">\n {error}\n </p>\n ) : (\n result !== undefined && (\n <section className=\"grid gap-1\">\n <h4 className=\"text-[11px] font-semibold tracking-[0.06em] text-muted-foreground uppercase\">\n Result\n </h4>\n <pre className=\"max-h-64 overflow-auto rounded-sm bg-muted/60 p-2 font-mono text-[12px] leading-5\">\n {json(result)}\n </pre>\n </section>\n )\n )}\n </div>\n </CollapsiblePrimitive.Content>\n </div>\n </CollapsiblePrimitive.Root>\n );\n}\n\nexport interface ToolApprovalProps extends Omit<React.ComponentProps<'div'>, 'title'> {\n name: string;\n /** What will happen, in plain words, e.g. \"Approve L-1042 and send it to Gravitate\". */\n description: React.ReactNode;\n args?: unknown;\n /** `pending` shows the buttons; the others record the decision. */\n state?: 'pending' | 'approved' | 'denied';\n onApprove?: () => void;\n onDeny?: () => void;\n approveLabel?: string;\n denyLabel?: string;\n}\n\n/** A gate before an agent runs a tool with side effects: the person approves or denies it. */\nfunction ToolApproval({\n name,\n description,\n args,\n state = 'pending',\n onApprove,\n onDeny,\n approveLabel = 'Approve',\n denyLabel = 'Deny',\n className,\n ...props\n}: ToolApprovalProps) {\n return (\n <div\n data-slot=\"tool-approval\"\n data-state={state}\n className={cn(\n 'grid animate-in gap-3 rounded-md border p-3 text-[13px]',\n state === 'pending' ? 'border-warning/40 bg-warning/5' : 'bg-surface',\n className,\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n <Wrench className=\"size-3.5 text-muted-foreground\" aria-hidden />\n <span className=\"font-mono text-[12.5px]\">{name}</span>\n <span className=\"ml-auto text-xs text-muted-foreground\">\n {state === 'pending'\n ? 'Needs your approval'\n : state === 'approved'\n ? 'Approved'\n : 'Denied'}\n </span>\n </div>\n <p className=\"text-sm\">{description}</p>\n {args !== undefined && (\n <pre className=\"overflow-x-auto rounded-sm bg-muted/60 p-2 font-mono text-[12px] leading-5\">\n {json(args)}\n </pre>\n )}\n {state === 'pending' && (\n <div className=\"flex justify-end gap-2\">\n <Button size=\"sm\" variant=\"outline\" onClick={onDeny}>\n {denyLabel}\n </Button>\n <Button size=\"sm\" onClick={onApprove}>\n {approveLabel}\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nexport { ToolApproval, ToolCall };\n"],"mappings":";;;;;;;;;AAYA,IAAM,aAA6C;CACjD,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;AACT;AACA,IAAM,YAAY;CAChB,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,IAAM,QAAQ,MAAgB,OAAO,MAAM,WAAW,IAAI,KAAK,UAAU,GAAG,MAAM,CAAC;;AAiBnF,SAAS,SAAS,EAChB,MACA,QACA,MACA,QACA,OACA,YACA,cAAc,OACd,WACA,GAAG,SACa;CAChB,MAAM,YAAY,SAAS,KAAA,KAAa,WAAW,KAAA,KAAa,QAAQ,KAAK;CAC7E,OACE,oBAACA,YAAqB,MAAtB;EAAwC;EAAa,UAAU,CAAC;EAC9D,UAAA,qBAAC,OAAD;GACE,aAAU;GACV,eAAa;GACb,WAAW,GACT,uEACA,WAAW,WAAW,yBACtB,SACF;GACA,GAAI;GARN,UAAA,CAUE,qBAACA,YAAqB,SAAtB;IAA8B,WAAU;IAAxC,UAAA;KACE,oBAAC,QAAD;MAAQ,WAAU;MAA0C,eAAA;KAAa,CAAA;KACzE,oBAAC,QAAD;MAAM,WAAU;MAAmD,UAAA;KAAW,CAAA;KAC9E,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA;OACE,oBAAC,WAAD;QAAW,QAAQ,UAAU;QAAS,OAAO,WAAW;OAAY,CAAA;OACnE,WAAW;OACX,eAAe,KAAA,KAAa,WAAW,aACtC,qBAAC,QAAD;QAAM,WAAU;QAAhB,UAAA;SAA+B;UAAI,aAAa,IAAA,CAAM,QAAQ,CAAC;SAAE;QAAO;;MAEtE;;KACL,aACC,oBAAC,cAAD;MACE,eAAA;MACA,WAAU;KACX,CAAA;IAEyB;GAC9B,CAAA,GAAA,oBAACA,YAAqB,SAAtB;IAA8B,WAAU;IACtC,UAAA,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACG,SAAS,KAAA,KACR,qBAAC,WAAD;MAAS,WAAU;MAAnB,UAAA,CACE,oBAAC,MAAD;OAAI,WAAU;OAA8E,UAAA;MAExF,CAAA,GACJ,oBAAC,OAAD;OAAK,WAAU;OACZ,UAAA,KAAK,IAAI;MACP,CAAA,CACE;KAEV,CAAA,GAAA,QACC,oBAAC,KAAD;MAAG,MAAK;MAAQ,WAAU;MACvB,UAAA;KACA,CAAA,IAEH,WAAW,KAAA,KACT,qBAAC,WAAD;MAAS,WAAU;MAAnB,UAAA,CACE,oBAAC,MAAD;OAAI,WAAU;OAA8E,UAAA;MAExF,CAAA,GACJ,oBAAC,OAAD;OAAK,WAAU;OACZ,UAAA,KAAK,MAAM;MACT,CAAA,CACE;KAGV,CAAA,CAAA;;GACuB,CAAA,CAC3B;;CACoB,CAAA;AAE/B;;AAgBA,SAAS,aAAa,EACpB,MACA,aACA,MACA,QAAQ,WACR,WACA,QACA,eAAe,WACf,YAAY,QACZ,WACA,GAAG,SACiB;CACpB,OACE,qBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,WAAW,GACT,2DACA,UAAU,YAAY,mCAAmC,cACzD,SACF;EACA,GAAI;EARN,UAAA;GAUE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,oBAAC,QAAD;MAAQ,WAAU;MAAiC,eAAA;KAAa,CAAA;KAChE,oBAAC,QAAD;MAAM,WAAU;MAA2B,UAAA;KAAW,CAAA;KACtD,oBAAC,QAAD;MAAM,WAAU;MACb,UAAA,UAAU,YACP,wBACA,UAAU,aACR,aACA;KACF,CAAA;IACH;;GACL,oBAAC,KAAD;IAAG,WAAU;IAAW,UAAA;GAAe,CAAA;GACtC,SAAS,KAAA,KACR,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA,KAAK,IAAI;GACP,CAAA;GAEN,UAAU,aACT,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,QAAD;KAAQ,MAAK;KAAK,SAAQ;KAAU,SAAS;KAC1C,UAAA;IACK,CAAA,GACR,oBAAC,QAAD;KAAQ,MAAK;KAAK,SAAS;KACxB,UAAA;IACK,CAAA,CACL;;EAEJ;;AAET"}
@@ -27,7 +27,7 @@ function TooltipContent({ className, sideOffset = 6, children, ...props }) {
27
27
  return /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsxs(Tooltip.Content, {
28
28
  "data-slot": "tooltip-content",
29
29
  sideOffset,
30
- className: cn("z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) animate-in rounded-sm border border-white/10 bg-code px-2 py-1 text-[11.5px] leading-4 font-medium text-balance text-code-foreground shadow-md data-[state=closed]:animate-out", className),
30
+ className: cn("z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) animate-in [--bl-scale:0.98] data-[side=bottom]:[--bl-ty:-4px] data-[side=top]:[--bl-ty:4px] data-[side=left]:[--bl-tx:4px] data-[side=right]:[--bl-tx:-4px] rounded-sm border border-white/10 bg-code px-2 py-1 text-[11.5px] leading-4 font-medium text-balance text-code-foreground shadow-md data-[state=closed]:animate-out", className),
31
31
  ...props,
32
32
  children: [children, /* @__PURE__ */ jsx(Tooltip.Arrow, { className: "fill-code" })]
33
33
  }) });