@wlloyalty/wll-react-sdk 1.4.9 → 1.5.0

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
@@ -183,6 +183,7 @@ declare class ContentTileConfig {
183
183
  artworkUrl?: string | null;
184
184
  ctaLinkTarget?: CTALinkTarget;
185
185
  ctaLink?: string | null;
186
+ isLocked?: boolean;
186
187
  }
187
188
  declare class RewardTileConfig {
188
189
  rewardId: string;
@@ -190,6 +191,7 @@ declare class RewardTileConfig {
190
191
  showPrice: boolean;
191
192
  showArtwork?: boolean;
192
193
  showDetails?: boolean;
194
+ isLocked?: boolean;
193
195
  id: string;
194
196
  createdAt: string;
195
197
  updatedAt: string;
@@ -222,6 +224,7 @@ declare class VenueTileConfig {
222
224
  name: string;
223
225
  artworkUrl: string;
224
226
  description: string;
227
+ isLocked?: boolean;
225
228
  }
226
229
  declare enum BadgeTileType {
227
230
  Specific = "SPECIFIC",
@@ -353,9 +356,10 @@ type ButtonProps = {
353
356
  disabled?: boolean;
354
357
  accessibilityLabel?: string;
355
358
  accessibilityHint?: string;
359
+ icon?: React$1.ReactNode;
356
360
  testID?: string;
357
361
  };
358
- declare const Button: ({ title, onPress, variant, disabled, accessibilityLabel, accessibilityHint, testID, }: ButtonProps) => React$1.ReactElement;
362
+ declare const Button: ({ title, onPress, variant, disabled, accessibilityLabel, accessibilityHint, icon, testID, }: ButtonProps) => React$1.ReactElement;
359
363
 
360
364
  type IconName = keyof typeof LucideReactIcons;
361
365
  type IconProps = {
package/dist/native.js CHANGED
@@ -2177,6 +2177,7 @@ var useButtonDynamicStyles = function () {
2177
2177
  button: {
2178
2178
  justifyContent: 'center',
2179
2179
  alignItems: 'center',
2180
+ flexDirection: 'row',
2180
2181
  paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
2181
2182
  paddingVertical: theme.sizes.sm,
2182
2183
  alignSelf: 'flex-start',
@@ -2219,12 +2220,12 @@ var useTextStyles = createVariantSystem({}, function (theme) { return ({
2219
2220
  },
2220
2221
  }); });
2221
2222
  var Button = function (_a) {
2222
- var title = _a.title, onPress = _a.onPress, variant = _a.variant, _b = _a.disabled, disabled = _b === void 0 ? false : _b, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, testID = _a.testID;
2223
+ var title = _a.title, onPress = _a.onPress, variant = _a.variant, _b = _a.disabled, disabled = _b === void 0 ? false : _b, accessibilityLabel = _a.accessibilityLabel, accessibilityHint = _a.accessibilityHint, icon = _a.icon, testID = _a.testID;
2223
2224
  var theme = useWllSdk().theme;
2224
2225
  var buttonStyle = useButtonStyles(theme, variant);
2225
2226
  var textStyle = useTextStyles(theme, variant);
2226
2227
  var styles = useButtonDynamicStyles();
2227
- return (jsxRuntimeExports.jsx(reactNative.Pressable, { style: function (_a) {
2228
+ return (jsxRuntimeExports.jsxs(reactNative.Pressable, { style: function (_a) {
2228
2229
  var pressed = _a.pressed;
2229
2230
  return [
2230
2231
  styles.button,
@@ -2233,7 +2234,7 @@ var Button = function (_a) {
2233
2234
  disabled && { opacity: 0.5 },
2234
2235
  pressed && { opacity: 0.7 },
2235
2236
  ];
2236
- }, onPress: onPress, disabled: disabled, accessible: true, role: "button", accessibilityLabel: accessibilityLabel || title, accessibilityHint: accessibilityHint, accessibilityState: { disabled: disabled }, testID: testID, children: jsxRuntimeExports.jsx(reactNative.Text, { style: [styles.text, textStyle], children: title }) }));
2237
+ }, onPress: onPress, disabled: disabled, accessible: true, role: "button", accessibilityLabel: accessibilityLabel || title, accessibilityHint: accessibilityHint, accessibilityState: { disabled: disabled }, testID: testID, children: [icon && icon, title && jsxRuntimeExports.jsx(reactNative.Text, { style: [styles.text, textStyle], children: title })] }));
2237
2238
  };
2238
2239
 
2239
2240
  var LucideReactNativeIcons;
@@ -2783,6 +2784,9 @@ var shouldHideContentForHalfTile = function (sizeInfo, artworkUrl) {
2783
2784
  };
2784
2785
 
2785
2786
  var baseStyles = reactNative.StyleSheet.create({
2787
+ imageContainer: {
2788
+ position: 'relative',
2789
+ },
2786
2790
  container: {
2787
2791
  width: '100%',
2788
2792
  height: '100%',
@@ -2819,6 +2823,17 @@ var useBaseTileStyles = function () {
2819
2823
  justifyContent: 'space-between',
2820
2824
  },
2821
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
+ },
2822
2837
  });
2823
2838
  }
2824
2839
  var sizeInfo = useTileSize(tileContext);
@@ -2838,6 +2853,17 @@ var useBaseTileStyles = function () {
2838
2853
  textAlign: isHalfSize ? 'center' : undefined,
2839
2854
  },
2840
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
+ },
2841
2867
  });
2842
2868
  };
2843
2869
 
@@ -2901,11 +2927,11 @@ var BaseTileMedia = function (props) {
2901
2927
  var tileContext = useTileContext();
2902
2928
  if (!isContextValid(tileContext))
2903
2929
  return null;
2904
- 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;
2905
2931
  var styles = useBaseTileStyles();
2906
2932
  if (!artworkUrl)
2907
2933
  return null;
2908
- 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" }) }))] }));
2909
2935
  };
2910
2936
 
2911
2937
  /**
@@ -5041,6 +5067,15 @@ var useRewardTileStyles = function () {
5041
5067
  height: '100%',
5042
5068
  resizeMode: 'cover',
5043
5069
  },
5070
+ lockIcon: {
5071
+ position: 'absolute',
5072
+ top: 0,
5073
+ left: 0,
5074
+ bottom: 0,
5075
+ right: 0,
5076
+ width: '100%',
5077
+ height: '100%',
5078
+ },
5044
5079
  content: {
5045
5080
  paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
5046
5081
  flex: 1,
@@ -5062,6 +5097,17 @@ var useRewardTileStyles = function () {
5062
5097
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
5063
5098
  },
5064
5099
  tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
5100
+ lockOverlay: {
5101
+ position: 'absolute',
5102
+ top: 0,
5103
+ left: 0,
5104
+ right: 0,
5105
+ bottom: 0,
5106
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
5107
+ justifyContent: 'center',
5108
+ alignItems: 'center',
5109
+ zIndex: 10,
5110
+ },
5065
5111
  });
5066
5112
  };
5067
5113
 
@@ -5078,13 +5124,13 @@ var RewardTileMedia = function (_a) {
5078
5124
  var tileContext = useTileContext();
5079
5125
  if (!isContextValid(tileContext))
5080
5126
  return null;
5081
- 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;
5127
+ 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;
5082
5128
  if (!artworkUrl || !showArtwork)
5083
5129
  return null;
5084
5130
  var containerStyle = {
5085
5131
  flexBasis: isArtworkOnly ? '100%' : '50%',
5086
5132
  };
5087
- 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) }) }));
5133
+ 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" }) }))] }));
5088
5134
  };
5089
5135
 
5090
5136
  /**
@@ -5481,6 +5527,17 @@ var useVenueTileStyles = function () {
5481
5527
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
5482
5528
  },
5483
5529
  tileTitle: __assign({ maxWidth: '90%', flex: 1 }, getDirectionalMargin(8)),
5530
+ lockOverlay: {
5531
+ position: 'absolute',
5532
+ top: 0,
5533
+ left: 0,
5534
+ right: 0,
5535
+ bottom: 0,
5536
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
5537
+ justifyContent: 'center',
5538
+ alignItems: 'center',
5539
+ zIndex: 10,
5540
+ },
5484
5541
  });
5485
5542
  };
5486
5543
 
@@ -5492,18 +5549,18 @@ var useVenueTileStyles = function () {
5492
5549
  * @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
5493
5550
  */
5494
5551
  var VenueTileMedia = function (_a) {
5495
- var isArtworkOnly = _a.isArtworkOnly;
5552
+ var _b = _a.isArtworkOnly, isArtworkOnly = _b === void 0 ? false : _b;
5496
5553
  var styles = useVenueTileStyles();
5497
5554
  var tileContext = useTileContext();
5498
5555
  if (!isContextValid(tileContext))
5499
5556
  return null;
5500
- var _b = tileContext.configuration, artworkUrl = _b.artworkUrl, _c = _b.name, name = _c === void 0 ? 'Venue' : _c;
5557
+ 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;
5501
5558
  if (!artworkUrl)
5502
5559
  return null;
5503
5560
  var containerStyle = {
5504
5561
  flexBasis: isArtworkOnly ? '100%' : '50%',
5505
5562
  };
5506
- 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) }) }));
5563
+ 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" }) }))] }));
5507
5564
  };
5508
5565
 
5509
5566
  /**
@@ -5557,7 +5614,7 @@ var VenueTileRoot = function (_a) {
5557
5614
  !tile.active ||
5558
5615
  !tile.configuration)
5559
5616
  return null;
5560
- 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, {})] })] }));
5617
+ 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, {})] })] }));
5561
5618
  };
5562
5619
  /**
5563
5620
  * The VenueTile component with subcomponents attached.