@playfast/reform-better-hub-ui-primitives 0.2.1 → 0.3.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.
@@ -1,85 +1,80 @@
1
- // Adapted from better-hub by Better Auth — https://github.com/better-auth/better-hub
2
- // (apps/web/src/components/ui/popover.tsx). Full credit to the Better Auth team.
1
+ import type * as React from 'react'
2
+ import type { ComponentProps } from 'react'
3
+ import { Popover as PopoverPrimitive } from 'radix-ui'
3
4
 
4
- import type * as React from "react";
5
- import type { ComponentProps } from "react";
6
- import { Popover as PopoverPrimitive } from "radix-ui";
7
-
8
- import { cn } from "../foundation/cn";
5
+ import { cn } from '../foundation/cn'
9
6
 
10
7
  function Popover({ ...props }: ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element {
11
- return <PopoverPrimitive.Root data-slot="popover" {...props} />;
8
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
9
  }
13
10
 
14
- function PopoverTrigger({ ...props }: ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element {
15
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
11
+ function PopoverTrigger({
12
+ ...props
13
+ }: ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element {
14
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
16
15
  }
17
16
 
18
17
  function PopoverContent({
19
- className,
20
- align = "center",
21
- sideOffset = 4,
22
- ...props
18
+ className,
19
+ align = 'center',
20
+ sideOffset = 4,
21
+ ...props
23
22
  }: ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element {
24
- return (
25
- <PopoverPrimitive.Portal>
26
- <PopoverPrimitive.Content
27
- data-slot="popover-content"
28
- align={align}
29
- sideOffset={sideOffset}
30
- className={cn(
31
- // NOTE: `--popover` is not defined in this design system (only --background/--card/…),
32
- // so `bg-popover` rendered transparent. Use the defined `bg-background`/`text-foreground`
33
- // (exactly what DropdownMenuContent uses) so a portaled popover is opaque.
34
- "z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-background p-4 text-foreground shadow-md outline-hidden 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
35
- className,
36
- )}
37
- {...props}
38
- />
39
- </PopoverPrimitive.Portal>
40
- );
23
+ return (
24
+ <PopoverPrimitive.Portal>
25
+ <PopoverPrimitive.Content
26
+ data-slot="popover-content"
27
+ align={align}
28
+ sideOffset={sideOffset}
29
+ className={cn(
30
+ // NOTE: `--popover` is not defined in this design system (only --background/--card/…),
31
+ // so `bg-popover` rendered transparent. Use the defined `bg-background`/`text-foreground`
32
+ // (exactly what DropdownMenuContent uses) so a portaled popover is opaque.
33
+ 'z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-background p-4 text-foreground shadow-md outline-hidden 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
34
+ className,
35
+ )}
36
+ {...props}
37
+ />
38
+ </PopoverPrimitive.Portal>
39
+ )
41
40
  }
42
41
 
43
- function PopoverAnchor({ ...props }: ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element {
44
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
42
+ function PopoverAnchor({
43
+ ...props
44
+ }: ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element {
45
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
45
46
  }
46
47
 
47
- function PopoverHeader({ className, ...props }: ComponentProps<"div">): React.JSX.Element {
48
- return (
49
- <div
50
- data-slot="popover-header"
51
- className={cn("flex flex-col gap-1 text-sm", className)}
52
- {...props}
53
- />
54
- );
48
+ function PopoverHeader({ className, ...props }: ComponentProps<'div'>): React.JSX.Element {
49
+ return (
50
+ <div
51
+ data-slot="popover-header"
52
+ className={cn('flex flex-col gap-1 text-sm', className)}
53
+ {...props}
54
+ />
55
+ )
55
56
  }
56
57
 
57
- function PopoverTitle({ className, ...props }: ComponentProps<"h2">): React.JSX.Element {
58
- return (
59
- <div
60
- data-slot="popover-title"
61
- className={cn("font-medium", className)}
62
- {...props}
63
- />
64
- );
58
+ function PopoverTitle({ className, ...props }: ComponentProps<'h2'>): React.JSX.Element {
59
+ return <div data-slot="popover-title" className={cn('font-medium', className)} {...props} />
65
60
  }
66
61
 
67
- function PopoverDescription({ className, ...props }: ComponentProps<"p">): React.JSX.Element {
68
- return (
69
- <p
70
- data-slot="popover-description"
71
- className={cn("text-muted-foreground", className)}
72
- {...props}
73
- />
74
- );
62
+ function PopoverDescription({ className, ...props }: ComponentProps<'p'>): React.JSX.Element {
63
+ return (
64
+ <p
65
+ data-slot="popover-description"
66
+ className={cn('text-muted-foreground', className)}
67
+ {...props}
68
+ />
69
+ )
75
70
  }
76
71
 
77
72
  export {
78
- Popover,
79
- PopoverTrigger,
80
- PopoverContent,
81
- PopoverAnchor,
82
- PopoverHeader,
83
- PopoverTitle,
84
- PopoverDescription,
85
- };
73
+ Popover,
74
+ PopoverTrigger,
75
+ PopoverContent,
76
+ PopoverAnchor,
77
+ PopoverHeader,
78
+ PopoverTitle,
79
+ PopoverDescription,
80
+ }
@@ -1,101 +1,87 @@
1
- // Adapted from better-hub by Better Auth — https://github.com/better-auth/better-hub
2
- // (apps/web/src/components/ui/resize-handle.tsx). Full credit to the Better Auth team.
3
-
4
- import type * as React from "react";
5
- import { useCallback, useEffect, useState } from "react";
6
- import type { MouseEvent as ReactMouseEvent } from "react";
7
- import { cn } from "../foundation/cn";
1
+ import type * as React from 'react'
2
+ import { useCallback, useEffect, useState } from 'react'
3
+ import type { MouseEvent as ReactMouseEvent } from 'react'
4
+ import { cn } from '../foundation/cn'
8
5
 
9
6
  interface ResizeHandlePropsExternalApi {
10
- /** Called continuously during drag with the pointer position on the resize axis
11
- * (clientX for `axis: "x"`, clientY for `axis: "y"`). */
12
- onResize: (clientPos: number) => void;
13
- /** Called when drag starts */
14
- onDragStart?: () => void;
15
- /** Called when drag ends */
16
- onDragEnd?: () => void;
17
- /** Double click handler (e.g. reset to default) */
18
- onDoubleClick?: () => void;
19
- /** Resize axis: "x" (vertical handle, horizontal drag — default) or "y" (horizontal
20
- * handle, vertical drag — for a top/bottom panel edge). */
21
- axis?: "x" | "y";
22
- className?: string;
7
+ onResize: (clientPos: number) => void
8
+ onDragStart?: () => void
9
+ onDragEnd?: () => void
10
+ onDoubleClick?: () => void
11
+ axis?: 'x' | 'y'
12
+ className?: string
23
13
  }
24
14
 
25
15
  export function ResizeHandle({
26
- onResize,
27
- onDragStart,
28
- onDragEnd,
29
- onDoubleClick,
30
- axis = "x",
31
- className,
16
+ onResize,
17
+ onDragStart,
18
+ onDragEnd,
19
+ onDoubleClick,
20
+ axis = 'x',
21
+ className,
32
22
  }: ResizeHandlePropsExternalApi): React.JSX.Element {
33
- const [isDragging, setIsDragging] = useState(false);
34
- const vertical = axis === "y";
23
+ const [isDragging, setIsDragging] = useState(false)
24
+ const vertical = axis === 'y'
35
25
 
36
- const handleMouseDown = useCallback(
37
- (event: ReactMouseEvent) => {
38
- event.preventDefault();
39
- setIsDragging(true);
40
- onDragStart?.();
41
- },
42
- [onDragStart],
43
- );
26
+ const handleMouseDown = useCallback(
27
+ (event: ReactMouseEvent) => {
28
+ event.preventDefault()
29
+ setIsDragging(true)
30
+ onDragStart?.()
31
+ },
32
+ [onDragStart],
33
+ )
44
34
 
45
- useEffect(() => {
46
- if (!isDragging) {
47
- return;
48
- }
35
+ useEffect(() => {
36
+ if (!isDragging) {
37
+ return
38
+ }
49
39
 
50
- const handleMouseMove = (event: MouseEvent) => {
51
- onResize(vertical ? event.clientY : event.clientX);
52
- };
40
+ const handleMouseMove = (event: MouseEvent) => {
41
+ onResize(vertical ? event.clientY : event.clientX)
42
+ }
53
43
 
54
- const handleMouseUp = () => {
55
- setIsDragging(false);
56
- onDragEnd?.();
57
- };
44
+ const handleMouseUp = () => {
45
+ setIsDragging(false)
46
+ onDragEnd?.()
47
+ }
58
48
 
59
- document.addEventListener("mousemove", handleMouseMove);
60
- document.addEventListener("mouseup", handleMouseUp);
61
- document.body.style.userSelect = "none";
62
- document.body.style.cursor = vertical ? "row-resize" : "col-resize";
49
+ document.addEventListener('mousemove', handleMouseMove)
50
+ document.addEventListener('mouseup', handleMouseUp)
51
+ document.body.style.userSelect = 'none'
52
+ document.body.style.cursor = vertical ? 'row-resize' : 'col-resize'
63
53
 
64
- return () => {
65
- document.removeEventListener("mousemove", handleMouseMove);
66
- document.removeEventListener("mouseup", handleMouseUp);
67
- document.body.style.userSelect = "";
68
- document.body.style.cursor = "";
69
- };
70
- }, [isDragging, onResize, onDragEnd, vertical]);
54
+ return () => {
55
+ document.removeEventListener('mousemove', handleMouseMove)
56
+ document.removeEventListener('mouseup', handleMouseUp)
57
+ document.body.style.userSelect = ''
58
+ document.body.style.cursor = ''
59
+ }
60
+ }, [isDragging, onResize, onDragEnd, vertical])
71
61
 
72
- return (
73
- <div
74
- onMouseDown={handleMouseDown}
75
- onDoubleClick={onDoubleClick}
76
- className={cn(
77
- "relative shrink-0 group/resize z-10",
78
- vertical ? "h-0 cursor-row-resize" : "w-0 cursor-col-resize",
79
- className,
80
- )}
81
- >
82
- {/* Wider invisible hit area */}
83
- <div
84
- className={cn(
85
- "absolute",
86
- vertical ? "inset-x-0 -top-[5px] h-[11px]" : "inset-y-0 -left-[5px] w-[11px]",
87
- )}
88
- />
89
- {/* Visible line */}
90
- <div
91
- className={cn(
92
- "absolute transition-all duration-150",
93
- vertical ? "inset-x-0 -top-px h-[2px]" : "inset-y-0 -left-px w-[2px]",
94
- isDragging
95
- ? "bg-foreground/25"
96
- : "bg-transparent group-hover/resize:bg-foreground/15",
97
- )}
98
- />
99
- </div>
100
- );
62
+ return (
63
+ <div
64
+ onMouseDown={handleMouseDown}
65
+ onDoubleClick={onDoubleClick}
66
+ className={cn(
67
+ 'relative shrink-0 group/resize z-10',
68
+ vertical ? 'h-0 cursor-row-resize' : 'w-0 cursor-col-resize',
69
+ className,
70
+ )}
71
+ >
72
+ <div
73
+ className={cn(
74
+ 'absolute',
75
+ vertical ? 'inset-x-0 -top-[5px] h-[11px]' : 'inset-y-0 -left-[5px] w-[11px]',
76
+ )}
77
+ />
78
+ <div
79
+ className={cn(
80
+ 'absolute transition-all duration-150',
81
+ vertical ? 'inset-x-0 -top-px h-[2px]' : 'inset-y-0 -left-px w-[2px]',
82
+ isDragging ? 'bg-foreground/25' : 'bg-transparent group-hover/resize:bg-foreground/15',
83
+ )}
84
+ />
85
+ </div>
86
+ )
101
87
  }
@@ -1,147 +1,152 @@
1
- // Adapted from better-hub by Better Auth — https://github.com/better-auth/better-hub
2
- // (apps/web/src/components/ui/sheet.tsx). Full credit to the Better Auth team.
3
-
4
- import * as DialogPrimitive from "@radix-ui/react-dialog";
5
- import { XIcon } from "lucide-react";
6
- import type * as React from "react";
7
- import { cn } from "../foundation/cn";
1
+ import * as DialogPrimitive from '@radix-ui/react-dialog'
2
+ import { XIcon } from 'lucide-react'
3
+ import type * as React from 'react'
4
+ import { cn } from '../foundation/cn'
8
5
 
9
6
  function Sheet({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element {
10
- return <DialogPrimitive.Root data-slot="sheet" {...props} />;
7
+ return <DialogPrimitive.Root data-slot="sheet" {...props} />
11
8
  }
12
9
 
13
- function SheetTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element {
14
- return <DialogPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
10
+ function SheetTrigger({
11
+ ...props
12
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element {
13
+ return <DialogPrimitive.Trigger data-slot="sheet-trigger" {...props} />
15
14
  }
16
15
 
17
- function SheetPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element {
18
- return <DialogPrimitive.Portal data-slot="sheet-portal" {...props} />;
16
+ function SheetPortal({
17
+ ...props
18
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element {
19
+ return <DialogPrimitive.Portal data-slot="sheet-portal" {...props} />
19
20
  }
20
21
 
21
- function SheetClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element {
22
- return <DialogPrimitive.Close data-slot="sheet-close" {...props} />;
22
+ function SheetClose({
23
+ ...props
24
+ }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element {
25
+ return <DialogPrimitive.Close data-slot="sheet-close" {...props} />
23
26
  }
24
27
 
25
28
  function SheetOverlay({
26
- className,
27
- ...props
29
+ className,
30
+ ...props
28
31
  }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element {
29
- return (
30
- <DialogPrimitive.Overlay
31
- data-slot="sheet-overlay"
32
- className={cn(
33
- "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/25 dark:bg-black/70 backdrop-blur-[2px]",
34
- className,
35
- )}
36
- {...props}
37
- />
38
- );
32
+ return (
33
+ <DialogPrimitive.Overlay
34
+ data-slot="sheet-overlay"
35
+ className={cn(
36
+ '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/25 dark:bg-black/70 backdrop-blur-[2px]',
37
+ className,
38
+ )}
39
+ {...props}
40
+ />
41
+ )
39
42
  }
40
43
 
41
- interface SheetContentPropsExternalApi extends React.ComponentProps<typeof DialogPrimitive.Content> {
42
- side?: "left" | "right" | "top" | "bottom";
43
- showCloseButton?: boolean;
44
+ interface SheetContentPropsExternalApi extends React.ComponentProps<
45
+ typeof DialogPrimitive.Content
46
+ > {
47
+ side?: 'left' | 'right' | 'top' | 'bottom'
48
+ showCloseButton?: boolean
44
49
  }
45
50
 
46
51
  function SheetContent({
47
- className,
48
- children,
49
- side = "right",
50
- showCloseButton = true,
51
- ...props
52
+ className,
53
+ children,
54
+ side = 'right',
55
+ showCloseButton = true,
56
+ ...props
52
57
  }: SheetContentPropsExternalApi): React.JSX.Element {
53
- const sideStyles = {
54
- right: "inset-y-0 right-0 h-full w-3/4 sm:max-w-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",
55
- left: "inset-y-0 left-0 h-full w-3/4 sm:max-w-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
56
- top: "inset-x-0 top-0 w-full data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
57
- bottom: "inset-x-0 bottom-0 w-full data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
58
- };
58
+ const sideStyles = {
59
+ right:
60
+ 'inset-y-0 right-0 h-full w-3/4 sm:max-w-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',
61
+ left: 'inset-y-0 left-0 h-full w-3/4 sm:max-w-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',
62
+ top: 'inset-x-0 top-0 w-full data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
63
+ bottom:
64
+ 'inset-x-0 bottom-0 w-full data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
65
+ }
59
66
 
60
- return (
61
- <SheetPortal>
62
- <SheetOverlay />
63
- <DialogPrimitive.Content
64
- data-slot="sheet-content"
65
- className={cn(
66
- "fixed z-50 flex flex-col bg-background border-l border-border shadow-lg duration-300",
67
- sideStyles[side],
68
- className,
69
- )}
70
- {...props}
71
- >
72
- <DialogPrimitive.Title className="hidden sr-only">
73
- {props.title}
74
- </DialogPrimitive.Title>
75
- {children}
76
- {showCloseButton && (
77
- <DialogPrimitive.Close className="absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary cursor-pointer">
78
- <XIcon className="h-4 w-4" />
79
- <span className="sr-only">Close</span>
80
- </DialogPrimitive.Close>
81
- )}
82
- </DialogPrimitive.Content>
83
- </SheetPortal>
84
- );
67
+ return (
68
+ <SheetPortal>
69
+ <SheetOverlay />
70
+ <DialogPrimitive.Content
71
+ data-slot="sheet-content"
72
+ className={cn(
73
+ 'fixed z-50 flex flex-col bg-background border-l border-border shadow-lg duration-300',
74
+ sideStyles[side],
75
+ className,
76
+ )}
77
+ {...props}
78
+ >
79
+ <DialogPrimitive.Title className="hidden sr-only">{props.title}</DialogPrimitive.Title>
80
+ {children}
81
+ {showCloseButton && (
82
+ <DialogPrimitive.Close className="absolute top-4 right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary cursor-pointer">
83
+ <XIcon className="h-4 w-4" />
84
+ <span className="sr-only">Close</span>
85
+ </DialogPrimitive.Close>
86
+ )}
87
+ </DialogPrimitive.Content>
88
+ </SheetPortal>
89
+ )
85
90
  }
86
91
 
87
- function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element {
88
- return (
89
- <div
90
- data-slot="sheet-header"
91
- className={cn(
92
- "flex flex-col gap-2 px-6 py-4 border-b border-border",
93
- className,
94
- )}
95
- {...props}
96
- />
97
- );
92
+ function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element {
93
+ return (
94
+ <div
95
+ data-slot="sheet-header"
96
+ className={cn('flex flex-col gap-2 px-6 py-4 border-b border-border', className)}
97
+ {...props}
98
+ />
99
+ )
98
100
  }
99
101
 
100
- function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element {
101
- return (
102
- <div
103
- data-slot="sheet-footer"
104
- className={cn(
105
- "flex flex-col-reverse gap-2 px-6 py-4 border-t border-border sm:flex-row sm:justify-end",
106
- className,
107
- )}
108
- {...props}
109
- />
110
- );
102
+ function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element {
103
+ return (
104
+ <div
105
+ data-slot="sheet-footer"
106
+ className={cn(
107
+ 'flex flex-col-reverse gap-2 px-6 py-4 border-t border-border sm:flex-row sm:justify-end',
108
+ className,
109
+ )}
110
+ {...props}
111
+ />
112
+ )
111
113
  }
112
114
 
113
- function SheetTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element {
114
- return (
115
- <DialogPrimitive.Title
116
- data-slot="sheet-title"
117
- className={cn("text-lg font-semibold text-foreground", className)}
118
- {...props}
119
- />
120
- );
115
+ function SheetTitle({
116
+ className,
117
+ ...props
118
+ }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element {
119
+ return (
120
+ <DialogPrimitive.Title
121
+ data-slot="sheet-title"
122
+ className={cn('text-lg font-semibold text-foreground', className)}
123
+ {...props}
124
+ />
125
+ )
121
126
  }
122
127
 
123
128
  function SheetDescription({
124
- className,
125
- ...props
129
+ className,
130
+ ...props
126
131
  }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element {
127
- return (
128
- <DialogPrimitive.Description
129
- data-slot="sheet-description"
130
- className={cn("text-sm text-muted-foreground", className)}
131
- {...props}
132
- />
133
- );
132
+ return (
133
+ <DialogPrimitive.Description
134
+ data-slot="sheet-description"
135
+ className={cn('text-sm text-muted-foreground', className)}
136
+ {...props}
137
+ />
138
+ )
134
139
  }
135
140
 
136
141
  export {
137
- Sheet,
138
- SheetClose,
139
- SheetContent,
140
- SheetDescription,
141
- SheetFooter,
142
- SheetHeader,
143
- SheetOverlay,
144
- SheetPortal,
145
- SheetTitle,
146
- SheetTrigger,
147
- };
142
+ Sheet,
143
+ SheetClose,
144
+ SheetContent,
145
+ SheetDescription,
146
+ SheetFooter,
147
+ SheetHeader,
148
+ SheetOverlay,
149
+ SheetPortal,
150
+ SheetTitle,
151
+ SheetTrigger,
152
+ }
@@ -1,21 +1,19 @@
1
- // Adapted from better-hub by Better Auth — https://github.com/better-auth/better-hub
2
- // (apps/web/src/components/ui/textarea.tsx). Full credit to the Better Auth team.
3
- import type * as React from "react";
4
- import type { ComponentProps } from "react";
1
+ import type * as React from 'react'
2
+ import type { ComponentProps } from 'react'
5
3
 
6
- import { cn } from "../foundation/cn";
4
+ import { cn } from '../foundation/cn'
7
5
 
8
- function Textarea({ className, ...props }: ComponentProps<"textarea">): React.JSX.Element {
9
- return (
10
- <textarea
11
- data-slot="textarea"
12
- className={cn(
13
- "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
14
- className,
15
- )}
16
- {...props}
17
- />
18
- );
6
+ function Textarea({ className, ...props }: ComponentProps<'textarea'>): React.JSX.Element {
7
+ return (
8
+ <textarea
9
+ data-slot="textarea"
10
+ className={cn(
11
+ 'flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40',
12
+ className,
13
+ )}
14
+ {...props}
15
+ />
16
+ )
19
17
  }
20
18
 
21
- export { Textarea };
19
+ export { Textarea }