@playfast/reform-better-hub-ui-primitives 0.2.2 → 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.
- package/README.md +9 -9
- package/package.json +23 -23
- package/src/components/agent-icon.tsx +16 -16
- package/src/components/autocomplete.tsx +166 -162
- package/src/components/badge.tsx +46 -45
- package/src/components/button.tsx +56 -63
- package/src/components/combobox.tsx +233 -228
- package/src/components/command.tsx +135 -139
- package/src/components/dialog.tsx +106 -98
- package/src/components/dropdown-menu.tsx +118 -115
- package/src/components/github-background.tsx +214 -216
- package/src/components/halftone-background.tsx +164 -155
- package/src/components/halftone-config.ts +8 -8
- package/src/components/input-group.tsx +149 -147
- package/src/components/input.tsx +17 -17
- package/src/components/live-duration.tsx +70 -64
- package/src/components/logo.tsx +9 -13
- package/src/components/popover.tsx +60 -62
- package/src/components/resize-handle.tsx +73 -75
- package/src/components/sheet.tsx +120 -112
- package/src/components/textarea.tsx +15 -15
- package/src/components/time-ago.tsx +64 -62
- package/src/components/tooltip.tsx +48 -42
- package/src/foundation/styles.css +6 -4
- package/src/index.ts +21 -21
|
@@ -1,82 +1,80 @@
|
|
|
1
|
-
import type * as React from
|
|
2
|
-
import type { ComponentProps } from
|
|
3
|
-
import { Popover as PopoverPrimitive } from
|
|
1
|
+
import type * as React from 'react'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
|
+
import { Popover as PopoverPrimitive } from 'radix-ui'
|
|
4
4
|
|
|
5
|
-
import { cn } from
|
|
5
|
+
import { cn } from '../foundation/cn'
|
|
6
6
|
|
|
7
7
|
function Popover({ ...props }: ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element {
|
|
8
|
-
|
|
8
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function PopoverTrigger({
|
|
12
|
-
|
|
11
|
+
function PopoverTrigger({
|
|
12
|
+
...props
|
|
13
|
+
}: ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element {
|
|
14
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
function PopoverContent({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
className,
|
|
19
|
+
align = 'center',
|
|
20
|
+
sideOffset = 4,
|
|
21
|
+
...props
|
|
20
22
|
}: ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
)
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
function PopoverAnchor({
|
|
41
|
-
|
|
42
|
+
function PopoverAnchor({
|
|
43
|
+
...props
|
|
44
|
+
}: ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element {
|
|
45
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
42
46
|
}
|
|
43
47
|
|
|
44
|
-
function PopoverHeader({ className, ...props }: ComponentProps<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
+
)
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
function PopoverTitle({ className, ...props }: ComponentProps<
|
|
55
|
-
|
|
56
|
-
<div
|
|
57
|
-
data-slot="popover-title"
|
|
58
|
-
className={cn("font-medium", className)}
|
|
59
|
-
{...props}
|
|
60
|
-
/>
|
|
61
|
-
);
|
|
58
|
+
function PopoverTitle({ className, ...props }: ComponentProps<'h2'>): React.JSX.Element {
|
|
59
|
+
return <div data-slot="popover-title" className={cn('font-medium', className)} {...props} />
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
function PopoverDescription({ className, ...props }: ComponentProps<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
+
)
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
73
|
+
Popover,
|
|
74
|
+
PopoverTrigger,
|
|
75
|
+
PopoverContent,
|
|
76
|
+
PopoverAnchor,
|
|
77
|
+
PopoverHeader,
|
|
78
|
+
PopoverTitle,
|
|
79
|
+
PopoverDescription,
|
|
80
|
+
}
|
|
@@ -1,89 +1,87 @@
|
|
|
1
|
-
import type * as React from
|
|
2
|
-
import { useCallback, useEffect, useState } from
|
|
3
|
-
import type { MouseEvent as ReactMouseEvent } from
|
|
4
|
-
import { cn } from
|
|
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'
|
|
5
5
|
|
|
6
6
|
interface ResizeHandlePropsExternalApi {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
onResize: (clientPos: number) => void
|
|
8
|
+
onDragStart?: () => void
|
|
9
|
+
onDragEnd?: () => void
|
|
10
|
+
onDoubleClick?: () => void
|
|
11
|
+
axis?: 'x' | 'y'
|
|
12
|
+
className?: string
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function ResizeHandle({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
onResize,
|
|
17
|
+
onDragStart,
|
|
18
|
+
onDragEnd,
|
|
19
|
+
onDoubleClick,
|
|
20
|
+
axis = 'x',
|
|
21
|
+
className,
|
|
22
22
|
}: ResizeHandlePropsExternalApi): React.JSX.Element {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const [isDragging, setIsDragging] = useState(false)
|
|
24
|
+
const vertical = axis === 'y'
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
const handleMouseDown = useCallback(
|
|
27
|
+
(event: ReactMouseEvent) => {
|
|
28
|
+
event.preventDefault()
|
|
29
|
+
setIsDragging(true)
|
|
30
|
+
onDragStart?.()
|
|
31
|
+
},
|
|
32
|
+
[onDragStart],
|
|
33
|
+
)
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!isDragging) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const handleMouseMove = (event: MouseEvent) => {
|
|
41
|
+
onResize(vertical ? event.clientY : event.clientX)
|
|
42
|
+
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const handleMouseUp = () => {
|
|
45
|
+
setIsDragging(false)
|
|
46
|
+
onDragEnd?.()
|
|
47
|
+
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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'
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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])
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
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
|
+
)
|
|
89
87
|
}
|
package/src/components/sheet.tsx
CHANGED
|
@@ -1,144 +1,152 @@
|
|
|
1
|
-
import * as DialogPrimitive from
|
|
2
|
-
import { XIcon } from
|
|
3
|
-
import type * as React from
|
|
4
|
-
import { cn } from
|
|
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'
|
|
5
5
|
|
|
6
6
|
function Sheet({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element {
|
|
7
|
-
|
|
7
|
+
return <DialogPrimitive.Root data-slot="sheet" {...props} />
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
function SheetTrigger({
|
|
11
|
-
|
|
10
|
+
function SheetTrigger({
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element {
|
|
13
|
+
return <DialogPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
function SheetPortal({
|
|
15
|
-
|
|
16
|
+
function SheetPortal({
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element {
|
|
19
|
+
return <DialogPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
function SheetClose({
|
|
19
|
-
|
|
22
|
+
function SheetClose({
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element {
|
|
25
|
+
return <DialogPrimitive.Close data-slot="sheet-close" {...props} />
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
function SheetOverlay({
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
25
31
|
}: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
)
|
|
36
42
|
}
|
|
37
43
|
|
|
38
|
-
interface SheetContentPropsExternalApi extends React.ComponentProps<
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
interface SheetContentPropsExternalApi extends React.ComponentProps<
|
|
45
|
+
typeof DialogPrimitive.Content
|
|
46
|
+
> {
|
|
47
|
+
side?: 'left' | 'right' | 'top' | 'bottom'
|
|
48
|
+
showCloseButton?: boolean
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
function SheetContent({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
side = 'right',
|
|
55
|
+
showCloseButton = true,
|
|
56
|
+
...props
|
|
49
57
|
}: SheetContentPropsExternalApi): React.JSX.Element {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
+
}
|
|
56
66
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</SheetPortal>
|
|
81
|
-
);
|
|
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
|
+
)
|
|
82
90
|
}
|
|
83
91
|
|
|
84
|
-
function SheetHeader({ className, ...props }: React.ComponentProps<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
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
|
+
)
|
|
95
100
|
}
|
|
96
101
|
|
|
97
|
-
function SheetFooter({ className, ...props }: React.ComponentProps<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
+
)
|
|
108
113
|
}
|
|
109
114
|
|
|
110
|
-
function SheetTitle({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
+
)
|
|
118
126
|
}
|
|
119
127
|
|
|
120
128
|
function SheetDescription({
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
className,
|
|
130
|
+
...props
|
|
123
131
|
}: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
return (
|
|
133
|
+
<DialogPrimitive.Description
|
|
134
|
+
data-slot="sheet-description"
|
|
135
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
136
|
+
{...props}
|
|
137
|
+
/>
|
|
138
|
+
)
|
|
131
139
|
}
|
|
132
140
|
|
|
133
141
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
142
|
+
Sheet,
|
|
143
|
+
SheetClose,
|
|
144
|
+
SheetContent,
|
|
145
|
+
SheetDescription,
|
|
146
|
+
SheetFooter,
|
|
147
|
+
SheetHeader,
|
|
148
|
+
SheetOverlay,
|
|
149
|
+
SheetPortal,
|
|
150
|
+
SheetTitle,
|
|
151
|
+
SheetTrigger,
|
|
152
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type * as React from
|
|
2
|
-
import type { ComponentProps } from
|
|
1
|
+
import type * as React from 'react'
|
|
2
|
+
import type { ComponentProps } from 'react'
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '../foundation/cn'
|
|
5
5
|
|
|
6
|
-
function Textarea({ className, ...props }: ComponentProps<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export { Textarea }
|
|
19
|
+
export { Textarea }
|