@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.
- package/dist/compat-shims-CO9JXXV4.cjs.map +1 -1
- package/dist/compat-shims-DxtUrORi.js.map +1 -1
- package/dist/compat-shims.d.ts +9 -8
- package/dist/components/Chat/index.d.ts +2 -1
- package/dist/components/ChatHistory.d.ts +1 -1
- package/dist/components/FrontendTools/index.d.ts +1 -1
- package/dist/components/Replay.d.ts +1 -1
- package/dist/components/Replay.stories.d.ts +2 -2
- package/dist/components/ShadowRoot.d.ts +1 -1
- package/dist/components/ShareButton/index.d.ts +1 -1
- package/dist/components/ui/avatar.d.ts +3 -3
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/buttonVariants.d.ts +2 -2
- package/dist/components/ui/calendar.d.ts +2 -1
- package/dist/components/ui/collapsible.d.ts +3 -3
- package/dist/components/ui/dialog.d.ts +10 -10
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/time-range-picker.d.ts +2 -1
- package/dist/components/ui/tool-ui.d.ts +7 -7
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/contexts/ConnectionStatusContext.d.ts +1 -1
- package/dist/contexts/ElementsProvider.d.ts +1 -1
- package/dist/contexts/ToolApprovalContext.d.ts +2 -2
- package/dist/contexts/ToolExecutionContext.d.ts +1 -1
- package/dist/contexts/portal-container.d.ts +1 -1
- package/dist/elements.cjs +1 -1
- package/dist/elements.css +1 -1
- package/dist/elements.js +2 -2
- package/dist/hooks/useDensity.d.ts +1 -1
- package/dist/hooks/useElements.d.ts +2 -1
- package/dist/hooks/useGramThreadListAdapter.d.ts +13 -0
- package/dist/hooks/useRadius.d.ts +1 -1
- package/dist/hooks/useThemeProps.d.ts +1 -1
- package/dist/hooks/useToolApproval.d.ts +2 -1
- package/dist/{index-BFU6NvbL.js → index-BhIowiZF.js} +9408 -9204
- package/dist/index-BhIowiZF.js.map +1 -0
- package/dist/{index-C08dvTEo.cjs → index-D0jIGQr7.cjs} +3 -3
- package/dist/index-D0jIGQr7.cjs.map +1 -0
- package/dist/{index-B5lZrrO2.js → index-Dz13dSDa.js} +57 -15
- package/dist/index-Dz13dSDa.js.map +1 -0
- package/dist/index-PXd3rs95.cjs +194 -0
- package/dist/index-PXd3rs95.cjs.map +1 -0
- package/dist/lib/errorTracking.d.ts +1 -1
- package/dist/lib/tools.d.ts +11 -10
- package/dist/plugins/generative-ui/catalog.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/accordion.d.ts +4 -4
- package/dist/plugins/generative-ui/ui/action-button.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/alert.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/avatar-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/avatar.d.ts +6 -6
- package/dist/plugins/generative-ui/ui/badge.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/button.d.ts +3 -3
- package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/card.d.ts +7 -7
- package/dist/plugins/generative-ui/ui/checkbox-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/checkbox.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/data-table.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/dialog.d.ts +10 -10
- package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +15 -15
- package/dist/plugins/generative-ui/ui/grid.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/index.d.ts +57 -40
- package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/input.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/label.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/list.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/metric.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/pagination.d.ts +7 -7
- package/dist/plugins/generative-ui/ui/popover.d.ts +7 -7
- package/dist/plugins/generative-ui/ui/progress.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/radio-group.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/select-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/select.d.ts +10 -10
- package/dist/plugins/generative-ui/ui/separator.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/skeleton-wrapper.d.ts +2 -1
- package/dist/plugins/generative-ui/ui/skeleton.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/stack.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/switch.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/table.d.ts +8 -8
- package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +2 -2
- package/dist/plugins/generative-ui/ui/tabs.d.ts +4 -4
- package/dist/plugins/generative-ui/ui/text.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/textarea.d.ts +1 -1
- package/dist/plugins/generative-ui/ui/tooltip.d.ts +4 -4
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +1 -1
- package/dist/{profiler-KLSTpp6I.js → profiler-CtGKTWWP.js} +2 -2
- package/dist/{profiler-KLSTpp6I.js.map → profiler-CtGKTWWP.js.map} +1 -1
- package/dist/{profiler-BRnyr1GA.cjs → profiler-l7_HjTyw.cjs} +2 -2
- package/dist/{profiler-BRnyr1GA.cjs.map → profiler-l7_HjTyw.cjs.map} +1 -1
- package/dist/react-shim.cjs.map +1 -1
- package/dist/react-shim.d.ts +1 -1
- package/dist/react-shim.js +1 -4
- package/dist/react-shim.js.map +1 -1
- package/dist/server/bun.cjs.map +1 -1
- package/dist/server/bun.js.map +1 -1
- package/dist/server/express.cjs.map +1 -1
- package/dist/server/express.js.map +1 -1
- package/dist/server/fastify.cjs.map +1 -1
- package/dist/server/fastify.js.map +1 -1
- package/dist/server/hono.cjs.map +1 -1
- package/dist/server/hono.js.map +1 -1
- package/dist/server/nextjs.cjs.map +1 -1
- package/dist/server/nextjs.js.map +1 -1
- package/dist/server/tanstack-start.cjs.map +1 -1
- package/dist/server/tanstack-start.js.map +1 -1
- package/dist/{startRecording-CKx-YWbq.cjs → startRecording-DEw2Aeq4.cjs} +2 -2
- package/dist/{startRecording-CKx-YWbq.cjs.map → startRecording-DEw2Aeq4.cjs.map} +1 -1
- package/dist/{startRecording-BfxB1xxR.js → startRecording-iYEL0-vr.js} +2 -2
- package/dist/{startRecording-BfxB1xxR.js.map → startRecording-iYEL0-vr.js.map} +1 -1
- package/dist/types/index.d.ts +29 -3
- package/package.json +7 -10
- package/src/compat-shims.ts +16 -2
- package/src/components/Chat/index.tsx +4 -1
- package/src/components/Chat/stories/FrontendTools.stories.tsx +1 -1
- package/src/components/Chat/stories/ToolApproval.stories.tsx +2 -2
- package/src/components/Chat/stories/Tools.stories.tsx +13 -5
- package/src/components/ChatHistory.tsx +3 -1
- package/src/components/FrontendTools/index.tsx +1 -1
- package/src/components/MessageContent.tsx +1 -0
- package/src/components/Replay.stories.tsx +2 -3
- package/src/components/Replay.tsx +17 -10
- package/src/components/ShadowRoot.tsx +2 -2
- package/src/components/ShareButton/index.tsx +4 -2
- package/src/components/assistant-ui/assistant-modal.tsx +5 -3
- package/src/components/assistant-ui/attachment.tsx +1 -1
- package/src/components/assistant-ui/error-boundary.tsx +1 -1
- package/src/components/assistant-ui/markdown-text.tsx +1 -1
- package/src/components/assistant-ui/thread.tsx +249 -11
- package/src/components/assistant-ui/tool-mention-autocomplete.tsx +1 -1
- package/src/components/ui/avatar.tsx +3 -3
- package/src/components/ui/calendar.tsx +1 -1
- package/src/components/ui/collapsible.tsx +7 -3
- package/src/components/ui/dialog.tsx +18 -10
- package/src/components/ui/generative-ui.tsx +9 -4
- package/src/components/ui/popover.tsx +4 -4
- package/src/components/ui/skeleton.tsx +4 -1
- package/src/components/ui/time-range-picker.stories.tsx +164 -154
- package/src/components/ui/time-range-picker.tsx +11 -5
- package/src/components/ui/tool-ui.tsx +18 -9
- package/src/components/ui/tooltip.tsx +4 -4
- package/src/contexts/ChatIdContext.tsx +1 -1
- package/src/contexts/ConnectionStatusContext.tsx +6 -5
- package/src/contexts/ElementsProvider.tsx +64 -41
- package/src/contexts/ReplayContext.ts +1 -1
- package/src/contexts/ToolApprovalContext.tsx +5 -1
- package/src/contexts/ToolExecutionContext.tsx +1 -1
- package/src/contexts/portal-container.tsx +1 -1
- package/src/hooks/useAuth.ts +2 -1
- package/src/hooks/useDensity.ts +1 -1
- package/src/hooks/useElements.ts +2 -1
- package/src/hooks/useFollowOnSuggestions.ts +3 -6
- package/src/hooks/useGramThreadListAdapter.tsx +50 -3
- package/src/hooks/useMCPTools.ts +2 -2
- package/src/hooks/useModel.ts +1 -3
- package/src/hooks/usePluginComponents.ts +3 -1
- package/src/hooks/useRadius.ts +1 -1
- package/src/hooks/useSession.ts +3 -1
- package/src/hooks/useThemeProps.ts +5 -5
- package/src/hooks/useToolApproval.ts +2 -1
- package/src/lib/cassette.ts +20 -8
- package/src/lib/errorTracking.ts +1 -4
- package/src/lib/messageConverter.test.ts +11 -13
- package/src/lib/messageConverter.ts +13 -4
- package/src/lib/token.ts +2 -5
- package/src/lib/tool-mentions.ts +5 -2
- package/src/lib/tools.byte-cap.test.ts +1 -1
- package/src/lib/tools.test.ts +1 -1
- package/src/lib/tools.ts +15 -5
- package/src/lib/utils.ts +2 -2
- package/src/lib.d.ts +8 -1
- package/src/plugins/chart/chart.test.ts +3 -4
- package/src/plugins/chart/component.tsx +7 -6
- package/src/plugins/chart/ui/area-chart.tsx +1 -1
- package/src/plugins/chart/ui/line-chart.tsx +1 -1
- package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +2 -2
- package/src/plugins/generative-ui/ui/accordion.tsx +4 -4
- package/src/plugins/generative-ui/ui/action-button.tsx +4 -2
- package/src/plugins/generative-ui/ui/alert-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/alert.tsx +7 -3
- package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +5 -1
- package/src/plugins/generative-ui/ui/avatar.tsx +12 -6
- package/src/plugins/generative-ui/ui/badge.tsx +1 -1
- package/src/plugins/generative-ui/ui/button-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/button.tsx +1 -1
- package/src/plugins/generative-ui/ui/card-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/card.tsx +28 -7
- package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/checkbox.tsx +1 -1
- package/src/plugins/generative-ui/ui/data-table.tsx +1 -1
- package/src/plugins/generative-ui/ui/dialog.tsx +15 -10
- package/src/plugins/generative-ui/ui/dropdown-menu.tsx +33 -15
- package/src/plugins/generative-ui/ui/grid.tsx +1 -1
- package/src/plugins/generative-ui/ui/index.ts +154 -40
- package/src/plugins/generative-ui/ui/input-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/input.tsx +5 -1
- package/src/plugins/generative-ui/ui/label.tsx +1 -1
- package/src/plugins/generative-ui/ui/list.tsx +5 -1
- package/src/plugins/generative-ui/ui/metric.tsx +2 -1
- package/src/plugins/generative-ui/ui/pagination.tsx +12 -7
- package/src/plugins/generative-ui/ui/popover.tsx +13 -7
- package/src/plugins/generative-ui/ui/progress.tsx +1 -1
- package/src/plugins/generative-ui/ui/radio-group.tsx +2 -2
- package/src/plugins/generative-ui/ui/select-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/select.tsx +14 -10
- package/src/plugins/generative-ui/ui/separator.tsx +1 -1
- package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +1 -1
- package/src/plugins/generative-ui/ui/skeleton.tsx +4 -1
- package/src/plugins/generative-ui/ui/stack.tsx +1 -1
- package/src/plugins/generative-ui/ui/switch.tsx +1 -1
- package/src/plugins/generative-ui/ui/table.tsx +29 -8
- package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +5 -2
- package/src/plugins/generative-ui/ui/tabs.tsx +4 -4
- package/src/plugins/generative-ui/ui/text.tsx +1 -1
- package/src/plugins/generative-ui/ui/textarea.tsx +4 -1
- package/src/plugins/generative-ui/ui/tooltip.tsx +4 -4
- package/src/react-shim.ts +9 -4
- package/src/server/bun.ts +1 -1
- package/src/server/express.ts +1 -1
- package/src/server/fastify.ts +1 -1
- package/src/server/hono.ts +1 -1
- package/src/server/nextjs.ts +1 -1
- package/src/server/tanstack-start.ts +1 -1
- package/src/storybook.d.ts +5 -0
- package/src/types/index.ts +39 -3
- package/dist/index-B5lZrrO2.js.map +0 -1
- package/dist/index-BFU6NvbL.js.map +0 -1
- package/dist/index-C08dvTEo.cjs.map +0 -1
- package/dist/index-DzZ1-jQY.cjs +0 -194
- 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({
|
|
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({
|
|
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({
|
|
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({
|
|
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"
|
|
@@ -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"
|
|
@@ -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<
|
|
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<
|
|
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"
|
|
@@ -4,7 +4,10 @@ import * as React from "react";
|
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils";
|
|
6
6
|
|
|
7
|
-
function 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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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({
|
|
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"
|
|
@@ -2,7 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "@/lib/utils";
|
|
4
4
|
|
|
5
|
-
function 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
package/src/server/express.ts
CHANGED
|
@@ -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]
|
package/src/server/fastify.ts
CHANGED
|
@@ -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]
|
package/src/server/hono.ts
CHANGED
|
@@ -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
|
|
package/src/server/nextjs.ts
CHANGED
|
@@ -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
|
|
package/src/storybook.d.ts
CHANGED
|
@@ -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" {
|