@arobo/react 1.1.2 → 1.1.3
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.
|
@@ -19,8 +19,8 @@ declare function CarouselContent({ className, ...props }: CarouselContentProps):
|
|
|
19
19
|
type CarouselItemProps = React.ComponentProps<"div">;
|
|
20
20
|
declare function CarouselItem({ className, ...props }: CarouselItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
type CarouselPreviousProps = React.ComponentProps<typeof Button>;
|
|
22
|
-
declare function CarouselPrevious({ className, size, variant, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function CarouselPrevious({ className, size, variant, children, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
type CarouselNextProps = React.ComponentProps<typeof Button>;
|
|
24
|
-
declare function CarouselNext({ className, size, variant, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function CarouselNext({ className, size, variant, children, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export { Carousel as CarouselRoot, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|
|
26
26
|
export type { CarouselProps as CarouselRootProps, CarouselContentProps, CarouselItemProps, CarouselPreviousProps, CarouselNextProps, };
|
|
@@ -3,7 +3,7 @@ import { ArrowRight, ArrowLeft } from 'lucide-react';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cn } from 'tailwind-variants';
|
|
5
5
|
import { Button } from '../button/index.js';
|
|
6
|
-
import { jsx
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
const CarouselContext = /*#__PURE__*/React.createContext(null);
|
|
9
9
|
function useCarousel() {
|
|
@@ -120,6 +120,7 @@ function CarouselPrevious({
|
|
|
120
120
|
className,
|
|
121
121
|
size = "md",
|
|
122
122
|
variant = "outline",
|
|
123
|
+
children,
|
|
123
124
|
...props
|
|
124
125
|
}) {
|
|
125
126
|
const {
|
|
@@ -127,7 +128,7 @@ function CarouselPrevious({
|
|
|
127
128
|
scrollPrev,
|
|
128
129
|
canScrollPrev
|
|
129
130
|
} = useCarousel();
|
|
130
|
-
return /*#__PURE__*/
|
|
131
|
+
return /*#__PURE__*/jsx(Button, {
|
|
131
132
|
"data-slot": "carousel-previous",
|
|
132
133
|
isDisabled: !canScrollPrev,
|
|
133
134
|
size: size,
|
|
@@ -135,16 +136,14 @@ function CarouselPrevious({
|
|
|
135
136
|
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),
|
|
136
137
|
onClick: scrollPrev,
|
|
137
138
|
...props,
|
|
138
|
-
children:
|
|
139
|
-
className: "sr-only",
|
|
140
|
-
children: "Previous slide"
|
|
141
|
-
})]
|
|
139
|
+
children: children ? children : /*#__PURE__*/jsx(ArrowLeft, {})
|
|
142
140
|
});
|
|
143
141
|
}
|
|
144
142
|
function CarouselNext({
|
|
145
143
|
className,
|
|
146
144
|
size = "md",
|
|
147
145
|
variant = "outline",
|
|
146
|
+
children,
|
|
148
147
|
...props
|
|
149
148
|
}) {
|
|
150
149
|
const {
|
|
@@ -152,7 +151,7 @@ function CarouselNext({
|
|
|
152
151
|
scrollNext,
|
|
153
152
|
canScrollNext
|
|
154
153
|
} = useCarousel();
|
|
155
|
-
return /*#__PURE__*/
|
|
154
|
+
return /*#__PURE__*/jsx(Button, {
|
|
156
155
|
"data-slot": "carousel-next",
|
|
157
156
|
isDisabled: !canScrollNext,
|
|
158
157
|
size: size,
|
|
@@ -160,10 +159,7 @@ function CarouselNext({
|
|
|
160
159
|
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),
|
|
161
160
|
onClick: scrollNext,
|
|
162
161
|
...props,
|
|
163
|
-
children:
|
|
164
|
-
className: "sr-only",
|
|
165
|
-
children: "Next slide"
|
|
166
|
-
})]
|
|
162
|
+
children: children ? children : /*#__PURE__*/jsx(ArrowRight, {})
|
|
167
163
|
});
|
|
168
164
|
}
|
|
169
165
|
|