@catalystsoftware/ui 1.0.5 → 1.0.7

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 (155) hide show
  1. package/dist/data/data.tsx +29 -29
  2. package/dist/data/tailwind.config.js +3821 -261
  3. package/dist/data.tsx +29 -29
  4. package/package.json +4 -3
  5. package/components/catalyst-ui/buttons/burger.tsx +0 -207
  6. package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
  7. package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
  8. package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
  9. package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
  10. package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
  11. package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
  12. package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
  13. package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
  14. package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
  15. package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
  16. package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
  17. package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
  18. package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
  19. package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
  20. package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
  21. package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
  22. package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
  23. package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
  24. package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
  25. package/components/catalyst-ui/media/image.tsx +0 -13
  26. package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
  27. package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
  28. package/components/catalyst-ui/primitives/accordion.tsx +0 -250
  29. package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
  30. package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
  31. package/components/catalyst-ui/primitives/avatar.tsx +0 -296
  32. package/components/catalyst-ui/primitives/badge.tsx +0 -57
  33. package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
  34. package/components/catalyst-ui/primitives/button.tsx +0 -265
  35. package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
  36. package/components/catalyst-ui/primitives/calendar.tsx +0 -295
  37. package/components/catalyst-ui/primitives/card.tsx +0 -618
  38. package/components/catalyst-ui/primitives/carousel.tsx +0 -238
  39. package/components/catalyst-ui/primitives/chart.tsx +0 -347
  40. package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
  41. package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
  42. package/components/catalyst-ui/primitives/command.tsx +0 -393
  43. package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
  44. package/components/catalyst-ui/primitives/dialog.tsx +0 -471
  45. package/components/catalyst-ui/primitives/drawer.tsx +0 -761
  46. package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
  47. package/components/catalyst-ui/primitives/empty.tsx +0 -104
  48. package/components/catalyst-ui/primitives/field.tsx +0 -244
  49. package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
  50. package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
  51. package/components/catalyst-ui/primitives/input.tsx +0 -64
  52. package/components/catalyst-ui/primitives/item.tsx +0 -196
  53. package/components/catalyst-ui/primitives/kbd.tsx +0 -75
  54. package/components/catalyst-ui/primitives/label.tsx +0 -24
  55. package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
  56. package/components/catalyst-ui/primitives/pagination.tsx +0 -198
  57. package/components/catalyst-ui/primitives/popover.tsx +0 -232
  58. package/components/catalyst-ui/primitives/progress.tsx +0 -34
  59. package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
  60. package/components/catalyst-ui/primitives/resizable.tsx +0 -56
  61. package/components/catalyst-ui/primitives/select.tsx +0 -155
  62. package/components/catalyst-ui/primitives/separator.tsx +0 -74
  63. package/components/catalyst-ui/primitives/sheet.tsx +0 -126
  64. package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
  65. package/components/catalyst-ui/primitives/slider.tsx +0 -27
  66. package/components/catalyst-ui/primitives/switch.tsx +0 -187
  67. package/components/catalyst-ui/primitives/tabs.tsx +0 -335
  68. package/components/catalyst-ui/primitives/textarea.tsx +0 -24
  69. package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
  70. package/components/catalyst-ui/primitives/toggle.tsx +0 -42
  71. package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
  72. package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
  73. package/components/catalyst-ui/utils/context-storage.tsx +0 -19
  74. package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
  75. package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
  76. package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
  77. package/components/catalyst-ui/utils/incId.tsx +0 -75
  78. package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
  79. package/components/catalyst-ui/utils/request-id.tsx +0 -14
  80. package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
  81. package/components/catalyst-ui/utils/server-timing.tsx +0 -23
  82. package/components/catalyst-ui/utils/utils.ts +0 -43
  83. package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
  84. package/components/catalyst-ui/x/accordian-x.tsx +0 -428
  85. package/components/catalyst-ui/x/alert-x.tsx +0 -413
  86. package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
  87. package/components/catalyst-ui/x/avatar-x.tsx +0 -515
  88. package/components/catalyst-ui/x/badge-x.tsx +0 -670
  89. package/components/catalyst-ui/x/button-X.tsx +0 -2857
  90. package/components/catalyst-ui/x/button-group-x.tsx +0 -847
  91. package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
  92. package/components/catalyst-ui/x/card-x.tsx +0 -2597
  93. package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
  94. package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
  95. package/components/catalyst-ui/x/combobox-x.tsx +0 -911
  96. package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
  97. package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
  98. package/components/catalyst-ui/x/dialog-x.tsx +0 -659
  99. package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
  100. package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
  101. package/components/catalyst-ui/x/icon-x.tsx +0 -840
  102. package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
  103. package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
  104. package/components/catalyst-ui/x/loader-x.tsx +0 -1757
  105. package/components/catalyst-ui/x/pagination-x.tsx +0 -622
  106. package/components/catalyst-ui/x/popover-x.tsx +0 -744
  107. package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
  108. package/components/catalyst-ui/x/select-x.tsx +0 -1127
  109. package/components/catalyst-ui/x/sheet-x.tsx +0 -668
  110. package/components/catalyst-ui/x/switch-x.tsx +0 -681
  111. package/components/catalyst-ui/x/table-x.tsx +0 -574
  112. package/components/catalyst-ui/x/tabs-x.tsx +0 -839
  113. package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
  114. package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
  115. package/components/catalyst-ui/x/tracker-x.tsx +0 -560
  116. package/data/bg-data.tsx +0 -901
  117. package/data/buttons-data.tsx +0 -2327
  118. package/data/charts-data.tsx +0 -102
  119. package/data/chat-data.tsx +0 -83
  120. package/data/code-data.tsx +0 -1040
  121. package/data/comboboxes-data.tsx +0 -1843
  122. package/data/command-data.tsx +0 -1381
  123. package/data/core-data.tsx +0 -15953
  124. package/data/crm-data.tsx +0 -47
  125. package/data/data.tsx +0 -159
  126. package/data/date-and-time-data.tsx +0 -554
  127. package/data/dependencies.tsx +0 -7
  128. package/data/ecommerce-data.tsx +0 -1387
  129. package/data/forms-data.tsx +0 -7890
  130. package/data/hooks-data.tsx +0 -5487
  131. package/data/index.ts +0 -34
  132. package/data/inputs-data.tsx +0 -557
  133. package/data/interactive-data.tsx +0 -5394
  134. package/data/lofi-data.tsx +0 -18295
  135. package/data/marketing-data.tsx +0 -2546
  136. package/data/media-data.tsx +0 -1510
  137. package/data/motion-data.tsx +0 -5801
  138. package/data/overlay-data.tsx +0 -4136
  139. package/data/pdf-data.tsx +0 -124
  140. package/data/pos-data.tsx +0 -213
  141. package/data/postcss.config.js +0 -6
  142. package/data/primitive-data.tsx +0 -5170
  143. package/data/prompt-data.tsx +0 -1226
  144. package/data/requiredLibs.ts +0 -4
  145. package/data/sandbox-data.tsx +0 -1
  146. package/data/sidebars-data.tsx +0 -5421
  147. package/data/stacks-data.tsx +0 -32
  148. package/data/table-data.tsx +0 -706
  149. package/data/tailwind.config.js +0 -270
  150. package/data/tailwind.config.ngin.js +0 -3830
  151. package/data/tailwind.css +0 -431
  152. package/data/tools-data.tsx +0 -6910
  153. package/data/typography-data.tsx +0 -2050
  154. package/data/utils-data.tsx +0 -6500
  155. package/data/x-data.tsx +0 -1171
@@ -1,250 +0,0 @@
1
- import * as React from "react"
2
- import * as AccordionPrimitive from "@radix-ui/react-accordion"
3
- import { ChevronDown } from "lucide-react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
- import { cn } from "~/components/catalyst-ui"
6
-
7
- export const accordionVariants = cva("w-full", {
8
- variants: {
9
- variant: {
10
- default: "",
11
- split: "space-y-2",
12
- outline: "space-y-2",
13
- box: "rounded-md border",
14
- tabs: "",
15
- tabsOutline: "",
16
- filled: "space-y-2",
17
- },
18
- },
19
- defaultVariants: {
20
- variant: "default",
21
- },
22
- })
23
-
24
- export const accordionItemVariants = cva("border-b w-full", {
25
- variants: {
26
- variant: {
27
- default: "",
28
- split: "bg-card rounded-md border-b-0 shadow-md data-[state=open]:shadow-lg",
29
- outline: "rounded-md border!",
30
- box: "",
31
- tabs: "data-[state=open]:bg-accent rounded-md border-none px-5 transition-colors duration-200",
32
- tabsOutline: "data-[state=open]:border-border rounded-md border border-transparent px-5 transition-colors duration-200 data-[state=open]:border data-[state=open]:shadow-md",
33
- filled: "rounded-md border!",
34
- },
35
- },
36
- defaultVariants: {
37
- variant: "default",
38
- },
39
- })
40
-
41
- export const accordionTriggerVariants = cva(
42
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180 text-muted-foreground w-full text-left",
43
- {
44
- variants: {
45
- variant: {
46
- default: "",
47
- split: "px-5 [&>svg]:rotate-90 [&[data-state=open]>svg]:rotate-0",
48
- outline: "px-5",
49
- box: "px-5",
50
- tabs: "",
51
- tabsOutline: "",
52
- filled: "bg-accent px-5 data-[state=open]:rounded-b-none",
53
- },
54
- },
55
- defaultVariants: {
56
- variant: "default",
57
- },
58
- }
59
- )
60
-
61
- export const accordionContentVariants = cva("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", {
62
- variants: {
63
- variant: {
64
- default: "",
65
- split: "",
66
- outline: "",
67
- box: "",
68
- tabs: "",
69
- tabsOutline: "",
70
- filled: "",
71
- },
72
- },
73
- defaultVariants: {
74
- variant: "default",
75
- },
76
- })
77
-
78
- export const accordionContentInnerVariants = cva("pb-4 pt-0", {
79
- variants: {
80
- variant: {
81
- default: "",
82
- split: "text-muted-foreground px-5",
83
- outline: "text-muted-foreground px-5",
84
- box: "text-muted-foreground px-5",
85
- tabs: "text-muted-foreground",
86
- tabsOutline: "text-muted-foreground",
87
- filled: "text-muted-foreground px-5 pt-4",
88
- },
89
- },
90
- defaultVariants: {
91
- variant: "default",
92
- },
93
- })
94
-
95
- type AccordionContextType = {
96
- variant?: VariantProps<typeof accordionVariants>["variant"]
97
- }
98
-
99
- const AccordionContext = React.createContext<AccordionContextType>({
100
- variant: "default",
101
- })
102
-
103
- const useAccordionContext = () => {
104
- const context = React.useContext(AccordionContext)
105
- if (!context) {
106
- throw new Error("Accordion components must be used within Accordion")
107
- }
108
- return context
109
- }
110
-
111
- const Accordion = React.forwardRef<
112
- React.ElementRef<typeof AccordionPrimitive.Root>,
113
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root> &
114
- VariantProps<typeof accordionVariants>
115
- >(({ className, variant, ...props }, ref) => (
116
- <AccordionContext.Provider value={{ variant }}>
117
- <AccordionPrimitive.Root
118
- ref={ref}
119
- className={cn(accordionVariants({ variant }), className)}
120
- {...props}
121
- />
122
- </AccordionContext.Provider>
123
- ))
124
- Accordion.displayName = "Accordion"
125
-
126
- const AccordionItem = React.forwardRef<
127
- React.ElementRef<typeof AccordionPrimitive.Item>,
128
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
129
- >(({ className, ...props }, ref) => {
130
- const { variant } = useAccordionContext()
131
- return (
132
- <AccordionPrimitive.Item
133
- ref={ref}
134
- className={cn(accordionItemVariants({ variant }), className)}
135
- {...props}
136
- />
137
- )
138
- })
139
- AccordionItem.displayName = "AccordionItem"
140
-
141
- const AccordionTrigger = React.forwardRef<
142
- React.ElementRef<typeof AccordionPrimitive.Trigger>,
143
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
144
- >(({ className, children, ...props }, ref) => {
145
- const { variant } = useAccordionContext()
146
- return (
147
- <AccordionPrimitive.Header className="flex">
148
- <AccordionPrimitive.Trigger
149
- ref={ref}
150
- className={cn(accordionTriggerVariants({ variant }), className)}
151
- {...props}
152
- >
153
- {children}
154
- <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
155
- </AccordionPrimitive.Trigger>
156
- </AccordionPrimitive.Header>
157
- )
158
- })
159
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
160
-
161
- const AccordionContent = React.forwardRef<
162
- React.ElementRef<typeof AccordionPrimitive.Content>,
163
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
164
- >(({ className, children, ...props }, ref) => {
165
- const { variant } = useAccordionContext()
166
- return (
167
- <AccordionPrimitive.Content
168
- ref={ref}
169
- className={cn(accordionContentVariants({ variant }))}
170
- {...props}
171
- >
172
- <div className={cn(accordionContentInnerVariants({ variant }), className)}>
173
- {children}
174
- </div>
175
- </AccordionPrimitive.Content>
176
- )
177
- })
178
- AccordionContent.displayName = AccordionPrimitive.Content.displayName
179
-
180
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
181
-
182
-
183
- /**import * as React from "react"
184
- import * as AccordionPrimitive from "@radix-ui/react-accordion"
185
- import { ChevronDown } from "lucide-react"
186
- import { cn } from "~/components/catalyst-ui"
187
-
188
- const Accordion = React.forwardRef<
189
- React.ElementRef<typeof AccordionPrimitive.Root>,
190
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>
191
- >(({ className, ...props }, ref) => (
192
- <AccordionPrimitive.Root
193
- ref={ref}
194
- className={cn("w-full", className)} // Default to full width
195
- {...props}
196
- />
197
- ))
198
- Accordion.displayName = "Accordion"
199
-
200
- const AccordionItem = React.forwardRef<
201
- React.ElementRef<typeof AccordionPrimitive.Item>,
202
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
203
- >(({ className, ...props }, ref) => (
204
- <AccordionPrimitive.Item
205
- ref={ref}
206
- className={cn("border-b w-full", className)}
207
- {...props}
208
- />
209
- ))
210
- AccordionItem.displayName = "AccordionItem"
211
-
212
- const AccordionTrigger = React.forwardRef<
213
- React.ElementRef<typeof AccordionPrimitive.Trigger>,
214
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
215
- >(({ className, children, ...props }, ref) => (
216
- <AccordionPrimitive.Header className="flex">
217
- <AccordionPrimitive.Trigger
218
- ref={ref}
219
- className={cn(
220
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180 text-muted-foreground",
221
- "w-full text-left",
222
- className
223
- )}
224
- {...props}
225
- >
226
- {children}
227
- <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
228
- </AccordionPrimitive.Trigger>
229
- </AccordionPrimitive.Header>
230
- ))
231
- AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
232
-
233
- const AccordionContent = React.forwardRef<
234
- React.ElementRef<typeof AccordionPrimitive.Content>,
235
- React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
236
- >(({ className, children, ...props }, ref) => (
237
- <AccordionPrimitive.Content
238
- ref={ref}
239
- className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
240
- {...props}
241
- >
242
- <div className={cn("pb-4 pt-0", className)}>{children}</div>
243
- </AccordionPrimitive.Content>
244
- ))
245
- AccordionContent.displayName = AccordionPrimitive.Content.displayName
246
-
247
-
248
-
249
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent} */
250
-
@@ -1,126 +0,0 @@
1
- import React from 'react'
2
- import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
3
- import { cn } from '~/components/catalyst-ui'
4
- import { buttonVariants } from "~/components/catalyst-ui"
5
-
6
- // @dev app/components/catalyst-ui/data/primitive-data.tsx:4005
7
- const AlertDialog = AlertDialogPrimitive.Root
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-background/80 backdrop-blur-sm 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 = AlertDialogPrimitive.Description.displayName
96
-
97
- const AlertDialogAction = React.forwardRef<
98
- React.ElementRef<typeof AlertDialogPrimitive.Action>,
99
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
100
- >(({ className, ...props }, ref) => (
101
- <AlertDialogPrimitive.Action
102
- ref={ref}
103
- className={cn(buttonVariants(), className)}
104
- {...props}
105
- />
106
- ))
107
- AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
108
-
109
- const AlertDialogCancel = React.forwardRef<
110
- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
111
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
112
- >(({ className, ...props }, ref) => (
113
- <AlertDialogPrimitive.Cancel
114
- ref={ref}
115
- className={cn(
116
- buttonVariants({ variant: 'outline' }),
117
- 'mt-2 sm:mt-0',
118
- className
119
- )}
120
- {...props}
121
- />
122
- ))
123
- AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
124
-
125
- export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel,
126
- }
@@ -1,9 +0,0 @@
1
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
2
-
3
- function AspectRatio({
4
- ...props
5
- }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
6
- return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
7
- }
8
-
9
- export { AspectRatio }
@@ -1,296 +0,0 @@
1
- import * as AvatarPrimitive from '@radix-ui/react-avatar'
2
- import { cn } from '~/components/catalyst-ui'
3
- import { cva, type VariantProps } from "class-variance-authority"
4
- import React, { Children, type ReactNode } from "react"
5
-
6
- const avatarVariants = cva(
7
- 'relative flex shrink-0 overflow-hidden rounded-full',
8
- {
9
- variants: {
10
- variant: {
11
- default: '',
12
- ring: 'ring-ring ring-2',
13
- rounded: 'rounded-sm',
14
- 'status-ring': 'ring-offset-background ring-2 ring-green-600 ring-offset-2 dark:ring-green-400',
15
- 'group-ring': 'ring-background ring-2',
16
- 'group-transition': 'ring-background ring-2 transition-all duration-300 ease-in-out',
17
- 'group-hover-lift': 'ring-background ring-2 transition-all duration-300 ease-in-out hover:z-1 hover:-translate-y-1 hover:shadow-md',
18
- gradient: '',
19
- "gradient-outline": "",
20
- "in-progress": "",
21
- blocked: "",
22
- completed: "",
23
- pending: "",
24
- failed: "",
25
- successful: "",
26
- notification: "",
27
- },
28
- size: {
29
- default: 'w-10 h-10',
30
- sm: 'w-8 h-8',
31
- md: 'w-10 h-10',
32
- lg: 'w-12 h-12',
33
- xl: 'w-16 h-16',
34
- },
35
- status: {
36
- busy: 'bg-destructive',
37
- online: 'bg-green-400',
38
- ring: 'bg-green-400',
39
- away: 'bg-amber-400',
40
- none: '',
41
- },
42
- statusPosition: {
43
- 'bottom-right': '-right-0.5 -bottom-0.5',
44
- 'top-right': '-right-0.5 -top-0.5',
45
- 'bottom-left': '-left-0.5 -bottom-0.5',
46
- 'top-left': '-left-0.5 -top-0.5',
47
- 'bottom-right-lg': '-right-1.5 -bottom-1.5',
48
- 'top-right-lg': '-right-1.5 -top-1.5',
49
- 'bottom-left-lg': '-left-1.5 -bottom-1.5',
50
- 'top-left-lg': '-left-1.5 -top-1.5',
51
- none: '',
52
- },
53
- },
54
- defaultVariants: {
55
- variant: 'default',
56
- size: 'default',
57
- status: 'none',
58
- statusPosition: 'none',
59
- },
60
- }
61
- )
62
-
63
- export interface AvatarProps
64
- extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,
65
- VariantProps<typeof avatarVariants> { }
66
-
67
- const Avatar = React.forwardRef<
68
- React.ElementRef<typeof AvatarPrimitive.Root>,
69
- AvatarProps
70
- >(({ className, variant, size, ...props }, ref) => (
71
- <AvatarPrimitive.Root
72
- ref={ref}
73
- className={cn(avatarVariants({ variant, size }), className)}
74
- {...props}
75
- />
76
- ))
77
- Avatar.displayName = AvatarPrimitive.Root.displayName
78
-
79
- const AvatarImage = React.forwardRef<
80
- React.ElementRef<typeof AvatarPrimitive.Image>,
81
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
82
- >(({ className, ...props }, ref) => (
83
- <AvatarPrimitive.Image
84
- ref={ref}
85
- className={cn('aspect-square h-full w-full', className)}
86
- {...props}
87
- />
88
- ))
89
- AvatarImage.displayName = AvatarPrimitive.Image.displayName
90
-
91
- const AvatarFallback = React.forwardRef<
92
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
93
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
94
- >(({ className, ...props }, ref) => (
95
- <AvatarPrimitive.Fallback
96
- ref={ref}
97
- className={cn(
98
- 'flex h-full w-full items-center justify-center rounded-full bg-muted',
99
- className
100
- )}
101
- {...props}
102
- />
103
- ))
104
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
105
-
106
- type AvatarStackProps = {
107
- children: ReactNode;
108
- className?: string;
109
- animate?: boolean;
110
- size?: number;
111
- }
112
-
113
- const AvatarStack = ({
114
- children,
115
- className,
116
- animate = false,
117
- size = 40,
118
- ...props
119
- }: AvatarStackProps) => (
120
- <div
121
- className={cn(
122
- "-space-x-1 flex items-center",
123
- animate && "hover:space-x-0 [&>*]:transition-all",
124
- className
125
- )}
126
- {...props}
127
- >
128
- {Children.map(children, (child, index) => {
129
- if (!child) {
130
- return null;
131
- }
132
-
133
- return (
134
- <div
135
- className={cn(
136
- "size-full shrink-0 overflow-hidden rounded-full",
137
- '[&_[data-slot="avatar"]]:size-full',
138
- className
139
- )}
140
- style={{
141
- width: size,
142
- height: size,
143
- maskImage: index
144
- ? `radial-gradient(circle ${size / 2}px at -${size / 4 + size / 10}px 50%, transparent 99%, white 100%)`
145
- : "",
146
- }}
147
- >
148
- {child}
149
- </div>
150
- );
151
- })}
152
- </div>
153
- )
154
-
155
- const AvatarGroupVariants = cva("flex items-center", {
156
- variants: {
157
- spacing: {
158
- tight: "-space-x-2",
159
- default: "-space-x-1",
160
- loose: "-space-x-0.5",
161
- none: "space-x-0",
162
- },
163
- direction: {
164
- row: 'flex items-center -space-x-1',
165
- stack: 'flex flex-col items-center -space-y-1'
166
- }
167
- },
168
- defaultVariants: {
169
- spacing: "default",
170
- },
171
- })
172
-
173
- type AvatarMoreProps = {
174
- count: number;
175
- className?: string;
176
- size?: number;
177
- }
178
-
179
- const AvatarMore = ({
180
- count,
181
- className,
182
- size = 40,
183
- ...props
184
- }: AvatarMoreProps) => (
185
- <div
186
- data-slot="avatar"
187
- className={cn(
188
- "bg-muted text-muted-foreground flex shrink-0 items-center justify-center overflow-hidden rounded-full text-xs font-medium",
189
- className,
190
- )}
191
- style={{
192
- width: size,
193
- height: size,
194
- }}
195
- {...props}
196
- >
197
- +{count}
198
- </div>
199
- )
200
-
201
- function AvatarGroupTooltip(props: any) {
202
- return <div {...props} />
203
- }
204
-
205
- type AvatarGroupVariant = 'motion' | 'css' | 'stack'
206
-
207
- type AvatarGroupProps = Omit<React.ComponentProps<'div'>, 'translate'> & {
208
- children: React.ReactElement[];
209
- variant?: AvatarGroupVariant;
210
- transition?: any;
211
- invertOverlap?: boolean;
212
- translate?: string | number;
213
- tooltipProps?: any;
214
- animate?: boolean;
215
- size?: number;
216
- }
217
-
218
- function AvatarGroup({
219
- ref,
220
- children,
221
- className,
222
- variant = 'motion',
223
- transition = { type: 'spring', stiffness: 300, damping: 17 },
224
- invertOverlap = false,
225
- translate = '-30%',
226
- tooltipProps = { side: 'top', sideOffset: 24 },
227
- animate = false,
228
- size = 40,
229
- ...props
230
- }: AvatarGroupProps) {
231
- // Stack variant
232
- if (variant === 'stack') {
233
- return (
234
- <div
235
- ref={ref}
236
- className={cn(
237
- '-space-x-1 flex items-center',
238
- animate && 'hover:space-x-0 [&>*]:transition-all',
239
- className
240
- )}
241
- {...props}
242
- >
243
- {Children.map(children, (child, index) => {
244
- if (!child) {
245
- return null;
246
- }
247
- return (
248
- <div
249
- key={index}
250
- className={cn(
251
- "size-full shrink-0 overflow-hidden rounded-full",
252
- '[&_[data-slot="avatar"]]:size-full',
253
- )}
254
- style={{
255
- width: size,
256
- height: size,
257
- maskImage: index
258
- ? `radial-gradient(circle ${size / 2}px at -${size / 4 + size / 10}px 50%, transparent 99%, white 100%)`
259
- : "",
260
- }}
261
- >
262
- {child}
263
- </div>
264
- );
265
- })}
266
- </div>
267
- );
268
- }
269
-
270
- // Motion and CSS variants
271
- return (
272
- <div
273
- ref={ref}
274
- data-slot="avatar-group"
275
- className={cn(
276
- 'flex items-center',
277
- variant === 'css' && '-space-x-3',
278
- variant === 'motion' && 'flex-row -space-x-2 h-8',
279
- className
280
- )}
281
- {...props}
282
- >
283
- {children?.map((child, index) => {
284
- const zIndex = invertOverlap ? React.Children.count(children) - index : index;
285
-
286
- return (
287
- <div key={index} style={{ zIndex }}>
288
- {child}
289
- </div>
290
- );
291
- })}
292
- </div>
293
- );
294
- }
295
-
296
- export { Avatar, AvatarImage, AvatarFallback, AvatarStack, AvatarMore, AvatarGroup, AvatarGroupTooltip, avatarVariants, AvatarGroupVariants }