@wlloyalty/wll-react-sdk 1.0.89 → 1.0.91

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 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.Pressable, { style: [
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.Pressable, { style: [
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) {
@@ -4289,7 +4318,7 @@ var PointsTileFormattedPoints = function () {
4289
4318
  if (!isContextValid(tileContext))
4290
4319
  return null;
4291
4320
  var _a = tileContext.configuration, _b = _a.pointsMultiplier, pointsMultiplier = _b === void 0 ? 1 : _b, _c = _a.pointsPrefix, pointsPrefix = _c === void 0 ? '' : _c, _d = _a.pointsSuffix, pointsSuffix = _d === void 0 ? 'pts' : _d, _e = _a.points, points = _e === void 0 ? 0 : _e;
4292
- if (points === undefined || points === 0)
4321
+ if (points === undefined)
4293
4322
  return null;
4294
4323
  var calculatedPoints = applyMultiplier(points, pointsMultiplier);
4295
4324
  var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix).trim();
@@ -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;