@jorgemadrid/open-carousel 0.1.1 → 0.1.4
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 +14 -6
- package/dist/index.cjs +1 -2528
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +1 -2470
- package/dist/index.js.map +1 -1
- package/package.json +2 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
|
+
import { ReactNode, ComponentProps, PointerEvent, MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
declare const VISUAL_CONFIG: {
|
|
6
6
|
readonly MAX_DIST_MOBILE: 320;
|
|
@@ -128,6 +128,10 @@ interface BaseCarouselProps<T> {
|
|
|
128
128
|
infinite?: boolean;
|
|
129
129
|
onEndReached?: () => void;
|
|
130
130
|
hasNextPage?: boolean;
|
|
131
|
+
/** Custom label for previous button (aria-label). Defaults to 'Previous' */
|
|
132
|
+
prevLabel?: string;
|
|
133
|
+
/** Custom label for next button (aria-label). Defaults to 'Next' */
|
|
134
|
+
nextLabel?: string;
|
|
131
135
|
/**
|
|
132
136
|
* CSS variable name for item width. Uses native CSS media queries for responsive widths.
|
|
133
137
|
* Options: 'default' | 'review' | 'compact' | 'collection' | 'wide'
|
|
@@ -185,17 +189,18 @@ interface BaseCarouselProps<T> {
|
|
|
185
189
|
*/
|
|
186
190
|
eagerSelectionOnMobile?: boolean;
|
|
187
191
|
}
|
|
188
|
-
declare function BaseCarouselInner<T>({ items, getItemKey, renderItem, infinite, onEndReached, hasNextPage, itemWidthVar, itemWidthCssVar, fallbackWidth, itemClassName, snapType, disableOpacityEffect, disableScaleEffect, verticalPadding, snap, renderSkeleton, persistKey, onActiveItemChange, gap: gapProp, debugId, debug, eagerSelectionOnMobile, initialIndex, }: BaseCarouselProps<T>): react_jsx_runtime.JSX.Element;
|
|
192
|
+
declare function BaseCarouselInner<T>({ items, getItemKey, renderItem, infinite, onEndReached, hasNextPage, itemWidthVar, itemWidthCssVar, fallbackWidth, itemClassName, snapType, disableOpacityEffect, disableScaleEffect, verticalPadding, snap, renderSkeleton, persistKey, onActiveItemChange, gap: gapProp, debugId, debug, eagerSelectionOnMobile, initialIndex, prevLabel, nextLabel, }: BaseCarouselProps<T>): react_jsx_runtime.JSX.Element;
|
|
189
193
|
declare const Carousel: typeof BaseCarouselInner;
|
|
190
194
|
|
|
191
195
|
type Direction = 'left' | 'right';
|
|
192
|
-
interface CarouselArrowProps {
|
|
196
|
+
interface CarouselArrowProps extends ComponentProps<'button'> {
|
|
193
197
|
direction: Direction;
|
|
194
198
|
onClick: () => void;
|
|
195
199
|
disabled?: boolean;
|
|
196
200
|
className?: string;
|
|
201
|
+
label?: string;
|
|
197
202
|
}
|
|
198
|
-
declare function CarouselArrow({ direction, onClick, disabled, className, }: CarouselArrowProps): react_jsx_runtime.JSX.Element;
|
|
203
|
+
declare function CarouselArrow({ direction, onClick, disabled, className, label, ...props }: CarouselArrowProps): react_jsx_runtime.JSX.Element;
|
|
199
204
|
|
|
200
205
|
type CarouselPhase = 'UNINITIALIZED' | 'IDLE' | 'SCROLLING' | 'BOUNCING' | 'PRE_TELEPORTING' | 'TELEPORTING' | 'DRAGGING';
|
|
201
206
|
interface CarouselContext {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
|
+
import { ReactNode, ComponentProps, PointerEvent, MouseEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
declare const VISUAL_CONFIG: {
|
|
6
6
|
readonly MAX_DIST_MOBILE: 320;
|
|
@@ -128,6 +128,10 @@ interface BaseCarouselProps<T> {
|
|
|
128
128
|
infinite?: boolean;
|
|
129
129
|
onEndReached?: () => void;
|
|
130
130
|
hasNextPage?: boolean;
|
|
131
|
+
/** Custom label for previous button (aria-label). Defaults to 'Previous' */
|
|
132
|
+
prevLabel?: string;
|
|
133
|
+
/** Custom label for next button (aria-label). Defaults to 'Next' */
|
|
134
|
+
nextLabel?: string;
|
|
131
135
|
/**
|
|
132
136
|
* CSS variable name for item width. Uses native CSS media queries for responsive widths.
|
|
133
137
|
* Options: 'default' | 'review' | 'compact' | 'collection' | 'wide'
|
|
@@ -185,17 +189,18 @@ interface BaseCarouselProps<T> {
|
|
|
185
189
|
*/
|
|
186
190
|
eagerSelectionOnMobile?: boolean;
|
|
187
191
|
}
|
|
188
|
-
declare function BaseCarouselInner<T>({ items, getItemKey, renderItem, infinite, onEndReached, hasNextPage, itemWidthVar, itemWidthCssVar, fallbackWidth, itemClassName, snapType, disableOpacityEffect, disableScaleEffect, verticalPadding, snap, renderSkeleton, persistKey, onActiveItemChange, gap: gapProp, debugId, debug, eagerSelectionOnMobile, initialIndex, }: BaseCarouselProps<T>): react_jsx_runtime.JSX.Element;
|
|
192
|
+
declare function BaseCarouselInner<T>({ items, getItemKey, renderItem, infinite, onEndReached, hasNextPage, itemWidthVar, itemWidthCssVar, fallbackWidth, itemClassName, snapType, disableOpacityEffect, disableScaleEffect, verticalPadding, snap, renderSkeleton, persistKey, onActiveItemChange, gap: gapProp, debugId, debug, eagerSelectionOnMobile, initialIndex, prevLabel, nextLabel, }: BaseCarouselProps<T>): react_jsx_runtime.JSX.Element;
|
|
189
193
|
declare const Carousel: typeof BaseCarouselInner;
|
|
190
194
|
|
|
191
195
|
type Direction = 'left' | 'right';
|
|
192
|
-
interface CarouselArrowProps {
|
|
196
|
+
interface CarouselArrowProps extends ComponentProps<'button'> {
|
|
193
197
|
direction: Direction;
|
|
194
198
|
onClick: () => void;
|
|
195
199
|
disabled?: boolean;
|
|
196
200
|
className?: string;
|
|
201
|
+
label?: string;
|
|
197
202
|
}
|
|
198
|
-
declare function CarouselArrow({ direction, onClick, disabled, className, }: CarouselArrowProps): react_jsx_runtime.JSX.Element;
|
|
203
|
+
declare function CarouselArrow({ direction, onClick, disabled, className, label, ...props }: CarouselArrowProps): react_jsx_runtime.JSX.Element;
|
|
199
204
|
|
|
200
205
|
type CarouselPhase = 'UNINITIALIZED' | 'IDLE' | 'SCROLLING' | 'BOUNCING' | 'PRE_TELEPORTING' | 'TELEPORTING' | 'DRAGGING';
|
|
201
206
|
interface CarouselContext {
|