@wlloyalty/wll-react-sdk 1.0.89 → 1.0.90
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/dist/index.d.ts +7 -1
- package/dist/native.js +40 -10
- package/dist/native.js.map +1 -1
- package/dist/types/components/molecules/CarouselNavButton/index.d.ts +6 -0
- package/dist/types/components/molecules/CarouselNavButton/styles.d.ts +22 -0
- package/dist/types/components/molecules/index.d.ts +1 -0
- package/dist/web.js +57 -25
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -528,6 +528,12 @@ type CarouselProps = {
|
|
|
528
528
|
};
|
|
529
529
|
declare const Carousel: ({ section }: CarouselProps) => JSX.Element | null;
|
|
530
530
|
|
|
531
|
+
type CarouselNavButtonProps = {
|
|
532
|
+
direction: 'left' | 'right';
|
|
533
|
+
onPress: () => void;
|
|
534
|
+
};
|
|
535
|
+
declare const CarouselNavButton: ({ direction, onPress, }: CarouselNavButtonProps) => JSX.Element;
|
|
536
|
+
|
|
531
537
|
type GridProps = {
|
|
532
538
|
section: TSection;
|
|
533
539
|
};
|
|
@@ -681,4 +687,4 @@ type WllSdkProviderProps = WithChildren & {
|
|
|
681
687
|
declare const WllSdkProvider: ({ children, theme: providedTheme, config, navigationConfig, }: WllSdkProviderProps) => JSX.Element;
|
|
682
688
|
declare const useWllSdk: () => WllSdkContextType;
|
|
683
689
|
|
|
684
|
-
export { type APIResponse, type Align, type Availability, type Badge, type BadgeDetail, _default$5 as BadgeTile, BadgeTileConfig, BadgeTileType, _default$4 as BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, Column, _default$3 as ContentTile, ContentTileConfig, type DerivedColors, type DerivedProperties, type DesaturationType, type FlexDirection, FullFlex, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, Layout, type LayoutProps$1 as LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, type PercentageKey, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, type TGroup, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, type TileSizeInfo, TileType, type Variant, WllSdkProvider, alignMap, justifyMap, useWllSdk };
|
|
690
|
+
export { type APIResponse, type Align, type Availability, type Badge, type BadgeDetail, _default$5 as BadgeTile, BadgeTileConfig, BadgeTileType, _default$4 as BannerTile, BannerTileConfig, BaseBanner, type BaseThemeObject, BaseTile, Button, CTALinkTarget, Carousel, CarouselNavButton, Column, _default$3 as ContentTile, ContentTileConfig, type DerivedColors, type DerivedProperties, type DesaturationType, type FlexDirection, FullFlex, Grid, Group, Icon, type ImagePropsNoSource, Indicator, type Justify, Layout, type LayoutProps$1 as LayoutProps, LoadingIndicator, type NavigationConfig, type NavigationType, type PercentageKey, _default$2 as PointsTile, PointsTileConfig, type ProgessType, ProgressBar, ProgressIndicator, ProgressType, ProgressiveImage, Reward, type RewardCategory, _default$1 as RewardCategoryTile, RewardCategoryTileConfig, _default as RewardTile, RewardTileConfig, Row, type SDKConfig, Section, SectionHeader, SectionType, type Size, Skeleton, Spacer, type TGroup, type TSection, Text, type ThemeContextType, type ThemeObject, type ThemeProviderProps, TierTileConfig, TierTileType, TierTile as TierTileUpdated, type TierType, type Tile, type TileConfig, TileContainer, TileHeight, type TileSizeInfo, TileType, type Variant, WllSdkProvider, alignMap, justifyMap, useWllSdk };
|
package/dist/native.js
CHANGED
|
@@ -3678,22 +3678,14 @@ var Carousel = function (_a) {
|
|
|
3678
3678
|
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(SectionHeader, { title: section.title, description: section.description }), jsxRuntimeExports.jsxs(reactNative.View, { ref: containerRef, style: styles.container, onLayout: function (event) {
|
|
3679
3679
|
var width = event.nativeEvent.layout.width;
|
|
3680
3680
|
dispatch({ type: 'SET_CONTAINER_WIDTH', payload: width });
|
|
3681
|
-
}, children: [jsxRuntimeExports.jsxs(reactNative.View, { style: styles.carouselContainer, children: [showPrevButton && (jsxRuntimeExports.jsx(reactNative.
|
|
3682
|
-
styles.navButton,
|
|
3683
|
-
styles.navButtonLeft,
|
|
3684
|
-
{ backgroundColor: theme.background },
|
|
3685
|
-
], onPress: handlePrev, accessibilityLabel: "Previous slide", role: "button", children: jsxRuntimeExports.jsx(Icon, { name: "ArrowLeft", size: 20, color: theme.primary }) })), jsxRuntimeExports.jsx(reactNative.ScrollView, { ref: scrollViewRef, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onScroll: handleScroll, onMomentumScrollEnd: handleScrollEnd, scrollEventThrottle: 16, style: [styles.carouselContent], contentContainerStyle: {
|
|
3681
|
+
}, children: [jsxRuntimeExports.jsxs(reactNative.View, { style: styles.carouselContainer, children: [showPrevButton && (jsxRuntimeExports.jsx(CarouselNavButton, { direction: "left", onPress: handlePrev })), jsxRuntimeExports.jsx(reactNative.ScrollView, { ref: scrollViewRef, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onScroll: handleScroll, onMomentumScrollEnd: handleScrollEnd, scrollEventThrottle: 16, style: styles.carouselContent, contentContainerStyle: {
|
|
3686
3682
|
width: containerWidth * sortedTiles.length,
|
|
3687
3683
|
}, decelerationRate: "fast", snapToInterval: containerWidth, snapToAlignment: "start", children: sortedTiles.map(function (tile, index) { return (jsxRuntimeExports.jsx(reactNative.View, { style: [
|
|
3688
3684
|
styles.slideContainer,
|
|
3689
3685
|
{
|
|
3690
3686
|
width: containerWidth,
|
|
3691
3687
|
},
|
|
3692
|
-
], children: jsxRuntimeExports.jsx(BannerTile$1, { tile: tile }) }, index)); }) }), showNextButton && (jsxRuntimeExports.jsx(reactNative.
|
|
3693
|
-
styles.navButton,
|
|
3694
|
-
styles.navButtonRight,
|
|
3695
|
-
{ backgroundColor: theme.background },
|
|
3696
|
-
], onPress: handleNext, accessibilityLabel: "Next slide", role: "button", children: jsxRuntimeExports.jsx(Icon, { name: "ArrowRight", size: 20, color: theme.primary }) }))] }), displayControls && (jsxRuntimeExports.jsx(reactNative.View, { style: dynamicStyles.indicators, children: sortedTiles.map(function (_, index) {
|
|
3688
|
+
], children: jsxRuntimeExports.jsx(BannerTile$1, { tile: tile }) }, index)); }) }), showNextButton && (jsxRuntimeExports.jsx(CarouselNavButton, { direction: "right", onPress: handleNext }))] }), displayControls && (jsxRuntimeExports.jsx(reactNative.View, { style: dynamicStyles.indicators, children: sortedTiles.map(function (_, index) {
|
|
3697
3689
|
var width = animatedIndex.interpolate({
|
|
3698
3690
|
inputRange: [index - 1, index, index + 1],
|
|
3699
3691
|
outputRange: [8, 30, 8],
|
|
@@ -3709,6 +3701,43 @@ var Carousel = function (_a) {
|
|
|
3709
3701
|
}) }))] })] }));
|
|
3710
3702
|
};
|
|
3711
3703
|
|
|
3704
|
+
var useNavButtonStyles = function () {
|
|
3705
|
+
var theme = useWllSdk().theme;
|
|
3706
|
+
var buttonSize = IS_MOBILE ? BUTTON_SIZE * 0.75 : BUTTON_SIZE;
|
|
3707
|
+
return reactNative.StyleSheet.create({
|
|
3708
|
+
navButton: {
|
|
3709
|
+
position: 'absolute',
|
|
3710
|
+
top: '50%',
|
|
3711
|
+
transform: [{ translateY: -buttonSize / 2 }],
|
|
3712
|
+
width: buttonSize,
|
|
3713
|
+
height: buttonSize,
|
|
3714
|
+
borderRadius: buttonSize / 2,
|
|
3715
|
+
backgroundColor: theme.background,
|
|
3716
|
+
justifyContent: 'center',
|
|
3717
|
+
alignItems: 'center',
|
|
3718
|
+
zIndex: 1,
|
|
3719
|
+
},
|
|
3720
|
+
navButtonLeft: {
|
|
3721
|
+
left: -buttonSize / 2,
|
|
3722
|
+
},
|
|
3723
|
+
navButtonRight: {
|
|
3724
|
+
right: -buttonSize / 2,
|
|
3725
|
+
},
|
|
3726
|
+
});
|
|
3727
|
+
};
|
|
3728
|
+
|
|
3729
|
+
var CarouselNavButton = function (_a) {
|
|
3730
|
+
var direction = _a.direction, onPress = _a.onPress;
|
|
3731
|
+
var theme = useWllSdk().theme;
|
|
3732
|
+
var isRight = direction === 'right';
|
|
3733
|
+
var styles = useNavButtonStyles();
|
|
3734
|
+
return (jsxRuntimeExports.jsx(reactNative.Pressable, { style: [
|
|
3735
|
+
styles.navButton,
|
|
3736
|
+
isRight ? styles.navButtonRight : styles.navButtonLeft,
|
|
3737
|
+
{ backgroundColor: theme.background },
|
|
3738
|
+
], onPress: onPress, accessibilityLabel: "".concat(isRight ? 'Next' : 'Previous', " slide"), role: "button", children: jsxRuntimeExports.jsx(Icon, { name: isRight ? 'ArrowRight' : 'ArrowLeft', size: 20, color: theme.primary }) }));
|
|
3739
|
+
};
|
|
3740
|
+
|
|
3712
3741
|
var Grid = function (_a) {
|
|
3713
3742
|
var section = _a.section;
|
|
3714
3743
|
if (section.type !== exports.SectionType.Grid) {
|
|
@@ -4770,6 +4799,7 @@ exports.BaseBanner = BaseBanner;
|
|
|
4770
4799
|
exports.BaseTile = BaseTile;
|
|
4771
4800
|
exports.Button = Button;
|
|
4772
4801
|
exports.Carousel = Carousel;
|
|
4802
|
+
exports.CarouselNavButton = CarouselNavButton;
|
|
4773
4803
|
exports.Column = Column;
|
|
4774
4804
|
exports.ContentTile = ContentTile$1;
|
|
4775
4805
|
exports.ContentTileConfig = ContentTileConfig;
|