@pattern-stack/frontend-patterns 0.0.1 → 0.0.3
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 +6 -6
- package/package.json +3 -5
- package/src/App.css +0 -42
- package/src/App.tsx +0 -54
- package/src/__tests__/README.md +0 -221
- package/src/__tests__/atoms/hooks/simple-hooks.test.ts +0 -44
- package/src/__tests__/atoms/ui/button.test.tsx +0 -68
- package/src/__tests__/atoms/utils/simple.test.ts +0 -18
- package/src/__tests__/atoms/utils/utils.test.ts +0 -77
- package/src/__tests__/features/auth/simple-auth.test.tsx +0 -40
- package/src/__tests__/molecules/layout/simple-layout.test.tsx +0 -81
- package/src/__tests__/organisms/showcase/simple-showcase.test.tsx +0 -167
- package/src/__tests__/setup.ts +0 -51
- package/src/__tests__/utils.tsx +0 -123
- package/src/atoms/composed/Accordion/Accordion.tsx +0 -271
- package/src/atoms/composed/Accordion/index.ts +0 -1
- package/src/atoms/composed/Alert/Alert.tsx +0 -132
- package/src/atoms/composed/Alert/index.ts +0 -1
- package/src/atoms/composed/Breadcrumb/Breadcrumb.tsx +0 -83
- package/src/atoms/composed/Breadcrumb/index.ts +0 -1
- package/src/atoms/composed/Chart/Chart.tsx +0 -425
- package/src/atoms/composed/Chart/index.ts +0 -2
- package/src/atoms/composed/ColorSwatch/ColorSwatch.tsx +0 -72
- package/src/atoms/composed/ColorSwatch/index.ts +0 -1
- package/src/atoms/composed/DarkModeToggle.tsx +0 -66
- package/src/atoms/composed/DataBadge/DataBadge.tsx +0 -81
- package/src/atoms/composed/DataBadge/index.ts +0 -1
- package/src/atoms/composed/DataTable/DataTable.tsx +0 -394
- package/src/atoms/composed/DataTable/TableCellWithTooltip.tsx +0 -41
- package/src/atoms/composed/DataTable/index.ts +0 -2
- package/src/atoms/composed/DateTimePicker/DateTimePicker.tsx +0 -611
- package/src/atoms/composed/DateTimePicker/index.ts +0 -2
- package/src/atoms/composed/DetailedCard/DetailedCard.tsx +0 -181
- package/src/atoms/composed/DetailedCard/index.ts +0 -2
- package/src/atoms/composed/EmptyState/EmptyState.tsx +0 -90
- package/src/atoms/composed/EmptyState/index.ts +0 -1
- package/src/atoms/composed/FileUpload/FileUpload.tsx +0 -477
- package/src/atoms/composed/FileUpload/index.ts +0 -2
- package/src/atoms/composed/FormField/FormField.tsx +0 -92
- package/src/atoms/composed/FormField/index.ts +0 -1
- package/src/atoms/composed/GlobalSearch/GlobalSearch.tsx +0 -37
- package/src/atoms/composed/GlobalSearch/index.ts +0 -1
- package/src/atoms/composed/IconBadge/IconBadge.tsx +0 -95
- package/src/atoms/composed/IconBadge/index.ts +0 -2
- package/src/atoms/composed/Modal/Modal.tsx +0 -223
- package/src/atoms/composed/Modal/index.ts +0 -2
- package/src/atoms/composed/PaletteSwitcher.tsx +0 -386
- package/src/atoms/composed/ProgressBar/ProgressBar.tsx +0 -116
- package/src/atoms/composed/ProgressBar/index.ts +0 -1
- package/src/atoms/composed/StatCard/StatCard.tsx +0 -219
- package/src/atoms/composed/StatCard/index.ts +0 -1
- package/src/atoms/composed/StyleGuide.tsx +0 -717
- package/src/atoms/composed/Toast/Toast.tsx +0 -219
- package/src/atoms/composed/Toast/index.ts +0 -1
- package/src/atoms/composed/Tooltip/Tooltip.tsx +0 -213
- package/src/atoms/composed/Tooltip/index.ts +0 -1
- package/src/atoms/composed/UserAvatar/UserAvatar.tsx +0 -139
- package/src/atoms/composed/UserAvatar/index.ts +0 -1
- package/src/atoms/composed/UserMenu/UserMenu.tsx +0 -16
- package/src/atoms/composed/UserMenu/index.ts +0 -1
- package/src/atoms/composed/index.ts +0 -29
- package/src/atoms/hooks/useApi.ts +0 -80
- package/src/atoms/hooks/useHealth.ts +0 -17
- package/src/atoms/index.ts +0 -13
- package/src/atoms/services/api/client.ts +0 -134
- package/src/atoms/services/auth-service.ts +0 -248
- package/src/atoms/services/health.ts +0 -15
- package/src/atoms/services/index.ts +0 -3
- package/src/atoms/shared/config/constants.ts +0 -17
- package/src/atoms/shared/config/dashboard-sizes.ts +0 -111
- package/src/atoms/shared/config/environment.ts +0 -10
- package/src/atoms/shared/index.ts +0 -4
- package/src/atoms/shared/styles/color-palettes.css +0 -566
- package/src/atoms/types/auth.ts +0 -62
- package/src/atoms/types/generated.ts +0 -1469
- package/src/atoms/types/index.ts +0 -4
- package/src/atoms/types/loading.ts +0 -28
- package/src/atoms/ui/Badge.tsx +0 -30
- package/src/atoms/ui/ErrorBoundary.tsx +0 -59
- package/src/atoms/ui/Select.tsx +0 -53
- package/src/atoms/ui/Switch.tsx +0 -42
- package/src/atoms/ui/Tabs.tsx +0 -118
- package/src/atoms/ui/avatar.tsx +0 -48
- package/src/atoms/ui/button.tsx +0 -70
- package/src/atoms/ui/card.tsx +0 -76
- package/src/atoms/ui/dropdown-menu.tsx +0 -199
- package/src/atoms/ui/index.ts +0 -39
- package/src/atoms/ui/input.tsx +0 -23
- package/src/atoms/ui/label.tsx +0 -23
- package/src/atoms/ui/skeleton.tsx +0 -13
- package/src/atoms/ui/spinner.tsx +0 -49
- package/src/atoms/ui/table.tsx +0 -116
- package/src/atoms/utils/animations.ts +0 -135
- package/src/atoms/utils/tooltip-helpers.ts +0 -140
- package/src/atoms/utils/utils.ts +0 -9
- package/src/features/auth/components/LoginForm.tsx +0 -168
- package/src/features/auth/components/LogoutButton.tsx +0 -19
- package/src/features/auth/components/ProtectedRoute.tsx +0 -60
- package/src/features/auth/components/index.ts +0 -4
- package/src/features/auth/hooks/index.ts +0 -2
- package/src/features/auth/hooks/useAuth.tsx +0 -205
- package/src/features/auth/hooks/usePermissions.ts +0 -35
- package/src/features/auth/index.ts +0 -2
- package/src/features/index.ts +0 -2
- package/src/index.css +0 -704
- package/src/index.ts +0 -13
- package/src/main.tsx +0 -48
- package/src/molecules/.gitkeep +0 -0
- package/src/molecules/forms/FormGroup.tsx +0 -75
- package/src/molecules/forms/SearchInput.tsx +0 -259
- package/src/molecules/forms/index.ts +0 -4
- package/src/molecules/index.ts +0 -4
- package/src/molecules/layout/AppHeader/AppHeader.tsx +0 -42
- package/src/molecules/layout/AppHeader/index.ts +0 -1
- package/src/molecules/layout/AppLayout.tsx +0 -29
- package/src/molecules/layout/PageTemplate.tsx +0 -87
- package/src/molecules/layout/SectionHeader/SectionHeader.tsx +0 -87
- package/src/molecules/layout/SectionHeader/index.ts +0 -1
- package/src/molecules/layout/ShowcaseSection.tsx +0 -57
- package/src/molecules/layout/Sidebar.tsx +0 -144
- package/src/molecules/layout/SidebarButton/SidebarButton.tsx +0 -99
- package/src/molecules/layout/SidebarButton/index.ts +0 -1
- package/src/molecules/layout/SidebarContext.tsx +0 -31
- package/src/molecules/layout/index.ts +0 -7
- package/src/molecules/navigation/NavMenu.tsx +0 -188
- package/src/molecules/navigation/Pagination.tsx +0 -172
- package/src/molecules/navigation/index.ts +0 -4
- package/src/organisms/index.ts +0 -5
- package/src/organisms/showcase/ComponentShowcasePage.tsx +0 -2496
- package/src/organisms/showcase/index.ts +0 -1
- package/src/pages/AdminShowcase/AdminCRUDShowcase.tsx +0 -242
- package/src/pages/AdminShowcase/AdminDashboardShowcase.tsx +0 -171
- package/src/pages/AdminShowcase/AdminDetailShowcase.tsx +0 -385
- package/src/pages/AdminShowcase/index.tsx +0 -3
- package/src/pages/ComponentShowcase/BadgesShowcase.tsx +0 -188
- package/src/pages/ComponentShowcase/CardsShowcase.tsx +0 -392
- package/src/pages/ComponentShowcase/PalettesShowcase.tsx +0 -207
- package/src/pages/ComponentShowcase/StatesShowcase.tsx +0 -485
- package/src/pages/ComponentShowcase/TablesShowcase.tsx +0 -134
- package/src/pages/ComponentShowcase/TypographyShowcase.tsx +0 -255
- package/src/pages/ComponentShowcase/index.tsx +0 -188
- package/src/pages/index.ts +0 -2
- package/src/templates/AuthTemplate.tsx +0 -216
- package/src/templates/ComponentShowcaseTemplate.tsx +0 -173
- package/src/templates/DashboardTemplate.tsx +0 -232
- package/src/templates/DataTemplate.tsx +0 -319
- package/src/templates/admin/AdminCRUDTemplate.tsx +0 -630
- package/src/templates/admin/AdminDashboardTemplate.tsx +0 -351
- package/src/templates/admin/AdminDetailTemplate.tsx +0 -563
- package/src/templates/admin/index.ts +0 -29
- package/src/templates/factory.tsx +0 -169
- package/src/templates/index.ts +0 -37
- package/src/vite-env.d.ts +0 -1
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
|
|
3
|
-
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from '../utils/utils'
|
|
6
|
-
|
|
7
|
-
const DropdownMenu = DropdownMenuPrimitive.Root
|
|
8
|
-
|
|
9
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
|
|
10
|
-
|
|
11
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group
|
|
12
|
-
|
|
13
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal
|
|
14
|
-
|
|
15
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub
|
|
16
|
-
|
|
17
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
|
|
18
|
-
|
|
19
|
-
const DropdownMenuSubTrigger = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
-
inset?: boolean
|
|
23
|
-
}
|
|
24
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
25
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
29
|
-
inset && "pl-8",
|
|
30
|
-
className
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
<ChevronRight className="ml-auto h-4 w-4" />
|
|
36
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
37
|
-
))
|
|
38
|
-
DropdownMenuSubTrigger.displayName =
|
|
39
|
-
DropdownMenuPrimitive.SubTrigger.displayName
|
|
40
|
-
|
|
41
|
-
const DropdownMenuSubContent = React.forwardRef<
|
|
42
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
43
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
44
|
-
>(({ className, ...props }, ref) => (
|
|
45
|
-
<DropdownMenuPrimitive.SubContent
|
|
46
|
-
ref={ref}
|
|
47
|
-
className={cn(
|
|
48
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
49
|
-
className
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
))
|
|
54
|
-
DropdownMenuSubContent.displayName =
|
|
55
|
-
DropdownMenuPrimitive.SubContent.displayName
|
|
56
|
-
|
|
57
|
-
const DropdownMenuContent = React.forwardRef<
|
|
58
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
59
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
60
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
61
|
-
<DropdownMenuPrimitive.Portal>
|
|
62
|
-
<DropdownMenuPrimitive.Content
|
|
63
|
-
ref={ref}
|
|
64
|
-
sideOffset={sideOffset}
|
|
65
|
-
className={cn(
|
|
66
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
|
|
67
|
-
"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",
|
|
68
|
-
className
|
|
69
|
-
)}
|
|
70
|
-
{...props}
|
|
71
|
-
/>
|
|
72
|
-
</DropdownMenuPrimitive.Portal>
|
|
73
|
-
))
|
|
74
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
|
|
75
|
-
|
|
76
|
-
const DropdownMenuItem = React.forwardRef<
|
|
77
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
78
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
79
|
-
inset?: boolean
|
|
80
|
-
}
|
|
81
|
-
>(({ className, inset, ...props }, ref) => (
|
|
82
|
-
<DropdownMenuPrimitive.Item
|
|
83
|
-
ref={ref}
|
|
84
|
-
className={cn(
|
|
85
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
86
|
-
inset && "pl-8",
|
|
87
|
-
className
|
|
88
|
-
)}
|
|
89
|
-
{...props}
|
|
90
|
-
/>
|
|
91
|
-
))
|
|
92
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
|
|
93
|
-
|
|
94
|
-
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
95
|
-
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
96
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
97
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
98
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
99
|
-
ref={ref}
|
|
100
|
-
className={cn(
|
|
101
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
102
|
-
className
|
|
103
|
-
)}
|
|
104
|
-
checked={checked}
|
|
105
|
-
{...props}
|
|
106
|
-
>
|
|
107
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
108
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
109
|
-
<Check className="h-4 w-4" />
|
|
110
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
111
|
-
</span>
|
|
112
|
-
{children}
|
|
113
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
114
|
-
))
|
|
115
|
-
DropdownMenuCheckboxItem.displayName =
|
|
116
|
-
DropdownMenuPrimitive.CheckboxItem.displayName
|
|
117
|
-
|
|
118
|
-
const DropdownMenuRadioItem = React.forwardRef<
|
|
119
|
-
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
120
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
121
|
-
>(({ className, children, ...props }, ref) => (
|
|
122
|
-
<DropdownMenuPrimitive.RadioItem
|
|
123
|
-
ref={ref}
|
|
124
|
-
className={cn(
|
|
125
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
126
|
-
className
|
|
127
|
-
)}
|
|
128
|
-
{...props}
|
|
129
|
-
>
|
|
130
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
131
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
132
|
-
<Circle className="h-2 w-2 fill-current" />
|
|
133
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
134
|
-
</span>
|
|
135
|
-
{children}
|
|
136
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
137
|
-
))
|
|
138
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
|
|
139
|
-
|
|
140
|
-
const DropdownMenuLabel = React.forwardRef<
|
|
141
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
142
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
143
|
-
inset?: boolean
|
|
144
|
-
}
|
|
145
|
-
>(({ className, inset, ...props }, ref) => (
|
|
146
|
-
<DropdownMenuPrimitive.Label
|
|
147
|
-
ref={ref}
|
|
148
|
-
className={cn(
|
|
149
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
150
|
-
inset && "pl-8",
|
|
151
|
-
className
|
|
152
|
-
)}
|
|
153
|
-
{...props}
|
|
154
|
-
/>
|
|
155
|
-
))
|
|
156
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
|
|
157
|
-
|
|
158
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
159
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
160
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
161
|
-
>(({ className, ...props }, ref) => (
|
|
162
|
-
<DropdownMenuPrimitive.Separator
|
|
163
|
-
ref={ref}
|
|
164
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
165
|
-
{...props}
|
|
166
|
-
/>
|
|
167
|
-
))
|
|
168
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
|
|
169
|
-
|
|
170
|
-
const DropdownMenuShortcut = ({
|
|
171
|
-
className,
|
|
172
|
-
...props
|
|
173
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
174
|
-
return (
|
|
175
|
-
<span
|
|
176
|
-
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
177
|
-
{...props}
|
|
178
|
-
/>
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
|
|
182
|
-
|
|
183
|
-
export {
|
|
184
|
-
DropdownMenu,
|
|
185
|
-
DropdownMenuTrigger,
|
|
186
|
-
DropdownMenuContent,
|
|
187
|
-
DropdownMenuItem,
|
|
188
|
-
DropdownMenuCheckboxItem,
|
|
189
|
-
DropdownMenuRadioItem,
|
|
190
|
-
DropdownMenuLabel,
|
|
191
|
-
DropdownMenuSeparator,
|
|
192
|
-
DropdownMenuShortcut,
|
|
193
|
-
DropdownMenuGroup,
|
|
194
|
-
DropdownMenuPortal,
|
|
195
|
-
DropdownMenuSub,
|
|
196
|
-
DropdownMenuSubContent,
|
|
197
|
-
DropdownMenuSubTrigger,
|
|
198
|
-
DropdownMenuRadioGroup,
|
|
199
|
-
}
|
package/src/atoms/ui/index.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Export shared UI components here
|
|
2
|
-
export { ErrorBoundary } from './ErrorBoundary';
|
|
3
|
-
|
|
4
|
-
// Export ShadCN UI components (local)
|
|
5
|
-
export { Button } from './button';
|
|
6
|
-
export { Card, CardContent, CardDescription, CardHeader, CardTitle, CardFooter } from './card';
|
|
7
|
-
export { Input } from './input';
|
|
8
|
-
export { Label } from './label';
|
|
9
|
-
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, TableFooter } from './table';
|
|
10
|
-
|
|
11
|
-
// Export custom components
|
|
12
|
-
export { Badge } from './Badge';
|
|
13
|
-
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select';
|
|
14
|
-
export { Switch } from './Switch';
|
|
15
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger } from './Tabs';
|
|
16
|
-
export { Avatar, AvatarImage, AvatarFallback } from './avatar';
|
|
17
|
-
export {
|
|
18
|
-
DropdownMenu,
|
|
19
|
-
DropdownMenuTrigger,
|
|
20
|
-
DropdownMenuContent,
|
|
21
|
-
DropdownMenuItem,
|
|
22
|
-
DropdownMenuCheckboxItem,
|
|
23
|
-
DropdownMenuRadioItem,
|
|
24
|
-
DropdownMenuLabel,
|
|
25
|
-
DropdownMenuSeparator,
|
|
26
|
-
DropdownMenuShortcut,
|
|
27
|
-
DropdownMenuGroup,
|
|
28
|
-
DropdownMenuPortal,
|
|
29
|
-
DropdownMenuSub,
|
|
30
|
-
DropdownMenuSubContent,
|
|
31
|
-
DropdownMenuSubTrigger,
|
|
32
|
-
DropdownMenuRadioGroup
|
|
33
|
-
} from './dropdown-menu';
|
|
34
|
-
|
|
35
|
-
// Export skeleton component
|
|
36
|
-
export { Skeleton } from './skeleton';
|
|
37
|
-
|
|
38
|
-
// Export loading components
|
|
39
|
-
export { Spinner, Loading } from './spinner';
|
package/src/atoms/ui/input.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cn } from '../utils/utils'
|
|
3
|
-
|
|
4
|
-
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>
|
|
5
|
-
|
|
6
|
-
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
7
|
-
({ className, type, ...props }, ref) => {
|
|
8
|
-
return (
|
|
9
|
-
<input
|
|
10
|
-
type={type}
|
|
11
|
-
className={cn(
|
|
12
|
-
"flex h-10 w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/20 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 transition-all",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
ref={ref}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
)
|
|
21
|
-
Input.displayName = "Input"
|
|
22
|
-
|
|
23
|
-
export { Input }
|
package/src/atoms/ui/label.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
-
import { cn } from '../utils/utils'
|
|
5
|
-
|
|
6
|
-
const labelVariants = cva(
|
|
7
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
const Label = React.forwardRef<
|
|
11
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
12
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
|
13
|
-
VariantProps<typeof labelVariants>
|
|
14
|
-
>(({ className, ...props }, ref) => (
|
|
15
|
-
<LabelPrimitive.Root
|
|
16
|
-
ref={ref}
|
|
17
|
-
className={cn(labelVariants(), className)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
))
|
|
21
|
-
Label.displayName = LabelPrimitive.Root.displayName
|
|
22
|
-
|
|
23
|
-
export { Label }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { cn } from '../utils/utils'
|
|
2
|
-
|
|
3
|
-
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
4
|
-
return (
|
|
5
|
-
<div
|
|
6
|
-
data-slot="skeleton"
|
|
7
|
-
className={cn("bg-accent animate-pulse rounded-md", className)}
|
|
8
|
-
{...props}
|
|
9
|
-
/>
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { Skeleton }
|
package/src/atoms/ui/spinner.tsx
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { cn } from '../utils/utils';
|
|
3
|
-
import { Loader2 } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
interface SpinnerProps {
|
|
6
|
-
size?: 'sm' | 'md' | 'lg';
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const sizeMap = {
|
|
11
|
-
sm: 'w-4 h-4',
|
|
12
|
-
md: 'w-6 h-6',
|
|
13
|
-
lg: 'w-8 h-8'
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const Spinner: React.FC<SpinnerProps> = ({
|
|
17
|
-
size = 'md',
|
|
18
|
-
className
|
|
19
|
-
}) => {
|
|
20
|
-
return (
|
|
21
|
-
<Loader2
|
|
22
|
-
className={cn(
|
|
23
|
-
'animate-spin text-muted-foreground',
|
|
24
|
-
sizeMap[size],
|
|
25
|
-
className
|
|
26
|
-
)}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Alternative loading component for inline use
|
|
32
|
-
interface LoadingProps {
|
|
33
|
-
text?: string;
|
|
34
|
-
size?: 'sm' | 'md' | 'lg';
|
|
35
|
-
className?: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const Loading: React.FC<LoadingProps> = ({
|
|
39
|
-
text = 'Loading...',
|
|
40
|
-
size = 'md',
|
|
41
|
-
className
|
|
42
|
-
}) => {
|
|
43
|
-
return (
|
|
44
|
-
<div className={cn('flex items-center gap-2 text-muted-foreground', className)}>
|
|
45
|
-
<Spinner size={size} />
|
|
46
|
-
<span className="text-sm">{text}</span>
|
|
47
|
-
</div>
|
|
48
|
-
);
|
|
49
|
-
};
|
package/src/atoms/ui/table.tsx
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cn } from '../utils/utils'
|
|
3
|
-
|
|
4
|
-
const Table = React.forwardRef<
|
|
5
|
-
HTMLTableElement,
|
|
6
|
-
React.HTMLAttributes<HTMLTableElement>
|
|
7
|
-
>(({ className, ...props }, ref) => (
|
|
8
|
-
<div className="relative w-full overflow-auto">
|
|
9
|
-
<table
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn("w-full caption-bottom text-sm", className)}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
))
|
|
16
|
-
Table.displayName = "Table"
|
|
17
|
-
|
|
18
|
-
const TableHeader = React.forwardRef<
|
|
19
|
-
HTMLTableSectionElement,
|
|
20
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
21
|
-
>(({ className, ...props }, ref) => (
|
|
22
|
-
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
|
|
23
|
-
))
|
|
24
|
-
TableHeader.displayName = "TableHeader"
|
|
25
|
-
|
|
26
|
-
const TableBody = React.forwardRef<
|
|
27
|
-
HTMLTableSectionElement,
|
|
28
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
29
|
-
>(({ className, ...props }, ref) => (
|
|
30
|
-
<tbody
|
|
31
|
-
ref={ref}
|
|
32
|
-
className={cn("[&_tr:last-child]:border-0", className)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
))
|
|
36
|
-
TableBody.displayName = "TableBody"
|
|
37
|
-
|
|
38
|
-
const TableFooter = React.forwardRef<
|
|
39
|
-
HTMLTableSectionElement,
|
|
40
|
-
React.HTMLAttributes<HTMLTableSectionElement>
|
|
41
|
-
>(({ className, ...props }, ref) => (
|
|
42
|
-
<tfoot
|
|
43
|
-
ref={ref}
|
|
44
|
-
className={cn(
|
|
45
|
-
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
))
|
|
51
|
-
TableFooter.displayName = "TableFooter"
|
|
52
|
-
|
|
53
|
-
const TableRow = React.forwardRef<
|
|
54
|
-
HTMLTableRowElement,
|
|
55
|
-
React.HTMLAttributes<HTMLTableRowElement>
|
|
56
|
-
>(({ className, ...props }, ref) => (
|
|
57
|
-
<tr
|
|
58
|
-
ref={ref}
|
|
59
|
-
className={cn(
|
|
60
|
-
"border-b border-gray-100 transition-all duration-150 hover:bg-gray-50/50 data-[state=selected]:bg-gray-100",
|
|
61
|
-
className
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
))
|
|
66
|
-
TableRow.displayName = "TableRow"
|
|
67
|
-
|
|
68
|
-
const TableHead = React.forwardRef<
|
|
69
|
-
HTMLTableCellElement,
|
|
70
|
-
React.ThHTMLAttributes<HTMLTableCellElement>
|
|
71
|
-
>(({ className, ...props }, ref) => (
|
|
72
|
-
<th
|
|
73
|
-
ref={ref}
|
|
74
|
-
className={cn(
|
|
75
|
-
"h-12 px-4 text-left align-middle font-semibold text-gray-700 text-xs uppercase tracking-wider [&:has([role=checkbox])]:pr-0",
|
|
76
|
-
className
|
|
77
|
-
)}
|
|
78
|
-
{...props}
|
|
79
|
-
/>
|
|
80
|
-
))
|
|
81
|
-
TableHead.displayName = "TableHead"
|
|
82
|
-
|
|
83
|
-
const TableCell = React.forwardRef<
|
|
84
|
-
HTMLTableCellElement,
|
|
85
|
-
React.TdHTMLAttributes<HTMLTableCellElement>
|
|
86
|
-
>(({ className, ...props }, ref) => (
|
|
87
|
-
<td
|
|
88
|
-
ref={ref}
|
|
89
|
-
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
|
|
90
|
-
{...props}
|
|
91
|
-
/>
|
|
92
|
-
))
|
|
93
|
-
TableCell.displayName = "TableCell"
|
|
94
|
-
|
|
95
|
-
const TableCaption = React.forwardRef<
|
|
96
|
-
HTMLTableCaptionElement,
|
|
97
|
-
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
98
|
-
>(({ className, ...props }, ref) => (
|
|
99
|
-
<caption
|
|
100
|
-
ref={ref}
|
|
101
|
-
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
102
|
-
{...props}
|
|
103
|
-
/>
|
|
104
|
-
))
|
|
105
|
-
TableCaption.displayName = "TableCaption"
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
Table,
|
|
109
|
-
TableHeader,
|
|
110
|
-
TableBody,
|
|
111
|
-
TableFooter,
|
|
112
|
-
TableHead,
|
|
113
|
-
TableRow,
|
|
114
|
-
TableCell,
|
|
115
|
-
TableCaption,
|
|
116
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Centralized animation variants system for consistent interactions across components.
|
|
5
|
-
*
|
|
6
|
-
* Based on analysis of successful patterns:
|
|
7
|
-
* - DataBadge: scale + shadow effects work well (tactile feel)
|
|
8
|
-
* - Tab hover: needs consistency in timing
|
|
9
|
-
* - Overall: standardize timing and easing
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export const interactionVariants = cva(
|
|
13
|
-
// Base transition classes applied to all interactive elements
|
|
14
|
-
'transition-all ease-out',
|
|
15
|
-
{
|
|
16
|
-
variants: {
|
|
17
|
-
/**
|
|
18
|
-
* Animation type based on component purpose and successful patterns
|
|
19
|
-
*/
|
|
20
|
-
type: {
|
|
21
|
-
/**
|
|
22
|
-
* Subtle: minimal hover effects for navigation elements
|
|
23
|
-
* Used for: secondary buttons, nav links, subtle interactive elements
|
|
24
|
-
*/
|
|
25
|
-
subtle: 'duration-200 hover:bg-accent/50 hover:text-accent-foreground',
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Tactile: badges, chips with satisfying scale + shadow feedback
|
|
29
|
-
* Used for: DataBadge, chips, small interactive elements
|
|
30
|
-
* PRESERVE: This pattern works well and should be maintained
|
|
31
|
-
*/
|
|
32
|
-
tactile: 'duration-200 hover:scale-105 active:scale-95 shadow hover:shadow-md',
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Card: cards and major content blocks with elevation
|
|
36
|
-
* Used for: content cards, major clickable areas
|
|
37
|
-
*/
|
|
38
|
-
card: 'duration-300 hover:shadow-lg hover:-translate-y-0.5',
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Button: primary actions with clear feedback
|
|
42
|
-
* Used for: primary buttons, call-to-action elements
|
|
43
|
-
*/
|
|
44
|
-
button: 'duration-200 hover:scale-[1.02] active:scale-[0.98] hover:shadow-md',
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Tab: header navigation tabs with tactile feedback
|
|
48
|
-
* UPDATED: Removed scale and border changes to prevent layout jitter
|
|
49
|
-
*/
|
|
50
|
-
tab: 'duration-200 hover:shadow-sm hover:bg-accent/30',
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Size affects the scale intensity for different component sizes
|
|
55
|
-
*/
|
|
56
|
-
size: {
|
|
57
|
-
sm: '', // Default scaling
|
|
58
|
-
md: '', // Default scaling
|
|
59
|
-
lg: 'hover:scale-[1.03] active:scale-[0.97]', // Reduced scaling for larger elements
|
|
60
|
-
xl: 'hover:scale-[1.02] active:scale-[0.98]', // Minimal scaling for very large elements
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Timing variants for special cases
|
|
65
|
-
*/
|
|
66
|
-
timing: {
|
|
67
|
-
instant: 'duration-100',
|
|
68
|
-
fast: 'duration-150',
|
|
69
|
-
normal: 'duration-200',
|
|
70
|
-
slow: 'duration-300',
|
|
71
|
-
slower: 'duration-500',
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Disable animations for accessibility or performance
|
|
76
|
-
*/
|
|
77
|
-
disabled: {
|
|
78
|
-
true: 'transition-none',
|
|
79
|
-
false: '',
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
defaultVariants: {
|
|
83
|
-
type: 'subtle',
|
|
84
|
-
size: 'md',
|
|
85
|
-
timing: 'normal',
|
|
86
|
-
disabled: false,
|
|
87
|
-
},
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
export type InteractionVariants = VariantProps<typeof interactionVariants>;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Helper function to get animation classes
|
|
95
|
-
* @param variants - Animation variant configuration
|
|
96
|
-
* @returns Tailwind classes for the animation
|
|
97
|
-
*/
|
|
98
|
-
export const getAnimationClasses = (variants?: InteractionVariants) => {
|
|
99
|
-
return interactionVariants(variants);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Predefined animation configurations for common use cases
|
|
104
|
-
*/
|
|
105
|
-
export const animationPresets = {
|
|
106
|
-
// Preserve successful DataBadge pattern
|
|
107
|
-
dataBadge: { type: 'tactile' as const, timing: 'normal' as const },
|
|
108
|
-
|
|
109
|
-
// Improved tab pattern to match tactile feel
|
|
110
|
-
tab: { type: 'tab' as const, timing: 'normal' as const },
|
|
111
|
-
|
|
112
|
-
// Other common patterns
|
|
113
|
-
button: { type: 'button' as const, timing: 'normal' as const },
|
|
114
|
-
card: { type: 'card' as const, timing: 'slow' as const },
|
|
115
|
-
subtle: { type: 'subtle' as const, timing: 'normal' as const },
|
|
116
|
-
|
|
117
|
-
// Size-specific presets
|
|
118
|
-
smallTactile: { type: 'tactile' as const, size: 'sm' as const },
|
|
119
|
-
largeTactile: { type: 'tactile' as const, size: 'lg' as const },
|
|
120
|
-
} as const;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Legacy class combinations for migration reference
|
|
124
|
-
* These can be replaced with the new animation system
|
|
125
|
-
*/
|
|
126
|
-
export const legacyPatterns = {
|
|
127
|
-
// Current DataBadge: 'hover:scale-105 active:scale-95 shadow hover:shadow'
|
|
128
|
-
dataBadgeLegacy: 'transition-all hover:scale-105 active:scale-95 shadow hover:shadow',
|
|
129
|
-
|
|
130
|
-
// Current TabsTrigger: 'hover:scale-105 active:scale-95 hover:shadow transition-all duration-150'
|
|
131
|
-
tabTriggerLegacy: 'transition-all duration-150 hover:scale-105 active:scale-95 hover:shadow',
|
|
132
|
-
|
|
133
|
-
// Current TabsList: 'hover:shadow-md transition-all duration-200'
|
|
134
|
-
tabsListLegacy: 'transition-all duration-200 hover:shadow-md',
|
|
135
|
-
} as const;
|