@townco/ui 0.1.6 → 0.1.7

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 (250) hide show
  1. package/README.md +11 -11
  2. package/dist/core/hooks/use-chat-input.d.ts +17 -17
  3. package/dist/core/hooks/use-chat-input.js +55 -64
  4. package/dist/core/hooks/use-chat-messages.d.ts +11 -11
  5. package/dist/core/hooks/use-chat-messages.js +114 -121
  6. package/dist/core/hooks/use-chat-session.d.ts +5 -5
  7. package/dist/core/hooks/use-chat-session.js +80 -78
  8. package/dist/core/index.d.ts +1 -1
  9. package/dist/core/index.js +1 -1
  10. package/dist/core/schemas/chat.d.ts +56 -83
  11. package/dist/core/schemas/chat.js +25 -27
  12. package/dist/core/store/chat-store.d.ts +22 -28
  13. package/dist/core/store/chat-store.js +50 -59
  14. package/dist/gui/components/Button.d.ts +7 -23
  15. package/dist/gui/components/Button.js +27 -40
  16. package/dist/gui/components/Card.d.ts +7 -26
  17. package/dist/gui/components/Card.js +8 -54
  18. package/dist/gui/components/ChatInput.d.ts +36 -58
  19. package/dist/gui/components/ChatInput.js +121 -191
  20. package/dist/gui/components/ChatSecondaryPanel.d.ts +11 -14
  21. package/dist/gui/components/ChatSecondaryPanel.js +38 -115
  22. package/dist/gui/components/ChatStatus.d.ts +2 -4
  23. package/dist/gui/components/ChatStatus.js +34 -45
  24. package/dist/gui/components/Conversation.d.ts +14 -17
  25. package/dist/gui/components/Conversation.js +83 -143
  26. package/dist/gui/components/Dialog.d.ts +11 -57
  27. package/dist/gui/components/Dialog.js +8 -84
  28. package/dist/gui/components/HeightTransition.d.ts +7 -12
  29. package/dist/gui/components/HeightTransition.js +77 -88
  30. package/dist/gui/components/Input.d.ts +6 -13
  31. package/dist/gui/components/Input.js +16 -27
  32. package/dist/gui/components/Label.d.ts +1 -7
  33. package/dist/gui/components/Label.js +2 -12
  34. package/dist/gui/components/MarkdownRenderer.d.ts +4 -6
  35. package/dist/gui/components/MarkdownRenderer.js +81 -178
  36. package/dist/gui/components/Message.d.ts +18 -25
  37. package/dist/gui/components/Message.js +23 -44
  38. package/dist/gui/components/MessageContent.d.ts +22 -29
  39. package/dist/gui/components/MessageContent.js +85 -157
  40. package/dist/gui/components/Reasoning.d.ts +24 -30
  41. package/dist/gui/components/Reasoning.js +60 -187
  42. package/dist/gui/components/Response.d.ts +9 -11
  43. package/dist/gui/components/Response.js +90 -229
  44. package/dist/gui/components/Select.d.ts +10 -69
  45. package/dist/gui/components/Select.js +12 -118
  46. package/dist/gui/components/Tabs.d.ts +4 -24
  47. package/dist/gui/components/Tabs.js +4 -32
  48. package/dist/gui/components/Task.d.ts +24 -28
  49. package/dist/gui/components/Task.js +31 -164
  50. package/dist/gui/components/Textarea.d.ts +7 -15
  51. package/dist/gui/components/Textarea.js +46 -63
  52. package/dist/gui/components/ThinkingBlock.d.ts +10 -20
  53. package/dist/gui/components/ThinkingBlock.js +35 -134
  54. package/dist/gui/components/TodoList.d.ts +10 -12
  55. package/dist/gui/components/TodoList.js +7 -22
  56. package/dist/gui/components/TodoListItem.d.ts +6 -9
  57. package/dist/gui/components/TodoListItem.js +4 -18
  58. package/dist/gui/components/index.d.ts +8 -59
  59. package/dist/gui/components/index.js +8 -42
  60. package/dist/gui/lib/utils.js +1 -1
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/index.test.js +1 -0
  64. package/dist/sdk/client/acp-client.d.ts +76 -88
  65. package/dist/sdk/client/acp-client.js +217 -215
  66. package/dist/sdk/index.d.ts +1 -1
  67. package/dist/sdk/index.js +1 -1
  68. package/dist/sdk/schemas/agent.d.ts +64 -111
  69. package/dist/sdk/schemas/agent.js +24 -24
  70. package/dist/sdk/schemas/message.d.ts +147 -245
  71. package/dist/sdk/schemas/message.js +40 -40
  72. package/dist/sdk/schemas/session.d.ts +135 -219
  73. package/dist/sdk/schemas/session.js +27 -27
  74. package/dist/sdk/transports/http.d.ts +55 -55
  75. package/dist/sdk/transports/http.js +469 -472
  76. package/dist/sdk/transports/stdio.d.ts +20 -20
  77. package/dist/sdk/transports/stdio.js +286 -289
  78. package/dist/sdk/transports/types.d.ts +42 -42
  79. package/dist/sdk/transports/websocket.d.ts +12 -12
  80. package/dist/sdk/transports/websocket.js +46 -52
  81. package/dist/tui/components/ChatView.d.ts +2 -4
  82. package/dist/tui/components/ChatView.js +18 -51
  83. package/dist/tui/components/GameOfLife.js +35 -64
  84. package/dist/tui/components/InputBox.d.ts +11 -18
  85. package/dist/tui/components/InputBox.js +10 -70
  86. package/dist/tui/components/MessageList.d.ts +2 -4
  87. package/dist/tui/components/MessageList.js +10 -37
  88. package/dist/tui/components/MultiSelect.d.ts +10 -15
  89. package/dist/tui/components/MultiSelect.js +73 -116
  90. package/dist/tui/components/ReadlineInput.d.ts +6 -12
  91. package/dist/tui/components/ReadlineInput.js +237 -252
  92. package/dist/tui/components/SingleSelect.d.ts +9 -15
  93. package/dist/tui/components/SingleSelect.js +43 -84
  94. package/dist/tui/components/StatusBar.d.ts +6 -11
  95. package/dist/tui/components/StatusBar.js +67 -102
  96. package/dist/tui/index.d.ts +1 -1
  97. package/dist/tui/index.js +1 -1
  98. package/package.json +2 -2
  99. package/dist/core/hooks/index.d.ts.map +0 -1
  100. package/dist/core/hooks/index.js.map +0 -1
  101. package/dist/core/hooks/use-chat-input.d.ts.map +0 -1
  102. package/dist/core/hooks/use-chat-input.js.map +0 -1
  103. package/dist/core/hooks/use-chat-messages.d.ts.map +0 -1
  104. package/dist/core/hooks/use-chat-messages.js.map +0 -1
  105. package/dist/core/hooks/use-chat-session.d.ts.map +0 -1
  106. package/dist/core/hooks/use-chat-session.js.map +0 -1
  107. package/dist/core/hooks/use-media-query.d.ts +0 -39
  108. package/dist/core/hooks/use-media-query.js +0 -80
  109. package/dist/core/index.d.ts.map +0 -1
  110. package/dist/core/index.js.map +0 -1
  111. package/dist/core/schemas/chat.d.ts.map +0 -1
  112. package/dist/core/schemas/chat.js.map +0 -1
  113. package/dist/core/schemas/index.d.ts.map +0 -1
  114. package/dist/core/schemas/index.js.map +0 -1
  115. package/dist/core/store/chat-store.d.ts.map +0 -1
  116. package/dist/core/store/chat-store.js.map +0 -1
  117. package/dist/gui/components/Button.d.ts.map +0 -1
  118. package/dist/gui/components/Button.js.map +0 -1
  119. package/dist/gui/components/Card.d.ts.map +0 -1
  120. package/dist/gui/components/Card.js.map +0 -1
  121. package/dist/gui/components/ChatHeader.d.ts +0 -65
  122. package/dist/gui/components/ChatHeader.js +0 -189
  123. package/dist/gui/components/ChatInput.d.ts.map +0 -1
  124. package/dist/gui/components/ChatInput.js.map +0 -1
  125. package/dist/gui/components/ChatInterface.d.ts +0 -12
  126. package/dist/gui/components/ChatInterface.d.ts.map +0 -1
  127. package/dist/gui/components/ChatInterface.js +0 -204
  128. package/dist/gui/components/ChatInterface.js.map +0 -1
  129. package/dist/gui/components/ChatLayout.d.ts +0 -82
  130. package/dist/gui/components/ChatLayout.js +0 -232
  131. package/dist/gui/components/ChatPanelTabContent.d.ts +0 -27
  132. package/dist/gui/components/ChatPanelTabContent.js +0 -93
  133. package/dist/gui/components/ChatPreview.d.ts +0 -12
  134. package/dist/gui/components/ChatPreview.d.ts.map +0 -1
  135. package/dist/gui/components/ChatPreview.js +0 -214
  136. package/dist/gui/components/ChatPreview.js.map +0 -1
  137. package/dist/gui/components/ChatSecondaryPanel.d.ts.map +0 -1
  138. package/dist/gui/components/ChatSecondaryPanel.js.map +0 -1
  139. package/dist/gui/components/ChatSidebar.d.ts +0 -27
  140. package/dist/gui/components/ChatSidebar.js +0 -57
  141. package/dist/gui/components/ChatStatus.d.ts.map +0 -1
  142. package/dist/gui/components/ChatStatus.js.map +0 -1
  143. package/dist/gui/components/ChatView.d.ts +0 -8
  144. package/dist/gui/components/ChatView.d.ts.map +0 -1
  145. package/dist/gui/components/ChatView.js +0 -42
  146. package/dist/gui/components/ChatView.js.map +0 -1
  147. package/dist/gui/components/ConfigPanel.d.ts +0 -20
  148. package/dist/gui/components/ConfigPanel.d.ts.map +0 -1
  149. package/dist/gui/components/ConfigPanel.js +0 -225
  150. package/dist/gui/components/ConfigPanel.js.map +0 -1
  151. package/dist/gui/components/Conversation.d.ts.map +0 -1
  152. package/dist/gui/components/Conversation.js.map +0 -1
  153. package/dist/gui/components/Dialog.d.ts.map +0 -1
  154. package/dist/gui/components/Dialog.js.map +0 -1
  155. package/dist/gui/components/DropdownMenu.d.ts +0 -108
  156. package/dist/gui/components/DropdownMenu.js +0 -215
  157. package/dist/gui/components/HeightTransition.d.ts.map +0 -1
  158. package/dist/gui/components/HeightTransition.js.map +0 -1
  159. package/dist/gui/components/Input.d.ts.map +0 -1
  160. package/dist/gui/components/Input.js.map +0 -1
  161. package/dist/gui/components/InputBox.d.ts +0 -21
  162. package/dist/gui/components/InputBox.d.ts.map +0 -1
  163. package/dist/gui/components/InputBox.js +0 -90
  164. package/dist/gui/components/InputBox.js.map +0 -1
  165. package/dist/gui/components/Label.d.ts.map +0 -1
  166. package/dist/gui/components/Label.js.map +0 -1
  167. package/dist/gui/components/MarkdownRenderer.d.ts.map +0 -1
  168. package/dist/gui/components/MarkdownRenderer.js.map +0 -1
  169. package/dist/gui/components/Message.d.ts.map +0 -1
  170. package/dist/gui/components/Message.js.map +0 -1
  171. package/dist/gui/components/MessageContent.d.ts.map +0 -1
  172. package/dist/gui/components/MessageContent.js.map +0 -1
  173. package/dist/gui/components/MessageList.d.ts.map +0 -1
  174. package/dist/gui/components/MessageList.js.map +0 -1
  175. package/dist/gui/components/PlaygroundLayout.d.ts +0 -14
  176. package/dist/gui/components/PlaygroundLayout.d.ts.map +0 -1
  177. package/dist/gui/components/PlaygroundLayout.js +0 -49
  178. package/dist/gui/components/PlaygroundLayout.js.map +0 -1
  179. package/dist/gui/components/Reasoning.d.ts.map +0 -1
  180. package/dist/gui/components/Reasoning.js.map +0 -1
  181. package/dist/gui/components/Response.d.ts.map +0 -1
  182. package/dist/gui/components/Response.js.map +0 -1
  183. package/dist/gui/components/Select.d.ts.map +0 -1
  184. package/dist/gui/components/Select.js.map +0 -1
  185. package/dist/gui/components/Sonner.d.ts +0 -7
  186. package/dist/gui/components/Sonner.js +0 -34
  187. package/dist/gui/components/StatusBar.d.ts +0 -12
  188. package/dist/gui/components/StatusBar.d.ts.map +0 -1
  189. package/dist/gui/components/StatusBar.js +0 -58
  190. package/dist/gui/components/StatusBar.js.map +0 -1
  191. package/dist/gui/components/Tabs.d.ts.map +0 -1
  192. package/dist/gui/components/Tabs.js.map +0 -1
  193. package/dist/gui/components/Task.d.ts.map +0 -1
  194. package/dist/gui/components/Task.js.map +0 -1
  195. package/dist/gui/components/Textarea.d.ts.map +0 -1
  196. package/dist/gui/components/Textarea.js.map +0 -1
  197. package/dist/gui/components/ThinkingBlock.d.ts.map +0 -1
  198. package/dist/gui/components/ThinkingBlock.js.map +0 -1
  199. package/dist/gui/components/TodoList.d.ts.map +0 -1
  200. package/dist/gui/components/TodoList.js.map +0 -1
  201. package/dist/gui/components/TodoListItem.d.ts.map +0 -1
  202. package/dist/gui/components/TodoListItem.js.map +0 -1
  203. package/dist/gui/components/index.d.ts.map +0 -1
  204. package/dist/gui/components/index.js.map +0 -1
  205. package/dist/gui/index.d.ts.map +0 -1
  206. package/dist/gui/index.js.map +0 -1
  207. package/dist/gui/lib/utils.d.ts.map +0 -1
  208. package/dist/gui/lib/utils.js.map +0 -1
  209. package/dist/index.d.ts.map +0 -1
  210. package/dist/index.js.map +0 -1
  211. package/dist/sdk/client/acp-client.d.ts.map +0 -1
  212. package/dist/sdk/client/acp-client.js.map +0 -1
  213. package/dist/sdk/client/index.d.ts.map +0 -1
  214. package/dist/sdk/client/index.js.map +0 -1
  215. package/dist/sdk/index.d.ts.map +0 -1
  216. package/dist/sdk/index.js.map +0 -1
  217. package/dist/sdk/schemas/agent.d.ts.map +0 -1
  218. package/dist/sdk/schemas/agent.js.map +0 -1
  219. package/dist/sdk/schemas/index.d.ts.map +0 -1
  220. package/dist/sdk/schemas/index.js.map +0 -1
  221. package/dist/sdk/schemas/message.d.ts.map +0 -1
  222. package/dist/sdk/schemas/message.js.map +0 -1
  223. package/dist/sdk/schemas/session.d.ts.map +0 -1
  224. package/dist/sdk/schemas/session.js.map +0 -1
  225. package/dist/sdk/transports/http.d.ts.map +0 -1
  226. package/dist/sdk/transports/http.js.map +0 -1
  227. package/dist/sdk/transports/index.d.ts.map +0 -1
  228. package/dist/sdk/transports/index.js.map +0 -1
  229. package/dist/sdk/transports/stdio.d.ts.map +0 -1
  230. package/dist/sdk/transports/stdio.js.map +0 -1
  231. package/dist/sdk/transports/types.d.ts.map +0 -1
  232. package/dist/sdk/transports/types.js.map +0 -1
  233. package/dist/sdk/transports/websocket.d.ts.map +0 -1
  234. package/dist/sdk/transports/websocket.js.map +0 -1
  235. package/dist/tui/components/ChatView.d.ts.map +0 -1
  236. package/dist/tui/components/ChatView.js.map +0 -1
  237. package/dist/tui/components/GameOfLife.d.ts.map +0 -1
  238. package/dist/tui/components/GameOfLife.js.map +0 -1
  239. package/dist/tui/components/InputBox.d.ts.map +0 -1
  240. package/dist/tui/components/InputBox.js.map +0 -1
  241. package/dist/tui/components/MessageList.d.ts.map +0 -1
  242. package/dist/tui/components/MessageList.js.map +0 -1
  243. package/dist/tui/components/ReadlineInput.d.ts.map +0 -1
  244. package/dist/tui/components/ReadlineInput.js.map +0 -1
  245. package/dist/tui/components/StatusBar.d.ts.map +0 -1
  246. package/dist/tui/components/StatusBar.js.map +0 -1
  247. package/dist/tui/components/index.d.ts.map +0 -1
  248. package/dist/tui/components/index.js.map +0 -1
  249. package/dist/tui/index.d.ts.map +0 -1
  250. package/dist/tui/index.js.map +0 -1
@@ -1,98 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import * as DialogPrimitive from "@radix-ui/react-dialog";
2
3
  import { X } from "lucide-react";
3
4
  import * as React from "react";
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { cn } from "../lib/utils.js";
6
-
7
6
  const Dialog = DialogPrimitive.Root;
8
7
  const DialogTrigger = DialogPrimitive.Trigger;
9
8
  const DialogPortal = DialogPrimitive.Portal;
10
9
  const DialogClose = DialogPrimitive.Close;
11
- const DialogOverlay = React.forwardRef(({ className, ...props }, ref) =>
12
- _jsx(DialogPrimitive.Overlay, {
13
- ref: ref,
14
- className: cn(
15
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
16
- className,
17
- ),
18
- ...props,
19
- }),
20
- );
10
+ const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
21
11
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
22
- const DialogContent = React.forwardRef(
23
- ({ className, children, ...props }, ref) =>
24
- _jsxs(DialogPortal, {
25
- children: [
26
- _jsx(DialogOverlay, {}),
27
- _jsxs(DialogPrimitive.Content, {
28
- ref: ref,
29
- className: cn(
30
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
31
- className,
32
- ),
33
- ...props,
34
- children: [
35
- children,
36
- _jsxs(DialogPrimitive.Close, {
37
- className:
38
- "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
39
- children: [
40
- _jsx(X, { className: "h-4 w-4" }),
41
- _jsx("span", { className: "sr-only", children: "Close" }),
42
- ],
43
- }),
44
- ],
45
- }),
46
- ],
47
- }),
48
- );
12
+ const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
49
13
  DialogContent.displayName = DialogPrimitive.Content.displayName;
50
- const DialogHeader = ({ className, ...props }) =>
51
- _jsx("div", {
52
- className: cn(
53
- "flex flex-col space-y-1.5 text-center sm:text-left",
54
- className,
55
- ),
56
- ...props,
57
- });
14
+ const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
58
15
  DialogHeader.displayName = "DialogHeader";
59
- const DialogFooter = ({ className, ...props }) =>
60
- _jsx("div", {
61
- className: cn(
62
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
63
- className,
64
- ),
65
- ...props,
66
- });
16
+ const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
67
17
  DialogFooter.displayName = "DialogFooter";
68
- const DialogTitle = React.forwardRef(({ className, ...props }, ref) =>
69
- _jsx(DialogPrimitive.Title, {
70
- ref: ref,
71
- className: cn(
72
- "text-lg font-semibold leading-none tracking-tight",
73
- className,
74
- ),
75
- ...props,
76
- }),
77
- );
18
+ const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
78
19
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
79
- const DialogDescription = React.forwardRef(({ className, ...props }, ref) =>
80
- _jsx(DialogPrimitive.Description, {
81
- ref: ref,
82
- className: cn("text-sm text-muted-foreground", className),
83
- ...props,
84
- }),
85
- );
20
+ const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
86
21
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
87
- export {
88
- Dialog,
89
- DialogPortal,
90
- DialogOverlay,
91
- DialogClose,
92
- DialogTrigger,
93
- DialogContent,
94
- DialogHeader,
95
- DialogFooter,
96
- DialogTitle,
97
- DialogDescription,
98
- };
22
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1,15 +1,10 @@
1
1
  import { type ReactNode } from "react";
2
2
  interface HeightTransitionProps {
3
- children: ReactNode;
4
- durationMs?: number;
5
- easing?: string;
6
- pinContentTo?: "top" | "bottom";
7
- className?: string;
3
+ children: ReactNode;
4
+ durationMs?: number;
5
+ easing?: string;
6
+ pinContentTo?: "top" | "bottom";
7
+ className?: string;
8
8
  }
9
- export declare function HeightTransition({
10
- children,
11
- durationMs,
12
- easing,
13
- pinContentTo,
14
- className,
15
- }: HeightTransitionProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function HeightTransition({ children, durationMs, easing, pinContentTo, className, }: HeightTransitionProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -1,91 +1,80 @@
1
- import { useCallback, useEffect, useRef } from "react";
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef } from "react";
3
3
  import { cn } from "../lib/utils.js";
4
- export function HeightTransition({
5
- children,
6
- durationMs = 320,
7
- easing = "ease",
8
- pinContentTo = "top",
9
- className,
10
- }) {
11
- const containerRef = useRef(null);
12
- const contentRef = useRef(null);
13
- const prevHeightRef = useRef(null);
14
- const isAnimatingRef = useRef(false);
15
- const durationRef = useRef(durationMs);
16
- const easingRef = useRef(easing);
17
- useEffect(() => {
18
- durationRef.current = durationMs;
19
- easingRef.current = easing;
20
- }, [durationMs, easing]);
21
- const transitionTo = useCallback(
22
- (next) => {
23
- const el = containerRef.current;
24
- const contentEl = contentRef.current;
25
- if (!el || !contentEl) return;
26
- const prev = prevHeightRef.current ?? el.getBoundingClientRect().height;
27
- if (Math.abs(prev - next) < 0.5) {
28
- prevHeightRef.current = next;
29
- el.style.height = `${next}px`;
30
- return;
31
- }
32
- if (isAnimatingRef.current) return;
33
- isAnimatingRef.current = true;
34
- el.style.transition = "none";
35
- el.style.height = `${prev}px`;
36
- void el.getBoundingClientRect();
37
- el.style.transition = `height ${durationRef.current}ms ${easingRef.current}`;
38
- el.style.height = `${next}px`;
39
- contentEl.style.position = "absolute";
40
- if (pinContentTo === "top") {
41
- contentEl.style.top = "0";
42
- } else {
43
- contentEl.style.bottom = "0";
44
- }
45
- prevHeightRef.current = next;
46
- },
47
- [pinContentTo],
48
- );
49
- const onEndTransition = useCallback((e) => {
50
- const el = containerRef.current;
51
- const contentEl = contentRef.current;
52
- if (!el || !contentEl) return;
53
- if (e.propertyName !== "height") return;
54
- if (e.target !== el) return;
55
- el.style.transition = "";
56
- el.style.height = `auto`;
57
- contentEl.style.removeProperty("position");
58
- contentEl.style.removeProperty("top");
59
- contentEl.style.removeProperty("bottom");
60
- isAnimatingRef.current = false;
61
- }, []);
62
- // Observe intrinsic content height changes and animate container height accordingly
63
- useEffect(() => {
64
- const el = containerRef.current;
65
- const contentEl = contentRef.current;
66
- if (!el || !contentEl) return;
67
- const initial = contentEl.scrollHeight;
68
- prevHeightRef.current = initial;
69
- const ro = new ResizeObserver(() => {
70
- const next = contentEl.scrollHeight;
71
- transitionTo(next);
72
- });
73
- ro.observe(contentEl);
74
- el.addEventListener("transitionend", onEndTransition);
75
- return () => {
76
- ro.disconnect();
77
- el.removeEventListener("transitionend", onEndTransition);
78
- };
79
- // eslint-disable-next-line react-hooks/exhaustive-deps
80
- }, [onEndTransition, transitionTo]);
81
- return _jsx("div", {
82
- ref: containerRef,
83
- className: cn("overflow-hidden relative", className),
84
- style: { willChange: "height" },
85
- children: _jsx("div", {
86
- ref: contentRef,
87
- className: "w-full",
88
- children: children,
89
- }),
90
- });
4
+ export function HeightTransition({ children, durationMs = 320, easing = "ease", pinContentTo = "top", className, }) {
5
+ const containerRef = useRef(null);
6
+ const contentRef = useRef(null);
7
+ const prevHeightRef = useRef(null);
8
+ const isAnimatingRef = useRef(false);
9
+ const durationRef = useRef(durationMs);
10
+ const easingRef = useRef(easing);
11
+ useEffect(() => {
12
+ durationRef.current = durationMs;
13
+ easingRef.current = easing;
14
+ }, [durationMs, easing]);
15
+ const transitionTo = useCallback((next) => {
16
+ const el = containerRef.current;
17
+ const contentEl = contentRef.current;
18
+ if (!el || !contentEl)
19
+ return;
20
+ const prev = prevHeightRef.current ?? el.getBoundingClientRect().height;
21
+ if (Math.abs(prev - next) < 0.5) {
22
+ prevHeightRef.current = next;
23
+ el.style.height = `${next}px`;
24
+ return;
25
+ }
26
+ if (isAnimatingRef.current)
27
+ return;
28
+ isAnimatingRef.current = true;
29
+ el.style.transition = "none";
30
+ el.style.height = `${prev}px`;
31
+ void el.getBoundingClientRect();
32
+ el.style.transition = `height ${durationRef.current}ms ${easingRef.current}`;
33
+ el.style.height = `${next}px`;
34
+ contentEl.style.position = "absolute";
35
+ if (pinContentTo === "top") {
36
+ contentEl.style.top = "0";
37
+ }
38
+ else {
39
+ contentEl.style.bottom = "0";
40
+ }
41
+ prevHeightRef.current = next;
42
+ }, [pinContentTo]);
43
+ const onEndTransition = useCallback((e) => {
44
+ const el = containerRef.current;
45
+ const contentEl = contentRef.current;
46
+ if (!el || !contentEl)
47
+ return;
48
+ if (e.propertyName !== "height")
49
+ return;
50
+ if (e.target !== el)
51
+ return;
52
+ el.style.transition = "";
53
+ el.style.height = `auto`;
54
+ contentEl.style.removeProperty("position");
55
+ contentEl.style.removeProperty("top");
56
+ contentEl.style.removeProperty("bottom");
57
+ isAnimatingRef.current = false;
58
+ }, []);
59
+ // Observe intrinsic content height changes and animate container height accordingly
60
+ useEffect(() => {
61
+ const el = containerRef.current;
62
+ const contentEl = contentRef.current;
63
+ if (!el || !contentEl)
64
+ return;
65
+ const initial = contentEl.scrollHeight;
66
+ prevHeightRef.current = initial;
67
+ const ro = new ResizeObserver(() => {
68
+ const next = contentEl.scrollHeight;
69
+ transitionTo(next);
70
+ });
71
+ ro.observe(contentEl);
72
+ el.addEventListener("transitionend", onEndTransition);
73
+ return () => {
74
+ ro.disconnect();
75
+ el.removeEventListener("transitionend", onEndTransition);
76
+ };
77
+ // eslint-disable-next-line react-hooks/exhaustive-deps
78
+ }, [onEndTransition, transitionTo]);
79
+ return (_jsx("div", { ref: containerRef, className: cn("overflow-hidden relative", className), style: { willChange: "height" }, children: _jsx("div", { ref: contentRef, className: "w-full", children: children }) }));
91
80
  }
@@ -1,16 +1,9 @@
1
1
  import { type VariantProps } from "class-variance-authority";
2
2
  import * as React from "react";
3
- declare const inputVariants: (
4
- props?:
5
- | ({
6
- variant?: "default" | "error" | "success" | null | undefined;
7
- } & import("class-variance-authority/types").ClassProp)
8
- | undefined,
9
- ) => string;
10
- export interface InputProps
11
- extends React.InputHTMLAttributes<HTMLInputElement>,
12
- VariantProps<typeof inputVariants> {}
13
- declare const Input: React.ForwardRefExoticComponent<
14
- InputProps & React.RefAttributes<HTMLInputElement>
15
- >;
3
+ declare const inputVariants: (props?: ({
4
+ variant?: "success" | "default" | "error" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
7
+ }
8
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
16
9
  export { Input, inputVariants };
@@ -1,32 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { cva } from "class-variance-authority";
2
3
  import * as React from "react";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { cn } from "../lib/utils.js";
5
-
6
- const inputVariants = cva(
7
- "flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
8
- {
9
- variants: {
10
- variant: {
11
- default: "border-input focus-visible:ring-ring",
12
- error: "border-destructive focus-visible:ring-destructive",
13
- success: "border-green-500 focus-visible:ring-green-500",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
19
- },
20
- );
21
- const Input = React.forwardRef(
22
- ({ className, type, variant, ...props }, ref) => {
23
- return _jsx("input", {
24
- type: type,
25
- className: cn(inputVariants({ variant, className })),
26
- ref: ref,
27
- ...props,
28
- });
29
- },
30
- );
5
+ const inputVariants = cva("flex h-10 w-full rounded-md border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", {
6
+ variants: {
7
+ variant: {
8
+ default: "border-input focus-visible:ring-ring",
9
+ error: "border-destructive focus-visible:ring-destructive",
10
+ success: "border-green-500 focus-visible:ring-green-500",
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ variant: "default",
15
+ },
16
+ });
17
+ const Input = React.forwardRef(({ className, type, variant, ...props }, ref) => {
18
+ return (_jsx("input", { type: type, className: cn(inputVariants({ variant, className })), ref: ref, ...props }));
19
+ });
31
20
  Input.displayName = "Input";
32
21
  export { Input, inputVariants };
@@ -1,10 +1,4 @@
1
1
  import * as LabelPrimitive from "@radix-ui/react-label";
2
2
  import * as React from "react";
3
- declare const Label: React.ForwardRefExoticComponent<
4
- Omit<
5
- LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>,
6
- "ref"
7
- > &
8
- React.RefAttributes<HTMLLabelElement>
9
- >;
3
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
10
4
  export { Label };
@@ -1,17 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as LabelPrimitive from "@radix-ui/react-label";
2
3
  import * as React from "react";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { cn } from "../lib/utils.js";
5
-
6
- const Label = React.forwardRef(({ className, ...props }, ref) =>
7
- _jsx(LabelPrimitive.Root, {
8
- ref: ref,
9
- className: cn(
10
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
11
- className,
12
- ),
13
- ...props,
14
- }),
15
- );
5
+ const Label = React.forwardRef(({ className, ...props }, ref) => (_jsx(LabelPrimitive.Root, { ref: ref, className: cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className), ...props })));
16
6
  Label.displayName = LabelPrimitive.Root.displayName;
17
7
  export { Label };
@@ -1,8 +1,6 @@
1
1
  interface MarkdownRendererProps {
2
- content: string;
3
- className?: string;
2
+ content: string;
3
+ className?: string;
4
4
  }
5
- export declare function MarkdownRenderer({
6
- content,
7
- className,
8
- }: MarkdownRendererProps): import("react/jsx-runtime").JSX.Element | null;
5
+ export declare function MarkdownRenderer({ content, className, }: MarkdownRendererProps): import("react/jsx-runtime").JSX.Element | null;
6
+ export {};