@create-lft-app/nextjs 3.2.0 → 3.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 +549 -549
- package/package.json +48 -48
- package/template/.claude/skills/anti-patterns.md +150 -0
- package/template/.claude/skills/drizzle-schema.md +178 -0
- package/template/.claude/skills/formatting.md +56 -0
- package/template/.claude/skills/module-architecture.md +143 -0
- package/template/.claude/skills/supabase-server-actions.md +199 -0
- package/template/.claude/skills/ui-patterns.md +161 -0
- package/template/CLAUDE.md +114 -1239
- package/template/drizzle.config.ts +12 -12
- package/template/eslint.config.mjs +16 -16
- package/template/gitignore +36 -36
- package/template/next.config.ts +7 -7
- package/template/package.json +86 -86
- package/template/postcss.config.mjs +7 -7
- package/template/proxy.ts +12 -12
- package/template/public/logolft.svg +11 -11
- package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -124
- package/template/src/app/(auth)/dashboard/page.tsx +9 -9
- package/template/src/app/(auth)/layout.tsx +7 -7
- package/template/src/app/(auth)/users/page.tsx +9 -9
- package/template/src/app/(auth)/users/users-content.tsx +26 -26
- package/template/src/app/(public)/layout.tsx +7 -7
- package/template/src/app/(public)/login/page.tsx +17 -17
- package/template/src/app/api/webhooks/route.ts +20 -20
- package/template/src/app/globals.css +249 -249
- package/template/src/app/layout.tsx +37 -37
- package/template/src/app/page.tsx +5 -5
- package/template/src/app/providers.tsx +27 -27
- package/template/src/components/layout/main-content.tsx +28 -28
- package/template/src/components/layout/sidebar-context.tsx +33 -33
- package/template/src/components/layout/sidebar.tsx +141 -141
- package/template/src/components/tables/data-table-column-header.tsx +68 -68
- package/template/src/components/tables/data-table-date-filter.tsx +203 -203
- package/template/src/components/tables/data-table-faceted-filter.tsx +185 -185
- package/template/src/components/tables/data-table-filters-dropdown.tsx +130 -130
- package/template/src/components/tables/data-table-number-filter.tsx +295 -295
- package/template/src/components/tables/data-table-pagination.tsx +99 -99
- package/template/src/components/tables/data-table-toolbar.tsx +140 -140
- package/template/src/components/tables/data-table-view-options.tsx +63 -63
- package/template/src/components/tables/data-table.tsx +148 -148
- package/template/src/components/tables/index.ts +9 -9
- package/template/src/components/ui/accordion.tsx +58 -58
- package/template/src/components/ui/alert-dialog.tsx +165 -165
- package/template/src/components/ui/alert.tsx +66 -66
- package/template/src/components/ui/animations/index.ts +44 -44
- package/template/src/components/ui/avatar.tsx +55 -55
- package/template/src/components/ui/badge.tsx +50 -50
- package/template/src/components/ui/button.tsx +118 -118
- package/template/src/components/ui/calendar.tsx +220 -220
- package/template/src/components/ui/card.tsx +113 -113
- package/template/src/components/ui/checkbox.tsx +38 -38
- package/template/src/components/ui/collapsible.tsx +33 -33
- package/template/src/components/ui/command.tsx +196 -196
- package/template/src/components/ui/dialog.tsx +156 -156
- package/template/src/components/ui/dropdown-menu.tsx +280 -280
- package/template/src/components/ui/form.tsx +171 -171
- package/template/src/components/ui/icons.tsx +167 -167
- package/template/src/components/ui/input.tsx +28 -28
- package/template/src/components/ui/label.tsx +25 -25
- package/template/src/components/ui/motion.tsx +197 -197
- package/template/src/components/ui/page-transition.tsx +166 -166
- package/template/src/components/ui/popover.tsx +59 -59
- package/template/src/components/ui/progress.tsx +32 -32
- package/template/src/components/ui/radio-group.tsx +45 -45
- package/template/src/components/ui/scroll-area.tsx +63 -63
- package/template/src/components/ui/select.tsx +208 -208
- package/template/src/components/ui/separator.tsx +28 -28
- package/template/src/components/ui/sheet.tsx +170 -170
- package/template/src/components/ui/sidebar.tsx +726 -726
- package/template/src/components/ui/skeleton.tsx +15 -15
- package/template/src/components/ui/slider.tsx +58 -58
- package/template/src/components/ui/sonner.tsx +47 -47
- package/template/src/components/ui/spinner.tsx +27 -27
- package/template/src/components/ui/submit-button.tsx +47 -47
- package/template/src/components/ui/switch.tsx +31 -31
- package/template/src/components/ui/table.tsx +120 -120
- package/template/src/components/ui/tabs.tsx +75 -75
- package/template/src/components/ui/textarea.tsx +26 -26
- package/template/src/components/ui/tooltip.tsx +70 -70
- package/template/src/config/navigation.ts +59 -59
- package/template/src/config/roles.ts +27 -27
- package/template/src/config/site.ts +12 -12
- package/template/src/db/index.ts +12 -12
- package/template/src/db/schema/index.ts +1 -1
- package/template/src/db/schema/users.ts +16 -16
- package/template/src/db/seed.ts +39 -39
- package/template/src/hooks/index.ts +3 -3
- package/template/src/hooks/use-mobile.ts +21 -21
- package/template/src/hooks/useDataTable.ts +82 -82
- package/template/src/hooks/useDebounce.ts +49 -49
- package/template/src/hooks/useMediaQuery.ts +36 -36
- package/template/src/lib/date/config.ts +36 -36
- package/template/src/lib/date/formatters.ts +127 -127
- package/template/src/lib/date/index.ts +26 -26
- package/template/src/lib/excel/exporter.ts +89 -89
- package/template/src/lib/excel/index.ts +14 -14
- package/template/src/lib/excel/parser.ts +96 -96
- package/template/src/lib/query-client.ts +35 -35
- package/template/src/lib/supabase/admin.ts +23 -23
- package/template/src/lib/supabase/client.ts +11 -11
- package/template/src/lib/supabase/proxy.ts +67 -67
- package/template/src/lib/supabase/server.ts +38 -38
- package/template/src/lib/supabase/types.ts +53 -53
- package/template/src/lib/utils.ts +6 -6
- package/template/src/lib/validations/common.ts +75 -75
- package/template/src/lib/validations/index.ts +20 -20
- package/template/src/modules/auth/actions/auth-actions.ts +59 -59
- package/template/src/modules/auth/components/login-form.tsx +68 -68
- package/template/src/modules/auth/hooks/useAuth.ts +38 -38
- package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -43
- package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -43
- package/template/src/modules/auth/index.ts +12 -12
- package/template/src/modules/auth/schemas/auth.schema.ts +32 -32
- package/template/src/modules/auth/stores/useAuthStore.ts +37 -37
- package/template/src/modules/users/actions/users-actions.ts +166 -166
- package/template/src/modules/users/columns.tsx +106 -106
- package/template/src/modules/users/components/users-list.tsx +48 -48
- package/template/src/modules/users/hooks/useUsers.ts +39 -39
- package/template/src/modules/users/hooks/useUsersMutations.ts +55 -55
- package/template/src/modules/users/hooks/useUsersQueries.ts +35 -35
- package/template/src/modules/users/index.ts +30 -30
- package/template/src/modules/users/schemas/users.schema.ts +51 -51
- package/template/src/modules/users/stores/useUsersStore.ts +60 -60
- package/template/src/modules/users/types/auth-user.types.ts +42 -42
- package/template/src/modules/users/utils/user-mapper.ts +32 -32
- package/template/src/stores/index.ts +1 -1
- package/template/src/stores/useUiStore.ts +55 -55
- package/template/src/types/api.ts +28 -28
- package/template/src/types/index.ts +2 -2
- package/template/src/types/table.ts +34 -34
- package/template/supabase/config.toml +94 -94
- package/template/tsconfig.json +42 -42
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
interface ScrollAreaProps extends React.ComponentProps<typeof ScrollAreaPrimitive.Root> {
|
|
9
|
-
hideScrollbar?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function ScrollArea({
|
|
13
|
-
className,
|
|
14
|
-
children,
|
|
15
|
-
hideScrollbar = false,
|
|
16
|
-
...props
|
|
17
|
-
}: ScrollAreaProps) {
|
|
18
|
-
return (
|
|
19
|
-
<ScrollAreaPrimitive.Root
|
|
20
|
-
data-slot="scroll-area"
|
|
21
|
-
className={cn("relative overflow-hidden", className)}
|
|
22
|
-
{...props}
|
|
23
|
-
>
|
|
24
|
-
<ScrollAreaPrimitive.Viewport
|
|
25
|
-
data-slot="scroll-area-viewport"
|
|
26
|
-
className="h-full w-full rounded-[inherit]"
|
|
27
|
-
>
|
|
28
|
-
{children}
|
|
29
|
-
</ScrollAreaPrimitive.Viewport>
|
|
30
|
-
{!hideScrollbar && <ScrollBar />}
|
|
31
|
-
<ScrollAreaPrimitive.Corner />
|
|
32
|
-
</ScrollAreaPrimitive.Root>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function ScrollBar({
|
|
37
|
-
className,
|
|
38
|
-
orientation = "vertical",
|
|
39
|
-
...props
|
|
40
|
-
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
41
|
-
return (
|
|
42
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
43
|
-
data-slot="scroll-area-scrollbar"
|
|
44
|
-
orientation={orientation}
|
|
45
|
-
className={cn(
|
|
46
|
-
"flex touch-none select-none transition-colors",
|
|
47
|
-
orientation === "vertical" &&
|
|
48
|
-
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
49
|
-
orientation === "horizontal" &&
|
|
50
|
-
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
51
|
-
className
|
|
52
|
-
)}
|
|
53
|
-
{...props}
|
|
54
|
-
>
|
|
55
|
-
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
56
|
-
data-slot="scroll-area-thumb"
|
|
57
|
-
className="relative flex-1 rounded-full bg-border"
|
|
58
|
-
/>
|
|
59
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { ScrollArea, ScrollBar }
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
interface ScrollAreaProps extends React.ComponentProps<typeof ScrollAreaPrimitive.Root> {
|
|
9
|
+
hideScrollbar?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ScrollArea({
|
|
13
|
+
className,
|
|
14
|
+
children,
|
|
15
|
+
hideScrollbar = false,
|
|
16
|
+
...props
|
|
17
|
+
}: ScrollAreaProps) {
|
|
18
|
+
return (
|
|
19
|
+
<ScrollAreaPrimitive.Root
|
|
20
|
+
data-slot="scroll-area"
|
|
21
|
+
className={cn("relative overflow-hidden", className)}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
<ScrollAreaPrimitive.Viewport
|
|
25
|
+
data-slot="scroll-area-viewport"
|
|
26
|
+
className="h-full w-full rounded-[inherit]"
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</ScrollAreaPrimitive.Viewport>
|
|
30
|
+
{!hideScrollbar && <ScrollBar />}
|
|
31
|
+
<ScrollAreaPrimitive.Corner />
|
|
32
|
+
</ScrollAreaPrimitive.Root>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function ScrollBar({
|
|
37
|
+
className,
|
|
38
|
+
orientation = "vertical",
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
41
|
+
return (
|
|
42
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
43
|
+
data-slot="scroll-area-scrollbar"
|
|
44
|
+
orientation={orientation}
|
|
45
|
+
className={cn(
|
|
46
|
+
"flex touch-none select-none transition-colors",
|
|
47
|
+
orientation === "vertical" &&
|
|
48
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
49
|
+
orientation === "horizontal" &&
|
|
50
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
>
|
|
55
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
56
|
+
data-slot="scroll-area-thumb"
|
|
57
|
+
className="relative flex-1 rounded-full bg-border"
|
|
58
|
+
/>
|
|
59
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { ScrollArea, ScrollBar }
|
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
5
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
function Select({
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function SelectGroup({
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
|
-
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function SelectValue({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function SelectTrigger({
|
|
28
|
-
className,
|
|
29
|
-
size = "default",
|
|
30
|
-
children,
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
-
size?: "sm" | "default"
|
|
34
|
-
}) {
|
|
35
|
-
return (
|
|
36
|
-
<SelectPrimitive.Trigger
|
|
37
|
-
data-slot="select-trigger"
|
|
38
|
-
data-size={size}
|
|
39
|
-
className={cn(
|
|
40
|
-
"flex w-full items-center justify-between gap-2",
|
|
41
|
-
"rounded-md border border-input bg-transparent",
|
|
42
|
-
"px-3 py-2 text-sm",
|
|
43
|
-
"transition-colors duration-150",
|
|
44
|
-
"placeholder:text-muted-foreground",
|
|
45
|
-
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
46
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
47
|
-
"data-[size=default]:h-10 data-[size=sm]:h-8",
|
|
48
|
-
"[&>span]:line-clamp-1",
|
|
49
|
-
className
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
>
|
|
53
|
-
{children}
|
|
54
|
-
<SelectPrimitive.Icon asChild>
|
|
55
|
-
<ChevronDownIcon className="h-4 w-4 text-muted-foreground" />
|
|
56
|
-
</SelectPrimitive.Icon>
|
|
57
|
-
</SelectPrimitive.Trigger>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function SelectContent({
|
|
62
|
-
className,
|
|
63
|
-
children,
|
|
64
|
-
position = "popper",
|
|
65
|
-
...props
|
|
66
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
67
|
-
return (
|
|
68
|
-
<SelectPrimitive.Portal>
|
|
69
|
-
<SelectPrimitive.Content
|
|
70
|
-
data-slot="select-content"
|
|
71
|
-
className={cn(
|
|
72
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
|
|
73
|
-
"rounded-md border border-border",
|
|
74
|
-
"bg-popover",
|
|
75
|
-
"text-popover-foreground",
|
|
76
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
77
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
78
|
-
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
79
|
-
"data-[side=bottom]:slide-in-from-top-2",
|
|
80
|
-
"data-[side=left]:slide-in-from-right-2",
|
|
81
|
-
"data-[side=right]:slide-in-from-left-2",
|
|
82
|
-
"data-[side=top]:slide-in-from-bottom-2",
|
|
83
|
-
position === "popper" &&
|
|
84
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
85
|
-
className
|
|
86
|
-
)}
|
|
87
|
-
position={position}
|
|
88
|
-
{...props}
|
|
89
|
-
>
|
|
90
|
-
<SelectScrollUpButton />
|
|
91
|
-
<SelectPrimitive.Viewport
|
|
92
|
-
className={cn(
|
|
93
|
-
"p-1",
|
|
94
|
-
position === "popper" &&
|
|
95
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
96
|
-
)}
|
|
97
|
-
>
|
|
98
|
-
{children}
|
|
99
|
-
</SelectPrimitive.Viewport>
|
|
100
|
-
<SelectScrollDownButton />
|
|
101
|
-
</SelectPrimitive.Content>
|
|
102
|
-
</SelectPrimitive.Portal>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function SelectLabel({
|
|
107
|
-
className,
|
|
108
|
-
...props
|
|
109
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
110
|
-
return (
|
|
111
|
-
<SelectPrimitive.Label
|
|
112
|
-
data-slot="select-label"
|
|
113
|
-
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function SelectItem({
|
|
120
|
-
className,
|
|
121
|
-
children,
|
|
122
|
-
...props
|
|
123
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
124
|
-
return (
|
|
125
|
-
<SelectPrimitive.Item
|
|
126
|
-
data-slot="select-item"
|
|
127
|
-
className={cn(
|
|
128
|
-
"relative flex w-full cursor-default select-none items-center",
|
|
129
|
-
"rounded-sm py-1.5 pl-2 pr-8",
|
|
130
|
-
"text-sm outline-none",
|
|
131
|
-
"transition-colors duration-150",
|
|
132
|
-
"focus:bg-accent",
|
|
133
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
134
|
-
className
|
|
135
|
-
)}
|
|
136
|
-
{...props}
|
|
137
|
-
>
|
|
138
|
-
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
139
|
-
<SelectPrimitive.ItemIndicator>
|
|
140
|
-
<CheckIcon className="h-4 w-4" />
|
|
141
|
-
</SelectPrimitive.ItemIndicator>
|
|
142
|
-
</span>
|
|
143
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
144
|
-
</SelectPrimitive.Item>
|
|
145
|
-
)
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function SelectSeparator({
|
|
149
|
-
className,
|
|
150
|
-
...props
|
|
151
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
152
|
-
return (
|
|
153
|
-
<SelectPrimitive.Separator
|
|
154
|
-
data-slot="select-separator"
|
|
155
|
-
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
156
|
-
{...props}
|
|
157
|
-
/>
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function SelectScrollUpButton({
|
|
162
|
-
className,
|
|
163
|
-
...props
|
|
164
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
165
|
-
return (
|
|
166
|
-
<SelectPrimitive.ScrollUpButton
|
|
167
|
-
data-slot="select-scroll-up-button"
|
|
168
|
-
className={cn(
|
|
169
|
-
"flex cursor-default items-center justify-center py-1",
|
|
170
|
-
className
|
|
171
|
-
)}
|
|
172
|
-
{...props}
|
|
173
|
-
>
|
|
174
|
-
<ChevronUpIcon className="size-4" />
|
|
175
|
-
</SelectPrimitive.ScrollUpButton>
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function SelectScrollDownButton({
|
|
180
|
-
className,
|
|
181
|
-
...props
|
|
182
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
183
|
-
return (
|
|
184
|
-
<SelectPrimitive.ScrollDownButton
|
|
185
|
-
data-slot="select-scroll-down-button"
|
|
186
|
-
className={cn(
|
|
187
|
-
"flex cursor-default items-center justify-center py-1",
|
|
188
|
-
className
|
|
189
|
-
)}
|
|
190
|
-
{...props}
|
|
191
|
-
>
|
|
192
|
-
<ChevronDownIcon className="size-4" />
|
|
193
|
-
</SelectPrimitive.ScrollDownButton>
|
|
194
|
-
)
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export {
|
|
198
|
-
Select,
|
|
199
|
-
SelectContent,
|
|
200
|
-
SelectGroup,
|
|
201
|
-
SelectItem,
|
|
202
|
-
SelectLabel,
|
|
203
|
-
SelectScrollDownButton,
|
|
204
|
-
SelectScrollUpButton,
|
|
205
|
-
SelectSeparator,
|
|
206
|
-
SelectTrigger,
|
|
207
|
-
SelectValue,
|
|
208
|
-
}
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as SelectPrimitive from "@radix-ui/react-select"
|
|
5
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
function Select({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SelectGroup({
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SelectValue({
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
24
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function SelectTrigger({
|
|
28
|
+
className,
|
|
29
|
+
size = "default",
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
+
size?: "sm" | "default"
|
|
34
|
+
}) {
|
|
35
|
+
return (
|
|
36
|
+
<SelectPrimitive.Trigger
|
|
37
|
+
data-slot="select-trigger"
|
|
38
|
+
data-size={size}
|
|
39
|
+
className={cn(
|
|
40
|
+
"flex w-full items-center justify-between gap-2",
|
|
41
|
+
"rounded-md border border-input bg-transparent",
|
|
42
|
+
"px-3 py-2 text-sm",
|
|
43
|
+
"transition-colors duration-150",
|
|
44
|
+
"placeholder:text-muted-foreground",
|
|
45
|
+
"focus:outline-none focus:ring-1 focus:ring-ring",
|
|
46
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
47
|
+
"data-[size=default]:h-10 data-[size=sm]:h-8",
|
|
48
|
+
"[&>span]:line-clamp-1",
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
<SelectPrimitive.Icon asChild>
|
|
55
|
+
<ChevronDownIcon className="h-4 w-4 text-muted-foreground" />
|
|
56
|
+
</SelectPrimitive.Icon>
|
|
57
|
+
</SelectPrimitive.Trigger>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function SelectContent({
|
|
62
|
+
className,
|
|
63
|
+
children,
|
|
64
|
+
position = "popper",
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
67
|
+
return (
|
|
68
|
+
<SelectPrimitive.Portal>
|
|
69
|
+
<SelectPrimitive.Content
|
|
70
|
+
data-slot="select-content"
|
|
71
|
+
className={cn(
|
|
72
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
|
|
73
|
+
"rounded-md border border-border",
|
|
74
|
+
"bg-popover",
|
|
75
|
+
"text-popover-foreground",
|
|
76
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
77
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
78
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
79
|
+
"data-[side=bottom]:slide-in-from-top-2",
|
|
80
|
+
"data-[side=left]:slide-in-from-right-2",
|
|
81
|
+
"data-[side=right]:slide-in-from-left-2",
|
|
82
|
+
"data-[side=top]:slide-in-from-bottom-2",
|
|
83
|
+
position === "popper" &&
|
|
84
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
85
|
+
className
|
|
86
|
+
)}
|
|
87
|
+
position={position}
|
|
88
|
+
{...props}
|
|
89
|
+
>
|
|
90
|
+
<SelectScrollUpButton />
|
|
91
|
+
<SelectPrimitive.Viewport
|
|
92
|
+
className={cn(
|
|
93
|
+
"p-1",
|
|
94
|
+
position === "popper" &&
|
|
95
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</SelectPrimitive.Viewport>
|
|
100
|
+
<SelectScrollDownButton />
|
|
101
|
+
</SelectPrimitive.Content>
|
|
102
|
+
</SelectPrimitive.Portal>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function SelectLabel({
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
110
|
+
return (
|
|
111
|
+
<SelectPrimitive.Label
|
|
112
|
+
data-slot="select-label"
|
|
113
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function SelectItem({
|
|
120
|
+
className,
|
|
121
|
+
children,
|
|
122
|
+
...props
|
|
123
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
124
|
+
return (
|
|
125
|
+
<SelectPrimitive.Item
|
|
126
|
+
data-slot="select-item"
|
|
127
|
+
className={cn(
|
|
128
|
+
"relative flex w-full cursor-default select-none items-center",
|
|
129
|
+
"rounded-sm py-1.5 pl-2 pr-8",
|
|
130
|
+
"text-sm outline-none",
|
|
131
|
+
"transition-colors duration-150",
|
|
132
|
+
"focus:bg-accent",
|
|
133
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
134
|
+
className
|
|
135
|
+
)}
|
|
136
|
+
{...props}
|
|
137
|
+
>
|
|
138
|
+
<span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
139
|
+
<SelectPrimitive.ItemIndicator>
|
|
140
|
+
<CheckIcon className="h-4 w-4" />
|
|
141
|
+
</SelectPrimitive.ItemIndicator>
|
|
142
|
+
</span>
|
|
143
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
144
|
+
</SelectPrimitive.Item>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function SelectSeparator({
|
|
149
|
+
className,
|
|
150
|
+
...props
|
|
151
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
152
|
+
return (
|
|
153
|
+
<SelectPrimitive.Separator
|
|
154
|
+
data-slot="select-separator"
|
|
155
|
+
className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
|
|
156
|
+
{...props}
|
|
157
|
+
/>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function SelectScrollUpButton({
|
|
162
|
+
className,
|
|
163
|
+
...props
|
|
164
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
165
|
+
return (
|
|
166
|
+
<SelectPrimitive.ScrollUpButton
|
|
167
|
+
data-slot="select-scroll-up-button"
|
|
168
|
+
className={cn(
|
|
169
|
+
"flex cursor-default items-center justify-center py-1",
|
|
170
|
+
className
|
|
171
|
+
)}
|
|
172
|
+
{...props}
|
|
173
|
+
>
|
|
174
|
+
<ChevronUpIcon className="size-4" />
|
|
175
|
+
</SelectPrimitive.ScrollUpButton>
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function SelectScrollDownButton({
|
|
180
|
+
className,
|
|
181
|
+
...props
|
|
182
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
183
|
+
return (
|
|
184
|
+
<SelectPrimitive.ScrollDownButton
|
|
185
|
+
data-slot="select-scroll-down-button"
|
|
186
|
+
className={cn(
|
|
187
|
+
"flex cursor-default items-center justify-center py-1",
|
|
188
|
+
className
|
|
189
|
+
)}
|
|
190
|
+
{...props}
|
|
191
|
+
>
|
|
192
|
+
<ChevronDownIcon className="size-4" />
|
|
193
|
+
</SelectPrimitive.ScrollDownButton>
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export {
|
|
198
|
+
Select,
|
|
199
|
+
SelectContent,
|
|
200
|
+
SelectGroup,
|
|
201
|
+
SelectItem,
|
|
202
|
+
SelectLabel,
|
|
203
|
+
SelectScrollDownButton,
|
|
204
|
+
SelectScrollUpButton,
|
|
205
|
+
SelectSeparator,
|
|
206
|
+
SelectTrigger,
|
|
207
|
+
SelectValue,
|
|
208
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
|
|
8
|
-
function Separator({
|
|
9
|
-
className,
|
|
10
|
-
orientation = "horizontal",
|
|
11
|
-
decorative = true,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
-
return (
|
|
15
|
-
<SeparatorPrimitive.Root
|
|
16
|
-
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
|
-
orientation={orientation}
|
|
19
|
-
className={cn(
|
|
20
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Separator }
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Separator({
|
|
9
|
+
className,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
decorative = true,
|
|
12
|
+
...props
|
|
13
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
+
return (
|
|
15
|
+
<SeparatorPrimitive.Root
|
|
16
|
+
data-slot="separator"
|
|
17
|
+
decorative={decorative}
|
|
18
|
+
orientation={orientation}
|
|
19
|
+
className={cn(
|
|
20
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Separator }
|