@gram-ai/elements 1.34.0 → 1.35.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 (233) hide show
  1. package/dist/compat-shims-CO9JXXV4.cjs.map +1 -1
  2. package/dist/compat-shims-DxtUrORi.js.map +1 -1
  3. package/dist/compat-shims.d.ts +9 -8
  4. package/dist/components/Chat/index.d.ts +2 -1
  5. package/dist/components/ChatHistory.d.ts +1 -1
  6. package/dist/components/FrontendTools/index.d.ts +1 -1
  7. package/dist/components/Replay.d.ts +1 -1
  8. package/dist/components/Replay.stories.d.ts +2 -2
  9. package/dist/components/ShadowRoot.d.ts +1 -1
  10. package/dist/components/ShareButton/index.d.ts +1 -1
  11. package/dist/components/ui/avatar.d.ts +3 -3
  12. package/dist/components/ui/button.d.ts +2 -2
  13. package/dist/components/ui/buttonVariants.d.ts +2 -2
  14. package/dist/components/ui/calendar.d.ts +2 -1
  15. package/dist/components/ui/collapsible.d.ts +3 -3
  16. package/dist/components/ui/dialog.d.ts +10 -10
  17. package/dist/components/ui/popover.d.ts +4 -4
  18. package/dist/components/ui/skeleton.d.ts +1 -1
  19. package/dist/components/ui/time-range-picker.d.ts +2 -1
  20. package/dist/components/ui/tool-ui.d.ts +7 -7
  21. package/dist/components/ui/tooltip.d.ts +4 -4
  22. package/dist/contexts/ConnectionStatusContext.d.ts +1 -1
  23. package/dist/contexts/ElementsProvider.d.ts +1 -1
  24. package/dist/contexts/ToolApprovalContext.d.ts +2 -2
  25. package/dist/contexts/ToolExecutionContext.d.ts +1 -1
  26. package/dist/contexts/portal-container.d.ts +1 -1
  27. package/dist/elements.cjs +1 -1
  28. package/dist/elements.css +1 -1
  29. package/dist/elements.js +2 -2
  30. package/dist/hooks/useDensity.d.ts +1 -1
  31. package/dist/hooks/useElements.d.ts +2 -1
  32. package/dist/hooks/useGramThreadListAdapter.d.ts +13 -0
  33. package/dist/hooks/useRadius.d.ts +1 -1
  34. package/dist/hooks/useThemeProps.d.ts +1 -1
  35. package/dist/hooks/useToolApproval.d.ts +2 -1
  36. package/dist/{index-BFU6NvbL.js → index-BhIowiZF.js} +9408 -9204
  37. package/dist/index-BhIowiZF.js.map +1 -0
  38. package/dist/{index-C08dvTEo.cjs → index-D0jIGQr7.cjs} +3 -3
  39. package/dist/index-D0jIGQr7.cjs.map +1 -0
  40. package/dist/{index-B5lZrrO2.js → index-Dz13dSDa.js} +57 -15
  41. package/dist/index-Dz13dSDa.js.map +1 -0
  42. package/dist/index-PXd3rs95.cjs +194 -0
  43. package/dist/index-PXd3rs95.cjs.map +1 -0
  44. package/dist/lib/errorTracking.d.ts +1 -1
  45. package/dist/lib/tools.d.ts +11 -10
  46. package/dist/plugins/generative-ui/catalog.d.ts +3 -3
  47. package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +2 -2
  48. package/dist/plugins/generative-ui/ui/accordion.d.ts +4 -4
  49. package/dist/plugins/generative-ui/ui/action-button.d.ts +1 -1
  50. package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +2 -1
  51. package/dist/plugins/generative-ui/ui/alert.d.ts +3 -3
  52. package/dist/plugins/generative-ui/ui/avatar-wrapper.d.ts +2 -1
  53. package/dist/plugins/generative-ui/ui/avatar.d.ts +6 -6
  54. package/dist/plugins/generative-ui/ui/badge.d.ts +2 -2
  55. package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +2 -1
  56. package/dist/plugins/generative-ui/ui/button.d.ts +3 -3
  57. package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +1 -1
  58. package/dist/plugins/generative-ui/ui/card.d.ts +7 -7
  59. package/dist/plugins/generative-ui/ui/checkbox-wrapper.d.ts +2 -1
  60. package/dist/plugins/generative-ui/ui/checkbox.d.ts +1 -1
  61. package/dist/plugins/generative-ui/ui/data-table.d.ts +1 -1
  62. package/dist/plugins/generative-ui/ui/dialog.d.ts +10 -10
  63. package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +15 -15
  64. package/dist/plugins/generative-ui/ui/grid.d.ts +1 -1
  65. package/dist/plugins/generative-ui/ui/index.d.ts +57 -40
  66. package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +2 -1
  67. package/dist/plugins/generative-ui/ui/input.d.ts +1 -1
  68. package/dist/plugins/generative-ui/ui/label.d.ts +1 -1
  69. package/dist/plugins/generative-ui/ui/list.d.ts +2 -1
  70. package/dist/plugins/generative-ui/ui/metric.d.ts +1 -1
  71. package/dist/plugins/generative-ui/ui/pagination.d.ts +7 -7
  72. package/dist/plugins/generative-ui/ui/popover.d.ts +7 -7
  73. package/dist/plugins/generative-ui/ui/progress.d.ts +1 -1
  74. package/dist/plugins/generative-ui/ui/radio-group.d.ts +2 -2
  75. package/dist/plugins/generative-ui/ui/select-wrapper.d.ts +2 -1
  76. package/dist/plugins/generative-ui/ui/select.d.ts +10 -10
  77. package/dist/plugins/generative-ui/ui/separator.d.ts +1 -1
  78. package/dist/plugins/generative-ui/ui/skeleton-wrapper.d.ts +2 -1
  79. package/dist/plugins/generative-ui/ui/skeleton.d.ts +1 -1
  80. package/dist/plugins/generative-ui/ui/stack.d.ts +1 -1
  81. package/dist/plugins/generative-ui/ui/switch.d.ts +1 -1
  82. package/dist/plugins/generative-ui/ui/table.d.ts +8 -8
  83. package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +2 -2
  84. package/dist/plugins/generative-ui/ui/tabs.d.ts +4 -4
  85. package/dist/plugins/generative-ui/ui/text.d.ts +1 -1
  86. package/dist/plugins/generative-ui/ui/textarea.d.ts +1 -1
  87. package/dist/plugins/generative-ui/ui/tooltip.d.ts +4 -4
  88. package/dist/plugins.cjs +1 -1
  89. package/dist/plugins.js +1 -1
  90. package/dist/{profiler-KLSTpp6I.js → profiler-CtGKTWWP.js} +2 -2
  91. package/dist/{profiler-KLSTpp6I.js.map → profiler-CtGKTWWP.js.map} +1 -1
  92. package/dist/{profiler-BRnyr1GA.cjs → profiler-l7_HjTyw.cjs} +2 -2
  93. package/dist/{profiler-BRnyr1GA.cjs.map → profiler-l7_HjTyw.cjs.map} +1 -1
  94. package/dist/react-shim.cjs.map +1 -1
  95. package/dist/react-shim.d.ts +1 -1
  96. package/dist/react-shim.js +1 -4
  97. package/dist/react-shim.js.map +1 -1
  98. package/dist/server/bun.cjs.map +1 -1
  99. package/dist/server/bun.js.map +1 -1
  100. package/dist/server/express.cjs.map +1 -1
  101. package/dist/server/express.js.map +1 -1
  102. package/dist/server/fastify.cjs.map +1 -1
  103. package/dist/server/fastify.js.map +1 -1
  104. package/dist/server/hono.cjs.map +1 -1
  105. package/dist/server/hono.js.map +1 -1
  106. package/dist/server/nextjs.cjs.map +1 -1
  107. package/dist/server/nextjs.js.map +1 -1
  108. package/dist/server/tanstack-start.cjs.map +1 -1
  109. package/dist/server/tanstack-start.js.map +1 -1
  110. package/dist/{startRecording-CKx-YWbq.cjs → startRecording-DEw2Aeq4.cjs} +2 -2
  111. package/dist/{startRecording-CKx-YWbq.cjs.map → startRecording-DEw2Aeq4.cjs.map} +1 -1
  112. package/dist/{startRecording-BfxB1xxR.js → startRecording-iYEL0-vr.js} +2 -2
  113. package/dist/{startRecording-BfxB1xxR.js.map → startRecording-iYEL0-vr.js.map} +1 -1
  114. package/dist/types/index.d.ts +29 -3
  115. package/package.json +7 -10
  116. package/src/compat-shims.ts +16 -2
  117. package/src/components/Chat/index.tsx +4 -1
  118. package/src/components/Chat/stories/FrontendTools.stories.tsx +1 -1
  119. package/src/components/Chat/stories/ToolApproval.stories.tsx +2 -2
  120. package/src/components/Chat/stories/Tools.stories.tsx +13 -5
  121. package/src/components/ChatHistory.tsx +3 -1
  122. package/src/components/FrontendTools/index.tsx +1 -1
  123. package/src/components/MessageContent.tsx +1 -0
  124. package/src/components/Replay.stories.tsx +2 -3
  125. package/src/components/Replay.tsx +17 -10
  126. package/src/components/ShadowRoot.tsx +2 -2
  127. package/src/components/ShareButton/index.tsx +4 -2
  128. package/src/components/assistant-ui/assistant-modal.tsx +5 -3
  129. package/src/components/assistant-ui/attachment.tsx +1 -1
  130. package/src/components/assistant-ui/error-boundary.tsx +1 -1
  131. package/src/components/assistant-ui/markdown-text.tsx +1 -1
  132. package/src/components/assistant-ui/thread.tsx +249 -11
  133. package/src/components/assistant-ui/tool-mention-autocomplete.tsx +1 -1
  134. package/src/components/ui/avatar.tsx +3 -3
  135. package/src/components/ui/calendar.tsx +1 -1
  136. package/src/components/ui/collapsible.tsx +7 -3
  137. package/src/components/ui/dialog.tsx +18 -10
  138. package/src/components/ui/generative-ui.tsx +9 -4
  139. package/src/components/ui/popover.tsx +4 -4
  140. package/src/components/ui/skeleton.tsx +4 -1
  141. package/src/components/ui/time-range-picker.stories.tsx +164 -154
  142. package/src/components/ui/time-range-picker.tsx +11 -5
  143. package/src/components/ui/tool-ui.tsx +18 -9
  144. package/src/components/ui/tooltip.tsx +4 -4
  145. package/src/contexts/ChatIdContext.tsx +1 -1
  146. package/src/contexts/ConnectionStatusContext.tsx +6 -5
  147. package/src/contexts/ElementsProvider.tsx +64 -41
  148. package/src/contexts/ReplayContext.ts +1 -1
  149. package/src/contexts/ToolApprovalContext.tsx +5 -1
  150. package/src/contexts/ToolExecutionContext.tsx +1 -1
  151. package/src/contexts/portal-container.tsx +1 -1
  152. package/src/hooks/useAuth.ts +2 -1
  153. package/src/hooks/useDensity.ts +1 -1
  154. package/src/hooks/useElements.ts +2 -1
  155. package/src/hooks/useFollowOnSuggestions.ts +3 -6
  156. package/src/hooks/useGramThreadListAdapter.tsx +50 -3
  157. package/src/hooks/useMCPTools.ts +2 -2
  158. package/src/hooks/useModel.ts +1 -3
  159. package/src/hooks/usePluginComponents.ts +3 -1
  160. package/src/hooks/useRadius.ts +1 -1
  161. package/src/hooks/useSession.ts +3 -1
  162. package/src/hooks/useThemeProps.ts +5 -5
  163. package/src/hooks/useToolApproval.ts +2 -1
  164. package/src/lib/cassette.ts +20 -8
  165. package/src/lib/errorTracking.ts +1 -4
  166. package/src/lib/messageConverter.test.ts +11 -13
  167. package/src/lib/messageConverter.ts +13 -4
  168. package/src/lib/token.ts +2 -5
  169. package/src/lib/tool-mentions.ts +5 -2
  170. package/src/lib/tools.byte-cap.test.ts +1 -1
  171. package/src/lib/tools.test.ts +1 -1
  172. package/src/lib/tools.ts +15 -5
  173. package/src/lib/utils.ts +2 -2
  174. package/src/lib.d.ts +8 -1
  175. package/src/plugins/chart/chart.test.ts +3 -4
  176. package/src/plugins/chart/component.tsx +7 -6
  177. package/src/plugins/chart/ui/area-chart.tsx +1 -1
  178. package/src/plugins/chart/ui/line-chart.tsx +1 -1
  179. package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +2 -2
  180. package/src/plugins/generative-ui/ui/accordion.tsx +4 -4
  181. package/src/plugins/generative-ui/ui/action-button.tsx +4 -2
  182. package/src/plugins/generative-ui/ui/alert-wrapper.tsx +1 -1
  183. package/src/plugins/generative-ui/ui/alert.tsx +7 -3
  184. package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +5 -1
  185. package/src/plugins/generative-ui/ui/avatar.tsx +12 -6
  186. package/src/plugins/generative-ui/ui/badge.tsx +1 -1
  187. package/src/plugins/generative-ui/ui/button-wrapper.tsx +1 -1
  188. package/src/plugins/generative-ui/ui/button.tsx +1 -1
  189. package/src/plugins/generative-ui/ui/card-wrapper.tsx +1 -1
  190. package/src/plugins/generative-ui/ui/card.tsx +28 -7
  191. package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +1 -1
  192. package/src/plugins/generative-ui/ui/checkbox.tsx +1 -1
  193. package/src/plugins/generative-ui/ui/data-table.tsx +1 -1
  194. package/src/plugins/generative-ui/ui/dialog.tsx +15 -10
  195. package/src/plugins/generative-ui/ui/dropdown-menu.tsx +33 -15
  196. package/src/plugins/generative-ui/ui/grid.tsx +1 -1
  197. package/src/plugins/generative-ui/ui/index.ts +154 -40
  198. package/src/plugins/generative-ui/ui/input-wrapper.tsx +1 -1
  199. package/src/plugins/generative-ui/ui/input.tsx +5 -1
  200. package/src/plugins/generative-ui/ui/label.tsx +1 -1
  201. package/src/plugins/generative-ui/ui/list.tsx +5 -1
  202. package/src/plugins/generative-ui/ui/metric.tsx +2 -1
  203. package/src/plugins/generative-ui/ui/pagination.tsx +12 -7
  204. package/src/plugins/generative-ui/ui/popover.tsx +13 -7
  205. package/src/plugins/generative-ui/ui/progress.tsx +1 -1
  206. package/src/plugins/generative-ui/ui/radio-group.tsx +2 -2
  207. package/src/plugins/generative-ui/ui/select-wrapper.tsx +1 -1
  208. package/src/plugins/generative-ui/ui/select.tsx +14 -10
  209. package/src/plugins/generative-ui/ui/separator.tsx +1 -1
  210. package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +1 -1
  211. package/src/plugins/generative-ui/ui/skeleton.tsx +4 -1
  212. package/src/plugins/generative-ui/ui/stack.tsx +1 -1
  213. package/src/plugins/generative-ui/ui/switch.tsx +1 -1
  214. package/src/plugins/generative-ui/ui/table.tsx +29 -8
  215. package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +5 -2
  216. package/src/plugins/generative-ui/ui/tabs.tsx +4 -4
  217. package/src/plugins/generative-ui/ui/text.tsx +1 -1
  218. package/src/plugins/generative-ui/ui/textarea.tsx +4 -1
  219. package/src/plugins/generative-ui/ui/tooltip.tsx +4 -4
  220. package/src/react-shim.ts +9 -4
  221. package/src/server/bun.ts +1 -1
  222. package/src/server/express.ts +1 -1
  223. package/src/server/fastify.ts +1 -1
  224. package/src/server/hono.ts +1 -1
  225. package/src/server/nextjs.ts +1 -1
  226. package/src/server/tanstack-start.ts +1 -1
  227. package/src/storybook.d.ts +5 -0
  228. package/src/types/index.ts +39 -3
  229. package/dist/index-B5lZrrO2.js.map +0 -1
  230. package/dist/index-BFU6NvbL.js.map +0 -1
  231. package/dist/index-C08dvTEo.cjs.map +0 -1
  232. package/dist/index-DzZ1-jQY.cjs +0 -194
  233. package/dist/index-DzZ1-jQY.cjs.map +0 -1
@@ -8,7 +8,10 @@ import {
8
8
  import { cn } from "@/lib/utils";
9
9
  import { buttonVariants, Button } from "./button";
10
10
 
11
- function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
11
+ function Pagination({
12
+ className,
13
+ ...props
14
+ }: React.ComponentProps<"nav">): React.JSX.Element {
12
15
  return (
13
16
  <nav
14
17
  role="navigation"
@@ -23,7 +26,7 @@ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
23
26
  function PaginationContent({
24
27
  className,
25
28
  ...props
26
- }: React.ComponentProps<"ul">) {
29
+ }: React.ComponentProps<"ul">): React.JSX.Element {
27
30
  return (
28
31
  <ul
29
32
  data-slot="pagination-content"
@@ -33,7 +36,9 @@ function PaginationContent({
33
36
  );
34
37
  }
35
38
 
36
- function PaginationItem({ ...props }: React.ComponentProps<"li">) {
39
+ function PaginationItem({
40
+ ...props
41
+ }: React.ComponentProps<"li">): React.JSX.Element {
37
42
  return <li data-slot="pagination-item" {...props} />;
38
43
  }
39
44
 
@@ -47,7 +52,7 @@ function PaginationLink({
47
52
  isActive,
48
53
  size = "icon",
49
54
  ...props
50
- }: PaginationLinkProps) {
55
+ }: PaginationLinkProps): React.JSX.Element {
51
56
  return (
52
57
  <a
53
58
  aria-current={isActive ? "page" : undefined}
@@ -68,7 +73,7 @@ function PaginationLink({
68
73
  function PaginationPrevious({
69
74
  className,
70
75
  ...props
71
- }: React.ComponentProps<typeof PaginationLink>) {
76
+ }: React.ComponentProps<typeof PaginationLink>): React.JSX.Element {
72
77
  return (
73
78
  <PaginationLink
74
79
  aria-label="Go to previous page"
@@ -85,7 +90,7 @@ function PaginationPrevious({
85
90
  function PaginationNext({
86
91
  className,
87
92
  ...props
88
- }: React.ComponentProps<typeof PaginationLink>) {
93
+ }: React.ComponentProps<typeof PaginationLink>): React.JSX.Element {
89
94
  return (
90
95
  <PaginationLink
91
96
  aria-label="Go to next page"
@@ -102,7 +107,7 @@ function PaginationNext({
102
107
  function PaginationEllipsis({
103
108
  className,
104
109
  ...props
105
- }: React.ComponentProps<"span">) {
110
+ }: React.ComponentProps<"span">): React.JSX.Element {
106
111
  return (
107
112
  <span
108
113
  aria-hidden
@@ -7,13 +7,13 @@ import { cn } from "@/lib/utils";
7
7
 
8
8
  function Popover({
9
9
  ...props
10
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element {
11
11
  return <PopoverPrimitive.Root data-slot="popover" {...props} />;
12
12
  }
13
13
 
14
14
  function PopoverTrigger({
15
15
  ...props
16
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
16
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element {
17
17
  return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
18
18
  }
19
19
 
@@ -22,7 +22,7 @@ function PopoverContent({
22
22
  align = "center",
23
23
  sideOffset = 4,
24
24
  ...props
25
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
25
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element {
26
26
  return (
27
27
  <PopoverPrimitive.Portal>
28
28
  <PopoverPrimitive.Content
@@ -41,11 +41,14 @@ function PopoverContent({
41
41
 
42
42
  function PopoverAnchor({
43
43
  ...props
44
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
44
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element {
45
45
  return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
46
46
  }
47
47
 
48
- function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
48
+ function PopoverHeader({
49
+ className,
50
+ ...props
51
+ }: React.ComponentProps<"div">): React.JSX.Element {
49
52
  return (
50
53
  <div
51
54
  data-slot="popover-header"
@@ -55,7 +58,10 @@ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
55
58
  );
56
59
  }
57
60
 
58
- function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
61
+ function PopoverTitle({
62
+ className,
63
+ ...props
64
+ }: React.ComponentProps<"h2">): React.JSX.Element {
59
65
  return (
60
66
  <div
61
67
  data-slot="popover-title"
@@ -68,7 +74,7 @@ function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
68
74
  function PopoverDescription({
69
75
  className,
70
76
  ...props
71
- }: React.ComponentProps<"p">) {
77
+ }: React.ComponentProps<"p">): React.JSX.Element {
72
78
  return (
73
79
  <p
74
80
  data-slot="popover-description"
@@ -21,7 +21,7 @@ function Progress({
21
21
  label,
22
22
  max = 100,
23
23
  ...props
24
- }: ProgressProps) {
24
+ }: ProgressProps): React.JSX.Element {
25
25
  const percentage =
26
26
  value != null && max > 0
27
27
  ? Math.min(100, Math.max(0, (value / max) * 100))
@@ -9,7 +9,7 @@ import { cn } from "@/lib/utils";
9
9
  function RadioGroup({
10
10
  className,
11
11
  ...props
12
- }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
12
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element {
13
13
  return (
14
14
  <RadioGroupPrimitive.Root
15
15
  data-slot="radio-group"
@@ -22,7 +22,7 @@ function RadioGroup({
22
22
  function RadioGroupItem({
23
23
  className,
24
24
  ...props
25
- }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
25
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element {
26
26
  return (
27
27
  <RadioGroupPrimitive.Item
28
28
  data-slot="radio-group-item"
@@ -23,7 +23,7 @@ export function SelectWrapper({
23
23
  placeholder,
24
24
  valuePath,
25
25
  options,
26
- }: SelectWrapperProps) {
26
+ }: SelectWrapperProps): React.JSX.Element {
27
27
  return (
28
28
  <Select name={valuePath}>
29
29
  <SelectTrigger data-value-path={valuePath}>
@@ -8,19 +8,19 @@ import { cn } from "@/lib/utils";
8
8
 
9
9
  function Select({
10
10
  ...props
11
- }: React.ComponentProps<typeof SelectPrimitive.Root>) {
11
+ }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element {
12
12
  return <SelectPrimitive.Root data-slot="select" {...props} />;
13
13
  }
14
14
 
15
15
  function SelectGroup({
16
16
  ...props
17
- }: React.ComponentProps<typeof SelectPrimitive.Group>) {
17
+ }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element {
18
18
  return <SelectPrimitive.Group data-slot="select-group" {...props} />;
19
19
  }
20
20
 
21
21
  function SelectValue({
22
22
  ...props
23
- }: React.ComponentProps<typeof SelectPrimitive.Value>) {
23
+ }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element {
24
24
  return <SelectPrimitive.Value data-slot="select-value" {...props} />;
25
25
  }
26
26
 
@@ -31,7 +31,7 @@ function SelectTrigger({
31
31
  ...props
32
32
  }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
33
33
  size?: "sm" | "default";
34
- }) {
34
+ }): React.JSX.Element {
35
35
  return (
36
36
  <SelectPrimitive.Trigger
37
37
  data-slot="select-trigger"
@@ -56,7 +56,7 @@ function SelectContent({
56
56
  position = "item-aligned",
57
57
  align = "center",
58
58
  ...props
59
- }: React.ComponentProps<typeof SelectPrimitive.Content>) {
59
+ }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element {
60
60
  return (
61
61
  <SelectPrimitive.Portal>
62
62
  <SelectPrimitive.Content
@@ -90,7 +90,7 @@ function SelectContent({
90
90
  function SelectLabel({
91
91
  className,
92
92
  ...props
93
- }: React.ComponentProps<typeof SelectPrimitive.Label>) {
93
+ }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element {
94
94
  return (
95
95
  <SelectPrimitive.Label
96
96
  data-slot="select-label"
@@ -104,7 +104,7 @@ function SelectItem({
104
104
  className,
105
105
  children,
106
106
  ...props
107
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
107
+ }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element {
108
108
  return (
109
109
  <SelectPrimitive.Item
110
110
  data-slot="select-item"
@@ -130,7 +130,7 @@ function SelectItem({
130
130
  function SelectSeparator({
131
131
  className,
132
132
  ...props
133
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
133
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element {
134
134
  return (
135
135
  <SelectPrimitive.Separator
136
136
  data-slot="select-separator"
@@ -143,7 +143,9 @@ function SelectSeparator({
143
143
  function SelectScrollUpButton({
144
144
  className,
145
145
  ...props
146
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
146
+ }: React.ComponentProps<
147
+ typeof SelectPrimitive.ScrollUpButton
148
+ >): React.JSX.Element {
147
149
  return (
148
150
  <SelectPrimitive.ScrollUpButton
149
151
  data-slot="select-scroll-up-button"
@@ -161,7 +163,9 @@ function SelectScrollUpButton({
161
163
  function SelectScrollDownButton({
162
164
  className,
163
165
  ...props
164
- }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
166
+ }: React.ComponentProps<
167
+ typeof SelectPrimitive.ScrollDownButton
168
+ >): React.JSX.Element {
165
169
  return (
166
170
  <SelectPrimitive.ScrollDownButton
167
171
  data-slot="select-scroll-down-button"
@@ -10,7 +10,7 @@ function Separator({
10
10
  orientation = "horizontal",
11
11
  decorative = true,
12
12
  ...props
13
- }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
13
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element {
14
14
  return (
15
15
  <SeparatorPrimitive.Root
16
16
  data-slot="separator"
@@ -17,7 +17,7 @@ export function SkeletonWrapper({
17
17
  width,
18
18
  height,
19
19
  className,
20
- }: SkeletonWrapperProps) {
20
+ }: SkeletonWrapperProps): React.JSX.Element {
21
21
  return (
22
22
  <Skeleton
23
23
  className={cn(className)}
@@ -1,6 +1,9 @@
1
1
  import { cn } from "@/lib/utils";
2
2
 
3
- function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
3
+ function Skeleton({
4
+ className,
5
+ ...props
6
+ }: React.ComponentProps<"div">): React.JSX.Element {
4
7
  return (
5
8
  <div
6
9
  data-slot="skeleton"
@@ -36,7 +36,7 @@ export function Stack({
36
36
  justify,
37
37
  className,
38
38
  ...props
39
- }: StackProps) {
39
+ }: StackProps): React.JSX.Element {
40
40
  return (
41
41
  <div
42
42
  data-slot="stack"
@@ -11,7 +11,7 @@ function Switch({
11
11
  ...props
12
12
  }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
13
13
  size?: "sm" | "default";
14
- }) {
14
+ }): React.JSX.Element {
15
15
  return (
16
16
  <SwitchPrimitive.Root
17
17
  data-slot="switch"
@@ -4,7 +4,10 @@ import * as React from "react";
4
4
 
5
5
  import { cn } from "@/lib/utils";
6
6
 
7
- function Table({ className, ...props }: React.ComponentProps<"table">) {
7
+ function Table({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<"table">): React.JSX.Element {
8
11
  return (
9
12
  <div
10
13
  data-slot="table-container"
@@ -19,7 +22,10 @@ function Table({ className, ...props }: React.ComponentProps<"table">) {
19
22
  );
20
23
  }
21
24
 
22
- function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
25
+ function TableHeader({
26
+ className,
27
+ ...props
28
+ }: React.ComponentProps<"thead">): React.JSX.Element {
23
29
  return (
24
30
  <thead
25
31
  data-slot="table-header"
@@ -29,7 +35,10 @@ function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
29
35
  );
30
36
  }
31
37
 
32
- function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
38
+ function TableBody({
39
+ className,
40
+ ...props
41
+ }: React.ComponentProps<"tbody">): React.JSX.Element {
33
42
  return (
34
43
  <tbody
35
44
  data-slot="table-body"
@@ -39,7 +48,10 @@ function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
39
48
  );
40
49
  }
41
50
 
42
- function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
51
+ function TableFooter({
52
+ className,
53
+ ...props
54
+ }: React.ComponentProps<"tfoot">): React.JSX.Element {
43
55
  return (
44
56
  <tfoot
45
57
  data-slot="table-footer"
@@ -52,7 +64,10 @@ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
52
64
  );
53
65
  }
54
66
 
55
- function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
67
+ function TableRow({
68
+ className,
69
+ ...props
70
+ }: React.ComponentProps<"tr">): React.JSX.Element {
56
71
  return (
57
72
  <tr
58
73
  data-slot="table-row"
@@ -65,7 +80,10 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
65
80
  );
66
81
  }
67
82
 
68
- function TableHead({ className, ...props }: React.ComponentProps<"th">) {
83
+ function TableHead({
84
+ className,
85
+ ...props
86
+ }: React.ComponentProps<"th">): React.JSX.Element {
69
87
  return (
70
88
  <th
71
89
  data-slot="table-head"
@@ -78,7 +96,10 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
78
96
  );
79
97
  }
80
98
 
81
- function TableCell({ className, ...props }: React.ComponentProps<"td">) {
99
+ function TableCell({
100
+ className,
101
+ ...props
102
+ }: React.ComponentProps<"td">): React.JSX.Element {
82
103
  return (
83
104
  <td
84
105
  data-slot="table-cell"
@@ -94,7 +115,7 @@ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
94
115
  function TableCaption({
95
116
  className,
96
117
  ...props
97
- }: React.ComponentProps<"caption">) {
118
+ }: React.ComponentProps<"caption">): React.JSX.Element {
98
119
  return (
99
120
  <caption
100
121
  data-slot="table-caption"
@@ -21,7 +21,7 @@ export function TabsWrapper({
21
21
  defaultValue,
22
22
  tabs,
23
23
  children,
24
- }: TabsWrapperProps) {
24
+ }: TabsWrapperProps): React.JSX.Element {
25
25
  const defaultTab = defaultValue ?? tabs[0]?.value;
26
26
 
27
27
  return (
@@ -46,6 +46,9 @@ export interface TabContentWrapperProps {
46
46
  /**
47
47
  * TabContent wrapper - passes through to TabsContent.
48
48
  */
49
- export function TabContentWrapper({ value, children }: TabContentWrapperProps) {
49
+ export function TabContentWrapper({
50
+ value,
51
+ children,
52
+ }: TabContentWrapperProps): React.JSX.Element {
50
53
  return <TabsContentPrimitive value={value}>{children}</TabsContentPrimitive>;
51
54
  }
@@ -10,7 +10,7 @@ function Tabs({
10
10
  className,
11
11
  orientation = "horizontal",
12
12
  ...props
13
- }: React.ComponentProps<typeof TabsPrimitive.Root>) {
13
+ }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element {
14
14
  return (
15
15
  <TabsPrimitive.Root
16
16
  data-slot="tabs"
@@ -45,7 +45,7 @@ function TabsList({
45
45
  variant = "default",
46
46
  ...props
47
47
  }: React.ComponentProps<typeof TabsPrimitive.List> &
48
- VariantProps<typeof tabsListVariants>) {
48
+ VariantProps<typeof tabsListVariants>): React.JSX.Element {
49
49
  return (
50
50
  <TabsPrimitive.List
51
51
  data-slot="tabs-list"
@@ -59,7 +59,7 @@ function TabsList({
59
59
  function TabsTrigger({
60
60
  className,
61
61
  ...props
62
- }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
62
+ }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element {
63
63
  return (
64
64
  <TabsPrimitive.Trigger
65
65
  data-slot="tabs-trigger"
@@ -78,7 +78,7 @@ function TabsTrigger({
78
78
  function TabsContent({
79
79
  className,
80
80
  ...props
81
- }: React.ComponentProps<typeof TabsPrimitive.Content>) {
81
+ }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element {
82
82
  return (
83
83
  <TabsPrimitive.Content
84
84
  data-slot="tabs-content"
@@ -20,7 +20,7 @@ export function Text({
20
20
  className,
21
21
  children,
22
22
  ...props
23
- }: TextProps) {
23
+ }: TextProps): React.JSX.Element {
24
24
  return (
25
25
  <span
26
26
  data-slot="text"
@@ -2,7 +2,10 @@ import * as React from "react";
2
2
 
3
3
  import { cn } from "@/lib/utils";
4
4
 
5
- function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
5
+ function Textarea({
6
+ className,
7
+ ...props
8
+ }: React.ComponentProps<"textarea">): React.JSX.Element {
6
9
  return (
7
10
  <textarea
8
11
  data-slot="textarea"
@@ -8,7 +8,7 @@ import { cn } from "@/lib/utils";
8
8
  function TooltipProvider({
9
9
  delayDuration = 0,
10
10
  ...props
11
- }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
11
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element {
12
12
  return (
13
13
  <TooltipPrimitive.Provider
14
14
  data-slot="tooltip-provider"
@@ -20,13 +20,13 @@ function TooltipProvider({
20
20
 
21
21
  function Tooltip({
22
22
  ...props
23
- }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
23
+ }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element {
24
24
  return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
25
25
  }
26
26
 
27
27
  function TooltipTrigger({
28
28
  ...props
29
- }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
29
+ }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element {
30
30
  return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
31
31
  }
32
32
 
@@ -35,7 +35,7 @@ function TooltipContent({
35
35
  sideOffset = 0,
36
36
  children,
37
37
  ...props
38
- }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
38
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element {
39
39
  return (
40
40
  <TooltipPrimitive.Portal>
41
41
  <TooltipPrimitive.Content
package/src/react-shim.ts CHANGED
@@ -10,10 +10,15 @@ import { createShims } from "./compat-shims";
10
10
 
11
11
  const Shimmed = { ...ReactOriginal, ...createShims(ReactOriginal) };
12
12
 
13
- // React internals required by react-dom
14
- export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
15
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- (ReactOriginal as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
13
+ // React internals required by react-dom. Not part of React's public types;
14
+ // declared here as an opaque escape hatch so consuming code can re-export the
15
+ // same symbol react-dom looks up at runtime.
16
+ interface ReactInternals {
17
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?: unknown;
18
+ }
19
+ export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = (
20
+ ReactOriginal as ReactInternals
21
+ ).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
17
22
 
18
23
  export const {
19
24
  Children,
package/src/server/bun.ts CHANGED
@@ -33,7 +33,7 @@ export function createBunHandler(
33
33
  | ((
34
34
  request: Request,
35
35
  ) => SessionHandlerOptions | Promise<SessionHandlerOptions>),
36
- ) {
36
+ ): (request: Request) => Promise<Response> {
37
37
  return async (request: Request) => {
38
38
  const projectSlug = request.headers.get("gram-project");
39
39
 
@@ -34,7 +34,7 @@ export function createExpressHandler(
34
34
  | ((
35
35
  req: Request,
36
36
  ) => SessionHandlerOptions | Promise<SessionHandlerOptions>),
37
- ) {
37
+ ): (req: Request, res: Response) => Promise<void> {
38
38
  return async (req: Request, res: Response) => {
39
39
  const projectSlug = Array.isArray(req.headers["gram-project"])
40
40
  ? req.headers["gram-project"][0]
@@ -33,7 +33,7 @@ export function createFastifyHandler(
33
33
  | ((
34
34
  request: FastifyRequest,
35
35
  ) => SessionHandlerOptions | Promise<SessionHandlerOptions>),
36
- ) {
36
+ ): (request: FastifyRequest, reply: FastifyReply) => Promise<void> {
37
37
  return async (request: FastifyRequest, reply: FastifyReply) => {
38
38
  const projectSlug = Array.isArray(request.headers["gram-project"])
39
39
  ? request.headers["gram-project"][0]
@@ -31,7 +31,7 @@ export function createHonoHandler(
31
31
  options:
32
32
  | SessionHandlerOptions
33
33
  | ((c: Context) => SessionHandlerOptions | Promise<SessionHandlerOptions>),
34
- ) {
34
+ ): (c: Context) => Promise<Response> {
35
35
  return async (c: Context) => {
36
36
  const projectSlug = c.req.header("gram-project");
37
37
 
@@ -28,7 +28,7 @@ export function createNextHandler(
28
28
  | ((
29
29
  request: Request,
30
30
  ) => SessionHandlerOptions | Promise<SessionHandlerOptions>),
31
- ) {
31
+ ): (request: Request) => Promise<Response> {
32
32
  return async (request: Request) => {
33
33
  const projectSlug = request.headers.get("gram-project");
34
34
 
@@ -47,7 +47,7 @@ export function createTanStackStartHandler(
47
47
  | ((
48
48
  request: Request,
49
49
  ) => SessionHandlerOptions | Promise<SessionHandlerOptions>),
50
- ) {
50
+ ): (request: Request) => Promise<Response> {
51
51
  return async (request: Request) => {
52
52
  const projectSlug = request.headers.get("gram-project");
53
53
 
@@ -15,6 +15,11 @@ export interface ElementsParameters {
15
15
  * Use this to override specific config values per-story.
16
16
  */
17
17
  config?: Partial<ElementsConfig>;
18
+ /**
19
+ * When true, the global ElementsProvider decorator is skipped — useful for
20
+ * stories that render their own provider (e.g. `<Replay>`).
21
+ */
22
+ skipProvider?: boolean;
18
23
  }
19
24
 
20
25
  declare module "storybook/internal/csf" {