@turtleclub/ui 0.7.0-beta.32 → 0.7.0-beta.34

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 (139) hide show
  1. package/dist/index.cjs +10331 -110
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +7652 -47844
  4. package/dist/index.js.map +1 -1
  5. package/dist/types/components/features/sidebar-layout.d.ts +2 -0
  6. package/dist/types/components/features/sidebar-layout.d.ts.map +1 -1
  7. package/dist/types/components/ui/chart.d.ts +1 -1
  8. package/dist/types/components/ui/chart.d.ts.map +1 -1
  9. package/package.json +26 -22
  10. package/.prettierrc.json +0 -4
  11. package/.turbo/turbo-build.log +0 -182
  12. package/CHANGELOG.md +0 -795
  13. package/components.json +0 -21
  14. package/src/components/charts/QUICK_REFERENCE.md +0 -323
  15. package/src/components/charts/README.md +0 -658
  16. package/src/components/charts/RECHARTS_FEATURES.md +0 -458
  17. package/src/components/charts/area-chart.tsx +0 -248
  18. package/src/components/charts/bar-chart.tsx +0 -362
  19. package/src/components/charts/index.ts +0 -4
  20. package/src/components/charts/pie-chart.tsx +0 -277
  21. package/src/components/charts/radial-chart.tsx +0 -312
  22. package/src/components/features/api-status/index.tsx +0 -23
  23. package/src/components/features/data-table/data-table.tsx +0 -538
  24. package/src/components/features/data-table/expand-toggle.tsx +0 -17
  25. package/src/components/features/data-table/fuzzy-filter.tsx +0 -34
  26. package/src/components/features/data-table/index.ts +0 -3
  27. package/src/components/features/data-table/item-info.tsx +0 -19
  28. package/src/components/features/data-table/skeleton.tsx +0 -23
  29. package/src/components/features/data-table/sort-dropdown.tsx +0 -118
  30. package/src/components/features/data-table/sortable-header.tsx +0 -37
  31. package/src/components/features/index.ts +0 -6
  32. package/src/components/features/page-heading.tsx +0 -27
  33. package/src/components/features/search-bar.tsx +0 -55
  34. package/src/components/features/segmented-navigation.tsx +0 -18
  35. package/src/components/features/sidebar-layout.tsx +0 -193
  36. package/src/components/features/turtle-tooltip.tsx +0 -67
  37. package/src/components/icons/arrow.tsx +0 -23
  38. package/src/components/icons/beta.tsx +0 -95
  39. package/src/components/icons/dot.tsx +0 -102
  40. package/src/components/icons/index.ts +0 -7
  41. package/src/components/icons/issue.tsx +0 -106
  42. package/src/components/icons/turtle.tsx +0 -156
  43. package/src/components/icons/update.tsx +0 -113
  44. package/src/components/icons/warning.tsx +0 -95
  45. package/src/components/molecules/index.ts +0 -9
  46. package/src/components/molecules/opportunity/index.ts +0 -10
  47. package/src/components/molecules/opportunity/opportunity-apr.tsx +0 -129
  48. package/src/components/molecules/opportunity/opportunity-disclaimer.tsx +0 -46
  49. package/src/components/molecules/opportunity/opportunity-rate-estimator.tsx +0 -62
  50. package/src/components/molecules/opportunity/opportunity-section.tsx +0 -113
  51. package/src/components/molecules/opportunity/opportunity-selector.tsx +0 -30
  52. package/src/components/molecules/opportunity/opportunity-type.tsx +0 -16
  53. package/src/components/molecules/route-details.tsx +0 -112
  54. package/src/components/molecules/slippage-selector.tsx +0 -200
  55. package/src/components/molecules/swap-details.tsx +0 -55
  56. package/src/components/molecules/swap-input.tsx +0 -186
  57. package/src/components/molecules/tabs.tsx +0 -79
  58. package/src/components/molecules/token-selector.tsx +0 -180
  59. package/src/components/molecules/tx-status.tsx +0 -312
  60. package/src/components/molecules/widget/asset-list/asset-filters.tsx +0 -113
  61. package/src/components/molecules/widget/asset-list/asset-list.tsx +0 -178
  62. package/src/components/molecules/widget/asset-list/asset-row.tsx +0 -45
  63. package/src/components/molecules/widget/asset-list/hooks/index.ts +0 -2
  64. package/src/components/molecules/widget/asset-list/hooks/use-asset-filtering.ts +0 -44
  65. package/src/components/molecules/widget/asset-list/hooks/use-asset-grouping.ts +0 -87
  66. package/src/components/molecules/widget/asset-list/index.ts +0 -3
  67. package/src/components/molecules/widget/base-selector.tsx +0 -121
  68. package/src/components/molecules/widget/campaign-item.tsx +0 -82
  69. package/src/components/molecules/widget/deal-item.tsx +0 -92
  70. package/src/components/molecules/widget/index.ts +0 -36
  71. package/src/components/molecules/widget/opportunity-item.tsx +0 -105
  72. package/src/components/molecules/widget/widget-item-stats.tsx +0 -50
  73. package/src/components/molecules/widget/widget-item.tsx +0 -139
  74. package/src/components/molecules/widget/widget-list-items.tsx +0 -86
  75. package/src/components/ui/alert-dialog.tsx +0 -163
  76. package/src/components/ui/animated-background/animated-background.tsx +0 -182
  77. package/src/components/ui/animated-background/index.ts +0 -1
  78. package/src/components/ui/avatar.tsx +0 -73
  79. package/src/components/ui/badge.tsx +0 -59
  80. package/src/components/ui/banner.tsx +0 -84
  81. package/src/components/ui/button.tsx +0 -100
  82. package/src/components/ui/card.tsx +0 -119
  83. package/src/components/ui/chart.tsx +0 -346
  84. package/src/components/ui/checkbox.tsx +0 -32
  85. package/src/components/ui/chip.tsx +0 -52
  86. package/src/components/ui/collapsible.tsx +0 -34
  87. package/src/components/ui/combobox.tsx +0 -730
  88. package/src/components/ui/command.tsx +0 -184
  89. package/src/components/ui/dialog.tsx +0 -129
  90. package/src/components/ui/dropdown.tsx +0 -316
  91. package/src/components/ui/field.tsx +0 -244
  92. package/src/components/ui/heading.tsx +0 -74
  93. package/src/components/ui/hover-card.tsx +0 -139
  94. package/src/components/ui/icon-animation.tsx +0 -82
  95. package/src/components/ui/icon-list.tsx +0 -168
  96. package/src/components/ui/index.ts +0 -48
  97. package/src/components/ui/info-card.tsx +0 -110
  98. package/src/components/ui/input-group.tsx +0 -170
  99. package/src/components/ui/input.tsx +0 -72
  100. package/src/components/ui/label-with-icon.tsx +0 -122
  101. package/src/components/ui/label.tsx +0 -24
  102. package/src/components/ui/multi-select.tsx +0 -1090
  103. package/src/components/ui/navigation-bar.tsx +0 -153
  104. package/src/components/ui/navigation-menu.tsx +0 -188
  105. package/src/components/ui/opportunity-details-v1.tsx +0 -104
  106. package/src/components/ui/pagination.tsx +0 -127
  107. package/src/components/ui/popover.tsx +0 -48
  108. package/src/components/ui/scroll-area.tsx +0 -64
  109. package/src/components/ui/segment-control.tsx +0 -146
  110. package/src/components/ui/select.tsx +0 -199
  111. package/src/components/ui/separator.tsx +0 -26
  112. package/src/components/ui/sheet.tsx +0 -139
  113. package/src/components/ui/sidebar.tsx +0 -728
  114. package/src/components/ui/skeleton.tsx +0 -14
  115. package/src/components/ui/slider.tsx +0 -58
  116. package/src/components/ui/sonner.tsx +0 -24
  117. package/src/components/ui/switch.tsx +0 -29
  118. package/src/components/ui/table-shadcn.tsx +0 -110
  119. package/src/components/ui/table.tsx +0 -117
  120. package/src/components/ui/textarea.tsx +0 -22
  121. package/src/components/ui/toggle-group.tsx +0 -71
  122. package/src/components/ui/toggle.tsx +0 -47
  123. package/src/components/ui/tooltip.tsx +0 -66
  124. package/src/hooks/index.ts +0 -1
  125. package/src/hooks/useIsMobile.ts +0 -77
  126. package/src/index.ts +0 -16
  127. package/src/lib/utils.ts +0 -6
  128. package/src/styles/globals.css +0 -181
  129. package/src/styles/themes/index.css +0 -9
  130. package/src/styles/themes/semantic.css +0 -117
  131. package/src/styles/tokens/colors.css +0 -124
  132. package/src/styles/tokens/index.css +0 -15
  133. package/src/styles/tokens/radius.css +0 -18
  134. package/src/styles/tokens/spacing.css +0 -58
  135. package/src/styles/tokens/typography.css +0 -87
  136. package/src/tokens/index.ts +0 -108
  137. package/tsconfig.json +0 -20
  138. package/vite.config.js +0 -49
  139. /package/{src/images/enso.png → dist/enso-22FJ4GNK.png} +0 -0
@@ -1,146 +0,0 @@
1
- "use client";
2
- import * as React from "react";
3
- import { useCallback, useEffect, useRef } from "react";
4
- import { cn } from "@/lib/utils";
5
- import { cva, VariantProps } from "class-variance-authority";
6
-
7
- const segmentVariants = cva("relative flex rounded-full font-normal", {
8
- variants: {
9
- variant: {
10
- default: "gap-1",
11
- segment: "border-border bg-neutral-alpha-2 gap-2.5 border",
12
- pill: "border-border bg-neutral-alpha-2 gap-2.5 border p-0.5",
13
- },
14
- size: {
15
- default: "h-9",
16
- sm: "h-7",
17
- xs: "h-6",
18
- },
19
- },
20
- defaultVariants: {
21
- variant: "default",
22
- size: "default",
23
- },
24
- });
25
-
26
- const indicatorVariants = cva("transition-all duration-300", {
27
- variants: {
28
- variant: {
29
- default: "absolute",
30
- segment: "bg-neutral-alpha-5 absolute inset-0 origin-center rounded-full",
31
- pill: "bg-neutral-alpha-5 absolute inset-0.5 origin-center rounded-full",
32
- },
33
- },
34
- defaultVariants: {
35
- variant: "default",
36
- },
37
- });
38
-
39
- const tabVariants = cva(
40
- "text-muted-foreground relative z-10 flex w-full items-center justify-center rounded-full whitespace-nowrap transition-all sm:grow-0",
41
- {
42
- variants: {
43
- variant: {
44
- default:
45
- "border-border bg-neutral-alpha-2 data-[active=true]:bg-neutral-alpha-10 data-[active=true]:text-foreground border",
46
- segment: "data-[active=true]:text-primary",
47
- pill: "data-[active=true]:text-foreground",
48
- },
49
- size: {
50
- default: "px-4 py-2 text-sm",
51
- sm: "px-3 py-1.5 text-xs",
52
- xs: "px-3 py-1 text-[10px]",
53
- },
54
- cursorPointer: {
55
- true: "cursor-pointer",
56
- false: "",
57
- },
58
- },
59
- defaultVariants: {
60
- variant: "default",
61
- size: "default",
62
- },
63
- },
64
- );
65
-
66
- export type SegmentControlProps<T extends string> = {
67
- value: T;
68
- onChange: (value: T) => void;
69
- items: {
70
- label: React.ReactNode;
71
- value: T;
72
- disabled?: boolean;
73
- }[];
74
- cursorPointer?: boolean;
75
- className?: string;
76
- } & VariantProps<typeof segmentVariants>;
77
-
78
- export function SegmentControl<T extends string>({
79
- value,
80
- onChange,
81
- items,
82
- variant,
83
- size,
84
- cursorPointer = false,
85
- className,
86
- }: SegmentControlProps<T>) {
87
- const handleClick = (value: T) => {
88
- onChange(value);
89
- };
90
-
91
- const containerRef = useRef<HTMLDivElement | null>(null);
92
- const indicatorRef = useRef<HTMLDivElement | null>(null);
93
-
94
- const updateIndicatorPosition = useCallback(() => {
95
- if (!containerRef.current || !indicatorRef.current) return;
96
-
97
- const activeButton = containerRef.current.querySelector(
98
- `[data-active="true"]`,
99
- ) as HTMLElement;
100
- if (activeButton) {
101
- indicatorRef.current.style.width = `${activeButton.offsetWidth}px`;
102
- indicatorRef.current.style.left = `${activeButton.offsetLeft}px`;
103
- }
104
- }, [items]);
105
-
106
- useEffect(() => {
107
- updateIndicatorPosition();
108
-
109
- const resizeObserver = new ResizeObserver(updateIndicatorPosition);
110
-
111
- if (containerRef.current) {
112
- resizeObserver.observe(containerRef.current);
113
- }
114
-
115
- return () => {
116
- resizeObserver.disconnect();
117
- };
118
- }, [value, updateIndicatorPosition]);
119
-
120
- return (
121
- <>
122
- <div
123
- ref={containerRef}
124
- className={cn(segmentVariants({ variant, size }), className)}
125
- >
126
- <div ref={indicatorRef} className={indicatorVariants({ variant })} />
127
-
128
- {items.map((button) => (
129
- <button
130
- type="button"
131
- key={button.value}
132
- data-active={value === button.value}
133
- disabled={button.disabled}
134
- className={cn(
135
- tabVariants({ variant, size, cursorPointer }),
136
- button.disabled && "cursor-not-allowed opacity-50",
137
- )}
138
- onClick={() => !button.disabled && handleClick(button.value)}
139
- >
140
- {button.label}
141
- </button>
142
- ))}
143
- </div>
144
- </>
145
- );
146
- }
@@ -1,199 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as SelectPrimitive from "@radix-ui/react-select";
5
- import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
6
-
7
- import { cn } from "@/lib/utils";
8
- import { DotIcon } from "../icons";
9
-
10
- function Select({
11
- className,
12
- ...props
13
- }: React.ComponentProps<typeof SelectPrimitive.Root> & { className?: string }) {
14
- return (
15
- <div className={cn("relative z-10", className)}>
16
- <SelectPrimitive.Root data-slot="select" {...props} />
17
- </div>
18
- );
19
- }
20
-
21
- function SelectGroup({
22
- ...props
23
- }: React.ComponentProps<typeof SelectPrimitive.Group>) {
24
- return <SelectPrimitive.Group data-slot="select-group" {...props} />;
25
- }
26
-
27
- function SelectValue({
28
- ...props
29
- }: React.ComponentProps<typeof SelectPrimitive.Value>) {
30
- return <SelectPrimitive.Value data-slot="select-value" {...props} />;
31
- }
32
-
33
- function SelectTrigger({
34
- className,
35
- size = "default",
36
- children,
37
- ...props
38
- }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
39
- size?: "sm" | "default";
40
- }) {
41
- return (
42
- <SelectPrimitive.Trigger
43
- data-slot="select-trigger"
44
- data-size={size}
45
- className={cn(
46
- "bg-muted border-border data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-full border py-3 pr-3 pl-4 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-10 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
47
- className,
48
- )}
49
- {...props}
50
- >
51
- {children}
52
- <SelectPrimitive.Icon asChild>
53
- <ChevronDownIcon className="size-4 opacity-50" />
54
- </SelectPrimitive.Icon>
55
- </SelectPrimitive.Trigger>
56
- );
57
- }
58
-
59
- function SelectContent({
60
- className,
61
- children,
62
- position = "popper",
63
- sideOffset = -22,
64
-
65
- ...props
66
- }: React.ComponentProps<typeof SelectPrimitive.Content>) {
67
- return (
68
- <SelectPrimitive.Portal
69
- container={
70
- document.querySelectorAll(".turtle-widget-root")[0] ?? undefined
71
- }
72
- >
73
- <SelectPrimitive.Content
74
- data-slot="select-content"
75
- className={cn(
76
- "bg-background text-muted-foreground 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-b-turtle border-border relative max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-t-none border p-3 !pt-6 shadow-md",
77
- position === "popper" &&
78
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
79
- "w-[var(--radix-select-trigger-width)]",
80
- className,
81
- )}
82
- position={position}
83
- sideOffset={sideOffset}
84
- {...props}
85
- >
86
- <SelectScrollUpButton />
87
- <SelectPrimitive.Viewport
88
- className={cn(
89
- position === "popper" &&
90
- "min-h-[calc(var(--radix-select-trigger-height)*2)] scroll-my-1",
91
- )}
92
- >
93
- {children}
94
- </SelectPrimitive.Viewport>
95
- <SelectScrollDownButton />
96
- </SelectPrimitive.Content>
97
- </SelectPrimitive.Portal>
98
- );
99
- }
100
-
101
- function SelectLabel({
102
- className,
103
- ...props
104
- }: React.ComponentProps<typeof SelectPrimitive.Label>) {
105
- return (
106
- <SelectPrimitive.Label
107
- data-slot="select-label"
108
- className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
109
- {...props}
110
- />
111
- );
112
- }
113
-
114
- function SelectItem({
115
- className,
116
- children,
117
- ...props
118
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
119
- return (
120
- <SelectPrimitive.Item
121
- data-slot="select-item"
122
- className={cn(
123
- "focus:bg-neutral-alpha-2 focus:text-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative my-1 flex cursor-default items-center gap-2 rounded-full py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
124
- "data-[state=checked]:bg-neutral-alpha-2 data-[state=checked]:border-border data-[state=checked]:border",
125
- className,
126
- )}
127
- {...props}
128
- >
129
- <span className="absolute right-2 flex size-6 items-center justify-center">
130
- <SelectPrimitive.ItemIndicator>
131
- <DotIcon className="text-primary size-12" />
132
- </SelectPrimitive.ItemIndicator>
133
- </span>
134
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
135
- </SelectPrimitive.Item>
136
- );
137
- }
138
-
139
- function SelectSeparator({
140
- className,
141
- ...props
142
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
143
- return (
144
- <SelectPrimitive.Separator
145
- data-slot="select-separator"
146
- className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
147
- {...props}
148
- />
149
- );
150
- }
151
-
152
- function SelectScrollUpButton({
153
- className,
154
- ...props
155
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
156
- return (
157
- <SelectPrimitive.ScrollUpButton
158
- data-slot="select-scroll-up-button"
159
- className={cn(
160
- "flex cursor-default items-center justify-center py-1",
161
- className,
162
- )}
163
- {...props}
164
- >
165
- <ChevronUpIcon className="size-4" />
166
- </SelectPrimitive.ScrollUpButton>
167
- );
168
- }
169
-
170
- function SelectScrollDownButton({
171
- className,
172
- ...props
173
- }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
174
- return (
175
- <SelectPrimitive.ScrollDownButton
176
- data-slot="select-scroll-down-button"
177
- className={cn(
178
- "flex cursor-default items-center justify-center py-1",
179
- className,
180
- )}
181
- {...props}
182
- >
183
- <ChevronDownIcon className="size-4" />
184
- </SelectPrimitive.ScrollDownButton>
185
- );
186
- }
187
-
188
- export {
189
- Select,
190
- SelectContent,
191
- SelectGroup,
192
- SelectItem,
193
- SelectLabel,
194
- SelectScrollDownButton,
195
- SelectScrollUpButton,
196
- SelectSeparator,
197
- SelectTrigger,
198
- SelectValue,
199
- };
@@ -1,26 +0,0 @@
1
- import * as React from "react";
2
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- function Separator({
7
- className,
8
- orientation = "horizontal",
9
- decorative = true,
10
- ...props
11
- }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
12
- return (
13
- <SeparatorPrimitive.Root
14
- data-slot="separator"
15
- decorative={decorative}
16
- orientation={orientation}
17
- className={cn(
18
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
19
- className,
20
- )}
21
- {...props}
22
- />
23
- );
24
- }
25
-
26
- export { Separator };
@@ -1,139 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as SheetPrimitive from "@radix-ui/react-dialog";
5
- import { XIcon } from "lucide-react";
6
-
7
- import { cn } from "@/lib/utils";
8
-
9
- function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
- return <SheetPrimitive.Root data-slot="sheet" {...props} />;
11
- }
12
-
13
- function SheetTrigger({
14
- ...props
15
- }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
16
- return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
17
- }
18
-
19
- function SheetClose({
20
- ...props
21
- }: React.ComponentProps<typeof SheetPrimitive.Close>) {
22
- return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
23
- }
24
-
25
- function SheetPortal({
26
- ...props
27
- }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
28
- return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
29
- }
30
-
31
- function SheetOverlay({
32
- className,
33
- ...props
34
- }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
35
- return (
36
- <SheetPrimitive.Overlay
37
- data-slot="sheet-overlay"
38
- className={cn(
39
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
40
- className,
41
- )}
42
- {...props}
43
- />
44
- );
45
- }
46
-
47
- function SheetContent({
48
- className,
49
- children,
50
- side = "right",
51
- ...props
52
- }: React.ComponentProps<typeof SheetPrimitive.Content> & {
53
- side?: "top" | "right" | "bottom" | "left";
54
- }) {
55
- return (
56
- <SheetPortal>
57
- <SheetOverlay />
58
- <SheetPrimitive.Content
59
- data-slot="sheet-content"
60
- className={cn(
61
- "border-border bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
62
- side === "right" &&
63
- "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
64
- side === "left" &&
65
- "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
66
- side === "top" &&
67
- "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
68
- side === "bottom" &&
69
- "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
70
- className,
71
- )}
72
- {...props}
73
- >
74
- {children}
75
- <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
76
- <XIcon className="size-4" />
77
- <span className="sr-only">Close</span>
78
- </SheetPrimitive.Close>
79
- </SheetPrimitive.Content>
80
- </SheetPortal>
81
- );
82
- }
83
-
84
- function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
85
- return (
86
- <div
87
- data-slot="sheet-header"
88
- className={cn("flex flex-col gap-1.5 p-4", className)}
89
- {...props}
90
- />
91
- );
92
- }
93
-
94
- function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
95
- return (
96
- <div
97
- data-slot="sheet-footer"
98
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
99
- {...props}
100
- />
101
- );
102
- }
103
-
104
- function SheetTitle({
105
- className,
106
- ...props
107
- }: React.ComponentProps<typeof SheetPrimitive.Title>) {
108
- return (
109
- <SheetPrimitive.Title
110
- data-slot="sheet-title"
111
- className={cn("text-foreground font-semibold", className)}
112
- {...props}
113
- />
114
- );
115
- }
116
-
117
- function SheetDescription({
118
- className,
119
- ...props
120
- }: React.ComponentProps<typeof SheetPrimitive.Description>) {
121
- return (
122
- <SheetPrimitive.Description
123
- data-slot="sheet-description"
124
- className={cn("text-muted-foreground text-sm", className)}
125
- {...props}
126
- />
127
- );
128
- }
129
-
130
- export {
131
- Sheet,
132
- SheetTrigger,
133
- SheetClose,
134
- SheetContent,
135
- SheetHeader,
136
- SheetFooter,
137
- SheetTitle,
138
- SheetDescription,
139
- };