@multicomma/arkcn 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -0
- package/bin/arkcn.mjs +78 -0
- package/cli/commands.mjs +251 -0
- package/cli/project.mjs +168 -0
- package/cli/registry.mjs +50 -0
- package/cli/ui.mjs +46 -0
- package/mcp/server.mjs +149 -0
- package/package.json +201 -0
- package/registry/base.css +680 -0
- package/registry/index.json +1833 -0
- package/registry/items/accordion.json +18 -0
- package/registry/items/activity-feed.json +18 -0
- package/registry/items/alert-dialog.json +18 -0
- package/registry/items/alert.json +17 -0
- package/registry/items/angle-slider.json +17 -0
- package/registry/items/app-shell.json +28 -0
- package/registry/items/aspect-ratio.json +13 -0
- package/registry/items/attachment.json +19 -0
- package/registry/items/avatar.json +17 -0
- package/registry/items/badge.json +18 -0
- package/registry/items/breadcrumb.json +18 -0
- package/registry/items/bubble.json +18 -0
- package/registry/items/button-group.json +19 -0
- package/registry/items/button.json +18 -0
- package/registry/items/calendar.json +19 -0
- package/registry/items/canvas.json +24 -0
- package/registry/items/card.json +15 -0
- package/registry/items/carousel.json +19 -0
- package/registry/items/cascader.json +23 -0
- package/registry/items/chart.json +17 -0
- package/registry/items/chat.json +23 -0
- package/registry/items/checkbox.json +18 -0
- package/registry/items/clipboard.json +19 -0
- package/registry/items/collapsible.json +15 -0
- package/registry/items/color-picker.json +19 -0
- package/registry/items/combobox.json +20 -0
- package/registry/items/command.json +21 -0
- package/registry/items/comment-thread.json +25 -0
- package/registry/items/context-menu.json +18 -0
- package/registry/items/controllable.json +14 -0
- package/registry/items/data-grid.json +24 -0
- package/registry/items/data-table-adapter.json +14 -0
- package/registry/items/data-table.json +32 -0
- package/registry/items/date-input.json +17 -0
- package/registry/items/dialog.json +19 -0
- package/registry/items/direction.json +13 -0
- package/registry/items/drag-preview.json +16 -0
- package/registry/items/drawer.json +18 -0
- package/registry/items/dropdown-menu.json +18 -0
- package/registry/items/editable.json +17 -0
- package/registry/items/empty.json +17 -0
- package/registry/items/field.json +19 -0
- package/registry/items/file-upload.json +19 -0
- package/registry/items/floating-panel.json +19 -0
- package/registry/items/floating-toolbar.json +16 -0
- package/registry/items/form.json +14 -0
- package/registry/items/format.json +15 -0
- package/registry/items/gantt.json +22 -0
- package/registry/items/history.json +14 -0
- package/registry/items/hotkeys.json +18 -0
- package/registry/items/hover-card.json +17 -0
- package/registry/items/image-cropper.json +17 -0
- package/registry/items/input-group.json +20 -0
- package/registry/items/input-otp.json +18 -0
- package/registry/items/input.json +15 -0
- package/registry/items/item.json +19 -0
- package/registry/items/json-tree-view.json +17 -0
- package/registry/items/kanban.json +26 -0
- package/registry/items/kbd.json +15 -0
- package/registry/items/label.json +15 -0
- package/registry/items/live-region.json +16 -0
- package/registry/items/marker.json +18 -0
- package/registry/items/marquee.json +17 -0
- package/registry/items/menubar.json +19 -0
- package/registry/items/message.json +15 -0
- package/registry/items/navigation-menu.json +19 -0
- package/registry/items/node-graph.json +22 -0
- package/registry/items/number-input.json +18 -0
- package/registry/items/pagination.json +18 -0
- package/registry/items/password-input.json +18 -0
- package/registry/items/popconfirm.json +20 -0
- package/registry/items/popover.json +18 -0
- package/registry/items/progress.json +17 -0
- package/registry/items/qr-code.json +17 -0
- package/registry/items/query-builder.json +23 -0
- package/registry/items/radio-group.json +17 -0
- package/registry/items/rating-group.json +18 -0
- package/registry/items/resizable.json +17 -0
- package/registry/items/rich-text-editor.json +37 -0
- package/registry/items/row-layout.json +15 -0
- package/registry/items/scheduler.json +23 -0
- package/registry/items/scroll-area.json +17 -0
- package/registry/items/segment-group.json +17 -0
- package/registry/items/select.json +19 -0
- package/registry/items/separator.json +15 -0
- package/registry/items/sheet.json +19 -0
- package/registry/items/sidebar.json +27 -0
- package/registry/items/signature-pad.json +19 -0
- package/registry/items/skeleton.json +15 -0
- package/registry/items/slider.json +17 -0
- package/registry/items/sonner.json +17 -0
- package/registry/items/spinner.json +17 -0
- package/registry/items/steps.json +19 -0
- package/registry/items/swap.json +17 -0
- package/registry/items/switch.json +17 -0
- package/registry/items/table.json +16 -0
- package/registry/items/tabs.json +18 -0
- package/registry/items/tags-input.json +18 -0
- package/registry/items/textarea.json +15 -0
- package/registry/items/time.json +14 -0
- package/registry/items/timer.json +18 -0
- package/registry/items/toc.json +17 -0
- package/registry/items/toggle-group.json +19 -0
- package/registry/items/toggle.json +18 -0
- package/registry/items/tooltip.json +17 -0
- package/registry/items/tour.json +19 -0
- package/registry/items/transfer-list.json +24 -0
- package/registry/items/tree-select.json +24 -0
- package/registry/items/tree-view.json +18 -0
- package/registry/items/use-mobile.json +13 -0
- package/registry/items/utils.json +17 -0
- package/registry/items/virtual-list.json +16 -0
- package/src/components/ui/accordion.tsx +111 -0
- package/src/components/ui/activity-feed.tsx +228 -0
- package/src/components/ui/alert-dialog.tsx +204 -0
- package/src/components/ui/alert.tsx +55 -0
- package/src/components/ui/angle-slider.tsx +117 -0
- package/src/components/ui/app-shell.tsx +985 -0
- package/src/components/ui/aspect-ratio.tsx +35 -0
- package/src/components/ui/attachment.tsx +193 -0
- package/src/components/ui/avatar.tsx +94 -0
- package/src/components/ui/badge.tsx +45 -0
- package/src/components/ui/breadcrumb.tsx +93 -0
- package/src/components/ui/bubble.tsx +119 -0
- package/src/components/ui/button-group.tsx +79 -0
- package/src/components/ui/button.tsx +65 -0
- package/src/components/ui/calendar.tsx +172 -0
- package/src/components/ui/canvas.tsx +723 -0
- package/src/components/ui/card.tsx +69 -0
- package/src/components/ui/carousel.tsx +228 -0
- package/src/components/ui/cascader.tsx +754 -0
- package/src/components/ui/chart.tsx +303 -0
- package/src/components/ui/chat.tsx +544 -0
- package/src/components/ui/checkbox.tsx +94 -0
- package/src/components/ui/clipboard.tsx +94 -0
- package/src/components/ui/collapsible.tsx +32 -0
- package/src/components/ui/color-picker.tsx +441 -0
- package/src/components/ui/combobox.tsx +400 -0
- package/src/components/ui/command.tsx +292 -0
- package/src/components/ui/comment-thread.tsx +923 -0
- package/src/components/ui/context-menu.tsx +331 -0
- package/src/components/ui/data-grid.tsx +1227 -0
- package/src/components/ui/data-table.tsx +993 -0
- package/src/components/ui/date-input.tsx +103 -0
- package/src/components/ui/dialog.tsx +159 -0
- package/src/components/ui/direction.tsx +32 -0
- package/src/components/ui/drawer.tsx +200 -0
- package/src/components/ui/dropdown-menu.tsx +329 -0
- package/src/components/ui/editable.tsx +90 -0
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +218 -0
- package/src/components/ui/file-upload.tsx +204 -0
- package/src/components/ui/floating-panel.tsx +199 -0
- package/src/components/ui/floating-toolbar.tsx +79 -0
- package/src/components/ui/format.tsx +22 -0
- package/src/components/ui/gantt.tsx +950 -0
- package/src/components/ui/hotkeys.tsx +340 -0
- package/src/components/ui/hover-card.tsx +83 -0
- package/src/components/ui/image-cropper.tsx +100 -0
- package/src/components/ui/input-group.tsx +133 -0
- package/src/components/ui/input-otp.tsx +82 -0
- package/src/components/ui/input.tsx +18 -0
- package/src/components/ui/item.tsx +174 -0
- package/src/components/ui/json-tree-view.tsx +37 -0
- package/src/components/ui/kanban.tsx +884 -0
- package/src/components/ui/kbd.tsx +20 -0
- package/src/components/ui/label.tsx +30 -0
- package/src/components/ui/live-region.tsx +54 -0
- package/src/components/ui/marker.tsx +66 -0
- package/src/components/ui/marquee.tsx +61 -0
- package/src/components/ui/menubar.tsx +456 -0
- package/src/components/ui/message.tsx +74 -0
- package/src/components/ui/navigation-menu.tsx +202 -0
- package/src/components/ui/node-graph.tsx +1723 -0
- package/src/components/ui/number-input.tsx +148 -0
- package/src/components/ui/pagination.tsx +88 -0
- package/src/components/ui/password-input.tsx +104 -0
- package/src/components/ui/popconfirm.tsx +149 -0
- package/src/components/ui/popover.tsx +126 -0
- package/src/components/ui/progress.tsx +114 -0
- package/src/components/ui/qr-code.tsx +51 -0
- package/src/components/ui/query-builder.tsx +938 -0
- package/src/components/ui/radio-group.tsx +108 -0
- package/src/components/ui/rating-group.tsx +91 -0
- package/src/components/ui/resizable.tsx +41 -0
- package/src/components/ui/rich-text-editor.tsx +845 -0
- package/src/components/ui/scheduler.tsx +1164 -0
- package/src/components/ui/scroll-area.tsx +82 -0
- package/src/components/ui/segment-group.tsx +95 -0
- package/src/components/ui/select.tsx +354 -0
- package/src/components/ui/separator.tsx +32 -0
- package/src/components/ui/sheet.tsx +130 -0
- package/src/components/ui/sidebar.tsx +665 -0
- package/src/components/ui/signature-pad.tsx +112 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/slider.tsx +183 -0
- package/src/components/ui/sonner.tsx +37 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/steps.tsx +152 -0
- package/src/components/ui/swap.tsx +33 -0
- package/src/components/ui/switch.tsx +83 -0
- package/src/components/ui/table.tsx +72 -0
- package/src/components/ui/tabs.tsx +100 -0
- package/src/components/ui/tags-input.tsx +153 -0
- package/src/components/ui/textarea.tsx +17 -0
- package/src/components/ui/timer.tsx +67 -0
- package/src/components/ui/toc.tsx +64 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +46 -0
- package/src/components/ui/tooltip.tsx +113 -0
- package/src/components/ui/tour.tsx +168 -0
- package/src/components/ui/transfer-list.tsx +700 -0
- package/src/components/ui/tree-select.tsx +638 -0
- package/src/components/ui/tree-view.tsx +217 -0
- package/src/components/ui/virtual-list.tsx +343 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/lib/controllable.ts +31 -0
- package/src/lib/data-table-adapter.ts +67 -0
- package/src/lib/drag-preview.ts +39 -0
- package/src/lib/form.ts +39 -0
- package/src/lib/history.ts +55 -0
- package/src/lib/row-layout.ts +81 -0
- package/src/lib/table.ts +483 -0
- package/src/lib/time.ts +37 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/arkcn.css +764 -0
- package/src/styles/index.css +3 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
|
|
4
|
+
function Card({ className, size = "default", ...props }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
data-slot="card"
|
|
8
|
+
data-size={size}
|
|
9
|
+
className={cn(
|
|
10
|
+
"group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-slot="card-header"
|
|
22
|
+
className={cn(
|
|
23
|
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
data-slot="card-title"
|
|
35
|
+
className={cn("font-heading text-base/snug font-medium group-data-[size=sm]/card:text-sm", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
42
|
+
return <div data-slot="card-description" className={cn("text-sm text-muted-foreground", className)} {...props} />
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
data-slot="card-action"
|
|
49
|
+
className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
56
|
+
return <div data-slot="card-content" className={cn("px-(--card-spacing)", className)} {...props} />
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
data-slot="card-footer"
|
|
63
|
+
className={cn("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)", className)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent }
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react"
|
|
4
|
+
|
|
5
|
+
import { Button } from "@/components/ui/button"
|
|
6
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
type CarouselApi = UseEmblaCarouselType[1]
|
|
9
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
|
10
|
+
type CarouselOptions = UseCarouselParameters[0]
|
|
11
|
+
type CarouselPlugin = UseCarouselParameters[1]
|
|
12
|
+
|
|
13
|
+
type CarouselProps = {
|
|
14
|
+
opts?: CarouselOptions
|
|
15
|
+
plugins?: CarouselPlugin
|
|
16
|
+
orientation?: "horizontal" | "vertical"
|
|
17
|
+
setApi?: (api: CarouselApi) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type CarouselContextProps = {
|
|
21
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0]
|
|
22
|
+
api: ReturnType<typeof useEmblaCarousel>[1]
|
|
23
|
+
scrollPrev: () => void
|
|
24
|
+
scrollNext: () => void
|
|
25
|
+
canScrollPrev: boolean
|
|
26
|
+
canScrollNext: boolean
|
|
27
|
+
} & CarouselProps
|
|
28
|
+
|
|
29
|
+
const CarouselContext = React.createContext<CarouselContextProps | null>(null)
|
|
30
|
+
|
|
31
|
+
function useCarousel() {
|
|
32
|
+
const context = React.useContext(CarouselContext)
|
|
33
|
+
|
|
34
|
+
if (!context) {
|
|
35
|
+
throw new Error("useCarousel must be used within a <Carousel />")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return context
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function Carousel({
|
|
42
|
+
orientation = "horizontal",
|
|
43
|
+
opts,
|
|
44
|
+
setApi,
|
|
45
|
+
plugins,
|
|
46
|
+
className,
|
|
47
|
+
children,
|
|
48
|
+
...props
|
|
49
|
+
}: React.ComponentProps<"div"> & CarouselProps) {
|
|
50
|
+
const [carouselRef, api] = useEmblaCarousel(
|
|
51
|
+
{
|
|
52
|
+
...opts,
|
|
53
|
+
axis: orientation === "horizontal" ? "x" : "y",
|
|
54
|
+
},
|
|
55
|
+
plugins
|
|
56
|
+
)
|
|
57
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false)
|
|
58
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false)
|
|
59
|
+
|
|
60
|
+
const onSelect = React.useCallback((api: CarouselApi) => {
|
|
61
|
+
if (!api) return
|
|
62
|
+
setCanScrollPrev(api.canScrollPrev())
|
|
63
|
+
setCanScrollNext(api.canScrollNext())
|
|
64
|
+
}, [])
|
|
65
|
+
|
|
66
|
+
const scrollPrev = React.useCallback(() => {
|
|
67
|
+
api?.scrollPrev()
|
|
68
|
+
}, [api])
|
|
69
|
+
|
|
70
|
+
const scrollNext = React.useCallback(() => {
|
|
71
|
+
api?.scrollNext()
|
|
72
|
+
}, [api])
|
|
73
|
+
|
|
74
|
+
const handleKeyDown = React.useCallback(
|
|
75
|
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
76
|
+
if (event.key === "ArrowLeft") {
|
|
77
|
+
event.preventDefault()
|
|
78
|
+
scrollPrev()
|
|
79
|
+
} else if (event.key === "ArrowRight") {
|
|
80
|
+
event.preventDefault()
|
|
81
|
+
scrollNext()
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
[scrollPrev, scrollNext]
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
React.useEffect(() => {
|
|
88
|
+
if (!api || !setApi) return
|
|
89
|
+
setApi(api)
|
|
90
|
+
}, [api, setApi])
|
|
91
|
+
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
if (!api) return
|
|
94
|
+
onSelect(api)
|
|
95
|
+
api.on("reInit", onSelect)
|
|
96
|
+
api.on("select", onSelect)
|
|
97
|
+
|
|
98
|
+
return () => {
|
|
99
|
+
api?.off("select", onSelect)
|
|
100
|
+
}
|
|
101
|
+
}, [api, onSelect])
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<CarouselContext.Provider
|
|
105
|
+
value={{
|
|
106
|
+
carouselRef,
|
|
107
|
+
api: api,
|
|
108
|
+
opts,
|
|
109
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
110
|
+
scrollPrev,
|
|
111
|
+
scrollNext,
|
|
112
|
+
canScrollPrev,
|
|
113
|
+
canScrollNext,
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<div
|
|
117
|
+
onKeyDownCapture={handleKeyDown}
|
|
118
|
+
className={cn("relative", className)}
|
|
119
|
+
role="region"
|
|
120
|
+
aria-roledescription="carousel"
|
|
121
|
+
data-slot="carousel"
|
|
122
|
+
{...props}
|
|
123
|
+
>
|
|
124
|
+
{children}
|
|
125
|
+
</div>
|
|
126
|
+
</CarouselContext.Provider>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
131
|
+
const { carouselRef, orientation } = useCarousel()
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
|
|
135
|
+
<div className={cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)} {...props} />
|
|
136
|
+
</div>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
|
|
141
|
+
const { orientation } = useCarousel()
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div
|
|
145
|
+
role="group"
|
|
146
|
+
aria-roledescription="slide"
|
|
147
|
+
data-slot="carousel-item"
|
|
148
|
+
className={cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function CarouselPrevious({
|
|
155
|
+
className,
|
|
156
|
+
variant = "outline",
|
|
157
|
+
size = "icon-sm",
|
|
158
|
+
asChild,
|
|
159
|
+
children,
|
|
160
|
+
...props
|
|
161
|
+
}: React.ComponentProps<typeof Button>) {
|
|
162
|
+
const { orientation, scrollPrev, canScrollPrev } = useCarousel()
|
|
163
|
+
|
|
164
|
+
return (
|
|
165
|
+
<Button
|
|
166
|
+
data-slot="carousel-previous"
|
|
167
|
+
variant={variant}
|
|
168
|
+
size={size}
|
|
169
|
+
className={cn(
|
|
170
|
+
"absolute touch-manipulation rounded-full",
|
|
171
|
+
orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
172
|
+
className
|
|
173
|
+
)}
|
|
174
|
+
disabled={!canScrollPrev}
|
|
175
|
+
onClick={scrollPrev}
|
|
176
|
+
asChild={asChild}
|
|
177
|
+
{...props}
|
|
178
|
+
>
|
|
179
|
+
{asChild
|
|
180
|
+
? children
|
|
181
|
+
: (children ?? (
|
|
182
|
+
<>
|
|
183
|
+
<ChevronLeftIcon />
|
|
184
|
+
<span className="sr-only">Previous slide</span>
|
|
185
|
+
</>
|
|
186
|
+
))}
|
|
187
|
+
</Button>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function CarouselNext({
|
|
192
|
+
className,
|
|
193
|
+
variant = "outline",
|
|
194
|
+
size = "icon-sm",
|
|
195
|
+
asChild,
|
|
196
|
+
children,
|
|
197
|
+
...props
|
|
198
|
+
}: React.ComponentProps<typeof Button>) {
|
|
199
|
+
const { orientation, scrollNext, canScrollNext } = useCarousel()
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<Button
|
|
203
|
+
data-slot="carousel-next"
|
|
204
|
+
variant={variant}
|
|
205
|
+
size={size}
|
|
206
|
+
className={cn(
|
|
207
|
+
"absolute touch-manipulation rounded-full",
|
|
208
|
+
orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
209
|
+
className
|
|
210
|
+
)}
|
|
211
|
+
disabled={!canScrollNext}
|
|
212
|
+
onClick={scrollNext}
|
|
213
|
+
asChild={asChild}
|
|
214
|
+
{...props}
|
|
215
|
+
>
|
|
216
|
+
{asChild
|
|
217
|
+
? children
|
|
218
|
+
: (children ?? (
|
|
219
|
+
<>
|
|
220
|
+
<ChevronRightIcon />
|
|
221
|
+
<span className="sr-only">Next slide</span>
|
|
222
|
+
</>
|
|
223
|
+
))}
|
|
224
|
+
</Button>
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel }
|