@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.
- package/data/tailwind.config.js +261 -3821
- package/dist/components/catalyst-ui/buttons/burger.tsx +207 -0
- package/dist/components/catalyst-ui/core/data-display/timeline.tsx +210 -0
- package/dist/components/catalyst-ui/core/feedback/alert.tsx +491 -0
- package/dist/components/catalyst-ui/core/feedback/spinner-1.tsx +65 -0
- package/dist/components/catalyst-ui/core/feedback/toast.tsx +1857 -0
- package/dist/components/catalyst-ui/core/navigation/menu.tsx +164 -0
- package/dist/components/catalyst-ui/forms/toggle-class.tsx +176 -0
- package/dist/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +419 -0
- package/dist/components/catalyst-ui/hooks/use-counter.tsx +13 -0
- package/dist/components/catalyst-ui/hooks/use-event-listener.tsx +23 -0
- package/dist/components/catalyst-ui/hooks/use-export-markdown.tsx +47 -0
- package/dist/components/catalyst-ui/hooks/use-focus.tsx +17 -0
- package/dist/components/catalyst-ui/hooks/use-interval.tsx +23 -0
- package/dist/components/catalyst-ui/hooks/use-is-client.tsx +16 -0
- package/dist/components/catalyst-ui/hooks/use-media-query.tsx +19 -0
- package/dist/components/catalyst-ui/hooks/use-mobile.tsx +19 -0
- package/dist/components/catalyst-ui/hooks/use-resize-observer.tsx +81 -0
- package/dist/components/catalyst-ui/hooks/use-timeout.tsx +21 -0
- package/dist/components/catalyst-ui/hooks/use-timer.tsx +209 -0
- package/dist/components/catalyst-ui/hooks/use-toggle.tsx +12 -0
- package/dist/components/catalyst-ui/media/image.tsx +13 -0
- package/dist/components/catalyst-ui/overlays/dual-sidebar.tsx +4142 -0
- package/dist/components/catalyst-ui/overlays/sidebar-original.tsx +726 -0
- package/dist/components/catalyst-ui/primitives/accordion.tsx +250 -0
- package/dist/components/catalyst-ui/primitives/alert-dialog.tsx +126 -0
- package/dist/components/catalyst-ui/primitives/aspect-ratio.tsx +9 -0
- package/dist/components/catalyst-ui/primitives/avatar.tsx +296 -0
- package/dist/components/catalyst-ui/primitives/badge.tsx +57 -0
- package/dist/components/catalyst-ui/primitives/breadcrumb.tsx +101 -0
- package/dist/components/catalyst-ui/primitives/button.tsx +265 -0
- package/dist/components/catalyst-ui/primitives/calendar-v4.tsx +208 -0
- package/dist/components/catalyst-ui/primitives/calendar.tsx +295 -0
- package/dist/components/catalyst-ui/primitives/card.tsx +618 -0
- package/dist/components/catalyst-ui/primitives/carousel.tsx +238 -0
- package/dist/components/catalyst-ui/primitives/chart.tsx +347 -0
- package/dist/components/catalyst-ui/primitives/checkbox.tsx +225 -0
- package/dist/components/catalyst-ui/primitives/collapsible.tsx +212 -0
- package/dist/components/catalyst-ui/primitives/command.tsx +393 -0
- package/dist/components/catalyst-ui/primitives/context-menu.tsx +236 -0
- package/dist/components/catalyst-ui/primitives/dialog.tsx +471 -0
- package/dist/components/catalyst-ui/primitives/drawer.tsx +761 -0
- package/dist/components/catalyst-ui/primitives/dropdown-menu.tsx +290 -0
- package/dist/components/catalyst-ui/primitives/empty.tsx +104 -0
- package/dist/components/catalyst-ui/primitives/field.tsx +244 -0
- package/dist/components/catalyst-ui/primitives/hover-card.tsx +124 -0
- package/dist/components/catalyst-ui/primitives/input-otp.tsx +76 -0
- package/dist/components/catalyst-ui/primitives/input.tsx +64 -0
- package/dist/components/catalyst-ui/primitives/item.tsx +196 -0
- package/dist/components/catalyst-ui/primitives/kbd.tsx +75 -0
- package/dist/components/catalyst-ui/primitives/label.tsx +24 -0
- package/dist/components/catalyst-ui/primitives/navigation-menu.tsx +150 -0
- package/dist/components/catalyst-ui/primitives/pagination.tsx +198 -0
- package/dist/components/catalyst-ui/primitives/popover.tsx +232 -0
- package/dist/components/catalyst-ui/primitives/progress.tsx +34 -0
- package/dist/components/catalyst-ui/primitives/radio-group.tsx +43 -0
- package/dist/components/catalyst-ui/primitives/resizable.tsx +56 -0
- package/dist/components/catalyst-ui/primitives/select.tsx +155 -0
- package/dist/components/catalyst-ui/primitives/separator.tsx +74 -0
- package/dist/components/catalyst-ui/primitives/sheet.tsx +126 -0
- package/dist/components/catalyst-ui/primitives/skeleton.tsx +15 -0
- package/dist/components/catalyst-ui/primitives/slider.tsx +27 -0
- package/dist/components/catalyst-ui/primitives/switch.tsx +187 -0
- package/dist/components/catalyst-ui/primitives/tabs.tsx +335 -0
- package/dist/components/catalyst-ui/primitives/textarea.tsx +24 -0
- package/dist/components/catalyst-ui/primitives/toggle-group.tsx +55 -0
- package/dist/components/catalyst-ui/primitives/toggle.tsx +42 -0
- package/dist/components/catalyst-ui/primitives/tooltip.tsx +116 -0
- package/dist/components/catalyst-ui/utils/basic-auth.tsx +40 -0
- package/dist/components/catalyst-ui/utils/context-storage.tsx +19 -0
- package/dist/components/catalyst-ui/utils/cors-middleware.tsx +71 -0
- package/dist/components/catalyst-ui/utils/deferred-content.tsx +595 -0
- package/dist/components/catalyst-ui/utils/honeypot-middleware.tsx +38 -0
- package/dist/components/catalyst-ui/utils/incId.tsx +75 -0
- package/dist/components/catalyst-ui/utils/jwk-auth.tsx +36 -0
- package/dist/components/catalyst-ui/utils/request-id.tsx +14 -0
- package/dist/components/catalyst-ui/utils/secure-headers.tsx +37 -0
- package/dist/components/catalyst-ui/utils/server-timing.tsx +23 -0
- package/dist/components/catalyst-ui/utils/utils.ts +43 -0
- package/dist/components/catalyst-ui/utils/with-cookie.tsx +43 -0
- package/dist/components/catalyst-ui/x/accordian-x.tsx +428 -0
- package/dist/components/catalyst-ui/x/alert-x.tsx +413 -0
- package/dist/components/catalyst-ui/x/animated-text-x.tsx +2242 -0
- package/dist/components/catalyst-ui/x/avatar-x.tsx +515 -0
- package/dist/components/catalyst-ui/x/badge-x.tsx +670 -0
- package/dist/components/catalyst-ui/x/button-X.tsx +2857 -0
- package/dist/components/catalyst-ui/x/button-group-x.tsx +847 -0
- package/dist/components/catalyst-ui/x/calendar-x.tsx +1910 -0
- package/dist/components/catalyst-ui/x/card-x.tsx +2597 -0
- package/dist/components/catalyst-ui/x/checkbox-x.tsx +656 -0
- package/dist/components/catalyst-ui/x/collapsible-x.tsx +1360 -0
- package/dist/components/catalyst-ui/x/combobox-x.tsx +911 -0
- package/dist/components/catalyst-ui/x/data-table-x.tsx +1753 -0
- package/dist/components/catalyst-ui/x/date-picker-x.tsx +648 -0
- package/dist/components/catalyst-ui/x/dialog-x.tsx +659 -0
- package/dist/components/catalyst-ui/x/dropdown-menu-x.tsx +612 -0
- package/dist/components/catalyst-ui/x/hover-card-x.tsx +375 -0
- package/dist/components/catalyst-ui/x/icon-x.tsx +840 -0
- package/dist/components/catalyst-ui/x/input-mask-x.tsx +981 -0
- package/dist/components/catalyst-ui/x/input-otp-x.tsx +659 -0
- package/dist/components/catalyst-ui/x/loader-x.tsx +1757 -0
- package/dist/components/catalyst-ui/x/pagination-x.tsx +622 -0
- package/dist/components/catalyst-ui/x/popover-x.tsx +744 -0
- package/dist/components/catalyst-ui/x/radio-group-x.tsx +499 -0
- package/dist/components/catalyst-ui/x/select-x.tsx +1127 -0
- package/dist/components/catalyst-ui/x/sheet-x.tsx +668 -0
- package/dist/components/catalyst-ui/x/switch-x.tsx +681 -0
- package/dist/components/catalyst-ui/x/table-x.tsx +574 -0
- package/dist/components/catalyst-ui/x/tabs-x.tsx +839 -0
- package/dist/components/catalyst-ui/x/textarea-x.tsx +1263 -0
- package/dist/components/catalyst-ui/x/tooltip-x.tsx +396 -0
- package/dist/components/catalyst-ui/x/tracker-x.tsx +560 -0
- package/dist/data/bg-data.tsx +901 -0
- package/dist/data/buttons-data.tsx +2327 -0
- package/dist/data/charts-data.tsx +102 -0
- package/dist/data/chat-data.tsx +83 -0
- package/dist/data/code-data.tsx +1040 -0
- package/dist/data/comboboxes-data.tsx +1843 -0
- package/dist/data/command-data.tsx +1381 -0
- package/dist/data/core-data.tsx +15953 -0
- package/dist/data/crm-data.tsx +47 -0
- package/dist/data/data.tsx +159 -0
- package/dist/data/date-and-time-data.tsx +554 -0
- package/dist/data/dependencies.tsx +7 -0
- package/dist/data/ecommerce-data.tsx +1387 -0
- package/dist/data/forms-data.tsx +7890 -0
- package/dist/data/hooks-data.tsx +5487 -0
- package/dist/data/index.ts +34 -0
- package/dist/data/inputs-data.tsx +557 -0
- package/dist/data/interactive-data.tsx +5394 -0
- package/dist/data/lofi-data.tsx +18295 -0
- package/dist/data/marketing-data.tsx +2546 -0
- package/dist/data/media-data.tsx +1510 -0
- package/dist/data/motion-data.tsx +5801 -0
- package/dist/data/overlay-data.tsx +4136 -0
- package/dist/data/pdf-data.tsx +124 -0
- package/dist/data/pos-data.tsx +213 -0
- package/dist/data/postcss.config.js +6 -0
- package/dist/data/primitive-data.tsx +5170 -0
- package/dist/data/prompt-data.tsx +1226 -0
- package/dist/data/requiredLibs.ts +4 -0
- package/dist/data/sandbox-data.tsx +1 -0
- package/dist/data/sidebars-data.tsx +5421 -0
- package/dist/data/stacks-data.tsx +32 -0
- package/dist/data/table-data.tsx +706 -0
- package/dist/data/tailwind.config.js +270 -0
- package/dist/data/tailwind.config.ngin.js +3830 -0
- package/dist/data/tailwind.css +431 -0
- package/dist/data/tools-data.tsx +6910 -0
- package/dist/data/typography-data.tsx +2050 -0
- package/dist/data/utils-data.tsx +6500 -0
- package/dist/data/x-data.tsx +1171 -0
- package/dist/data.tsx +159 -0
- package/package.json +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -362
|
@@ -0,0 +1,250 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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 }
|
|
@@ -0,0 +1,296 @@
|
|
|
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 }
|