@c-rex/ui 0.1.0 → 0.1.2
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/package.json +15 -1
- package/src/breadcrumb.tsx +0 -2
- package/src/checkbox.tsx +19 -19
- package/src/dropdown-menu.tsx +184 -184
- package/src/input.tsx +30 -7
- package/src/pagination.tsx +124 -0
- package/src/sidebar.tsx +1 -1
- package/src/sonner.tsx +10 -0
- package/src/table.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c-rex/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src"
|
|
@@ -85,8 +85,20 @@
|
|
|
85
85
|
"./checkbox": {
|
|
86
86
|
"types": "./src/checkbox.tsx",
|
|
87
87
|
"import": "./src/checkbox.tsx"
|
|
88
|
+
},
|
|
89
|
+
"./sonner": {
|
|
90
|
+
"types": "./src/sonner.tsx",
|
|
91
|
+
"import": "./src/sonner.tsx"
|
|
92
|
+
},
|
|
93
|
+
"./pagination": {
|
|
94
|
+
"types": "./src/pagination.tsx",
|
|
95
|
+
"import": "./src/pagination.tsx"
|
|
88
96
|
}
|
|
89
97
|
},
|
|
98
|
+
"scripts": {
|
|
99
|
+
"lint": "eslint .",
|
|
100
|
+
"lint:fix": "eslint . --fix"
|
|
101
|
+
},
|
|
90
102
|
"devDependencies": {
|
|
91
103
|
"@c-rex/eslint-config": "*",
|
|
92
104
|
"@c-rex/typescript-config": "*",
|
|
@@ -108,6 +120,7 @@
|
|
|
108
120
|
"@radix-ui/react-popover": "^1.1.6",
|
|
109
121
|
"@radix-ui/react-select": "^2.1.6",
|
|
110
122
|
"@radix-ui/react-separator": "^1.1.2",
|
|
123
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
111
124
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
112
125
|
"class-variance-authority": "^0.7.1",
|
|
113
126
|
"clsx": "^2.1.1",
|
|
@@ -115,6 +128,7 @@
|
|
|
115
128
|
"lucide-react": "^0.486.0",
|
|
116
129
|
"react": "^18.3.1",
|
|
117
130
|
"react-dom": "^18.3.1",
|
|
131
|
+
"sonner": "^2.0.5",
|
|
118
132
|
"tailwind-merge": "^3.3.0",
|
|
119
133
|
"tw-animate-css": "^1.2.9"
|
|
120
134
|
}
|
package/src/breadcrumb.tsx
CHANGED
|
@@ -79,7 +79,6 @@ const BreadcrumbSeparator = ({
|
|
|
79
79
|
}: React.ComponentProps<"li">) => (
|
|
80
80
|
<li
|
|
81
81
|
role="presentation"
|
|
82
|
-
aria-hidden="true"
|
|
83
82
|
className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
|
|
84
83
|
{...props}
|
|
85
84
|
>
|
|
@@ -94,7 +93,6 @@ const BreadcrumbEllipsis = ({
|
|
|
94
93
|
}: React.ComponentProps<"span">) => (
|
|
95
94
|
<span
|
|
96
95
|
role="presentation"
|
|
97
|
-
aria-hidden="true"
|
|
98
96
|
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
99
97
|
{...props}
|
|
100
98
|
>
|
package/src/checkbox.tsx
CHANGED
|
@@ -5,26 +5,26 @@ import { CheckIcon } from "lucide-react"
|
|
|
5
5
|
import { cn } from "@c-rex/utils"
|
|
6
6
|
|
|
7
7
|
function Checkbox({
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
10
|
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
return (
|
|
12
|
+
<CheckboxPrimitive.Root
|
|
13
|
+
data-slot="checkbox"
|
|
14
|
+
className={cn(
|
|
15
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<CheckboxPrimitive.Indicator
|
|
21
|
+
data-slot="checkbox-indicator"
|
|
22
|
+
className="flex items-center justify-center text-current transition-none"
|
|
23
|
+
>
|
|
24
|
+
<CheckIcon className="size-3.5" />
|
|
25
|
+
</CheckboxPrimitive.Indicator>
|
|
26
|
+
</CheckboxPrimitive.Root>
|
|
27
|
+
)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export { Checkbox }
|
package/src/dropdown-menu.tsx
CHANGED
|
@@ -5,251 +5,251 @@ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
|
|
|
5
5
|
import { cn } from "@c-rex/utils"
|
|
6
6
|
|
|
7
7
|
function DropdownMenu({
|
|
8
|
-
|
|
8
|
+
...props
|
|
9
9
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
|
|
10
|
-
|
|
10
|
+
return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" modal={false} {...props} />
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function DropdownMenuPortal({
|
|
14
|
-
|
|
14
|
+
...props
|
|
15
15
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
return (
|
|
17
|
+
<DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
|
|
18
|
+
)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function DropdownMenuTrigger({
|
|
22
|
-
|
|
22
|
+
...props
|
|
23
23
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
return (
|
|
25
|
+
<DropdownMenuPrimitive.Trigger
|
|
26
|
+
data-slot="dropdown-menu-trigger"
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function DropdownMenuContent({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
className,
|
|
34
|
+
sideOffset = 4,
|
|
35
|
+
...props
|
|
36
36
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
return (
|
|
38
|
+
<DropdownMenuPrimitive.Portal>
|
|
39
|
+
<DropdownMenuPrimitive.Content
|
|
40
|
+
data-slot="dropdown-menu-content"
|
|
41
|
+
sideOffset={sideOffset}
|
|
42
|
+
className={cn(
|
|
43
|
+
"bg-popover text-popover-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",
|
|
44
|
+
className
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
</DropdownMenuPrimitive.Portal>
|
|
49
|
+
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function DropdownMenuGroup({
|
|
53
|
-
|
|
53
|
+
...props
|
|
54
54
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
return (
|
|
56
|
+
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
57
|
+
)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
function DropdownMenuItem({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
className,
|
|
62
|
+
inset,
|
|
63
|
+
variant = "default",
|
|
64
|
+
...props
|
|
65
65
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
inset?: boolean
|
|
67
|
+
variant?: "default" | "destructive"
|
|
68
68
|
}) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
return (
|
|
70
|
+
<DropdownMenuPrimitive.Item
|
|
71
|
+
data-slot="dropdown-menu-item"
|
|
72
|
+
data-inset={inset}
|
|
73
|
+
data-variant={variant}
|
|
74
|
+
className={cn(
|
|
75
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_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",
|
|
76
|
+
className
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
)
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
function DropdownMenuCheckboxItem({
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
className,
|
|
85
|
+
children,
|
|
86
|
+
checked,
|
|
87
|
+
...props
|
|
88
88
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
return (
|
|
90
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
91
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
92
|
+
className={cn(
|
|
93
|
+
"focus:bg-accent focus:text-accent-foreground 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",
|
|
94
|
+
className
|
|
95
|
+
)}
|
|
96
|
+
checked={checked}
|
|
97
|
+
{...props}
|
|
98
|
+
>
|
|
99
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
100
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
101
|
+
<CheckIcon className="size-4" />
|
|
102
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
103
|
+
</span>
|
|
104
|
+
{children}
|
|
105
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
106
|
+
)
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
function DropdownMenuRadioGroup({
|
|
110
|
-
|
|
110
|
+
...props
|
|
111
111
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
return (
|
|
113
|
+
<DropdownMenuPrimitive.RadioGroup
|
|
114
|
+
data-slot="dropdown-menu-radio-group"
|
|
115
|
+
{...props}
|
|
116
|
+
/>
|
|
117
|
+
)
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function DropdownMenuRadioItem({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
className,
|
|
122
|
+
children,
|
|
123
|
+
...props
|
|
124
124
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
125
|
+
return (
|
|
126
|
+
<DropdownMenuPrimitive.RadioItem
|
|
127
|
+
data-slot="dropdown-menu-radio-item"
|
|
128
|
+
className={cn(
|
|
129
|
+
"focus:bg-accent focus:text-accent-foreground 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",
|
|
130
|
+
className
|
|
131
|
+
)}
|
|
132
|
+
{...props}
|
|
133
|
+
>
|
|
134
|
+
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
135
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
136
|
+
<CircleIcon className="size-2 fill-current" />
|
|
137
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
138
|
+
</span>
|
|
139
|
+
{children}
|
|
140
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
141
|
+
)
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
function DropdownMenuLabel({
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
className,
|
|
146
|
+
inset,
|
|
147
|
+
...props
|
|
148
148
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
149
|
-
|
|
149
|
+
inset?: boolean
|
|
150
150
|
}) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
151
|
+
return (
|
|
152
|
+
<DropdownMenuPrimitive.Label
|
|
153
|
+
data-slot="dropdown-menu-label"
|
|
154
|
+
data-inset={inset}
|
|
155
|
+
className={cn(
|
|
156
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
157
|
+
className
|
|
158
|
+
)}
|
|
159
|
+
{...props}
|
|
160
|
+
/>
|
|
161
|
+
)
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
function DropdownMenuSeparator({
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
className,
|
|
166
|
+
...props
|
|
167
167
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
168
|
+
return (
|
|
169
|
+
<DropdownMenuPrimitive.Separator
|
|
170
|
+
data-slot="dropdown-menu-separator"
|
|
171
|
+
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
172
|
+
{...props}
|
|
173
|
+
/>
|
|
174
|
+
)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
function DropdownMenuShortcut({
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
className,
|
|
179
|
+
...props
|
|
180
180
|
}: React.ComponentProps<"span">) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
return (
|
|
182
|
+
<span
|
|
183
|
+
data-slot="dropdown-menu-shortcut"
|
|
184
|
+
className={cn(
|
|
185
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
186
|
+
className
|
|
187
|
+
)}
|
|
188
|
+
{...props}
|
|
189
|
+
/>
|
|
190
|
+
)
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
function DropdownMenuSub({
|
|
194
|
-
|
|
194
|
+
...props
|
|
195
195
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
196
|
-
|
|
196
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function DropdownMenuSubTrigger({
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
className,
|
|
201
|
+
inset,
|
|
202
|
+
children,
|
|
203
|
+
...props
|
|
204
204
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
205
|
-
|
|
205
|
+
inset?: boolean
|
|
206
206
|
}) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
207
|
+
return (
|
|
208
|
+
<DropdownMenuPrimitive.SubTrigger
|
|
209
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
210
|
+
data-inset={inset}
|
|
211
|
+
className={cn(
|
|
212
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
|
|
213
|
+
className
|
|
214
|
+
)}
|
|
215
|
+
{...props}
|
|
216
|
+
>
|
|
217
|
+
{children}
|
|
218
|
+
<ChevronRightIcon className="ml-auto size-4" />
|
|
219
|
+
</DropdownMenuPrimitive.SubTrigger>
|
|
220
|
+
)
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
function DropdownMenuSubContent({
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
className,
|
|
225
|
+
...props
|
|
226
226
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
227
|
+
return (
|
|
228
|
+
<DropdownMenuPrimitive.SubContent
|
|
229
|
+
data-slot="dropdown-menu-sub-content"
|
|
230
|
+
className={cn(
|
|
231
|
+
"bg-popover text-popover-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 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
232
|
+
className
|
|
233
|
+
)}
|
|
234
|
+
{...props}
|
|
235
|
+
/>
|
|
236
|
+
)
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
240
|
+
DropdownMenu,
|
|
241
|
+
DropdownMenuPortal,
|
|
242
|
+
DropdownMenuTrigger,
|
|
243
|
+
DropdownMenuContent,
|
|
244
|
+
DropdownMenuGroup,
|
|
245
|
+
DropdownMenuLabel,
|
|
246
|
+
DropdownMenuItem,
|
|
247
|
+
DropdownMenuCheckboxItem,
|
|
248
|
+
DropdownMenuRadioGroup,
|
|
249
|
+
DropdownMenuRadioItem,
|
|
250
|
+
DropdownMenuSeparator,
|
|
251
|
+
DropdownMenuShortcut,
|
|
252
|
+
DropdownMenuSub,
|
|
253
|
+
DropdownMenuSubTrigger,
|
|
254
|
+
DropdownMenuSubContent,
|
|
255
255
|
}
|
package/src/input.tsx
CHANGED
|
@@ -1,16 +1,39 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
import { cn } from "@c-rex/utils";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
const inputVariants = cva(
|
|
7
|
+
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base transition-colors placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
12
|
+
file: "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground",
|
|
13
|
+
embedded: "border-0 outline-none focus:border-0 focus:outline-none focus:ring20",
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
interface InputProps
|
|
23
|
+
extends React.ComponentProps<"input">,
|
|
24
|
+
VariantProps<typeof inputVariants> {
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
29
|
+
({ className, type, variant, ...props }, ref) => {
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
7
33
|
return (
|
|
8
34
|
<input
|
|
9
35
|
type={type}
|
|
10
|
-
className={cn(
|
|
11
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
-
className,
|
|
13
|
-
)}
|
|
36
|
+
className={cn(inputVariants({ variant, className }))}
|
|
14
37
|
ref={ref}
|
|
15
38
|
{...props}
|
|
16
39
|
/>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import {
|
|
3
|
+
ChevronLeftIcon,
|
|
4
|
+
ChevronRightIcon,
|
|
5
|
+
MoreHorizontalIcon,
|
|
6
|
+
} from "lucide-react"
|
|
7
|
+
|
|
8
|
+
import { cn } from "@c-rex/utils"
|
|
9
|
+
import { Button, buttonVariants } from "./button"
|
|
10
|
+
|
|
11
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
12
|
+
return (
|
|
13
|
+
<nav
|
|
14
|
+
role="navigation"
|
|
15
|
+
aria-label="pagination"
|
|
16
|
+
data-slot="pagination"
|
|
17
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function PaginationContent({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<"ul">) {
|
|
27
|
+
return (
|
|
28
|
+
<ul
|
|
29
|
+
data-slot="pagination-content"
|
|
30
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
37
|
+
return <li data-slot="pagination-item" {...props} />
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type PaginationLinkProps = {
|
|
41
|
+
isActive?: boolean
|
|
42
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
43
|
+
React.ComponentProps<"a">
|
|
44
|
+
|
|
45
|
+
function PaginationLink({
|
|
46
|
+
className,
|
|
47
|
+
isActive,
|
|
48
|
+
size = "icon",
|
|
49
|
+
...props
|
|
50
|
+
}: PaginationLinkProps) {
|
|
51
|
+
return (
|
|
52
|
+
<a
|
|
53
|
+
aria-current={isActive ? "page" : undefined}
|
|
54
|
+
data-slot="pagination-link"
|
|
55
|
+
data-active={isActive}
|
|
56
|
+
className={cn(
|
|
57
|
+
buttonVariants({
|
|
58
|
+
variant: isActive ? "outline" : "ghost",
|
|
59
|
+
size,
|
|
60
|
+
}),
|
|
61
|
+
className
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function PaginationPrevious({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
72
|
+
return (
|
|
73
|
+
<PaginationLink
|
|
74
|
+
aria-label="Go to previous page"
|
|
75
|
+
size="default"
|
|
76
|
+
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
<ChevronLeftIcon />
|
|
80
|
+
</PaginationLink>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function PaginationNext({
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}: React.ComponentProps<typeof PaginationLink>) {
|
|
88
|
+
return (
|
|
89
|
+
<PaginationLink
|
|
90
|
+
aria-label="Go to next page"
|
|
91
|
+
size="default"
|
|
92
|
+
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
93
|
+
{...props}
|
|
94
|
+
>
|
|
95
|
+
<ChevronRightIcon />
|
|
96
|
+
</PaginationLink>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function PaginationEllipsis({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<"span">) {
|
|
104
|
+
return (
|
|
105
|
+
<span
|
|
106
|
+
data-slot="pagination-ellipsis"
|
|
107
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
108
|
+
{...props}
|
|
109
|
+
>
|
|
110
|
+
<MoreHorizontalIcon className="size-4" />
|
|
111
|
+
<span className="sr-only">More pages</span>
|
|
112
|
+
</span>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
Pagination,
|
|
118
|
+
PaginationContent,
|
|
119
|
+
PaginationLink,
|
|
120
|
+
PaginationItem,
|
|
121
|
+
PaginationPrevious,
|
|
122
|
+
PaginationNext,
|
|
123
|
+
PaginationEllipsis,
|
|
124
|
+
}
|
package/src/sidebar.tsx
CHANGED
package/src/sonner.tsx
ADDED
package/src/table.tsx
CHANGED
|
@@ -20,7 +20,7 @@ const TableHeader = React.forwardRef<
|
|
|
20
20
|
HTMLTableSectionElement,
|
|
21
21
|
React.HTMLAttributes<HTMLTableSectionElement>
|
|
22
22
|
>(({ className, ...props }, ref) => (
|
|
23
|
-
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
|
|
23
|
+
<thead ref={ref} className={cn("[&_tr]:border-b font-bold", className)} {...props} />
|
|
24
24
|
));
|
|
25
25
|
TableHeader.displayName = "TableHeader";
|
|
26
26
|
|