tokka 0.2.0 → 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.
Files changed (71) hide show
  1. package/components/accordion.tsx +55 -0
  2. package/components/alert-dialog.tsx +138 -0
  3. package/components/alert.tsx +58 -0
  4. package/components/aspect-ratio.tsx +5 -0
  5. package/components/avatar.tsx +47 -0
  6. package/components/badge.tsx +35 -0
  7. package/components/breadcrumb.tsx +114 -0
  8. package/components/button.tsx +56 -0
  9. package/components/calendar.tsx +63 -0
  10. package/components/card.tsx +74 -0
  11. package/components/carousel.tsx +259 -0
  12. package/components/chart.tsx +9 -0
  13. package/components/checkbox.tsx +27 -0
  14. package/components/collapsible.tsx +9 -0
  15. package/components/combobox.tsx +8 -0
  16. package/components/command.tsx +152 -0
  17. package/components/context-menu.tsx +197 -0
  18. package/components/data-table.tsx +9 -0
  19. package/components/date-picker.tsx +8 -0
  20. package/components/dialog.tsx +119 -0
  21. package/components/drawer.tsx +115 -0
  22. package/components/dropdown-menu.tsx +197 -0
  23. package/components/form.tsx +175 -0
  24. package/components/hover-card.tsx +26 -0
  25. package/components/input-otp.tsx +68 -0
  26. package/components/input.tsx +48 -0
  27. package/components/label.tsx +23 -0
  28. package/components/lib/utils.ts +6 -0
  29. package/components/menubar.tsx +233 -0
  30. package/components/native-select.tsx +29 -0
  31. package/components/navigation-menu.tsx +127 -0
  32. package/components/pagination.tsx +116 -0
  33. package/components/popover.tsx +28 -0
  34. package/components/progress.tsx +25 -0
  35. package/components/radio-group.tsx +41 -0
  36. package/components/resizable.tsx +42 -0
  37. package/components/scroll-area.tsx +45 -0
  38. package/components/select.tsx +157 -0
  39. package/components/separator.tsx +28 -0
  40. package/components/sheet.tsx +137 -0
  41. package/components/sidebar.tsx +249 -0
  42. package/components/skeleton.tsx +15 -0
  43. package/components/slider.tsx +25 -0
  44. package/components/sonner.tsx +25 -0
  45. package/components/spinner.tsx +33 -0
  46. package/components/switch.tsx +26 -0
  47. package/components/table.tsx +116 -0
  48. package/components/tabs.tsx +52 -0
  49. package/components/textarea.tsx +23 -0
  50. package/components/toggle-group.tsx +58 -0
  51. package/components/toggle.tsx +42 -0
  52. package/components/tooltip.tsx +27 -0
  53. package/dist/index.js +49 -2
  54. package/package.json +4 -2
  55. package/systems/README.md +56 -0
  56. package/systems/accessible/system.json +17 -0
  57. package/systems/accessible/tokens/primitives.json +9 -0
  58. package/systems/accessible/tokens/semantics.json +11 -0
  59. package/systems/brutalist/system.json +17 -0
  60. package/systems/brutalist/tokens/primitives.json +10 -0
  61. package/systems/brutalist/tokens/semantics.json +12 -0
  62. package/systems/corporate/system.json +20 -0
  63. package/systems/corporate/tokens/primitives.json +60 -0
  64. package/systems/corporate/tokens/semantics.json +68 -0
  65. package/systems/dark-mode/system.json +17 -0
  66. package/systems/dark-mode/tokens/primitives.json +10 -0
  67. package/systems/dark-mode/tokens/semantics.json +11 -0
  68. package/systems/package.json +14 -0
  69. package/systems/soft-saas/system.json +20 -0
  70. package/systems/soft-saas/tokens/primitives.json +235 -0
  71. package/systems/soft-saas/tokens/semantics.json +190 -0
@@ -0,0 +1,55 @@
1
+ import * as React from "react"
2
+ import * as AccordionPrimitive from "@radix-ui/react-accordion"
3
+ import { ChevronDown } from "lucide-react"
4
+ import { cn } from "./lib/utils"
5
+
6
+ const Accordion = AccordionPrimitive.Root
7
+
8
+ const AccordionItem = React.forwardRef<
9
+ React.ElementRef<typeof AccordionPrimitive.Item>,
10
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
11
+ >(({ className, ...props }, ref) => (
12
+ <AccordionPrimitive.Item
13
+ ref={ref}
14
+ className={cn("border-b", className)}
15
+ {...props}
16
+ />
17
+ ))
18
+ AccordionItem.displayName = "AccordionItem"
19
+
20
+ const AccordionTrigger = React.forwardRef<
21
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
22
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
23
+ >(({ className, children, ...props }, ref) => (
24
+ <AccordionPrimitive.Header className="flex">
25
+ <AccordionPrimitive.Trigger
26
+ ref={ref}
27
+ className={cn(
28
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ {children}
34
+ <ChevronDown className="size-4 shrink-0 transition-transform duration-200" />
35
+ </AccordionPrimitive.Trigger>
36
+ </AccordionPrimitive.Header>
37
+ ))
38
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
39
+
40
+ const AccordionContent = React.forwardRef<
41
+ React.ElementRef<typeof AccordionPrimitive.Content>,
42
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
43
+ >(({ className, children, ...props }, ref) => (
44
+ <AccordionPrimitive.Content
45
+ ref={ref}
46
+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
47
+ {...props}
48
+ >
49
+ <div className={cn("pb-4 pt-0", className)}>{children}</div>
50
+ </AccordionPrimitive.Content>
51
+ ))
52
+
53
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName
54
+
55
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -0,0 +1,138 @@
1
+ import * as React from "react"
2
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
3
+ import { cn } from "./lib/utils"
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 * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "./lib/utils"
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/50 text-destructive dark:border-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,5 @@
1
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
2
+
3
+ const AspectRatio = AspectRatioPrimitive.Root
4
+
5
+ export { AspectRatio }
@@ -0,0 +1,47 @@
1
+ import * as React from "react"
2
+ import * as AvatarPrimitive from "@radix-ui/react-avatar"
3
+ import { cn } from "./lib/utils"
4
+
5
+ const Avatar = React.forwardRef<
6
+ React.ElementRef<typeof AvatarPrimitive.Root>,
7
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
8
+ >(({ className, ...props }, ref) => (
9
+ <AvatarPrimitive.Root
10
+ ref={ref}
11
+ className={cn(
12
+ "relative flex size-10 shrink-0 overflow-hidden rounded-full",
13
+ className
14
+ )}
15
+ {...props}
16
+ />
17
+ ))
18
+ Avatar.displayName = AvatarPrimitive.Root.displayName
19
+
20
+ const AvatarImage = React.forwardRef<
21
+ React.ElementRef<typeof AvatarPrimitive.Image>,
22
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
23
+ >(({ className, ...props }, ref) => (
24
+ <AvatarPrimitive.Image
25
+ ref={ref}
26
+ className={cn("aspect-square size-full", className)}
27
+ {...props}
28
+ />
29
+ ))
30
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName
31
+
32
+ const AvatarFallback = React.forwardRef<
33
+ React.ElementRef<typeof AvatarPrimitive.Fallback>,
34
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
35
+ >(({ className, ...props }, ref) => (
36
+ <AvatarPrimitive.Fallback
37
+ ref={ref}
38
+ className={cn(
39
+ "flex size-full items-center justify-center rounded-full bg-muted",
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ ))
45
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
46
+
47
+ export { Avatar, AvatarImage, AvatarFallback }
@@ -0,0 +1,35 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "./lib/utils"
4
+
5
+ const badgeVariants = cva(
6
+ "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",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default:
11
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
12
+ secondary:
13
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
14
+ destructive:
15
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
16
+ outline: "text-foreground",
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ variant: "default",
21
+ },
22
+ }
23
+ )
24
+
25
+ export interface BadgeProps
26
+ extends React.HTMLAttributes<HTMLDivElement>,
27
+ VariantProps<typeof badgeVariants> {}
28
+
29
+ function Badge({ className, variant, ...props }: BadgeProps) {
30
+ return (
31
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
32
+ )
33
+ }
34
+
35
+ export { Badge, badgeVariants }
@@ -0,0 +1,114 @@
1
+ import * as React from "react"
2
+ import { ChevronRight, MoreHorizontal } from "lucide-react"
3
+ import { Slot } from "@radix-ui/react-slot"
4
+ import { cn } from "./lib/utils"
5
+
6
+ const Breadcrumb = React.forwardRef<
7
+ HTMLElement,
8
+ React.ComponentPropsWithoutRef<"nav"> & {
9
+ separator?: React.ReactNode
10
+ }
11
+ >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
12
+ Breadcrumb.displayName = "Breadcrumb"
13
+
14
+ const BreadcrumbList = React.forwardRef<
15
+ HTMLOListElement,
16
+ React.ComponentPropsWithoutRef<"ol">
17
+ >(({ className, ...props }, ref) => (
18
+ <ol
19
+ ref={ref}
20
+ className={cn(
21
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
22
+ className
23
+ )}
24
+ {...props}
25
+ />
26
+ ))
27
+ BreadcrumbList.displayName = "BreadcrumbList"
28
+
29
+ const BreadcrumbItem = React.forwardRef<
30
+ HTMLLIElement,
31
+ React.ComponentPropsWithoutRef<"li">
32
+ >(({ className, ...props }, ref) => (
33
+ <li
34
+ ref={ref}
35
+ className={cn("inline-flex items-center gap-1.5", className)}
36
+ {...props}
37
+ />
38
+ ))
39
+ BreadcrumbItem.displayName = "BreadcrumbItem"
40
+
41
+ const BreadcrumbLink = React.forwardRef<
42
+ HTMLAnchorElement,
43
+ React.ComponentPropsWithoutRef<"a"> & {
44
+ asChild?: boolean
45
+ }
46
+ >(({ asChild, className, ...props }, ref) => {
47
+ const Comp = asChild ? Slot : "a"
48
+
49
+ return (
50
+ <Comp
51
+ ref={ref}
52
+ className={cn("transition-colors hover:text-foreground", className)}
53
+ {...props}
54
+ />
55
+ )
56
+ })
57
+ BreadcrumbLink.displayName = "BreadcrumbLink"
58
+
59
+ const BreadcrumbPage = React.forwardRef<
60
+ HTMLSpanElement,
61
+ React.ComponentPropsWithoutRef<"span">
62
+ >(({ className, ...props }, ref) => (
63
+ <span
64
+ ref={ref}
65
+ role="link"
66
+ aria-disabled="true"
67
+ aria-current="page"
68
+ className={cn("font-normal text-foreground", className)}
69
+ {...props}
70
+ />
71
+ ))
72
+ BreadcrumbPage.displayName = "BreadcrumbPage"
73
+
74
+ const BreadcrumbSeparator = ({
75
+ children,
76
+ className,
77
+ ...props
78
+ }: React.ComponentProps<"li">) => (
79
+ <li
80
+ role="presentation"
81
+ aria-hidden="true"
82
+ className={cn("[&>svg]:size-3.5", className)}
83
+ {...props}
84
+ >
85
+ {children ?? <ChevronRight />}
86
+ </li>
87
+ )
88
+ BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
89
+
90
+ const BreadcrumbEllipsis = ({
91
+ className,
92
+ ...props
93
+ }: React.ComponentProps<"span">) => (
94
+ <span
95
+ role="presentation"
96
+ aria-hidden="true"
97
+ className={cn("flex size-9 items-center justify-center", className)}
98
+ {...props}
99
+ >
100
+ <MoreHorizontal className="size-4" />
101
+ <span className="sr-only">More</span>
102
+ </span>
103
+ )
104
+ BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
105
+
106
+ export {
107
+ Breadcrumb,
108
+ BreadcrumbList,
109
+ BreadcrumbItem,
110
+ BreadcrumbLink,
111
+ BreadcrumbPage,
112
+ BreadcrumbSeparator,
113
+ BreadcrumbEllipsis,
114
+ }
@@ -0,0 +1,56 @@
1
+ import * as React from "react"
2
+ import { Slot } from "@radix-ui/react-slot"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+ import { cn } from "./lib/utils"
5
+
6
+ const buttonVariants = cva(
7
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
12
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
13
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
14
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ ghost: "hover:bg-accent hover:text-accent-foreground",
16
+ link: "text-primary underline-offset-4 hover:underline",
17
+ },
18
+ size: {
19
+ default: "h-10 px-4 py-2",
20
+ sm: "h-9 rounded-md px-3",
21
+ lg: "h-11 rounded-md px-8",
22
+ icon: "size-10",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ variant: "default",
27
+ size: "default",
28
+ },
29
+ }
30
+ )
31
+
32
+ export interface ButtonProps
33
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
34
+ VariantProps<typeof buttonVariants> {
35
+ asChild?: boolean
36
+ icon?: React.ReactNode
37
+ }
38
+
39
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
40
+ ({ className, variant, size, asChild = false, icon, children, ...props }, ref) => {
41
+ const Comp = asChild ? Slot : "button"
42
+ return (
43
+ <Comp
44
+ className={cn(buttonVariants({ variant, size, className }))}
45
+ ref={ref}
46
+ {...props}
47
+ >
48
+ {icon}
49
+ {children}
50
+ </Comp>
51
+ )
52
+ }
53
+ )
54
+ Button.displayName = "Button"
55
+
56
+ export { Button, buttonVariants }
@@ -0,0 +1,63 @@
1
+ import * as React from "react"
2
+ import { DayPicker } from "react-day-picker"
3
+ import { ChevronLeft, ChevronRight } from "lucide-react"
4
+ import { cn } from "./lib/utils"
5
+ import { buttonVariants } from "./button"
6
+
7
+ export type CalendarProps = React.ComponentProps<typeof DayPicker>
8
+
9
+ function Calendar({
10
+ className,
11
+ classNames,
12
+ showOutsideDays = true,
13
+ ...props
14
+ }: CalendarProps) {
15
+ return (
16
+ <DayPicker
17
+ showOutsideDays={showOutsideDays}
18
+ className={cn("p-3", className)}
19
+ classNames={{
20
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
21
+ month: "space-y-4",
22
+ caption: "flex justify-center pt-1 relative items-center",
23
+ caption_label: "text-sm font-medium",
24
+ nav: "space-x-1 flex items-center",
25
+ nav_button: cn(
26
+ buttonVariants({ variant: "outline" }),
27
+ "size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
28
+ ),
29
+ nav_button_previous: "absolute left-1",
30
+ nav_button_next: "absolute right-1",
31
+ table: "w-full border-collapse space-y-1",
32
+ head_row: "flex",
33
+ head_cell:
34
+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
35
+ row: "flex w-full mt-2",
36
+ cell: "size-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
37
+ day: cn(
38
+ buttonVariants({ variant: "ghost" }),
39
+ "size-9 p-0 font-normal aria-selected:opacity-100"
40
+ ),
41
+ day_range_end: "day-range-end",
42
+ day_selected:
43
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
44
+ day_today: "bg-accent text-accent-foreground",
45
+ day_outside:
46
+ "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
47
+ day_disabled: "text-muted-foreground opacity-50",
48
+ day_range_middle:
49
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
50
+ day_hidden: "invisible",
51
+ ...classNames,
52
+ }}
53
+ components={{
54
+ IconLeft: () => <ChevronLeft className="size-4" />,
55
+ IconRight: () => <ChevronRight className="size-4" />,
56
+ }}
57
+ {...props}
58
+ />
59
+ )
60
+ }
61
+ Calendar.displayName = "Calendar"
62
+
63
+ export { Calendar }
@@ -0,0 +1,74 @@
1
+ import * as React from "react"
2
+ import { cn } from "./lib/utils"
3
+
4
+ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
5
+ ({ className, ...props }, ref) => (
6
+ <div
7
+ ref={ref}
8
+ className={cn(
9
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
10
+ className
11
+ )}
12
+ {...props}
13
+ />
14
+ )
15
+ )
16
+ Card.displayName = "Card"
17
+
18
+ const CardHeader = React.forwardRef<
19
+ HTMLDivElement,
20
+ React.HTMLAttributes<HTMLDivElement>
21
+ >(({ className, ...props }, ref) => (
22
+ <div
23
+ ref={ref}
24
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
25
+ {...props}
26
+ />
27
+ ))
28
+ CardHeader.displayName = "CardHeader"
29
+
30
+ const CardTitle = React.forwardRef<
31
+ HTMLParagraphElement,
32
+ React.HTMLAttributes<HTMLHeadingElement>
33
+ >(({ className, ...props }, ref) => (
34
+ <h3
35
+ ref={ref}
36
+ className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
37
+ {...props}
38
+ />
39
+ ))
40
+ CardTitle.displayName = "CardTitle"
41
+
42
+ const CardDescription = React.forwardRef<
43
+ HTMLParagraphElement,
44
+ React.HTMLAttributes<HTMLParagraphElement>
45
+ >(({ className, ...props }, ref) => (
46
+ <p
47
+ ref={ref}
48
+ className={cn("text-sm text-muted-foreground", className)}
49
+ {...props}
50
+ />
51
+ ))
52
+ CardDescription.displayName = "CardDescription"
53
+
54
+ const CardContent = React.forwardRef<
55
+ HTMLDivElement,
56
+ React.HTMLAttributes<HTMLDivElement>
57
+ >(({ className, ...props }, ref) => (
58
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
59
+ ))
60
+ CardContent.displayName = "CardContent"
61
+
62
+ const CardFooter = React.forwardRef<
63
+ HTMLDivElement,
64
+ React.HTMLAttributes<HTMLDivElement>
65
+ >(({ className, ...props }, ref) => (
66
+ <div
67
+ ref={ref}
68
+ className={cn("flex items-center p-6 pt-0", className)}
69
+ {...props}
70
+ />
71
+ ))
72
+ CardFooter.displayName = "CardFooter"
73
+
74
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }