@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.
- package/README.md +9 -9
- package/package.json +23 -23
- package/src/components/agent-icon.tsx +16 -19
- package/src/components/autocomplete.tsx +193 -0
- package/src/components/badge.tsx +46 -47
- package/src/components/button.tsx +56 -65
- package/src/components/combobox.tsx +233 -231
- package/src/components/command.tsx +135 -142
- package/src/components/dialog.tsx +106 -101
- package/src/components/dropdown-menu.tsx +118 -118
- package/src/components/github-background.tsx +224 -239
- package/src/components/halftone-background.tsx +164 -176
- package/src/components/halftone-config.ts +14 -0
- package/src/components/input-group.tsx +152 -159
- package/src/components/input.tsx +17 -20
- package/src/components/live-duration.tsx +71 -72
- package/src/components/logo.tsx +9 -15
- package/src/components/popover.tsx +60 -65
- package/src/components/resize-handle.tsx +73 -87
- package/src/components/sheet.tsx +120 -115
- package/src/components/textarea.tsx +15 -17
- package/src/components/time-ago.tsx +64 -66
- package/src/components/tooltip.tsx +48 -45
- package/src/foundation/cn.ts +0 -4
- package/src/foundation/styles.css +6 -4
- package/src/index.ts +21 -24
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
|
|
2
|
+
import { CheckIcon } from 'lucide-react'
|
|
3
|
+
import type * as React from 'react'
|
|
4
|
+
import { cn } from '../foundation/cn'
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element {
|
|
10
|
-
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
6
|
+
function DropdownMenu({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element {
|
|
9
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
function DropdownMenuTrigger({
|
|
14
|
-
|
|
13
|
+
...props
|
|
15
14
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
return (
|
|
16
|
+
<DropdownMenuPrimitive.Trigger
|
|
17
|
+
data-slot="dropdown-menu-trigger"
|
|
18
|
+
{...props}
|
|
19
|
+
className={cn('rounded-sm', props.className)}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
function DropdownMenuContent({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
className,
|
|
26
|
+
sideOffset = 4,
|
|
27
|
+
...props
|
|
29
28
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
return (
|
|
30
|
+
<DropdownMenuPrimitive.Portal>
|
|
31
|
+
<DropdownMenuPrimitive.Content
|
|
32
|
+
data-slot="dropdown-menu-content"
|
|
33
|
+
sideOffset={sideOffset}
|
|
34
|
+
className={cn(
|
|
35
|
+
'bg-background text-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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
</DropdownMenuPrimitive.Portal>
|
|
41
|
+
)
|
|
43
42
|
}
|
|
44
43
|
|
|
45
|
-
function DropdownMenuGroup({
|
|
46
|
-
|
|
44
|
+
function DropdownMenuGroup({
|
|
45
|
+
...props
|
|
46
|
+
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element {
|
|
47
|
+
return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
type DropdownMenuItemPropsExternalApi = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
50
|
-
|
|
51
|
-
}
|
|
51
|
+
inset?: boolean
|
|
52
|
+
}
|
|
52
53
|
|
|
53
54
|
function DropdownMenuItem({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
className,
|
|
56
|
+
inset,
|
|
57
|
+
...props
|
|
57
58
|
}: DropdownMenuItemPropsExternalApi): React.JSX.Element {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
return (
|
|
60
|
+
<DropdownMenuPrimitive.Item
|
|
61
|
+
data-slot="dropdown-menu-item"
|
|
62
|
+
data-inset={inset}
|
|
63
|
+
className={cn(
|
|
64
|
+
"focus:bg-accent [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
)
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
function DropdownMenuCheckboxItem({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
className,
|
|
74
|
+
children,
|
|
75
|
+
...props
|
|
75
76
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
return (
|
|
78
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
79
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
80
|
+
className={cn(
|
|
81
|
+
"focus:bg-accent relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 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",
|
|
82
|
+
className,
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
87
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
88
|
+
<CheckIcon className="size-4" />
|
|
89
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
90
|
+
</span>
|
|
91
|
+
{children}
|
|
92
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
93
|
+
)
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
type DropdownMenuLabelPropsExternalApi = React.ComponentProps<
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
type DropdownMenuLabelPropsExternalApi = React.ComponentProps<
|
|
97
|
+
typeof DropdownMenuPrimitive.Label
|
|
98
|
+
> & {
|
|
99
|
+
inset?: boolean
|
|
100
|
+
}
|
|
98
101
|
|
|
99
102
|
function DropdownMenuLabel({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
className,
|
|
104
|
+
inset,
|
|
105
|
+
...props
|
|
103
106
|
}: DropdownMenuLabelPropsExternalApi): React.JSX.Element {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
107
|
+
return (
|
|
108
|
+
<DropdownMenuPrimitive.Label
|
|
109
|
+
data-slot="dropdown-menu-label"
|
|
110
|
+
data-inset={inset}
|
|
111
|
+
className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
)
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function DropdownMenuSeparator({
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
120
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
return (
|
|
122
|
+
<DropdownMenuPrimitive.Separator
|
|
123
|
+
data-slot="dropdown-menu-separator"
|
|
124
|
+
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
125
|
+
{...props}
|
|
126
|
+
/>
|
|
127
|
+
)
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
function DropdownMenuShortcut({
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
130
|
+
function DropdownMenuShortcut({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}: React.ComponentProps<'span'>): React.JSX.Element {
|
|
134
|
+
return (
|
|
135
|
+
<span
|
|
136
|
+
data-slot="dropdown-menu-shortcut"
|
|
137
|
+
className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
|
|
138
|
+
{...props}
|
|
139
|
+
/>
|
|
140
|
+
)
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
export {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
144
|
+
DropdownMenu,
|
|
145
|
+
DropdownMenuTrigger,
|
|
146
|
+
DropdownMenuContent,
|
|
147
|
+
DropdownMenuGroup,
|
|
148
|
+
DropdownMenuLabel,
|
|
149
|
+
DropdownMenuItem,
|
|
150
|
+
DropdownMenuCheckboxItem,
|
|
151
|
+
DropdownMenuSeparator,
|
|
152
|
+
DropdownMenuShortcut,
|
|
153
|
+
}
|