@arobo/react 1.1.0 → 1.1.1
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
1
3
|
import * as React from "react";
|
|
2
|
-
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
3
4
|
import { Button } from "../button";
|
|
4
5
|
export type CarouselApi = UseEmblaCarouselType[1];
|
|
5
6
|
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
@@ -11,20 +12,15 @@ type CarouselProps = {
|
|
|
11
12
|
orientation?: "horizontal" | "vertical";
|
|
12
13
|
setApi?: (api: CarouselApi) => void;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
-
declare function Carousel({
|
|
16
|
-
|
|
15
|
+
type CarouselRootProps = React.ComponentProps<"div"> & CarouselProps;
|
|
16
|
+
declare function Carousel({ children, className, opts, orientation, plugins, setApi, ...props }: CarouselRootProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
type CarouselContentProps = React.ComponentProps<"div">;
|
|
17
18
|
declare function CarouselContent({ className, ...props }: CarouselContentProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
|
|
19
|
+
type CarouselItemProps = React.ComponentProps<"div">;
|
|
19
20
|
declare function CarouselItem({ className, ...props }: CarouselItemProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
|
|
21
|
-
declare function CarouselPrevious({ className,
|
|
22
|
-
|
|
23
|
-
declare function CarouselNext({ className,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Item: typeof CarouselItem;
|
|
27
|
-
Previous: typeof CarouselPrevious;
|
|
28
|
-
Next: typeof CarouselNext;
|
|
29
|
-
};
|
|
30
|
-
export default _default;
|
|
21
|
+
type CarouselPreviousProps = React.ComponentProps<typeof Button>;
|
|
22
|
+
declare function CarouselPrevious({ className, size, variant, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
type CarouselNextProps = React.ComponentProps<typeof Button>;
|
|
24
|
+
declare function CarouselNext({ className, size, variant, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { Carousel as CarouselRoot, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
26
|
+
export type { CarouselProps as CarouselRootProps, CarouselContentProps, CarouselItemProps, CarouselPreviousProps, CarouselNextProps, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
3
2
|
import { ArrowRight, ArrowLeft } from 'lucide-react';
|
|
4
|
-
import
|
|
3
|
+
import * as React from 'react';
|
|
5
4
|
import { cn } from 'tailwind-variants';
|
|
5
|
+
import { Button } from '../button/index.js';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
const CarouselContext = /*#__PURE__*/React.createContext(null);
|
|
@@ -14,12 +14,12 @@ function useCarousel() {
|
|
|
14
14
|
return context;
|
|
15
15
|
}
|
|
16
16
|
function Carousel({
|
|
17
|
-
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
18
19
|
opts,
|
|
19
|
-
|
|
20
|
+
orientation = "horizontal",
|
|
20
21
|
plugins,
|
|
21
|
-
|
|
22
|
-
children,
|
|
22
|
+
setApi,
|
|
23
23
|
...props
|
|
24
24
|
}) {
|
|
25
25
|
const [carouselRef, api] = useEmblaCarousel({
|
|
@@ -73,11 +73,11 @@ function Carousel({
|
|
|
73
73
|
canScrollNext
|
|
74
74
|
},
|
|
75
75
|
children: /*#__PURE__*/jsx("div", {
|
|
76
|
-
onKeyDownCapture: handleKeyDown,
|
|
77
|
-
className: cn("relative", className),
|
|
78
|
-
role: "region",
|
|
79
76
|
"aria-roledescription": "carousel",
|
|
77
|
+
className: cn("relative", className),
|
|
80
78
|
"data-slot": "carousel",
|
|
79
|
+
role: "region",
|
|
80
|
+
onKeyDownCapture: handleKeyDown,
|
|
81
81
|
...props,
|
|
82
82
|
children: children
|
|
83
83
|
})
|
|
@@ -109,17 +109,17 @@ function CarouselItem({
|
|
|
109
109
|
orientation
|
|
110
110
|
} = useCarousel();
|
|
111
111
|
return /*#__PURE__*/jsx("div", {
|
|
112
|
-
role: "group",
|
|
113
112
|
"aria-roledescription": "slide",
|
|
114
113
|
"data-slot": "carousel-item",
|
|
114
|
+
role: "group",
|
|
115
115
|
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
|
|
116
116
|
...props
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
function CarouselPrevious({
|
|
120
120
|
className,
|
|
121
|
-
variant = "outline",
|
|
122
121
|
size = "md",
|
|
122
|
+
variant = "outline",
|
|
123
123
|
...props
|
|
124
124
|
}) {
|
|
125
125
|
const {
|
|
@@ -129,10 +129,10 @@ function CarouselPrevious({
|
|
|
129
129
|
} = useCarousel();
|
|
130
130
|
return /*#__PURE__*/jsxs(Button, {
|
|
131
131
|
"data-slot": "carousel-previous",
|
|
132
|
-
|
|
132
|
+
isDisabled: !canScrollPrev,
|
|
133
133
|
size: size,
|
|
134
|
+
variant: variant,
|
|
134
135
|
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
135
|
-
isDisabled: !canScrollPrev,
|
|
136
136
|
onClick: scrollPrev,
|
|
137
137
|
...props,
|
|
138
138
|
children: [/*#__PURE__*/jsx(ArrowLeft, {}), /*#__PURE__*/jsx("span", {
|
|
@@ -143,8 +143,8 @@ function CarouselPrevious({
|
|
|
143
143
|
}
|
|
144
144
|
function CarouselNext({
|
|
145
145
|
className,
|
|
146
|
-
variant = "outline",
|
|
147
146
|
size = "md",
|
|
147
|
+
variant = "outline",
|
|
148
148
|
...props
|
|
149
149
|
}) {
|
|
150
150
|
const {
|
|
@@ -154,10 +154,10 @@ function CarouselNext({
|
|
|
154
154
|
} = useCarousel();
|
|
155
155
|
return /*#__PURE__*/jsxs(Button, {
|
|
156
156
|
"data-slot": "carousel-next",
|
|
157
|
-
|
|
157
|
+
isDisabled: !canScrollNext,
|
|
158
158
|
size: size,
|
|
159
|
+
variant: variant,
|
|
159
160
|
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
160
|
-
isDisabled: !canScrollNext,
|
|
161
161
|
onClick: scrollNext,
|
|
162
162
|
...props,
|
|
163
163
|
children: [/*#__PURE__*/jsx(ArrowRight, {}), /*#__PURE__*/jsx("span", {
|
|
@@ -166,11 +166,5 @@ function CarouselNext({
|
|
|
166
166
|
})]
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
var carousel = Object.assign(Carousel, {
|
|
170
|
-
Content: CarouselContent,
|
|
171
|
-
Item: CarouselItem,
|
|
172
|
-
Previous: CarouselPrevious,
|
|
173
|
-
Next: CarouselNext
|
|
174
|
-
});
|
|
175
169
|
|
|
176
|
-
export {
|
|
170
|
+
export { CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Carousel as CarouselRoot };
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CarouselRoot } from "./carousel";
|
|
2
|
+
export declare const Carousel: typeof CarouselRoot & {
|
|
3
|
+
Content: typeof CarouselContent;
|
|
4
|
+
Item: typeof CarouselItem;
|
|
5
|
+
Previous: typeof CarouselPrevious;
|
|
6
|
+
Next: typeof CarouselNext;
|
|
7
|
+
};
|
|
8
|
+
export type Carousel = {
|
|
9
|
+
Props: React.ComponentProps<typeof CarouselRoot>;
|
|
10
|
+
RootProps: React.ComponentProps<typeof CarouselRoot>;
|
|
11
|
+
ContentProps: React.ComponentProps<typeof CarouselContent>;
|
|
12
|
+
ItemProps: React.ComponentProps<typeof CarouselItem>;
|
|
13
|
+
PreviousProps: React.ComponentProps<typeof CarouselPrevious>;
|
|
14
|
+
NextProps: React.ComponentProps<typeof CarouselNext>;
|
|
15
|
+
};
|
|
16
|
+
export { CarouselRoot, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
2
17
|
export type { CarouselApi, CarouselRootProps, CarouselContentProps, CarouselItemProps, CarouselPreviousProps, CarouselNextProps, } from "./carousel";
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { CarouselRoot as Carousel$1, CarouselNext, CarouselPrevious, CarouselItem, CarouselContent } from './carousel.js';
|
|
2
|
+
|
|
3
|
+
const Carousel = Object.assign(Carousel$1, {
|
|
4
|
+
Content: CarouselContent,
|
|
5
|
+
Item: CarouselItem,
|
|
6
|
+
Previous: CarouselPrevious,
|
|
7
|
+
Next: CarouselNext
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Carousel$1 as CarouselRoot };
|
package/dist/index.js
CHANGED
|
@@ -131,6 +131,8 @@ export { ToastActionButton, ToastCloseButton, ToastContainer, ToastContent, Toas
|
|
|
131
131
|
export { ToastQueue, toast, toastQueue } from './components/toast/toast-queue.js';
|
|
132
132
|
export { Separator } from './components/separator/index.js';
|
|
133
133
|
export { SeparatorRoot } from './components/separator/separator.js';
|
|
134
|
+
export { Carousel } from './components/carousel/index.js';
|
|
135
|
+
export { CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CarouselRoot } from './components/carousel/carousel.js';
|
|
134
136
|
export { useScrollShadow } from './components/scroll-shadow/use-scroll-shadow.js';
|
|
135
137
|
export { ScrollShadow } from './components/scroll-shadow/index.js';
|
|
136
138
|
export { ScrollShadowRoot } from './components/scroll-shadow/scroll-shadow.js';
|