@greatapps/greatauth-ui 0.1.5 → 0.2.1

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.
@@ -0,0 +1,90 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+ import { Tabs as TabsPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "../../lib/utils"
8
+
9
+ function Tabs({
10
+ className,
11
+ orientation = "horizontal",
12
+ ...props
13
+ }: React.ComponentProps<typeof TabsPrimitive.Root>) {
14
+ return (
15
+ <TabsPrimitive.Root
16
+ data-slot="tabs"
17
+ data-orientation={orientation}
18
+ className={cn(
19
+ "gap-2 group/tabs flex data-horizontal:flex-col",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ )
25
+ }
26
+
27
+ const tabsListVariants = cva(
28
+ "rounded-lg p-[3px] group-data-horizontal/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",
29
+ {
30
+ variants: {
31
+ variant: {
32
+ default: "bg-muted",
33
+ line: "gap-1 bg-transparent",
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ variant: "default",
38
+ },
39
+ }
40
+ )
41
+
42
+ function TabsList({
43
+ className,
44
+ variant = "default",
45
+ ...props
46
+ }: React.ComponentProps<typeof TabsPrimitive.List> &
47
+ VariantProps<typeof tabsListVariants>) {
48
+ return (
49
+ <TabsPrimitive.List
50
+ data-slot="tabs-list"
51
+ data-variant={variant}
52
+ className={cn(tabsListVariants({ variant }), className)}
53
+ {...props}
54
+ />
55
+ )
56
+ }
57
+
58
+ function TabsTrigger({
59
+ className,
60
+ ...props
61
+ }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
62
+ return (
63
+ <TabsPrimitive.Trigger
64
+ data-slot="tabs-trigger"
65
+ className={cn(
66
+ "gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
67
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
68
+ "data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground",
69
+ "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
70
+ className
71
+ )}
72
+ {...props}
73
+ />
74
+ )
75
+ }
76
+
77
+ function TabsContent({
78
+ className,
79
+ ...props
80
+ }: React.ComponentProps<typeof TabsPrimitive.Content>) {
81
+ return (
82
+ <TabsPrimitive.Content
83
+ data-slot="tabs-content"
84
+ className={cn("text-sm flex-1 outline-none", className)}
85
+ {...props}
86
+ />
87
+ )
88
+ }
89
+
90
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
@@ -0,0 +1,18 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "../../lib/utils"
4
+
5
+ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
+ return (
7
+ <textarea
8
+ data-slot="textarea"
9
+ className={cn(
10
+ "border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-3 aria-invalid:ring-3 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ export { Textarea }
package/src/ui.ts ADDED
@@ -0,0 +1,178 @@
1
+ /**
2
+ * @greatapps/greatauth-ui/ui
3
+ *
4
+ * Single source of truth for all UI primitives.
5
+ * Shared packages (e.g., @greatapps/greatchat-ui) MUST import from here
6
+ * to ensure consistent styling and shared Radix contexts.
7
+ */
8
+
9
+ // Utils
10
+ export { cn } from "./lib/utils"
11
+
12
+ // Button
13
+ export { Button, buttonVariants } from "./components/ui/button"
14
+
15
+ // Dialog
16
+ export {
17
+ Dialog,
18
+ DialogClose,
19
+ DialogContent,
20
+ DialogDescription,
21
+ DialogFooter,
22
+ DialogHeader,
23
+ DialogOverlay,
24
+ DialogPortal,
25
+ DialogTitle,
26
+ DialogTrigger,
27
+ } from "./components/ui/dialog"
28
+
29
+ // Alert Dialog
30
+ export {
31
+ AlertDialog,
32
+ AlertDialogAction,
33
+ AlertDialogCancel,
34
+ AlertDialogContent,
35
+ AlertDialogDescription,
36
+ AlertDialogFooter,
37
+ AlertDialogHeader,
38
+ AlertDialogOverlay,
39
+ AlertDialogPortal,
40
+ AlertDialogTitle,
41
+ AlertDialogTrigger,
42
+ } from "./components/ui/alert-dialog"
43
+
44
+ // Select
45
+ export {
46
+ Select,
47
+ SelectContent,
48
+ SelectGroup,
49
+ SelectItem,
50
+ SelectLabel,
51
+ SelectScrollDownButton,
52
+ SelectScrollUpButton,
53
+ SelectSeparator,
54
+ SelectTrigger,
55
+ SelectValue,
56
+ } from "./components/ui/select"
57
+
58
+ // Input
59
+ export { Input } from "./components/ui/input"
60
+
61
+ // Label
62
+ export { Label } from "./components/ui/label"
63
+
64
+ // Textarea
65
+ export { Textarea } from "./components/ui/textarea"
66
+
67
+ // Card
68
+ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/ui/card"
69
+
70
+ // Badge
71
+ export { Badge, badgeVariants } from "./components/ui/badge"
72
+
73
+ // Avatar
74
+ export { Avatar, AvatarFallback, AvatarImage } from "./components/ui/avatar"
75
+
76
+ // Tooltip
77
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip"
78
+
79
+ // Dropdown Menu
80
+ export {
81
+ DropdownMenu,
82
+ DropdownMenuContent,
83
+ DropdownMenuGroup,
84
+ DropdownMenuItem,
85
+ DropdownMenuLabel,
86
+ DropdownMenuSeparator,
87
+ DropdownMenuTrigger,
88
+ } from "./components/ui/dropdown-menu"
89
+
90
+ // Separator
91
+ export { Separator } from "./components/ui/separator"
92
+
93
+ // Skeleton
94
+ export { Skeleton } from "./components/ui/skeleton"
95
+
96
+ // Scroll Area
97
+ export { ScrollArea, ScrollBar } from "./components/ui/scroll-area"
98
+
99
+ // Tabs
100
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants } from "./components/ui/tabs"
101
+
102
+ // Table
103
+ export {
104
+ Table,
105
+ TableBody,
106
+ TableCaption,
107
+ TableCell,
108
+ TableFooter,
109
+ TableHead,
110
+ TableHeader,
111
+ TableRow,
112
+ } from "./components/ui/table"
113
+
114
+ // Progress
115
+ export { Progress } from "./components/ui/progress"
116
+
117
+ // Command
118
+ export {
119
+ Command,
120
+ CommandInput,
121
+ CommandList,
122
+ CommandEmpty,
123
+ CommandGroup,
124
+ CommandItem,
125
+ CommandSeparator,
126
+ CommandShortcut,
127
+ } from "./components/ui/command"
128
+
129
+ // Sidebar (re-export for completeness)
130
+ export {
131
+ Sidebar,
132
+ SidebarContent,
133
+ SidebarFooter,
134
+ SidebarGroup,
135
+ SidebarGroupContent,
136
+ SidebarGroupLabel,
137
+ SidebarHeader,
138
+ SidebarInset,
139
+ SidebarMenu,
140
+ SidebarMenuButton,
141
+ SidebarMenuItem,
142
+ SidebarMenuSub,
143
+ SidebarMenuSubButton,
144
+ SidebarMenuSubItem,
145
+ SidebarProvider,
146
+ SidebarRail,
147
+ SidebarSeparator,
148
+ SidebarTrigger,
149
+ useSidebar,
150
+ } from "./components/ui/sidebar"
151
+
152
+ // Sheet
153
+ export {
154
+ Sheet,
155
+ SheetClose,
156
+ SheetContent,
157
+ SheetDescription,
158
+ SheetFooter,
159
+ SheetHeader,
160
+ SheetTitle,
161
+ SheetTrigger,
162
+ } from "./components/ui/sheet"
163
+
164
+ // Alert
165
+ export { Alert, AlertDescription, AlertTitle } from "./components/ui/alert"
166
+
167
+ // Breadcrumb
168
+ export {
169
+ Breadcrumb,
170
+ BreadcrumbItem,
171
+ BreadcrumbLink,
172
+ BreadcrumbList,
173
+ BreadcrumbPage,
174
+ BreadcrumbSeparator,
175
+ } from "./components/ui/breadcrumb"
176
+
177
+ // Collapsible
178
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/ui/collapsible"