@blips/ui 0.0.1 → 2.0.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 (60) hide show
  1. package/dist/index.cjs +4308 -2010
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +435 -411
  4. package/dist/index.d.ts +435 -411
  5. package/dist/index.js +4244 -2008
  6. package/dist/index.js.map +1 -1
  7. package/package.json +18 -4
  8. package/src/components/accordion.tsx +58 -48
  9. package/src/components/alert-dialog.tsx +170 -112
  10. package/src/components/alert.tsx +49 -42
  11. package/src/components/aspect-ratio.tsx +9 -3
  12. package/src/components/avatar.tsx +109 -50
  13. package/src/components/badge.tsx +29 -17
  14. package/src/components/breadcrumb.tsx +81 -87
  15. package/src/components/button-group.tsx +83 -0
  16. package/src/components/button.tsx +40 -32
  17. package/src/components/calendar.tsx +49 -45
  18. package/src/components/card.tsx +77 -71
  19. package/src/components/carousel.tsx +150 -168
  20. package/src/components/chart.tsx +357 -0
  21. package/src/components/checkbox.tsx +28 -24
  22. package/src/components/collapsible.tsx +28 -6
  23. package/src/components/command.tsx +144 -110
  24. package/src/components/context-menu.tsx +220 -166
  25. package/src/components/dialog.tsx +131 -95
  26. package/src/components/drawer.tsx +105 -86
  27. package/src/components/dropdown-menu.tsx +234 -177
  28. package/src/components/form.tsx +167 -0
  29. package/src/components/hover-card.tsx +39 -22
  30. package/src/components/input-group.tsx +175 -0
  31. package/src/components/input-otp.tsx +56 -48
  32. package/src/components/input.tsx +18 -19
  33. package/src/components/kbd.tsx +28 -0
  34. package/src/components/label.tsx +20 -22
  35. package/src/components/menubar.tsx +221 -199
  36. package/src/components/navigation-menu.tsx +144 -102
  37. package/src/components/pagination.tsx +102 -91
  38. package/src/components/popover.tsx +86 -26
  39. package/src/components/progress.tsx +27 -24
  40. package/src/components/radio-group.tsx +28 -25
  41. package/src/components/resizable.tsx +42 -34
  42. package/src/components/scroll-area.tsx +54 -42
  43. package/src/components/select.tsx +165 -135
  44. package/src/components/separator.tsx +16 -17
  45. package/src/components/sheet.tsx +116 -113
  46. package/src/components/sidebar.tsx +726 -0
  47. package/src/components/skeleton.tsx +6 -8
  48. package/src/components/slider.tsx +60 -23
  49. package/src/components/sonner.tsx +25 -30
  50. package/src/components/spinner.tsx +16 -0
  51. package/src/components/switch.tsx +30 -22
  52. package/src/components/table.tsx +96 -97
  53. package/src/components/tabs.tsx +91 -53
  54. package/src/components/textarea.tsx +8 -12
  55. package/src/components/toggle-group.tsx +60 -37
  56. package/src/components/toggle.tsx +28 -24
  57. package/src/components/tooltip.tsx +50 -23
  58. package/src/globals.css +230 -68
  59. package/src/hooks/use-mobile.tsx +19 -0
  60. package/src/index.ts +105 -6
@@ -1,122 +1,163 @@
1
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
2
- import { cva } from "class-variance-authority";
3
- import { ChevronDown } from "lucide-react";
4
- import * as React from "react";
1
+ "use client"
5
2
 
6
- import { cn } from "../lib/utils";
3
+ import * as React from "react"
4
+ import { cva } from "class-variance-authority"
5
+ import { CaretDown } from "@phosphor-icons/react"
6
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
7
7
 
8
- const NavigationMenu = React.forwardRef<
9
- React.ElementRef<typeof NavigationMenuPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
11
- >(({ className, children, ...props }, ref) => (
12
- <NavigationMenuPrimitive.Root
13
- ref={ref}
14
- className={cn(
15
- "relative z-10 flex max-w-max flex-1 items-center justify-center",
16
- className
17
- )}
18
- {...props}
19
- >
20
- {children}
21
- <NavigationMenuViewport />
22
- </NavigationMenuPrimitive.Root>
23
- ));
24
- NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
8
+ import { cn } from "../lib/utils"
25
9
 
26
- const NavigationMenuList = React.forwardRef<
27
- React.ElementRef<typeof NavigationMenuPrimitive.List>,
28
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
29
- >(({ className, ...props }, ref) => (
30
- <NavigationMenuPrimitive.List
31
- ref={ref}
32
- className={cn(
33
- "group flex flex-1 list-none items-center justify-center space-x-1",
34
- className
35
- )}
36
- {...props}
37
- />
38
- ));
39
- NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
10
+ function NavigationMenu({
11
+ className,
12
+ children,
13
+ viewport = true,
14
+ ...props
15
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
16
+ viewport?: boolean
17
+ }) {
18
+ return (
19
+ <NavigationMenuPrimitive.Root
20
+ data-slot="navigation-menu"
21
+ data-viewport={viewport}
22
+ className={cn(
23
+ "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
24
+ className
25
+ )}
26
+ {...props}
27
+ >
28
+ {children}
29
+ {viewport && <NavigationMenuViewport />}
30
+ </NavigationMenuPrimitive.Root>
31
+ )
32
+ }
33
+
34
+ function NavigationMenuList({
35
+ className,
36
+ ...props
37
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
38
+ return (
39
+ <NavigationMenuPrimitive.List
40
+ data-slot="navigation-menu-list"
41
+ className={cn(
42
+ "group flex flex-1 list-none items-center justify-center gap-1",
43
+ className
44
+ )}
45
+ {...props}
46
+ />
47
+ )
48
+ }
40
49
 
41
- const NavigationMenuItem = NavigationMenuPrimitive.Item;
50
+ function NavigationMenuItem({
51
+ className,
52
+ ...props
53
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
54
+ return (
55
+ <NavigationMenuPrimitive.Item
56
+ data-slot="navigation-menu-item"
57
+ className={cn("relative", className)}
58
+ {...props}
59
+ />
60
+ )
61
+ }
42
62
 
43
63
  const navigationMenuTriggerStyle = cva(
44
- "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
45
- );
64
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent"
65
+ )
46
66
 
47
- const NavigationMenuTrigger = React.forwardRef<
48
- React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
49
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
50
- >(({ className, children, ...props }, ref) => (
51
- <NavigationMenuPrimitive.Trigger
52
- ref={ref}
53
- className={cn(navigationMenuTriggerStyle(), "group", className)}
54
- {...props}
55
- >
56
- {children}{" "}
57
- <ChevronDown
58
- className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
59
- aria-hidden="true"
60
- />
61
- </NavigationMenuPrimitive.Trigger>
62
- ));
63
- NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
67
+ function NavigationMenuTrigger({
68
+ className,
69
+ children,
70
+ ...props
71
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
72
+ return (
73
+ <NavigationMenuPrimitive.Trigger
74
+ data-slot="navigation-menu-trigger"
75
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
76
+ {...props}
77
+ >
78
+ {children}{" "}
79
+ <CaretDown
80
+ className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
81
+ aria-hidden="true"
82
+ />
83
+ </NavigationMenuPrimitive.Trigger>
84
+ )
85
+ }
64
86
 
65
- const NavigationMenuContent = React.forwardRef<
66
- React.ElementRef<typeof NavigationMenuPrimitive.Content>,
67
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
68
- >(({ className, ...props }, ref) => (
69
- <NavigationMenuPrimitive.Content
70
- ref={ref}
71
- className={cn(
72
- "left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
73
- className
74
- )}
75
- {...props}
76
- />
77
- ));
78
- NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
87
+ function NavigationMenuContent({
88
+ className,
89
+ ...props
90
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
91
+ return (
92
+ <NavigationMenuPrimitive.Content
93
+ data-slot="navigation-menu-content"
94
+ className={cn(
95
+ "top-0 left-0 w-full p-2 pr-2.5 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out md:absolute md:w-auto",
96
+ "group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95",
97
+ className
98
+ )}
99
+ {...props}
100
+ />
101
+ )
102
+ }
79
103
 
80
- const NavigationMenuLink = NavigationMenuPrimitive.Link;
104
+ function NavigationMenuViewport({
105
+ className,
106
+ ...props
107
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
108
+ return (
109
+ <div
110
+ className={cn(
111
+ "absolute top-full left-0 isolate z-50 flex justify-center"
112
+ )}
113
+ >
114
+ <NavigationMenuPrimitive.Viewport
115
+ data-slot="navigation-menu-viewport"
116
+ className={cn(
117
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
118
+ className
119
+ )}
120
+ {...props}
121
+ />
122
+ </div>
123
+ )
124
+ }
81
125
 
82
- const NavigationMenuViewport = React.forwardRef<
83
- React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
84
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
85
- >(({ className, ...props }, ref) => (
86
- <div className={cn("absolute left-0 top-full flex justify-center")}>
87
- <NavigationMenuPrimitive.Viewport
126
+ function NavigationMenuLink({
127
+ className,
128
+ ...props
129
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
130
+ return (
131
+ <NavigationMenuPrimitive.Link
132
+ data-slot="navigation-menu-link"
88
133
  className={cn(
89
- "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
134
+ "flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
90
135
  className
91
136
  )}
92
- ref={ref}
93
137
  {...props}
94
138
  />
95
- </div>
96
- ));
97
- NavigationMenuViewport.displayName =
98
- NavigationMenuPrimitive.Viewport.displayName;
139
+ )
140
+ }
99
141
 
100
- const NavigationMenuIndicator = React.forwardRef<
101
- React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
102
- React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
103
- >(({ className, ...props }, ref) => (
104
- <NavigationMenuPrimitive.Indicator
105
- ref={ref}
106
- className={cn(
107
- "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
108
- className
109
- )}
110
- {...props}
111
- >
112
- <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
113
- </NavigationMenuPrimitive.Indicator>
114
- ));
115
- NavigationMenuIndicator.displayName =
116
- NavigationMenuPrimitive.Indicator.displayName;
142
+ function NavigationMenuIndicator({
143
+ className,
144
+ ...props
145
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
146
+ return (
147
+ <NavigationMenuPrimitive.Indicator
148
+ data-slot="navigation-menu-indicator"
149
+ className={cn(
150
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
151
+ className
152
+ )}
153
+ {...props}
154
+ >
155
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
156
+ </NavigationMenuPrimitive.Indicator>
157
+ )
158
+ }
117
159
 
118
160
  export {
119
- navigationMenuTriggerStyle,
120
161
  NavigationMenu,
121
162
  NavigationMenuList,
122
163
  NavigationMenuItem,
@@ -125,4 +166,5 @@ export {
125
166
  NavigationMenuLink,
126
167
  NavigationMenuIndicator,
127
168
  NavigationMenuViewport,
128
- };
169
+ navigationMenuTriggerStyle,
170
+ }
@@ -1,116 +1,127 @@
1
- import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
2
- import * as React from "react";
3
- import { type ButtonProps, buttonVariants } from "./button";
4
- import { cn } from "../lib/utils";
1
+ import * as React from "react"
2
+ import {
3
+ CaretLeft,
4
+ CaretRight,
5
+ DotsThree,
6
+ } from "@phosphor-icons/react"
5
7
 
6
- const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
7
- <nav
8
- role="navigation"
9
- aria-label="pagination"
10
- className={cn("mx-auto flex w-full justify-center", className)}
11
- {...props}
12
- />
13
- );
14
- Pagination.displayName = "Pagination";
8
+ import { cn } from "../lib/utils"
9
+ import { buttonVariants, type Button } from "./button"
15
10
 
16
- const PaginationContent = React.forwardRef<
17
- HTMLUListElement,
18
- React.ComponentProps<"ul">
19
- >(({ className, ...props }, ref) => (
20
- <ul
21
- ref={ref}
22
- className={cn("flex flex-row items-center gap-1", className)}
23
- {...props}
24
- />
25
- ));
26
- PaginationContent.displayName = "PaginationContent";
11
+ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
12
+ return (
13
+ <nav
14
+ role="navigation"
15
+ aria-label="pagination"
16
+ data-slot="pagination"
17
+ className={cn("mx-auto flex w-full justify-center", className)}
18
+ {...props}
19
+ />
20
+ )
21
+ }
27
22
 
28
- const PaginationItem = React.forwardRef<
29
- HTMLLIElement,
30
- React.ComponentProps<"li">
31
- >(({ className, ...props }, ref) => (
32
- <li ref={ref} className={cn("", className)} {...props} />
33
- ));
34
- PaginationItem.displayName = "PaginationItem";
23
+ function PaginationContent({
24
+ className,
25
+ ...props
26
+ }: React.ComponentProps<"ul">) {
27
+ return (
28
+ <ul
29
+ data-slot="pagination-content"
30
+ className={cn("flex flex-row items-center gap-1", className)}
31
+ {...props}
32
+ />
33
+ )
34
+ }
35
+
36
+ function PaginationItem({ ...props }: React.ComponentProps<"li">) {
37
+ return <li data-slot="pagination-item" {...props} />
38
+ }
35
39
 
36
40
  type PaginationLinkProps = {
37
- isActive?: boolean;
38
- } & Pick<ButtonProps, "size"> &
39
- React.ComponentProps<"a">;
41
+ isActive?: boolean
42
+ } & Pick<React.ComponentProps<typeof Button>, "size"> &
43
+ React.ComponentProps<"a">
40
44
 
41
- const PaginationLink = ({
45
+ function PaginationLink({
42
46
  className,
43
47
  isActive,
44
48
  size = "icon",
45
49
  ...props
46
- }: PaginationLinkProps) => (
47
- <a
48
- aria-current={isActive ? "page" : undefined}
49
- className={cn(
50
- buttonVariants({
51
- variant: isActive ? "outline" : "ghost",
52
- size,
53
- }),
54
- className
55
- )}
56
- {...props}
57
- />
58
- );
59
- PaginationLink.displayName = "PaginationLink";
50
+ }: PaginationLinkProps) {
51
+ return (
52
+ <a
53
+ aria-current={isActive ? "page" : undefined}
54
+ data-slot="pagination-link"
55
+ data-active={isActive}
56
+ className={cn(
57
+ buttonVariants({
58
+ variant: isActive ? "outline" : "ghost",
59
+ size,
60
+ }),
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ )
66
+ }
60
67
 
61
- const PaginationPrevious = ({
68
+ function PaginationPrevious({
62
69
  className,
63
70
  ...props
64
- }: React.ComponentProps<typeof PaginationLink>) => (
65
- <PaginationLink
66
- aria-label="Go to previous page"
67
- size="default"
68
- className={cn("gap-1 pl-2.5", className)}
69
- {...props}
70
- >
71
- <ChevronLeft className="h-4 w-4" />
72
- <span>Previous</span>
73
- </PaginationLink>
74
- );
75
- PaginationPrevious.displayName = "PaginationPrevious";
71
+ }: React.ComponentProps<typeof PaginationLink>) {
72
+ return (
73
+ <PaginationLink
74
+ aria-label="Go to previous page"
75
+ size="default"
76
+ className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
77
+ {...props}
78
+ >
79
+ <CaretLeft />
80
+ <span className="hidden sm:block">Previous</span>
81
+ </PaginationLink>
82
+ )
83
+ }
76
84
 
77
- const PaginationNext = ({
85
+ function PaginationNext({
78
86
  className,
79
87
  ...props
80
- }: React.ComponentProps<typeof PaginationLink>) => (
81
- <PaginationLink
82
- aria-label="Go to next page"
83
- size="default"
84
- className={cn("gap-1 pr-2.5", className)}
85
- {...props}
86
- >
87
- <span>Next</span>
88
- <ChevronRight className="h-4 w-4" />
89
- </PaginationLink>
90
- );
91
- PaginationNext.displayName = "PaginationNext";
88
+ }: React.ComponentProps<typeof PaginationLink>) {
89
+ return (
90
+ <PaginationLink
91
+ aria-label="Go to next page"
92
+ size="default"
93
+ className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
94
+ {...props}
95
+ >
96
+ <span className="hidden sm:block">Next</span>
97
+ <CaretRight />
98
+ </PaginationLink>
99
+ )
100
+ }
92
101
 
93
- const PaginationEllipsis = ({
102
+ function PaginationEllipsis({
94
103
  className,
95
104
  ...props
96
- }: React.ComponentProps<"span">) => (
97
- <span
98
- aria-hidden
99
- className={cn("flex h-9 w-9 items-center justify-center", className)}
100
- {...props}
101
- >
102
- <MoreHorizontal className="h-4 w-4" />
103
- <span className="sr-only">More pages</span>
104
- </span>
105
- );
106
- PaginationEllipsis.displayName = "PaginationEllipsis";
105
+ }: React.ComponentProps<"span">) {
106
+ return (
107
+ <span
108
+ aria-hidden
109
+ data-slot="pagination-ellipsis"
110
+ className={cn("flex size-9 items-center justify-center", className)}
111
+ {...props}
112
+ >
113
+ <DotsThree className="size-4" />
114
+ <span className="sr-only">More pages</span>
115
+ </span>
116
+ )
117
+ }
107
118
 
108
119
  export {
109
120
  Pagination,
110
121
  PaginationContent,
111
- PaginationEllipsis,
112
- PaginationItem,
113
122
  PaginationLink,
114
- PaginationNext,
123
+ PaginationItem,
115
124
  PaginationPrevious,
116
- };
125
+ PaginationNext,
126
+ PaginationEllipsis,
127
+ }
@@ -1,29 +1,89 @@
1
- import * as PopoverPrimitive from "@radix-ui/react-popover";
2
- import * as React from "react";
3
-
4
- import { cn } from "../lib/utils";
5
-
6
- const Popover = PopoverPrimitive.Root;
7
-
8
- const PopoverTrigger = PopoverPrimitive.Trigger;
9
-
10
- const PopoverContent = React.forwardRef<
11
- React.ElementRef<typeof PopoverPrimitive.Content>,
12
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
13
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
- <PopoverPrimitive.Portal>
15
- <PopoverPrimitive.Content
16
- ref={ref}
17
- align={align}
18
- sideOffset={sideOffset}
19
- className={cn(
20
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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 origin-[--radix-popover-content-transform-origin]",
21
- className
22
- )}
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
5
+
6
+ import { cn } from "../lib/utils"
7
+
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
+ }
13
+
14
+ function PopoverTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
+ }
19
+
20
+ function PopoverContent({
21
+ className,
22
+ align = "center",
23
+ sideOffset = 4,
24
+ ...props
25
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
+ return (
27
+ <PopoverPrimitive.Portal>
28
+ <PopoverPrimitive.Content
29
+ data-slot="popover-content"
30
+ align={align}
31
+ sideOffset={sideOffset}
32
+ className={cn(
33
+ "z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ </PopoverPrimitive.Portal>
39
+ )
40
+ }
41
+
42
+ function PopoverAnchor({
43
+ ...props
44
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
45
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
46
+ }
47
+
48
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
49
+ return (
50
+ <div
51
+ data-slot="popover-header"
52
+ className={cn("flex flex-col gap-1 text-sm", className)}
53
+ {...props}
54
+ />
55
+ )
56
+ }
57
+
58
+ function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
59
+ return (
60
+ <div
61
+ data-slot="popover-title"
62
+ className={cn("font-medium", className)}
63
+ {...props}
64
+ />
65
+ )
66
+ }
67
+
68
+ function PopoverDescription({
69
+ className,
70
+ ...props
71
+ }: React.ComponentProps<"p">) {
72
+ return (
73
+ <p
74
+ data-slot="popover-description"
75
+ className={cn("text-muted-foreground", className)}
23
76
  {...props}
24
77
  />
25
- </PopoverPrimitive.Portal>
26
- ));
27
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
78
+ )
79
+ }
28
80
 
29
- export { Popover, PopoverTrigger, PopoverContent };
81
+ export {
82
+ Popover,
83
+ PopoverTrigger,
84
+ PopoverContent,
85
+ PopoverAnchor,
86
+ PopoverHeader,
87
+ PopoverTitle,
88
+ PopoverDescription,
89
+ }