@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,56 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { GripVerticalIcon } from "lucide-react"
|
|
3
|
+
import * as ResizablePrimitive from "react-resizable-panels"
|
|
4
|
+
|
|
5
|
+
import { cn } from "~/components/catalyst-ui"
|
|
6
|
+
|
|
7
|
+
// @dev app/components/catalyst-ui/data/primitive-data.tsx:956
|
|
8
|
+
|
|
9
|
+
function ResizablePanelGroup({
|
|
10
|
+
className,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
|
|
13
|
+
return (
|
|
14
|
+
<ResizablePrimitive.PanelGroup
|
|
15
|
+
data-slot="resizable-panel-group"
|
|
16
|
+
className={cn(
|
|
17
|
+
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function ResizablePanel({
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
|
|
28
|
+
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function ResizableHandle({
|
|
32
|
+
withHandle,
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
36
|
+
withHandle?: boolean
|
|
37
|
+
}) {
|
|
38
|
+
return (
|
|
39
|
+
<ResizablePrimitive.PanelResizeHandle
|
|
40
|
+
data-slot="resizable-handle"
|
|
41
|
+
className={cn(
|
|
42
|
+
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{withHandle && (
|
|
48
|
+
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
|
|
49
|
+
<GripVerticalIcon className="size-2.5" />
|
|
50
|
+
</div>
|
|
51
|
+
)}
|
|
52
|
+
</ResizablePrimitive.PanelResizeHandle>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import { Check, ChevronDown, ChevronRight, ChevronsUpDown, ChevronUp } 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:3678
|
|
7
|
+
const Select = SelectPrimitive.Root;
|
|
8
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
9
|
+
const SelectValue = SelectPrimitive.Value;
|
|
10
|
+
|
|
11
|
+
const SelectTrigger = React.forwardRef<
|
|
12
|
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
|
|
14
|
+
>(({ className, children, ...props }, ref) => (
|
|
15
|
+
<SelectPrimitive.Trigger
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn(
|
|
18
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
<SelectPrimitive.Icon asChild>
|
|
25
|
+
<ChevronsUpDown className="h-4 w-4 opacity-50" />
|
|
26
|
+
</SelectPrimitive.Icon>
|
|
27
|
+
</SelectPrimitive.Trigger>
|
|
28
|
+
));
|
|
29
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
30
|
+
|
|
31
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
32
|
+
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
33
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
34
|
+
>(({ className, ...props }, ref) => (
|
|
35
|
+
<SelectPrimitive.ScrollUpButton
|
|
36
|
+
ref={ref}
|
|
37
|
+
className={cn(
|
|
38
|
+
"flex cursor-default items-center justify-center py-1",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<ChevronUp className="h-4 w-4" />
|
|
44
|
+
</SelectPrimitive.ScrollUpButton>
|
|
45
|
+
));
|
|
46
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
47
|
+
|
|
48
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
49
|
+
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
50
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
51
|
+
>(({ className, ...props }, ref) => (
|
|
52
|
+
<SelectPrimitive.ScrollDownButton
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn(
|
|
55
|
+
"flex cursor-default items-center justify-center py-1",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
<ChevronDown className="h-4 w-4" />
|
|
61
|
+
</SelectPrimitive.ScrollDownButton>
|
|
62
|
+
));
|
|
63
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
64
|
+
|
|
65
|
+
const SelectContent = React.forwardRef<
|
|
66
|
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
67
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
68
|
+
>(({ className, children, position = "popper", ...props }, ref) => (
|
|
69
|
+
<SelectPrimitive.Portal>
|
|
70
|
+
<SelectPrimitive.Content
|
|
71
|
+
ref={ref}
|
|
72
|
+
className={cn(
|
|
73
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
74
|
+
position === "popper" &&
|
|
75
|
+
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
76
|
+
className
|
|
77
|
+
)}
|
|
78
|
+
position={position}
|
|
79
|
+
{...props}
|
|
80
|
+
>
|
|
81
|
+
<SelectScrollUpButton />
|
|
82
|
+
<SelectPrimitive.Viewport
|
|
83
|
+
className={cn(
|
|
84
|
+
"p-1",
|
|
85
|
+
position === "popper" &&
|
|
86
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
87
|
+
)}
|
|
88
|
+
>
|
|
89
|
+
{children}
|
|
90
|
+
</SelectPrimitive.Viewport>
|
|
91
|
+
<SelectScrollDownButton />
|
|
92
|
+
</SelectPrimitive.Content>
|
|
93
|
+
</SelectPrimitive.Portal>
|
|
94
|
+
));
|
|
95
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
96
|
+
|
|
97
|
+
const SelectLabel = React.forwardRef<
|
|
98
|
+
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
99
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
100
|
+
>(({ className, ...props }, ref) => (
|
|
101
|
+
<SelectPrimitive.Label
|
|
102
|
+
ref={ref}
|
|
103
|
+
className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
|
|
104
|
+
{...props}
|
|
105
|
+
/>
|
|
106
|
+
));
|
|
107
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
108
|
+
|
|
109
|
+
const SelectItem = React.forwardRef<
|
|
110
|
+
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
111
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
112
|
+
>(({ className, children, ...props }, ref) => (
|
|
113
|
+
<SelectPrimitive.Item
|
|
114
|
+
ref={ref}
|
|
115
|
+
className={cn(
|
|
116
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
117
|
+
className
|
|
118
|
+
)}
|
|
119
|
+
{...props}
|
|
120
|
+
>
|
|
121
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
122
|
+
<SelectPrimitive.ItemIndicator>
|
|
123
|
+
<Check className="h-4 w-4" />
|
|
124
|
+
</SelectPrimitive.ItemIndicator>
|
|
125
|
+
</span>
|
|
126
|
+
|
|
127
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
128
|
+
</SelectPrimitive.Item>
|
|
129
|
+
));
|
|
130
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
131
|
+
|
|
132
|
+
const SelectSeparator = React.forwardRef<
|
|
133
|
+
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
134
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
135
|
+
>(({ className, ...props }, ref) => (
|
|
136
|
+
<SelectPrimitive.Separator
|
|
137
|
+
ref={ref}
|
|
138
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
));
|
|
142
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
Select,
|
|
146
|
+
SelectGroup,
|
|
147
|
+
SelectValue,
|
|
148
|
+
SelectTrigger,
|
|
149
|
+
SelectContent,
|
|
150
|
+
SelectLabel,
|
|
151
|
+
SelectItem,
|
|
152
|
+
SelectSeparator,
|
|
153
|
+
SelectScrollUpButton,
|
|
154
|
+
SelectScrollDownButton,
|
|
155
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
|
3
|
+
import { cn } from '~/components/catalyst-ui'
|
|
4
|
+
|
|
5
|
+
// @dev app/components/catalyst-ui/data/primitive-data.tsx:3426
|
|
6
|
+
const Separator = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
9
|
+
>(
|
|
10
|
+
(
|
|
11
|
+
{ className, orientation = 'horizontal', decorative = true, ...props },
|
|
12
|
+
ref
|
|
13
|
+
) => (
|
|
14
|
+
<SeparatorPrimitive.Root
|
|
15
|
+
ref={ref}
|
|
16
|
+
decorative={decorative}
|
|
17
|
+
orientation={orientation}
|
|
18
|
+
className={cn(
|
|
19
|
+
'shrink-0 bg-border/30 border-border',
|
|
20
|
+
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[2px]',
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
)
|
|
27
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const SeparatorWithText = React.forwardRef<
|
|
31
|
+
HTMLDivElement,
|
|
32
|
+
React.HTMLAttributes<HTMLDivElement> & {
|
|
33
|
+
children: React.ReactNode
|
|
34
|
+
orientation?: 'horizontal' | 'vertical'
|
|
35
|
+
}
|
|
36
|
+
>(({ className, children, orientation = 'horizontal', ...props }, ref) => (
|
|
37
|
+
<div
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={cn(
|
|
40
|
+
'flex items-center',
|
|
41
|
+
orientation === 'horizontal' ? 'w-full' : 'h-full flex-col',
|
|
42
|
+
className
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
<Separator className="flex-1" orientation={orientation} />
|
|
47
|
+
<span className={cn(
|
|
48
|
+
'text-muted-foreground text-sm',
|
|
49
|
+
orientation === 'horizontal' ? 'px-3' : 'py-3'
|
|
50
|
+
)}>
|
|
51
|
+
{children}
|
|
52
|
+
</span>
|
|
53
|
+
<Separator className="flex-1" orientation={orientation} />
|
|
54
|
+
</div>
|
|
55
|
+
))
|
|
56
|
+
SeparatorWithText.displayName = 'SeparatorWithText'
|
|
57
|
+
|
|
58
|
+
export { Separator, SeparatorWithText }
|
|
59
|
+
|
|
60
|
+
/**usage
|
|
61
|
+
*
|
|
62
|
+
* // Horizontal (default)
|
|
63
|
+
<SeparatorWithText>OR</SeparatorWithText>
|
|
64
|
+
|
|
65
|
+
// With custom styling
|
|
66
|
+
<SeparatorWithText className="my-4">
|
|
67
|
+
Continue with
|
|
68
|
+
</SeparatorWithText>
|
|
69
|
+
|
|
70
|
+
// Vertical
|
|
71
|
+
<SeparatorWithText orientation="vertical">
|
|
72
|
+
OR
|
|
73
|
+
</SeparatorWithText>
|
|
74
|
+
*/
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { X } from "lucide-react";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { cn } from "~/components/catalyst-ui";
|
|
6
|
+
|
|
7
|
+
// @dev app/components/catalyst-ui/data/primitive-data.tsx:4773
|
|
8
|
+
const Sheet = DialogPrimitive.Root;
|
|
9
|
+
const SheetTrigger = DialogPrimitive.Trigger;
|
|
10
|
+
const SheetClose = DialogPrimitive.Close;
|
|
11
|
+
const SheetPortal = DialogPrimitive.Portal;
|
|
12
|
+
|
|
13
|
+
const SheetOverlay = React.forwardRef<
|
|
14
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
15
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
16
|
+
>(({ className, ...props }, ref) => (
|
|
17
|
+
<DialogPrimitive.Overlay
|
|
18
|
+
className={cn(
|
|
19
|
+
"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",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
ref={ref}
|
|
24
|
+
/>
|
|
25
|
+
));
|
|
26
|
+
SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
27
|
+
|
|
28
|
+
const sheetVariants = cva(
|
|
29
|
+
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
30
|
+
{
|
|
31
|
+
variants: {
|
|
32
|
+
side: {
|
|
33
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
34
|
+
bottom:
|
|
35
|
+
"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
36
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
37
|
+
right:
|
|
38
|
+
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
side: "right",
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
interface SheetContentProps
|
|
48
|
+
extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>,
|
|
49
|
+
VariantProps<typeof sheetVariants> { }
|
|
50
|
+
|
|
51
|
+
const SheetContent = React.forwardRef<
|
|
52
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
53
|
+
SheetContentProps
|
|
54
|
+
>(({ side = "right", className, children, ...props }, ref) => (
|
|
55
|
+
<SheetPortal>
|
|
56
|
+
<SheetOverlay />
|
|
57
|
+
<DialogPrimitive.Content
|
|
58
|
+
ref={ref}
|
|
59
|
+
className={cn(sheetVariants({ side }), className)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
<DialogPrimitive.Close className="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 data-[state=open]:bg-secondary">
|
|
64
|
+
<X className="h-4 w-4" />
|
|
65
|
+
<span className="sr-only">Close</span>
|
|
66
|
+
</DialogPrimitive.Close>
|
|
67
|
+
</DialogPrimitive.Content>
|
|
68
|
+
</SheetPortal>
|
|
69
|
+
));
|
|
70
|
+
SheetContent.displayName = DialogPrimitive.Content.displayName;
|
|
71
|
+
|
|
72
|
+
const SheetHeader = ({
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
76
|
+
<div
|
|
77
|
+
className={cn(
|
|
78
|
+
"flex flex-col space-y-2 text-center sm:text-left",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
SheetHeader.displayName = "SheetHeader";
|
|
85
|
+
|
|
86
|
+
const SheetFooter = ({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
90
|
+
<div
|
|
91
|
+
className={cn(
|
|
92
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
93
|
+
className
|
|
94
|
+
)}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
SheetFooter.displayName = "SheetFooter";
|
|
99
|
+
|
|
100
|
+
const SheetTitle = React.forwardRef<
|
|
101
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
102
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
103
|
+
>(({ className, ...props }, ref) => (
|
|
104
|
+
<DialogPrimitive.Title
|
|
105
|
+
ref={ref}
|
|
106
|
+
className={cn("text-lg font-semibold text-foreground", className)}
|
|
107
|
+
{...props}
|
|
108
|
+
/>
|
|
109
|
+
));
|
|
110
|
+
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
111
|
+
|
|
112
|
+
const SheetDescription = React.forwardRef<
|
|
113
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
114
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
115
|
+
>(({ className, ...props }, ref) => (
|
|
116
|
+
<DialogPrimitive.Description
|
|
117
|
+
ref={ref}
|
|
118
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
));
|
|
122
|
+
SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, type SheetContentProps
|
|
126
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cn } from "~/components/catalyst-ui"
|
|
2
|
+
|
|
3
|
+
// @dev app/components/catalyst-ui/data/primitive-data.tsx:288
|
|
4
|
+
|
|
5
|
+
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-slot="skeleton"
|
|
9
|
+
className={cn("bg-accent animate-pulse rounded-md", className)}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { Skeleton }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
2
|
+
import { cn } from "~/components/catalyst-ui";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
// @dev app/components/catalyst-ui/data/primitive-data.tsx:2559
|
|
6
|
+
const Slider = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof SliderPrimitive.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>
|
|
9
|
+
>(({ className, ...props }, ref) => (
|
|
10
|
+
<SliderPrimitive.Root
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn(
|
|
13
|
+
"relative flex w-full touch-none select-none items-center",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
<SliderPrimitive.Track className="relative h-2 w-full grow overflow-hidden rounded-full bg-secondary">
|
|
19
|
+
<SliderPrimitive.Range className="absolute h-full bg-primary" />
|
|
20
|
+
</SliderPrimitive.Track>
|
|
21
|
+
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
|
|
22
|
+
</SliderPrimitive.Root>
|
|
23
|
+
));
|
|
24
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export { Slider }
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
import { cn } from "~/components/catalyst-ui";
|
|
6
|
+
import React from "react";
|
|
7
|
+
|
|
8
|
+
// @dev app/components/catalyst-ui/data/primitive-data.tsx:2921
|
|
9
|
+
|
|
10
|
+
type SwitchVariantContextValue = {
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
|
+
variant?: "default" | "destructive" | "success" | "info" | "warning";
|
|
13
|
+
shape?: "default" | "square";
|
|
14
|
+
style?: "solid" | "outline";
|
|
15
|
+
mini?: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const SwitchVariantContext = React.createContext<SwitchVariantContextValue>({});
|
|
19
|
+
|
|
20
|
+
export const switchRootVariants = cva(
|
|
21
|
+
"peer inline-flex shrink-0 cursor-pointer items-center border transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
sm: "h-5 w-9",
|
|
26
|
+
md: "h-6 w-10",
|
|
27
|
+
lg: "h-7 w-12",
|
|
28
|
+
},
|
|
29
|
+
variant: {
|
|
30
|
+
default: "focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
31
|
+
destructive: "focus-visible:border-destructive focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 data-[state=checked]:bg-destructive data-[state=unchecked]:bg-input",
|
|
32
|
+
success: "focus-visible:border-green-600 dark:focus-visible:border-green-400 focus-visible:ring-green-600/20 dark:focus-visible:ring-green-400/40 data-[state=checked]:bg-green-600 dark:data-[state=checked]:bg-green-400 data-[state=unchecked]:bg-input",
|
|
33
|
+
info: "focus-visible:border-sky-600 dark:focus-visible:border-sky-400 focus-visible:ring-sky-600/20 dark:focus-visible:ring-sky-400/40 data-[state=checked]:bg-sky-600 dark:data-[state=checked]:bg-sky-400 data-[state=unchecked]:bg-input",
|
|
34
|
+
warning: "focus-visible:border-amber-600 dark:focus-visible:border-amber-400 focus-visible:ring-amber-600/20 dark:focus-visible:ring-amber-400/40 data-[state=checked]:bg-amber-600 dark:data-[state=checked]:bg-amber-400 data-[state=unchecked]:bg-input",
|
|
35
|
+
},
|
|
36
|
+
shape: {
|
|
37
|
+
default: "rounded-full",
|
|
38
|
+
square: "rounded-xs",
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
solid: "border-transparent",
|
|
42
|
+
outline: "data-[state=checked]:bg-transparent",
|
|
43
|
+
},
|
|
44
|
+
mini: {
|
|
45
|
+
true: "h-3 border-none",
|
|
46
|
+
false: "",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
compoundVariants: [
|
|
50
|
+
{
|
|
51
|
+
style: "outline",
|
|
52
|
+
variant: "default",
|
|
53
|
+
className: "focus-visible:border-primary data-[state=checked]:border-primary",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
style: "outline",
|
|
57
|
+
variant: "destructive",
|
|
58
|
+
className: "data-[state=checked]:border-destructive",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
style: "outline",
|
|
62
|
+
variant: "success",
|
|
63
|
+
className: "data-[state=checked]:border-green-600 dark:data-[state=checked]:border-green-400",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
style: "outline",
|
|
67
|
+
variant: "info",
|
|
68
|
+
className: "data-[state=checked]:border-sky-600 dark:data-[state=checked]:border-sky-400",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
style: "outline",
|
|
72
|
+
variant: "warning",
|
|
73
|
+
className: "data-[state=checked]:border-amber-600 dark:data-[state=checked]:border-amber-400",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
size: "sm",
|
|
78
|
+
variant: "default",
|
|
79
|
+
shape: "default",
|
|
80
|
+
style: "solid",
|
|
81
|
+
mini: false,
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const switchThumbVariants = cva(
|
|
87
|
+
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
88
|
+
{
|
|
89
|
+
variants: {
|
|
90
|
+
size: {
|
|
91
|
+
sm: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-1 data-[state=checked]:rtl:-translate-x-4 data-[state=unchecked]:rtl:-translate-x-1",
|
|
92
|
+
md: "h-5 w-5 data-[state=checked]:translate-x-4.5 data-[state=unchecked]:translate-x-1 data-[state=checked]:rtl:-translate-x-4.5 data-[state=unchecked]:rtl:-translate-x-1",
|
|
93
|
+
lg: "h-6 w-6 data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-1 data-[state=checked]:rtl:-translate-x-5.5 data-[state=unchecked]:rtl:-translate-x-1",
|
|
94
|
+
},
|
|
95
|
+
shape: {
|
|
96
|
+
default: "rounded-full",
|
|
97
|
+
square: "rounded-xs",
|
|
98
|
+
},
|
|
99
|
+
style: {
|
|
100
|
+
solid: "",
|
|
101
|
+
outline: "border",
|
|
102
|
+
},
|
|
103
|
+
mini: {
|
|
104
|
+
true: "size-4.5 border border-input",
|
|
105
|
+
false: "",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
compoundVariants: [
|
|
109
|
+
{
|
|
110
|
+
style: "outline",
|
|
111
|
+
className: "data-[state=checked]:border-background",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
style: "outline",
|
|
115
|
+
variant: "default",
|
|
116
|
+
className: "data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
style: "outline",
|
|
120
|
+
variant: "destructive",
|
|
121
|
+
className: "data-[state=checked]:bg-destructive dark:data-[state=checked]:bg-destructive",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
style: "outline",
|
|
125
|
+
variant: "success",
|
|
126
|
+
className: "data-[state=checked]:bg-green-600 dark:data-[state=checked]:bg-green-400",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
style: "outline",
|
|
130
|
+
variant: "info",
|
|
131
|
+
className: "data-[state=checked]:bg-sky-600 dark:data-[state=checked]:bg-sky-400",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
style: "outline",
|
|
135
|
+
variant: "warning",
|
|
136
|
+
className: "data-[state=checked]:bg-amber-600 dark:data-[state=checked]:bg-amber-400",
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
defaultVariants: {
|
|
140
|
+
size: "sm",
|
|
141
|
+
shape: "default",
|
|
142
|
+
style: "solid",
|
|
143
|
+
mini: false,
|
|
144
|
+
},
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
const Switch = React.forwardRef<
|
|
149
|
+
React.ElementRef<typeof SwitchPrimitive.Root>,
|
|
150
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> &
|
|
151
|
+
VariantProps<typeof switchRootVariants> &
|
|
152
|
+
SwitchVariantContextValue
|
|
153
|
+
>(({ className, size, variant, shape, style, mini, children, ...props }, ref) => {
|
|
154
|
+
const contextValue = { size, variant, shape, style, mini };
|
|
155
|
+
|
|
156
|
+
return (
|
|
157
|
+
<SwitchVariantContext.Provider value={contextValue}>
|
|
158
|
+
<SwitchPrimitive.Root
|
|
159
|
+
className={cn(switchRootVariants({ size, variant, shape, style, mini }), className)}
|
|
160
|
+
{...props}
|
|
161
|
+
ref={ref}
|
|
162
|
+
>
|
|
163
|
+
{children || <SwitchThumb />}
|
|
164
|
+
</SwitchPrimitive.Root>
|
|
165
|
+
</SwitchVariantContext.Provider>
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
169
|
+
|
|
170
|
+
// Thumb component consuming context
|
|
171
|
+
const SwitchThumb = React.forwardRef<
|
|
172
|
+
React.ElementRef<typeof SwitchPrimitive.Thumb>,
|
|
173
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Thumb>
|
|
174
|
+
>(({ className, ...props }, ref) => {
|
|
175
|
+
const { size, shape, style, mini, variant } = React.useContext(SwitchVariantContext);
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<SwitchPrimitive.Thumb
|
|
179
|
+
ref={ref}
|
|
180
|
+
className={cn(switchThumbVariants({ size, shape, style, mini, variant }), className)}
|
|
181
|
+
{...props}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
184
|
+
});
|
|
185
|
+
SwitchThumb.displayName = SwitchPrimitive.Thumb.displayName;
|
|
186
|
+
|
|
187
|
+
export { Switch, SwitchThumb };
|