@wlloyalty/wll-react-sdk 1.4.10 → 1.5.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.
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ declare const sizes: {
15
15
  readonly sm: 12;
16
16
  readonly md: 14;
17
17
  readonly lg: 16;
18
- readonly xl: 18;
18
+ readonly xl: 20;
19
19
  readonly xxl: 24;
20
20
  readonly xxxl: 32;
21
21
  readonly xxxxl: 40;
@@ -81,6 +81,7 @@ declare class Reward {
81
81
  summary?: string;
82
82
  redemptionMessage?: string;
83
83
  visibilityCriteria?: string;
84
+ isLocked?: boolean;
84
85
  }
85
86
  type RewardCategory = {
86
87
  name: string;
@@ -183,6 +184,7 @@ declare class ContentTileConfig {
183
184
  artworkUrl?: string | null;
184
185
  ctaLinkTarget?: CTALinkTarget;
185
186
  ctaLink?: string | null;
187
+ isLocked?: boolean;
186
188
  }
187
189
  declare class RewardTileConfig {
188
190
  rewardId: string;
@@ -190,6 +192,7 @@ declare class RewardTileConfig {
190
192
  showPrice: boolean;
191
193
  showArtwork?: boolean;
192
194
  showDetails?: boolean;
195
+ isLocked?: boolean;
193
196
  id: string;
194
197
  createdAt: string;
195
198
  updatedAt: string;
@@ -222,6 +225,7 @@ declare class VenueTileConfig {
222
225
  name: string;
223
226
  artworkUrl: string;
224
227
  description: string;
228
+ isLocked?: boolean;
225
229
  }
226
230
  declare enum BadgeTileType {
227
231
  Specific = "SPECIFIC",
package/dist/native.js CHANGED
@@ -1675,7 +1675,7 @@ var sizes = {
1675
1675
  sm: 12,
1676
1676
  md: 14,
1677
1677
  lg: 16,
1678
- xl: 18,
1678
+ xl: 20,
1679
1679
  xxl: 24,
1680
1680
  xxxl: 32,
1681
1681
  xxxxl: 40,
@@ -2784,6 +2784,9 @@ var shouldHideContentForHalfTile = function (sizeInfo, artworkUrl) {
2784
2784
  };
2785
2785
 
2786
2786
  var baseStyles = reactNative.StyleSheet.create({
2787
+ imageContainer: {
2788
+ position: 'relative',
2789
+ },
2787
2790
  container: {
2788
2791
  width: '100%',
2789
2792
  height: '100%',
@@ -2820,6 +2823,17 @@ var useBaseTileStyles = function () {
2820
2823
  justifyContent: 'space-between',
2821
2824
  },
2822
2825
  media: baseStyles.media,
2826
+ lockOverlay: {
2827
+ position: 'absolute',
2828
+ top: 0,
2829
+ left: 0,
2830
+ right: 0,
2831
+ bottom: 0,
2832
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
2833
+ justifyContent: 'center',
2834
+ alignItems: 'center',
2835
+ zIndex: 10,
2836
+ },
2823
2837
  });
2824
2838
  }
2825
2839
  var sizeInfo = useTileSize(tileContext);
@@ -2839,6 +2853,17 @@ var useBaseTileStyles = function () {
2839
2853
  textAlign: isHalfSize ? 'center' : undefined,
2840
2854
  },
2841
2855
  media: __assign(__assign({}, baseStyles.media), { flexBasis: !isHalfSize && title && body ? '50%' : '100%', height: isHalfSize ? '100%' : undefined }),
2856
+ lockOverlay: {
2857
+ position: 'absolute',
2858
+ top: 0,
2859
+ left: 0,
2860
+ right: 0,
2861
+ bottom: 0,
2862
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
2863
+ justifyContent: 'center',
2864
+ alignItems: 'center',
2865
+ zIndex: 10,
2866
+ },
2842
2867
  });
2843
2868
  };
2844
2869
 
@@ -2902,11 +2927,11 @@ var BaseTileMedia = function (props) {
2902
2927
  var tileContext = useTileContext();
2903
2928
  if (!isContextValid(tileContext))
2904
2929
  return null;
2905
- var _a = tileContext.configuration, artworkUrl = _a.artworkUrl, _b = _a.title, title = _b === void 0 ? '' : _b;
2930
+ var _a = tileContext.configuration, artworkUrl = _a.artworkUrl, _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.isLocked, isLocked = _c === void 0 ? false : _c;
2906
2931
  var styles = useBaseTileStyles();
2907
2932
  if (!artworkUrl)
2908
2933
  return null;
2909
- return (jsxRuntimeExports.jsx(ProgressiveImage, __assign({}, props, { source: { uri: artworkUrl }, testID: "tile-media", style: [props.style, baseStyles.media, styles.media], alt: "Content image".concat(title ? " for ".concat(title) : ''), role: "img" })));
2934
+ return (jsxRuntimeExports.jsxs(reactNative.View, { style: baseStyles.imageContainer, children: [jsxRuntimeExports.jsx(ProgressiveImage, __assign({}, props, { source: { uri: artworkUrl }, testID: "tile-media", style: [props.style, baseStyles.media, styles.media], alt: "Content image".concat(title ? " for ".concat(title) : ''), role: "img" })), isLocked && (jsxRuntimeExports.jsx(reactNative.View, { style: styles.lockOverlay, testID: "lock-overlay", children: jsxRuntimeExports.jsx(Icon, { name: "LockKeyhole", size: 48, color: "white" }) }))] }));
2910
2935
  };
2911
2936
 
2912
2937
  /**
@@ -3734,11 +3759,7 @@ var ContentTileTitle = function () {
3734
3759
  if (isHalfSize) {
3735
3760
  if (title && !body)
3736
3761
  return 3;
3737
- if (title && body)
3738
- return 1;
3739
3762
  }
3740
- if (artworkUrl)
3741
- return 1;
3742
3763
  if (!body)
3743
3764
  return 7;
3744
3765
  return 2;
@@ -5042,6 +5063,15 @@ var useRewardTileStyles = function () {
5042
5063
  height: '100%',
5043
5064
  resizeMode: 'cover',
5044
5065
  },
5066
+ lockIcon: {
5067
+ position: 'absolute',
5068
+ top: 0,
5069
+ left: 0,
5070
+ bottom: 0,
5071
+ right: 0,
5072
+ width: '100%',
5073
+ height: '100%',
5074
+ },
5045
5075
  content: {
5046
5076
  paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
5047
5077
  flex: 1,
@@ -5063,6 +5093,17 @@ var useRewardTileStyles = function () {
5063
5093
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
5064
5094
  },
5065
5095
  tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
5096
+ lockOverlay: {
5097
+ position: 'absolute',
5098
+ top: 0,
5099
+ left: 0,
5100
+ right: 0,
5101
+ bottom: 0,
5102
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
5103
+ justifyContent: 'center',
5104
+ alignItems: 'center',
5105
+ zIndex: 10,
5106
+ },
5066
5107
  });
5067
5108
  };
5068
5109
 
@@ -5079,13 +5120,13 @@ var RewardTileMedia = function (_a) {
5079
5120
  var tileContext = useTileContext();
5080
5121
  if (!isContextValid(tileContext))
5081
5122
  return null;
5082
- var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.showArtwork, showArtwork = _c === void 0 ? true : _c, _d = _b.name, name = _d === void 0 ? 'Reward' : _d;
5123
+ var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.showArtwork, showArtwork = _c === void 0 ? true : _c, _d = _b.name, name = _d === void 0 ? 'Reward' : _d, _e = _b.isLocked, isLocked = _e === void 0 ? false : _e;
5083
5124
  if (!artworkUrl || !showArtwork)
5084
5125
  return null;
5085
5126
  var containerStyle = {
5086
5127
  flexBasis: isArtworkOnly ? '100%' : '50%',
5087
5128
  };
5088
- return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "reward-tile-media", role: "img", accessibilityLabel: "Reward image for ".concat(name), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Reward image for ".concat(name) }) }));
5129
+ return (jsxRuntimeExports.jsxs(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "reward-tile-media", role: "img", accessibilityLabel: "Reward image for ".concat(name), children: [jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Reward image for ".concat(name) }), isLocked && (jsxRuntimeExports.jsx(reactNative.View, { style: styles.lockOverlay, testID: "lock-overlay", children: jsxRuntimeExports.jsx(Icon, { name: "LockKeyhole", size: 48, color: "white" }) }))] }));
5089
5130
  };
5090
5131
 
5091
5132
  /**
@@ -5482,6 +5523,17 @@ var useVenueTileStyles = function () {
5482
5523
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
5483
5524
  },
5484
5525
  tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
5526
+ lockOverlay: {
5527
+ position: 'absolute',
5528
+ top: 0,
5529
+ left: 0,
5530
+ right: 0,
5531
+ bottom: 0,
5532
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
5533
+ justifyContent: 'center',
5534
+ alignItems: 'center',
5535
+ zIndex: 10,
5536
+ },
5485
5537
  });
5486
5538
  };
5487
5539
 
@@ -5493,18 +5545,18 @@ var useVenueTileStyles = function () {
5493
5545
  * @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
5494
5546
  */
5495
5547
  var VenueTileMedia = function (_a) {
5496
- var isArtworkOnly = _a.isArtworkOnly;
5548
+ var _b = _a.isArtworkOnly, isArtworkOnly = _b === void 0 ? false : _b;
5497
5549
  var styles = useVenueTileStyles();
5498
5550
  var tileContext = useTileContext();
5499
5551
  if (!isContextValid(tileContext))
5500
5552
  return null;
5501
- var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.name, name = _c === void 0 ? 'Venue' : _c;
5553
+ var _c = tileContext.configuration, artworkUrl = _c.artworkUrl, _d = _c.name, name = _d === void 0 ? 'Venue' : _d, _e = _c.isLocked, isLocked = _e === void 0 ? false : _e;
5502
5554
  if (!artworkUrl)
5503
5555
  return null;
5504
5556
  var containerStyle = {
5505
5557
  flexBasis: isArtworkOnly ? '100%' : '50%',
5506
5558
  };
5507
- return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "venue-tile-media", role: "img", accessibilityLabel: "Venue image for ".concat(name), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Venue image for ".concat(name) }) }));
5559
+ return (jsxRuntimeExports.jsxs(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "venue-tile-media", role: "img", accessibilityLabel: "Venue image for ".concat(name), children: [jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Venue image for ".concat(name) }), isLocked && (jsxRuntimeExports.jsx(reactNative.View, { style: styles.lockOverlay, testID: "lock-overlay", children: jsxRuntimeExports.jsx(Icon, { name: "LockKeyhole", size: 48, color: "white" }) }))] }));
5508
5560
  };
5509
5561
 
5510
5562
  /**
@@ -5558,7 +5610,7 @@ var VenueTileRoot = function (_a) {
5558
5610
  !tile.active ||
5559
5611
  !tile.configuration)
5560
5612
  return null;
5561
- return (jsxRuntimeExports.jsxs(BaseTile, { tile: tile, children: [jsxRuntimeExports.jsx(VenueTile.Media, { isArtworkOnly: false }), jsxRuntimeExports.jsxs(Layout, { children: [jsxRuntimeExports.jsxs(Row, { justify: "between", align: "center", style: styles.header, children: [jsxRuntimeExports.jsx(VenueTile.Title, {}), jsxRuntimeExports.jsx(VenueTile.Chevron, {})] }), jsxRuntimeExports.jsx(VenueTile.Description, {})] })] }));
5613
+ return (jsxRuntimeExports.jsxs(BaseTile, { tile: tile, children: [jsxRuntimeExports.jsx(VenueTile.Media, {}), jsxRuntimeExports.jsxs(Layout, { children: [jsxRuntimeExports.jsxs(Row, { justify: "between", align: "center", style: styles.header, children: [jsxRuntimeExports.jsx(VenueTile.Title, {}), jsxRuntimeExports.jsx(VenueTile.Chevron, {})] }), jsxRuntimeExports.jsx(VenueTile.Description, {})] })] }));
5562
5614
  };
5563
5615
  /**
5564
5616
  * The VenueTile component with subcomponents attached.