@ancatag/at-design 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +537 -0
  2. package/dist/components/Sheet.d.ts +20 -0
  3. package/dist/components/Sheet.d.ts.map +1 -0
  4. package/dist/components/Sheet.js +26 -0
  5. package/dist/components/Sheet.js.map +1 -0
  6. package/dist/components/alert-dialog.d.ts +21 -0
  7. package/dist/components/alert-dialog.d.ts.map +1 -0
  8. package/dist/components/alert-dialog.js +27 -0
  9. package/dist/components/alert-dialog.js.map +1 -0
  10. package/dist/components/alert.d.ts +9 -0
  11. package/dist/components/alert.d.ts.map +1 -0
  12. package/dist/components/alert.js +23 -0
  13. package/dist/components/alert.js.map +1 -0
  14. package/dist/components/avatar.d.ts +7 -0
  15. package/dist/components/avatar.d.ts.map +1 -0
  16. package/dist/components/avatar.js +12 -0
  17. package/dist/components/avatar.js.map +1 -0
  18. package/dist/components/badge.d.ts +10 -0
  19. package/dist/components/badge.d.ts.map +1 -0
  20. package/dist/components/badge.js +21 -0
  21. package/dist/components/badge.js.map +1 -0
  22. package/dist/components/bottom-sheet.d.ts +16 -0
  23. package/dist/components/bottom-sheet.d.ts.map +1 -0
  24. package/dist/components/bottom-sheet.js +13 -0
  25. package/dist/components/bottom-sheet.js.map +1 -0
  26. package/dist/components/button.d.ts +12 -0
  27. package/dist/components/button.d.ts.map +1 -0
  28. package/dist/components/button.js +34 -0
  29. package/dist/components/button.js.map +1 -0
  30. package/dist/components/card.d.ts +9 -0
  31. package/dist/components/card.d.ts.map +1 -0
  32. package/dist/components/card.js +17 -0
  33. package/dist/components/card.js.map +1 -0
  34. package/dist/components/checkbox.d.ts +5 -0
  35. package/dist/components/checkbox.d.ts.map +1 -0
  36. package/dist/components/checkbox.js +10 -0
  37. package/dist/components/checkbox.js.map +1 -0
  38. package/dist/components/combobox.d.ts +19 -0
  39. package/dist/components/combobox.d.ts.map +1 -0
  40. package/dist/components/combobox.js +101 -0
  41. package/dist/components/combobox.js.map +1 -0
  42. package/dist/components/dialog.d.ts +20 -0
  43. package/dist/components/dialog.d.ts.map +1 -0
  44. package/dist/components/dialog.js +24 -0
  45. package/dist/components/dialog.js.map +1 -0
  46. package/dist/components/dropdown-menu.d.ts +28 -0
  47. package/dist/components/dropdown-menu.d.ts.map +1 -0
  48. package/dist/components/dropdown-menu.js +36 -0
  49. package/dist/components/dropdown-menu.js.map +1 -0
  50. package/dist/components/error-page.d.ts +105 -0
  51. package/dist/components/error-page.d.ts.map +1 -0
  52. package/dist/components/error-page.js +99 -0
  53. package/dist/components/error-page.js.map +1 -0
  54. package/dist/components/glass-card.d.ts +12 -0
  55. package/dist/components/glass-card.d.ts.map +1 -0
  56. package/dist/components/glass-card.js +15 -0
  57. package/dist/components/glass-card.js.map +1 -0
  58. package/dist/components/icon-badge.d.ts +15 -0
  59. package/dist/components/icon-badge.d.ts.map +1 -0
  60. package/dist/components/icon-badge.js +77 -0
  61. package/dist/components/icon-badge.js.map +1 -0
  62. package/dist/components/input.d.ts +6 -0
  63. package/dist/components/input.d.ts.map +1 -0
  64. package/dist/components/input.js +9 -0
  65. package/dist/components/input.js.map +1 -0
  66. package/dist/components/label.d.ts +6 -0
  67. package/dist/components/label.d.ts.map +1 -0
  68. package/dist/components/label.js +11 -0
  69. package/dist/components/label.js.map +1 -0
  70. package/dist/components/progress.d.ts +5 -0
  71. package/dist/components/progress.d.ts.map +1 -0
  72. package/dist/components/progress.js +9 -0
  73. package/dist/components/progress.js.map +1 -0
  74. package/dist/components/radio-group.d.ts +6 -0
  75. package/dist/components/radio-group.d.ts.map +1 -0
  76. package/dist/components/radio-group.js +15 -0
  77. package/dist/components/radio-group.js.map +1 -0
  78. package/dist/components/responsive-table.d.ts +21 -0
  79. package/dist/components/responsive-table.d.ts.map +1 -0
  80. package/dist/components/responsive-table.js +48 -0
  81. package/dist/components/responsive-table.js.map +1 -0
  82. package/dist/components/select.d.ts +14 -0
  83. package/dist/components/select.d.ts.map +1 -0
  84. package/dist/components/select.js +27 -0
  85. package/dist/components/select.js.map +1 -0
  86. package/dist/components/skeleton.d.ts +3 -0
  87. package/dist/components/skeleton.d.ts.map +1 -0
  88. package/dist/components/skeleton.js +7 -0
  89. package/dist/components/skeleton.js.map +1 -0
  90. package/dist/components/slider.d.ts +5 -0
  91. package/dist/components/slider.d.ts.map +1 -0
  92. package/dist/components/slider.js +9 -0
  93. package/dist/components/slider.js.map +1 -0
  94. package/dist/components/stat-card.d.ts +17 -0
  95. package/dist/components/stat-card.d.ts.map +1 -0
  96. package/dist/components/stat-card.js +23 -0
  97. package/dist/components/stat-card.js.map +1 -0
  98. package/dist/components/switch.d.ts +5 -0
  99. package/dist/components/switch.d.ts.map +1 -0
  100. package/dist/components/switch.js +9 -0
  101. package/dist/components/switch.js.map +1 -0
  102. package/dist/components/table.d.ts +11 -0
  103. package/dist/components/table.d.ts.map +1 -0
  104. package/dist/components/table.js +21 -0
  105. package/dist/components/table.js.map +1 -0
  106. package/dist/components/tabs.d.ts +8 -0
  107. package/dist/components/tabs.d.ts.map +1 -0
  108. package/dist/components/tabs.js +14 -0
  109. package/dist/components/tabs.js.map +1 -0
  110. package/dist/components/textarea.d.ts +6 -0
  111. package/dist/components/textarea.d.ts.map +1 -0
  112. package/dist/components/textarea.js +9 -0
  113. package/dist/components/textarea.js.map +1 -0
  114. package/dist/components/toast.d.ts +6 -0
  115. package/dist/components/toast.d.ts.map +1 -0
  116. package/dist/components/toast.js +14 -0
  117. package/dist/components/toast.js.map +1 -0
  118. package/dist/components/tooltip.d.ts +8 -0
  119. package/dist/components/tooltip.d.ts.map +1 -0
  120. package/dist/components/tooltip.js +12 -0
  121. package/dist/components/tooltip.js.map +1 -0
  122. package/dist/index.d.ts +32 -0
  123. package/dist/index.d.ts.map +1 -0
  124. package/dist/index.js +40 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/utils/cn.d.ts +3 -0
  127. package/dist/utils/cn.d.ts.map +1 -0
  128. package/dist/utils/cn.js +6 -0
  129. package/dist/utils/cn.js.map +1 -0
  130. package/package.json +96 -0
  131. package/src/components/Sheet.tsx +117 -0
  132. package/src/components/alert-dialog.tsx +138 -0
  133. package/src/components/alert.tsx +58 -0
  134. package/src/components/avatar.tsx +48 -0
  135. package/src/components/badge.tsx +36 -0
  136. package/src/components/bottom-sheet.tsx +68 -0
  137. package/src/components/button.tsx +56 -0
  138. package/src/components/card.tsx +85 -0
  139. package/src/components/checkbox.tsx +30 -0
  140. package/src/components/combobox.tsx +246 -0
  141. package/src/components/dialog.tsx +122 -0
  142. package/src/components/dropdown-menu.tsx +198 -0
  143. package/src/components/error-page.tsx +368 -0
  144. package/src/components/glass-card.tsx +37 -0
  145. package/src/components/icon-badge.tsx +126 -0
  146. package/src/components/input.tsx +25 -0
  147. package/src/components/label.tsx +26 -0
  148. package/src/components/progress.tsx +28 -0
  149. package/src/components/radio-group.tsx +42 -0
  150. package/src/components/responsive-table.tsx +191 -0
  151. package/src/components/select.tsx +158 -0
  152. package/src/components/skeleton.tsx +15 -0
  153. package/src/components/slider.tsx +27 -0
  154. package/src/components/stat-card.tsx +69 -0
  155. package/src/components/switch.tsx +29 -0
  156. package/src/components/table.tsx +117 -0
  157. package/src/components/tabs.tsx +55 -0
  158. package/src/components/textarea.tsx +23 -0
  159. package/src/components/toast.tsx +26 -0
  160. package/src/components/tooltip.tsx +34 -0
  161. package/src/index.ts +136 -0
  162. package/src/styles/animations.css +55 -0
  163. package/src/styles/base.css +51 -0
  164. package/src/styles/tokens.css +37 -0
  165. package/src/utils/cn.ts +6 -0
  166. package/tsconfig.json +22 -0
@@ -0,0 +1,117 @@
1
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
2
+ import * as React from "react";
3
+
4
+ import { cn } from "../utils/cn";
5
+
6
+ const Sheet = SheetPrimitive.Root;
7
+
8
+ const SheetTrigger = SheetPrimitive.Trigger;
9
+
10
+ const SheetClose = SheetPrimitive.Close;
11
+
12
+ const SheetPortal = SheetPrimitive.Portal;
13
+
14
+ const SheetOverlay = React.forwardRef<
15
+ React.ElementRef<typeof SheetPrimitive.Overlay>,
16
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
17
+ >(({ className, ...props }, ref) => (
18
+ <SheetPrimitive.Overlay
19
+ ref={ref}
20
+ className={cn(
21
+ "fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
22
+ className,
23
+ )}
24
+ {...props}
25
+ />
26
+ ));
27
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
28
+
29
+ const SheetContent = React.forwardRef<
30
+ React.ElementRef<typeof SheetPrimitive.Content>,
31
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & {
32
+ side?: "left" | "right" | "top" | "bottom";
33
+ }
34
+ >(({ side = "left", className, children, ...props }, ref) => (
35
+ <SheetPortal>
36
+ <SheetOverlay />
37
+ <SheetPrimitive.Content
38
+ ref={ref}
39
+ className={cn(
40
+ "fixed z-50 gap-4 bg-card p-6 shadow-lg transition ease-out data-[state=open]:animate-in data-[state=closed]:animate-out",
41
+ side === "left" &&
42
+ "inset-y-0 left-0 w-80 data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left border-r border-border",
43
+ side === "right" &&
44
+ "inset-y-0 right-0 w-80 data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right border-l border-border",
45
+ side === "top" &&
46
+ "inset-x-0 top-0 h-1/3 data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top border-b border-border",
47
+ side === "bottom" &&
48
+ "inset-x-0 bottom-0 h-1/3 data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom border-t border-border",
49
+ className,
50
+ )}
51
+ {...props}
52
+ >
53
+ {children}
54
+ </SheetPrimitive.Content>
55
+ </SheetPortal>
56
+ ));
57
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
58
+
59
+ const SheetHeader = ({
60
+ className,
61
+ ...props
62
+ }: React.HTMLAttributes<HTMLDivElement>) => (
63
+ <div
64
+ className={cn("flex flex-col space-y-2 text-left", className)}
65
+ {...props}
66
+ />
67
+ );
68
+ SheetHeader.displayName = "SheetHeader";
69
+
70
+ const SheetFooter = ({
71
+ className,
72
+ ...props
73
+ }: React.HTMLAttributes<HTMLDivElement>) => (
74
+ <div
75
+ className={cn(
76
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
77
+ className,
78
+ )}
79
+ {...props}
80
+ />
81
+ );
82
+ SheetFooter.displayName = "SheetFooter";
83
+
84
+ const SheetTitle = React.forwardRef<
85
+ React.ElementRef<typeof SheetPrimitive.Title>,
86
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>
87
+ >(({ className, ...props }, ref) => (
88
+ <SheetPrimitive.Title
89
+ ref={ref}
90
+ className={cn("text-lg font-semibold text-foreground", className)}
91
+ {...props}
92
+ />
93
+ ));
94
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
95
+
96
+ const SheetDescription = React.forwardRef<
97
+ React.ElementRef<typeof SheetPrimitive.Description>,
98
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>
99
+ >(({ className, ...props }, ref) => (
100
+ <SheetPrimitive.Description
101
+ ref={ref}
102
+ className={cn("text-sm text-muted-foreground", className)}
103
+ {...props}
104
+ />
105
+ ));
106
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
107
+
108
+ export {
109
+ Sheet,
110
+ SheetTrigger,
111
+ SheetClose,
112
+ SheetContent,
113
+ SheetHeader,
114
+ SheetFooter,
115
+ SheetTitle,
116
+ SheetDescription,
117
+ };
@@ -0,0 +1,138 @@
1
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
2
+ import * as React from "react";
3
+ import { cn } from "../utils/cn";
4
+ import { buttonVariants } from "./button";
5
+
6
+ const AlertDialog = AlertDialogPrimitive.Root;
7
+
8
+ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
9
+
10
+ const AlertDialogPortal = AlertDialogPrimitive.Portal;
11
+
12
+ const AlertDialogOverlay = React.forwardRef<
13
+ React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
14
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
15
+ >(({ className, ...props }, ref) => (
16
+ <AlertDialogPrimitive.Overlay
17
+ className={cn(
18
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
19
+ className,
20
+ )}
21
+ {...props}
22
+ ref={ref}
23
+ />
24
+ ));
25
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
26
+
27
+ const AlertDialogContent = React.forwardRef<
28
+ React.ElementRef<typeof AlertDialogPrimitive.Content>,
29
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
30
+ >(({ className, ...props }, ref) => (
31
+ <AlertDialogPortal>
32
+ <AlertDialogOverlay />
33
+ <AlertDialogPrimitive.Content
34
+ ref={ref}
35
+ className={cn(
36
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
37
+ className,
38
+ )}
39
+ {...props}
40
+ />
41
+ </AlertDialogPortal>
42
+ ));
43
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
44
+
45
+ const AlertDialogHeader = ({
46
+ className,
47
+ ...props
48
+ }: React.HTMLAttributes<HTMLDivElement>) => (
49
+ <div
50
+ className={cn(
51
+ "flex flex-col space-y-2 text-center sm:text-left",
52
+ className,
53
+ )}
54
+ {...props}
55
+ />
56
+ );
57
+ AlertDialogHeader.displayName = "AlertDialogHeader";
58
+
59
+ const AlertDialogFooter = ({
60
+ className,
61
+ ...props
62
+ }: React.HTMLAttributes<HTMLDivElement>) => (
63
+ <div
64
+ className={cn(
65
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
66
+ className,
67
+ )}
68
+ {...props}
69
+ />
70
+ );
71
+ AlertDialogFooter.displayName = "AlertDialogFooter";
72
+
73
+ const AlertDialogTitle = React.forwardRef<
74
+ React.ElementRef<typeof AlertDialogPrimitive.Title>,
75
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
76
+ >(({ className, ...props }, ref) => (
77
+ <AlertDialogPrimitive.Title
78
+ ref={ref}
79
+ className={cn("text-lg font-semibold", className)}
80
+ {...props}
81
+ />
82
+ ));
83
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
84
+
85
+ const AlertDialogDescription = React.forwardRef<
86
+ React.ElementRef<typeof AlertDialogPrimitive.Description>,
87
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
88
+ >(({ className, ...props }, ref) => (
89
+ <AlertDialogPrimitive.Description
90
+ ref={ref}
91
+ className={cn("text-sm text-muted-foreground", className)}
92
+ {...props}
93
+ />
94
+ ));
95
+ AlertDialogDescription.displayName =
96
+ AlertDialogPrimitive.Description.displayName;
97
+
98
+ const AlertDialogAction = React.forwardRef<
99
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
100
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
101
+ >(({ className, ...props }, ref) => (
102
+ <AlertDialogPrimitive.Action
103
+ ref={ref}
104
+ className={cn(buttonVariants(), className)}
105
+ {...props}
106
+ />
107
+ ));
108
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
109
+
110
+ const AlertDialogCancel = React.forwardRef<
111
+ React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
112
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
113
+ >(({ className, ...props }, ref) => (
114
+ <AlertDialogPrimitive.Cancel
115
+ ref={ref}
116
+ className={cn(
117
+ buttonVariants({ variant: "outline" }),
118
+ "mt-2 sm:mt-0",
119
+ className,
120
+ )}
121
+ {...props}
122
+ />
123
+ ));
124
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
125
+
126
+ export {
127
+ AlertDialog,
128
+ AlertDialogPortal,
129
+ AlertDialogOverlay,
130
+ AlertDialogTrigger,
131
+ AlertDialogContent,
132
+ AlertDialogHeader,
133
+ AlertDialogFooter,
134
+ AlertDialogTitle,
135
+ AlertDialogDescription,
136
+ AlertDialogAction,
137
+ AlertDialogCancel,
138
+ };
@@ -0,0 +1,58 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ import { cn } from "../utils/cn";
4
+
5
+ const alertVariants = cva(
6
+ "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-background text-foreground",
11
+ destructive:
12
+ "border-destructive text-destructive [&>svg]:text-destructive",
13
+ },
14
+ },
15
+ defaultVariants: {
16
+ variant: "default",
17
+ },
18
+ },
19
+ );
20
+
21
+ const Alert = React.forwardRef<
22
+ HTMLDivElement,
23
+ React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
24
+ >(({ className, variant, ...props }, ref) => (
25
+ <div
26
+ ref={ref}
27
+ role="alert"
28
+ className={cn(alertVariants({ variant }), className)}
29
+ {...props}
30
+ />
31
+ ));
32
+ Alert.displayName = "Alert";
33
+
34
+ const AlertTitle = React.forwardRef<
35
+ HTMLParagraphElement,
36
+ React.HTMLAttributes<HTMLHeadingElement>
37
+ >(({ className, ...props }, ref) => (
38
+ <h5
39
+ ref={ref}
40
+ className={cn("mb-1 font-medium leading-none tracking-tight", className)}
41
+ {...props}
42
+ />
43
+ ));
44
+ AlertTitle.displayName = "AlertTitle";
45
+
46
+ const AlertDescription = React.forwardRef<
47
+ HTMLParagraphElement,
48
+ React.HTMLAttributes<HTMLParagraphElement>
49
+ >(({ className, ...props }, ref) => (
50
+ <div
51
+ ref={ref}
52
+ className={cn("text-sm [&_p]:leading-relaxed", className)}
53
+ {...props}
54
+ />
55
+ ));
56
+ AlertDescription.displayName = "AlertDescription";
57
+
58
+ export { Alert, AlertTitle, AlertDescription };
@@ -0,0 +1,48 @@
1
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
2
+ import * as React from "react";
3
+
4
+ import { cn } from "../utils/cn";
5
+
6
+ const Avatar = React.forwardRef<
7
+ React.ElementRef<typeof AvatarPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
9
+ >(({ className, ...props }, ref) => (
10
+ <AvatarPrimitive.Root
11
+ ref={ref}
12
+ className={cn(
13
+ "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
14
+ className,
15
+ )}
16
+ {...props}
17
+ />
18
+ ));
19
+ Avatar.displayName = AvatarPrimitive.Root.displayName;
20
+
21
+ const AvatarImage = React.forwardRef<
22
+ React.ElementRef<typeof AvatarPrimitive.Image>,
23
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
24
+ >(({ className, ...props }, ref) => (
25
+ <AvatarPrimitive.Image
26
+ ref={ref}
27
+ className={cn("aspect-square h-full w-full", className)}
28
+ {...props}
29
+ />
30
+ ));
31
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
32
+
33
+ const AvatarFallback = React.forwardRef<
34
+ React.ElementRef<typeof AvatarPrimitive.Fallback>,
35
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
36
+ >(({ className, ...props }, ref) => (
37
+ <AvatarPrimitive.Fallback
38
+ ref={ref}
39
+ className={cn(
40
+ "flex h-full w-full items-center justify-center rounded-full bg-secondary",
41
+ className,
42
+ )}
43
+ {...props}
44
+ />
45
+ ));
46
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
47
+
48
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,36 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+
4
+ import { cn } from "../utils/cn";
5
+
6
+ const badgeVariants = cva(
7
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default:
12
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13
+ secondary:
14
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ destructive:
16
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17
+ outline: "text-foreground",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ },
23
+ },
24
+ );
25
+
26
+ export interface BadgeProps
27
+ extends React.HTMLAttributes<HTMLDivElement>,
28
+ VariantProps<typeof badgeVariants> {}
29
+
30
+ function Badge({ className, variant, ...props }: BadgeProps) {
31
+ return (
32
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
+ );
34
+ }
35
+
36
+ export { Badge, badgeVariants };
@@ -0,0 +1,68 @@
1
+ import { X } from "lucide-react";
2
+ import * as React from "react";
3
+ import { cn } from "../utils/cn";
4
+ import { Button } from "./button";
5
+ import { Sheet, SheetContent, SheetHeader, SheetTitle } from "./Sheet";
6
+
7
+ interface BottomSheetProps {
8
+ open: boolean;
9
+ onOpenChange: (open: boolean) => void;
10
+ title?: string;
11
+ children: React.ReactNode;
12
+ className?: string;
13
+ maxHeight?: string;
14
+ }
15
+
16
+ /**
17
+ * Mobile-optimized bottom sheet component
18
+ * Uses Sheet component with bottom positioning and mobile-friendly styling
19
+ */
20
+ export function BottomSheet({
21
+ open,
22
+ onOpenChange,
23
+ title,
24
+ children,
25
+ className,
26
+ maxHeight = "max-h-[90vh]",
27
+ }: BottomSheetProps) {
28
+ return (
29
+ <Sheet open={open} onOpenChange={onOpenChange}>
30
+ <SheetContent
31
+ side="bottom"
32
+ className={cn(
33
+ "w-full rounded-t-2xl border-t border-x-0 border-b-0 p-0",
34
+ maxHeight,
35
+ className,
36
+ )}
37
+ >
38
+ <div className="flex flex-col h-full max-h-[90vh]">
39
+ {/* Handle bar */}
40
+ <div className="flex justify-center pt-3 pb-2">
41
+ <div className="w-12 h-1 bg-muted-foreground/30 rounded-full" />
42
+ </div>
43
+
44
+ {/* Header */}
45
+ {title && (
46
+ <SheetHeader className="px-6 pb-4 border-b border-border">
47
+ <div className="flex items-center justify-between">
48
+ <SheetTitle>{title}</SheetTitle>
49
+ <Button
50
+ variant="ghost"
51
+ size="icon"
52
+ className="h-10 w-10"
53
+ onClick={() => onOpenChange(false)}
54
+ aria-label="Close"
55
+ >
56
+ <X className="h-5 w-5" />
57
+ </Button>
58
+ </div>
59
+ </SheetHeader>
60
+ )}
61
+
62
+ {/* Content */}
63
+ <div className="flex-1 overflow-y-auto px-6 py-4">{children}</div>
64
+ </div>
65
+ </SheetContent>
66
+ </Sheet>
67
+ );
68
+ }
@@ -0,0 +1,56 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import * as React from "react";
4
+
5
+ import { cn } from "../utils/cn";
6
+
7
+ const buttonVariants = cva(
8
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
+ destructive:
14
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15
+ outline:
16
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17
+ secondary:
18
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost: "hover:bg-accent hover:text-accent-foreground",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ },
22
+ size: {
23
+ default: "h-10 px-4 py-2",
24
+ sm: "h-9 rounded-md px-3",
25
+ lg: "h-11 rounded-md px-8",
26
+ icon: "h-10 w-10",
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ variant: "default",
31
+ size: "default",
32
+ },
33
+ },
34
+ );
35
+
36
+ export interface ButtonProps
37
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
+ VariantProps<typeof buttonVariants> {
39
+ asChild?: boolean;
40
+ }
41
+
42
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
44
+ const Comp = asChild ? Slot : "button";
45
+ return (
46
+ <Comp
47
+ className={cn(buttonVariants({ variant, size, className }))}
48
+ ref={ref}
49
+ {...props}
50
+ />
51
+ );
52
+ },
53
+ );
54
+ Button.displayName = "Button";
55
+
56
+ export { Button, buttonVariants };
@@ -0,0 +1,85 @@
1
+ import * as React from "react";
2
+ import { cn } from "../utils/cn";
3
+
4
+ const Card = React.forwardRef<
5
+ HTMLDivElement,
6
+ React.HTMLAttributes<HTMLDivElement>
7
+ >(({ className, ...props }, ref) => (
8
+ <div
9
+ ref={ref}
10
+ className={cn(
11
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
12
+ className,
13
+ )}
14
+ {...props}
15
+ />
16
+ ));
17
+ Card.displayName = "Card";
18
+
19
+ const CardHeader = React.forwardRef<
20
+ HTMLDivElement,
21
+ React.HTMLAttributes<HTMLDivElement>
22
+ >(({ className, ...props }, ref) => (
23
+ <div
24
+ ref={ref}
25
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
26
+ {...props}
27
+ />
28
+ ));
29
+ CardHeader.displayName = "CardHeader";
30
+
31
+ const CardTitle = React.forwardRef<
32
+ HTMLParagraphElement,
33
+ React.HTMLAttributes<HTMLHeadingElement>
34
+ >(({ className, ...props }, ref) => (
35
+ <h3
36
+ ref={ref}
37
+ className={cn(
38
+ "text-2xl font-semibold leading-none tracking-tight",
39
+ className,
40
+ )}
41
+ {...props}
42
+ />
43
+ ));
44
+ CardTitle.displayName = "CardTitle";
45
+
46
+ const CardDescription = React.forwardRef<
47
+ HTMLParagraphElement,
48
+ React.HTMLAttributes<HTMLParagraphElement>
49
+ >(({ className, ...props }, ref) => (
50
+ <p
51
+ ref={ref}
52
+ className={cn("text-sm text-muted-foreground", className)}
53
+ {...props}
54
+ />
55
+ ));
56
+ CardDescription.displayName = "CardDescription";
57
+
58
+ const CardContent = React.forwardRef<
59
+ HTMLDivElement,
60
+ React.HTMLAttributes<HTMLDivElement>
61
+ >(({ className, ...props }, ref) => (
62
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
63
+ ));
64
+ CardContent.displayName = "CardContent";
65
+
66
+ const CardFooter = React.forwardRef<
67
+ HTMLDivElement,
68
+ React.HTMLAttributes<HTMLDivElement>
69
+ >(({ className, ...props }, ref) => (
70
+ <div
71
+ ref={ref}
72
+ className={cn("flex items-center p-6 pt-0", className)}
73
+ {...props}
74
+ />
75
+ ));
76
+ CardFooter.displayName = "CardFooter";
77
+
78
+ export {
79
+ Card,
80
+ CardHeader,
81
+ CardFooter,
82
+ CardTitle,
83
+ CardDescription,
84
+ CardContent,
85
+ };
@@ -0,0 +1,30 @@
1
+ "use client";
2
+
3
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
4
+ import { Check } from "lucide-react";
5
+ import * as React from "react";
6
+
7
+ import { cn } from "../utils/cn";
8
+
9
+ const Checkbox = React.forwardRef<
10
+ React.ElementRef<typeof CheckboxPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
+ >(({ className, ...props }, ref) => (
13
+ <CheckboxPrimitive.Root
14
+ ref={ref}
15
+ className={cn(
16
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
17
+ className,
18
+ )}
19
+ {...props}
20
+ >
21
+ <CheckboxPrimitive.Indicator
22
+ className={cn("flex items-center justify-center text-current")}
23
+ >
24
+ <Check className="h-4 w-4" />
25
+ </CheckboxPrimitive.Indicator>
26
+ </CheckboxPrimitive.Root>
27
+ ));
28
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
29
+
30
+ export { Checkbox };