@catalystsoftware/ui 1.0.4 → 1.0.5

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 (157) hide show
  1. package/data/tailwind.config.js +261 -3821
  2. package/dist/components/catalyst-ui/buttons/burger.tsx +207 -0
  3. package/dist/components/catalyst-ui/core/data-display/timeline.tsx +210 -0
  4. package/dist/components/catalyst-ui/core/feedback/alert.tsx +491 -0
  5. package/dist/components/catalyst-ui/core/feedback/spinner-1.tsx +65 -0
  6. package/dist/components/catalyst-ui/core/feedback/toast.tsx +1857 -0
  7. package/dist/components/catalyst-ui/core/navigation/menu.tsx +164 -0
  8. package/dist/components/catalyst-ui/forms/toggle-class.tsx +176 -0
  9. package/dist/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +419 -0
  10. package/dist/components/catalyst-ui/hooks/use-counter.tsx +13 -0
  11. package/dist/components/catalyst-ui/hooks/use-event-listener.tsx +23 -0
  12. package/dist/components/catalyst-ui/hooks/use-export-markdown.tsx +47 -0
  13. package/dist/components/catalyst-ui/hooks/use-focus.tsx +17 -0
  14. package/dist/components/catalyst-ui/hooks/use-interval.tsx +23 -0
  15. package/dist/components/catalyst-ui/hooks/use-is-client.tsx +16 -0
  16. package/dist/components/catalyst-ui/hooks/use-media-query.tsx +19 -0
  17. package/dist/components/catalyst-ui/hooks/use-mobile.tsx +19 -0
  18. package/dist/components/catalyst-ui/hooks/use-resize-observer.tsx +81 -0
  19. package/dist/components/catalyst-ui/hooks/use-timeout.tsx +21 -0
  20. package/dist/components/catalyst-ui/hooks/use-timer.tsx +209 -0
  21. package/dist/components/catalyst-ui/hooks/use-toggle.tsx +12 -0
  22. package/dist/components/catalyst-ui/media/image.tsx +13 -0
  23. package/dist/components/catalyst-ui/overlays/dual-sidebar.tsx +4142 -0
  24. package/dist/components/catalyst-ui/overlays/sidebar-original.tsx +726 -0
  25. package/dist/components/catalyst-ui/primitives/accordion.tsx +250 -0
  26. package/dist/components/catalyst-ui/primitives/alert-dialog.tsx +126 -0
  27. package/dist/components/catalyst-ui/primitives/aspect-ratio.tsx +9 -0
  28. package/dist/components/catalyst-ui/primitives/avatar.tsx +296 -0
  29. package/dist/components/catalyst-ui/primitives/badge.tsx +57 -0
  30. package/dist/components/catalyst-ui/primitives/breadcrumb.tsx +101 -0
  31. package/dist/components/catalyst-ui/primitives/button.tsx +265 -0
  32. package/dist/components/catalyst-ui/primitives/calendar-v4.tsx +208 -0
  33. package/dist/components/catalyst-ui/primitives/calendar.tsx +295 -0
  34. package/dist/components/catalyst-ui/primitives/card.tsx +618 -0
  35. package/dist/components/catalyst-ui/primitives/carousel.tsx +238 -0
  36. package/dist/components/catalyst-ui/primitives/chart.tsx +347 -0
  37. package/dist/components/catalyst-ui/primitives/checkbox.tsx +225 -0
  38. package/dist/components/catalyst-ui/primitives/collapsible.tsx +212 -0
  39. package/dist/components/catalyst-ui/primitives/command.tsx +393 -0
  40. package/dist/components/catalyst-ui/primitives/context-menu.tsx +236 -0
  41. package/dist/components/catalyst-ui/primitives/dialog.tsx +471 -0
  42. package/dist/components/catalyst-ui/primitives/drawer.tsx +761 -0
  43. package/dist/components/catalyst-ui/primitives/dropdown-menu.tsx +290 -0
  44. package/dist/components/catalyst-ui/primitives/empty.tsx +104 -0
  45. package/dist/components/catalyst-ui/primitives/field.tsx +244 -0
  46. package/dist/components/catalyst-ui/primitives/hover-card.tsx +124 -0
  47. package/dist/components/catalyst-ui/primitives/input-otp.tsx +76 -0
  48. package/dist/components/catalyst-ui/primitives/input.tsx +64 -0
  49. package/dist/components/catalyst-ui/primitives/item.tsx +196 -0
  50. package/dist/components/catalyst-ui/primitives/kbd.tsx +75 -0
  51. package/dist/components/catalyst-ui/primitives/label.tsx +24 -0
  52. package/dist/components/catalyst-ui/primitives/navigation-menu.tsx +150 -0
  53. package/dist/components/catalyst-ui/primitives/pagination.tsx +198 -0
  54. package/dist/components/catalyst-ui/primitives/popover.tsx +232 -0
  55. package/dist/components/catalyst-ui/primitives/progress.tsx +34 -0
  56. package/dist/components/catalyst-ui/primitives/radio-group.tsx +43 -0
  57. package/dist/components/catalyst-ui/primitives/resizable.tsx +56 -0
  58. package/dist/components/catalyst-ui/primitives/select.tsx +155 -0
  59. package/dist/components/catalyst-ui/primitives/separator.tsx +74 -0
  60. package/dist/components/catalyst-ui/primitives/sheet.tsx +126 -0
  61. package/dist/components/catalyst-ui/primitives/skeleton.tsx +15 -0
  62. package/dist/components/catalyst-ui/primitives/slider.tsx +27 -0
  63. package/dist/components/catalyst-ui/primitives/switch.tsx +187 -0
  64. package/dist/components/catalyst-ui/primitives/tabs.tsx +335 -0
  65. package/dist/components/catalyst-ui/primitives/textarea.tsx +24 -0
  66. package/dist/components/catalyst-ui/primitives/toggle-group.tsx +55 -0
  67. package/dist/components/catalyst-ui/primitives/toggle.tsx +42 -0
  68. package/dist/components/catalyst-ui/primitives/tooltip.tsx +116 -0
  69. package/dist/components/catalyst-ui/utils/basic-auth.tsx +40 -0
  70. package/dist/components/catalyst-ui/utils/context-storage.tsx +19 -0
  71. package/dist/components/catalyst-ui/utils/cors-middleware.tsx +71 -0
  72. package/dist/components/catalyst-ui/utils/deferred-content.tsx +595 -0
  73. package/dist/components/catalyst-ui/utils/honeypot-middleware.tsx +38 -0
  74. package/dist/components/catalyst-ui/utils/incId.tsx +75 -0
  75. package/dist/components/catalyst-ui/utils/jwk-auth.tsx +36 -0
  76. package/dist/components/catalyst-ui/utils/request-id.tsx +14 -0
  77. package/dist/components/catalyst-ui/utils/secure-headers.tsx +37 -0
  78. package/dist/components/catalyst-ui/utils/server-timing.tsx +23 -0
  79. package/dist/components/catalyst-ui/utils/utils.ts +43 -0
  80. package/dist/components/catalyst-ui/utils/with-cookie.tsx +43 -0
  81. package/dist/components/catalyst-ui/x/accordian-x.tsx +428 -0
  82. package/dist/components/catalyst-ui/x/alert-x.tsx +413 -0
  83. package/dist/components/catalyst-ui/x/animated-text-x.tsx +2242 -0
  84. package/dist/components/catalyst-ui/x/avatar-x.tsx +515 -0
  85. package/dist/components/catalyst-ui/x/badge-x.tsx +670 -0
  86. package/dist/components/catalyst-ui/x/button-X.tsx +2857 -0
  87. package/dist/components/catalyst-ui/x/button-group-x.tsx +847 -0
  88. package/dist/components/catalyst-ui/x/calendar-x.tsx +1910 -0
  89. package/dist/components/catalyst-ui/x/card-x.tsx +2597 -0
  90. package/dist/components/catalyst-ui/x/checkbox-x.tsx +656 -0
  91. package/dist/components/catalyst-ui/x/collapsible-x.tsx +1360 -0
  92. package/dist/components/catalyst-ui/x/combobox-x.tsx +911 -0
  93. package/dist/components/catalyst-ui/x/data-table-x.tsx +1753 -0
  94. package/dist/components/catalyst-ui/x/date-picker-x.tsx +648 -0
  95. package/dist/components/catalyst-ui/x/dialog-x.tsx +659 -0
  96. package/dist/components/catalyst-ui/x/dropdown-menu-x.tsx +612 -0
  97. package/dist/components/catalyst-ui/x/hover-card-x.tsx +375 -0
  98. package/dist/components/catalyst-ui/x/icon-x.tsx +840 -0
  99. package/dist/components/catalyst-ui/x/input-mask-x.tsx +981 -0
  100. package/dist/components/catalyst-ui/x/input-otp-x.tsx +659 -0
  101. package/dist/components/catalyst-ui/x/loader-x.tsx +1757 -0
  102. package/dist/components/catalyst-ui/x/pagination-x.tsx +622 -0
  103. package/dist/components/catalyst-ui/x/popover-x.tsx +744 -0
  104. package/dist/components/catalyst-ui/x/radio-group-x.tsx +499 -0
  105. package/dist/components/catalyst-ui/x/select-x.tsx +1127 -0
  106. package/dist/components/catalyst-ui/x/sheet-x.tsx +668 -0
  107. package/dist/components/catalyst-ui/x/switch-x.tsx +681 -0
  108. package/dist/components/catalyst-ui/x/table-x.tsx +574 -0
  109. package/dist/components/catalyst-ui/x/tabs-x.tsx +839 -0
  110. package/dist/components/catalyst-ui/x/textarea-x.tsx +1263 -0
  111. package/dist/components/catalyst-ui/x/tooltip-x.tsx +396 -0
  112. package/dist/components/catalyst-ui/x/tracker-x.tsx +560 -0
  113. package/dist/data/bg-data.tsx +901 -0
  114. package/dist/data/buttons-data.tsx +2327 -0
  115. package/dist/data/charts-data.tsx +102 -0
  116. package/dist/data/chat-data.tsx +83 -0
  117. package/dist/data/code-data.tsx +1040 -0
  118. package/dist/data/comboboxes-data.tsx +1843 -0
  119. package/dist/data/command-data.tsx +1381 -0
  120. package/dist/data/core-data.tsx +15953 -0
  121. package/dist/data/crm-data.tsx +47 -0
  122. package/dist/data/data.tsx +159 -0
  123. package/dist/data/date-and-time-data.tsx +554 -0
  124. package/dist/data/dependencies.tsx +7 -0
  125. package/dist/data/ecommerce-data.tsx +1387 -0
  126. package/dist/data/forms-data.tsx +7890 -0
  127. package/dist/data/hooks-data.tsx +5487 -0
  128. package/dist/data/index.ts +34 -0
  129. package/dist/data/inputs-data.tsx +557 -0
  130. package/dist/data/interactive-data.tsx +5394 -0
  131. package/dist/data/lofi-data.tsx +18295 -0
  132. package/dist/data/marketing-data.tsx +2546 -0
  133. package/dist/data/media-data.tsx +1510 -0
  134. package/dist/data/motion-data.tsx +5801 -0
  135. package/dist/data/overlay-data.tsx +4136 -0
  136. package/dist/data/pdf-data.tsx +124 -0
  137. package/dist/data/pos-data.tsx +213 -0
  138. package/dist/data/postcss.config.js +6 -0
  139. package/dist/data/primitive-data.tsx +5170 -0
  140. package/dist/data/prompt-data.tsx +1226 -0
  141. package/dist/data/requiredLibs.ts +4 -0
  142. package/dist/data/sandbox-data.tsx +1 -0
  143. package/dist/data/sidebars-data.tsx +5421 -0
  144. package/dist/data/stacks-data.tsx +32 -0
  145. package/dist/data/table-data.tsx +706 -0
  146. package/dist/data/tailwind.config.js +270 -0
  147. package/dist/data/tailwind.config.ngin.js +3830 -0
  148. package/dist/data/tailwind.css +431 -0
  149. package/dist/data/tools-data.tsx +6910 -0
  150. package/dist/data/typography-data.tsx +2050 -0
  151. package/dist/data/utils-data.tsx +6500 -0
  152. package/dist/data/x-data.tsx +1171 -0
  153. package/dist/data.tsx +159 -0
  154. package/package.json +1 -1
  155. package/dist/index.d.ts +0 -3
  156. package/dist/index.d.ts.map +0 -1
  157. package/dist/index.js.map +0 -362
@@ -0,0 +1,150 @@
1
+ import { cn } from "~/components/catalyst-ui";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ import React from "react";
4
+ import { cva } from "class-variance-authority";
5
+ import { ChevronDownIcon } from "lucide-react"
6
+
7
+ // @dev app/components/catalyst-ui/data/primitive-data.tsx:1407
8
+
9
+ function NavigationMenu({
10
+ className,
11
+ children,
12
+ viewport = true,
13
+ ...props
14
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
15
+ viewport?: boolean
16
+ }) {
17
+ return (
18
+ <NavigationMenuPrimitive.Root
19
+ data-slot="navigation-menu"
20
+ data-viewport={viewport}
21
+ className={cn(
22
+ "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
23
+ className
24
+ )}
25
+ {...props}
26
+ >
27
+ {children}
28
+ {viewport && <NavigationMenuViewport />}
29
+ </NavigationMenuPrimitive.Root>
30
+ )
31
+ }
32
+ function NavigationMenuList({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
36
+ return (
37
+ <NavigationMenuPrimitive.List
38
+ data-slot="navigation-menu-list"
39
+ className={cn(
40
+ "group flex flex-1 list-none items-center justify-center gap-1",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ )
46
+ }
47
+ function NavigationMenuItem({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
51
+ return (
52
+ <NavigationMenuPrimitive.Item
53
+ data-slot="navigation-menu-item"
54
+ className={cn("relative", className)}
55
+ {...props}
56
+ />
57
+ )
58
+ }
59
+ const navigationMenuTriggerStyle = cva(
60
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
61
+ )
62
+ function NavigationMenuTrigger({
63
+ className,
64
+ children,
65
+ ...props
66
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
67
+ return (
68
+ <NavigationMenuPrimitive.Trigger
69
+ data-slot="navigation-menu-trigger"
70
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
71
+ {...props}
72
+ >
73
+ {children}{" "}
74
+ <ChevronDownIcon
75
+ className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
76
+ aria-hidden="true"
77
+ />
78
+ </NavigationMenuPrimitive.Trigger>
79
+ )
80
+ }
81
+ function NavigationMenuContent({
82
+ className,
83
+ ...props
84
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
85
+ return (
86
+ <NavigationMenuPrimitive.Content
87
+ data-slot="navigation-menu-content"
88
+ className={cn(
89
+ "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 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
90
+ "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 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: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",
91
+ className
92
+ )}
93
+ {...props}
94
+ />
95
+ )
96
+ }
97
+ function NavigationMenuViewport({
98
+ className,
99
+ ...props
100
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
101
+ return (
102
+ <div
103
+ className={cn(
104
+ "absolute top-full left-0 isolate z-50 flex justify-center"
105
+ )}
106
+ >
107
+ <NavigationMenuPrimitive.Viewport
108
+ data-slot="navigation-menu-viewport"
109
+ className={cn(
110
+ "origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
111
+ className
112
+ )}
113
+ {...props}
114
+ />
115
+ </div>
116
+ )
117
+ }
118
+ function NavigationMenuLink({
119
+ className,
120
+ ...props
121
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
122
+ return (
123
+ <NavigationMenuPrimitive.Link
124
+ data-slot="navigation-menu-link"
125
+ className={cn(
126
+ "data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
127
+ className
128
+ )}
129
+ {...props}
130
+ />
131
+ )
132
+ }
133
+ function NavigationMenuIndicator({
134
+ className,
135
+ ...props
136
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
137
+ return (
138
+ <NavigationMenuPrimitive.Indicator
139
+ data-slot="navigation-menu-indicator"
140
+ className={cn(
141
+ "data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
142
+ className
143
+ )}
144
+ {...props}
145
+ >
146
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
147
+ </NavigationMenuPrimitive.Indicator>
148
+ )
149
+ }
150
+ export { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuContent, NavigationMenuTrigger, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, navigationMenuTriggerStyle,}
@@ -0,0 +1,198 @@
1
+ import * as React from "react"
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
3
+ import { Button, ButtonProps } from "~/components/catalyst-ui"
4
+ import { cn } from "~/components/catalyst-ui"
5
+ // @dev app/components/catalyst-ui/data/primitive-data.tsx:325
6
+
7
+ interface PaginationProps extends React.ComponentProps<"nav"> {}
8
+
9
+ const Pagination = ({ className, ...props }: PaginationProps) => (
10
+ <nav
11
+ role="navigation"
12
+ aria-label="pagination"
13
+ className={cn("mx-auto flex w-full justify-center", className)}
14
+ {...props}
15
+ />
16
+ )
17
+ Pagination.displayName = "Pagination"
18
+
19
+ const PaginationContent = React.forwardRef<
20
+ HTMLUListElement,
21
+ React.ComponentProps<"ul">
22
+ >(({ className, ...props }, ref) => (
23
+ <ul
24
+ ref={ref}
25
+ className={cn("flex flex-row items-center gap-1", className)}
26
+ {...props}
27
+ />
28
+ ))
29
+ PaginationContent.displayName = "PaginationContent"
30
+
31
+ const PaginationItem = React.forwardRef<
32
+ HTMLLIElement,
33
+ React.ComponentProps<"li">
34
+ >(({ className, ...props }, ref) => (
35
+ <li ref={ref} className={cn("", className)} {...props} />
36
+ ))
37
+ PaginationItem.displayName = "PaginationItem"
38
+
39
+ interface PaginationLinkProps extends ButtonProps {
40
+ href?: string
41
+ isActive?: boolean
42
+ }
43
+
44
+ const PaginationLink = ({
45
+ className,
46
+ isActive,
47
+ href,
48
+ size = "icon",
49
+ variant = isActive ? "default" : "ghost",
50
+ ...props
51
+ }: PaginationLinkProps) => (
52
+ <Button
53
+ as={href ? "a" : "button"}
54
+ href={href}
55
+ variant={variant}
56
+ size={size}
57
+ className={cn("h-9 w-9 p-0", className)}
58
+ {...props}
59
+ />
60
+ )
61
+ PaginationLink.displayName = "PaginationLink"
62
+
63
+ interface PaginationPreviousProps extends React.ComponentProps<typeof PaginationLink> {}
64
+
65
+ const PaginationPrevious = ({
66
+ className,
67
+ ...props
68
+ }: PaginationPreviousProps) => (
69
+ <PaginationLink
70
+ aria-label="Go to previous page"
71
+ size="default"
72
+ className={cn("gap-1 pl-2.5", className)}
73
+ {...props}
74
+ >
75
+ <ChevronLeft className="h-4 w-4" />
76
+ <span>Previous</span>
77
+ </PaginationLink>
78
+ )
79
+ PaginationPrevious.displayName = "PaginationPrevious"
80
+
81
+ interface PaginationNextProps extends React.ComponentProps<typeof PaginationLink> {}
82
+
83
+ const PaginationNext = ({
84
+ className,
85
+ ...props
86
+ }: PaginationNextProps) => (
87
+ <PaginationLink
88
+ aria-label="Go to next page"
89
+ size="default"
90
+ className={cn("gap-1 pr-2.5", className)}
91
+ {...props}
92
+ >
93
+ <span>Next</span>
94
+ <ChevronRight className="h-4 w-4" />
95
+ </PaginationLink>
96
+ )
97
+ PaginationNext.displayName = "PaginationNext"
98
+
99
+ const PaginationEllipsis = ({
100
+ className,
101
+ ...props
102
+ }: React.ComponentProps<"span">) => (
103
+ <span
104
+ aria-hidden
105
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
106
+ {...props}
107
+ >
108
+ <MoreHorizontal className="h-4 w-4" />
109
+ <span className="sr-only">More pages</span>
110
+ </span>
111
+ )
112
+ PaginationEllipsis.displayName = "PaginationEllipsis"
113
+
114
+ // Helper component for generating pagination with hrefs
115
+ interface PaginationWithHrefsProps {
116
+ currentPage: number
117
+ totalPages: number
118
+ getHref: (page: number) => string
119
+ className?: string
120
+ }
121
+
122
+ const PaginationWithHrefs: React.FC<PaginationWithHrefsProps> = ({
123
+ currentPage,
124
+ totalPages,
125
+ getHref,
126
+ className,
127
+ }) => {
128
+ const pages = React.useMemo(() => {
129
+ if (totalPages <= 7) {
130
+ return Array.from({ length: totalPages }, (_, i) => i + 1)
131
+ }
132
+
133
+ const delta = 2
134
+ const range = []
135
+ const rangeWithDots = []
136
+
137
+ for (
138
+ let i = Math.max(2, currentPage - delta);
139
+ i <= Math.min(totalPages - 1, currentPage + delta);
140
+ i++
141
+ ) {
142
+ range.push(i)
143
+ }
144
+
145
+ if (currentPage - delta > 2) {
146
+ rangeWithDots.push(1, "...")
147
+ } else {
148
+ rangeWithDots.push(1)
149
+ }
150
+
151
+ rangeWithDots.push(...range)
152
+
153
+ if (currentPage + delta < totalPages - 1) {
154
+ rangeWithDots.push("...", totalPages)
155
+ } else {
156
+ rangeWithDots.push(totalPages)
157
+ }
158
+
159
+ return rangeWithDots
160
+ }, [currentPage, totalPages])
161
+
162
+ return (
163
+ <Pagination className={className}>
164
+ <PaginationContent>
165
+ <PaginationItem>
166
+ <PaginationPrevious
167
+ href={currentPage > 1 ? getHref(currentPage - 1) : undefined}
168
+ disabled={currentPage <= 1}
169
+ />
170
+ </PaginationItem>
171
+
172
+ {pages.map((page, index) => (
173
+ <PaginationItem key={index}>
174
+ {page === "..." ? (
175
+ <PaginationEllipsis />
176
+ ) : (
177
+ <PaginationLink
178
+ href={getHref(page as number)}
179
+ isActive={currentPage === page}
180
+ >
181
+ {page}
182
+ </PaginationLink>
183
+ )}
184
+ </PaginationItem>
185
+ ))}
186
+
187
+ <PaginationItem>
188
+ <PaginationNext
189
+ href={currentPage < totalPages ? getHref(currentPage + 1) : undefined}
190
+ disabled={currentPage >= totalPages}
191
+ />
192
+ </PaginationItem>
193
+ </PaginationContent>
194
+ </Pagination>
195
+ )
196
+ }
197
+
198
+ export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationWithHrefs, type PaginationProps, type PaginationLinkProps }
@@ -0,0 +1,232 @@
1
+ import * as React from "react"
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
3
+ import { X } from "lucide-react"
4
+ import { cn } from "~/components/catalyst-ui"
5
+
6
+ // @dev app/components/catalyst-ui/data/primitive-data.tsx:4449
7
+ export function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
8
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
9
+ }
10
+ export function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
11
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
12
+ }
13
+ export function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
14
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
15
+ }
16
+
17
+ export function PopoverClose({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Close>) {
18
+ return (
19
+ <PopoverPrimitive.Close
20
+ className={cn(
21
+ "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",
22
+ className
23
+ )}
24
+ {...props}
25
+ >
26
+ <X className="h-4 w-4" />
27
+ <span className="sr-only">Close</span>
28
+ </PopoverPrimitive.Close>
29
+ )
30
+ }
31
+
32
+ export function PopoverContent({ className, align = "center", sideOffset = 4, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
33
+ return (
34
+ <PopoverPrimitive.Portal>
35
+ <PopoverPrimitive.Content
36
+ data-slot="popover-content"
37
+ align={align}
38
+ sideOffset={sideOffset}
39
+ className={cn(
40
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
41
+ // Animation states
42
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
43
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
44
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
45
+ // Slide animations based on side
46
+ "data-[side=bottom]:slide-in-from-top-2",
47
+ "data-[side=left]:slide-in-from-right-2",
48
+ "data-[side=right]:slide-in-from-left-2",
49
+ "data-[side=top]:slide-in-from-bottom-2",
50
+ className
51
+ )}
52
+ style={{
53
+ transformOrigin: 'var(--radix-popover-content-transform-origin)'
54
+ }}
55
+ {...props}
56
+ />
57
+ </PopoverPrimitive.Portal>
58
+ )
59
+ }
60
+
61
+ export function PopoverHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
62
+ return (
63
+ <div
64
+ className={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)}
65
+ {...props}
66
+ />
67
+ )
68
+ }
69
+
70
+ export function PopoverFooter({
71
+ className,
72
+ ...props
73
+ }: React.HTMLAttributes<HTMLDivElement>) {
74
+ return (
75
+ <div
76
+ className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
77
+ {...props}
78
+ />
79
+ )
80
+ }
81
+
82
+ export function PopoverTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) {
83
+ return (
84
+ <h3
85
+ className={cn("text-lg font-semibold leading-none tracking-tight", className)}
86
+ {...props}
87
+ />
88
+ )
89
+ }
90
+
91
+ export function PopoverDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) {
92
+ return (
93
+ <p
94
+ className={cn("text-sm text-muted-foreground", className)}
95
+ {...props}
96
+ />
97
+ )
98
+ }
99
+
100
+ // Demo component showing usage
101
+ function PopoverDemo() {
102
+ return (
103
+ <Popover>
104
+ <PopoverTrigger asChild>
105
+ <button className="rounded-md bg-primary px-4 py-2 text-primary-foreground">
106
+ Open Popover
107
+ </button>
108
+ </PopoverTrigger>
109
+ <PopoverContent className="w-80">
110
+ <PopoverClose />
111
+ <PopoverHeader>
112
+ <PopoverTitle>Edit Profile</PopoverTitle>
113
+ <PopoverDescription>
114
+ Make changes to your profile here. Click save when you're done.
115
+ </PopoverDescription>
116
+ </PopoverHeader>
117
+ <div className="grid gap-4 py-4">
118
+ <div className="grid grid-cols-4 items-center gap-4">
119
+ <label htmlFor="name" className="text-right text-sm">
120
+ Name
121
+ </label>
122
+ <input
123
+ id="name"
124
+ defaultValue="Pedro Duarte"
125
+ className="col-span-3 rounded-md border border-input bg-background px-3 py-2 text-sm"
126
+ />
127
+ </div>
128
+ <div className="grid grid-cols-4 items-center gap-4">
129
+ <label htmlFor="username" className="text-right text-sm">
130
+ Username
131
+ </label>
132
+ <input
133
+ id="username"
134
+ defaultValue="@peduarte"
135
+ className="col-span-3 rounded-md border border-input bg-background px-3 py-2 text-sm"
136
+ />
137
+ </div>
138
+ </div>
139
+ <PopoverFooter>
140
+ <button className="inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
141
+ Save changes
142
+ </button>
143
+ </PopoverFooter>
144
+ </PopoverContent>
145
+ </Popover>
146
+ )
147
+ }
148
+
149
+ export function BasicPopoverExample() {
150
+ return (
151
+ <Popover>
152
+ <PopoverTrigger asChild>
153
+ <button className="rounded-md border px-4 py-2">Open</button>
154
+ </PopoverTrigger>
155
+ <PopoverContent>
156
+ <PopoverClose />
157
+ <div className="p-4">
158
+ <h4 className="font-semibold">Popover Content</h4>
159
+ <p className="text-sm text-muted-foreground">
160
+ This is a basic popover example with some content.
161
+ </p>
162
+ </div>
163
+ </PopoverContent>
164
+ </Popover>
165
+ )
166
+ }
167
+
168
+ export function FormPopoverExample() {
169
+ return (
170
+ <Popover>
171
+ <PopoverTrigger asChild>
172
+ <button className="rounded-md bg-blue-600 px-4 py-2 text-white">
173
+ Contact Us
174
+ </button>
175
+ </PopoverTrigger>
176
+ <PopoverContent className="w-96">
177
+ <PopoverHeader>
178
+ <PopoverTitle>Contact Form</PopoverTitle>
179
+ <PopoverDescription>
180
+ Fill out the form below and we'll get back to you soon.
181
+ </PopoverDescription>
182
+ </PopoverHeader>
183
+ <div className="space-y-4 py-4">
184
+ <input
185
+ placeholder="Your email"
186
+ className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
187
+ />
188
+ <textarea
189
+ placeholder="Your message"
190
+ rows={3}
191
+ className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
192
+ />
193
+ </div>
194
+ <PopoverFooter>
195
+ <button className="rounded-md bg-primary px-4 py-2 text-primary-foreground">
196
+ Send Message
197
+ </button>
198
+ </PopoverFooter>
199
+ </PopoverContent>
200
+ </Popover>
201
+ )
202
+ }
203
+
204
+ export function NotificationPopoverExample() {
205
+ return (
206
+ <Popover>
207
+ <PopoverTrigger asChild>
208
+ <button className="relative rounded-md border px-4 py-2">
209
+ Notifications
210
+ <span className="absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-xs text-white">
211
+ 3
212
+ </span>
213
+ </button>
214
+ </PopoverTrigger>
215
+ <PopoverContent className="w-80 p-0">
216
+ <PopoverHeader className="border-b p-4">
217
+ <PopoverTitle>Notifications</PopoverTitle>
218
+ </PopoverHeader>
219
+ <div className="p-2">
220
+ <div className="rounded-md bg-muted p-3 text-sm">
221
+ <p className="font-medium">New message received</p>
222
+ <p className="text-muted-foreground">2 minutes ago</p>
223
+ </div>
224
+ <div className="mt-2 rounded-md p-3 text-sm">
225
+ <p className="font-medium">Payment processed</p>
226
+ <p className="text-muted-foreground">1 hour ago</p>
227
+ </div>
228
+ </div>
229
+ </PopoverContent>
230
+ </Popover>
231
+ )
232
+ }
@@ -0,0 +1,34 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ProgressPrimitive from "@radix-ui/react-progress"
5
+
6
+ import { cn } from "~/components/catalyst-ui"
7
+
8
+ // @dev app/components/catalyst-ui/data/primitive-data.tsx:248
9
+
10
+
11
+ function Progress({
12
+ className,
13
+ value,
14
+ ...props
15
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
16
+ return (
17
+ <ProgressPrimitive.Root
18
+ data-slot="progress"
19
+ className={cn(
20
+ "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ <ProgressPrimitive.Indicator
26
+ data-slot="progress-indicator"
27
+ className="bg-primary h-full w-full flex-1 transition-all"
28
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
29
+ />
30
+ </ProgressPrimitive.Root>
31
+ )
32
+ }
33
+
34
+ export { Progress }
@@ -0,0 +1,43 @@
1
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
2
+ import { Circle } from "lucide-react";
3
+ import React from "react";
4
+ import { cn } from "~/components/catalyst-ui";
5
+
6
+ // @dev app/components/catalyst-ui/data/primitive-data.tsx:2878
7
+ const RadioGroup = React.forwardRef<
8
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10
+ >(({ className, ...props }, ref) => {
11
+ return (
12
+ <RadioGroupPrimitive.Root
13
+ className={cn("grid gap-2", className)}
14
+ {...props}
15
+ ref={ref}
16
+ />
17
+ );
18
+ });
19
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
20
+
21
+ const RadioGroupItem = React.forwardRef<
22
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
23
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
24
+ >(({ className, ...props }, ref) => {
25
+ return (
26
+ <RadioGroupPrimitive.Item
27
+ ref={ref}
28
+ className={cn(
29
+ "aspect-square h-5 w-5 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
30
+ className
31
+ )}
32
+ {...props}
33
+ >
34
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
35
+ <Circle className="h-3 w-3 fill-current text-current" />
36
+ </RadioGroupPrimitive.Indicator>
37
+ </RadioGroupPrimitive.Item>
38
+ );
39
+ });
40
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
41
+
42
+ export { RadioGroup, RadioGroupItem , };
43
+ // RadioCardItem