@wlloyalty/wll-react-sdk 1.2.0 → 1.3.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.
@@ -5,6 +5,9 @@ export default _default;
5
5
  export declare const FullSizeWelcomeTier: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
6
6
  tile: import("../../../types/tile").Tile;
7
7
  }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
8
+ export declare const ImageWithLongTitleAndBody: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
9
+ tile: import("../../../types/tile").Tile;
10
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
8
11
  export declare const FullSizeRewardHighlight: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
9
12
  tile: import("../../../types/tile").Tile;
10
13
  }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
@@ -26,3 +29,27 @@ export declare const HalfSizeReferralBonus: import("@storybook/csf").AnnotatedSt
26
29
  export declare const FullSizePartnerRewards: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
27
30
  tile: import("../../../types/tile").Tile;
28
31
  }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
32
+ export declare const TitleOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
33
+ tile: import("../../../types/tile").Tile;
34
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
35
+ export declare const BodyOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
36
+ tile: import("../../../types/tile").Tile;
37
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
38
+ export declare const TitleAndBody: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
39
+ tile: import("../../../types/tile").Tile;
40
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
41
+ export declare const HalfSizeTitleOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
42
+ tile: import("../../../types/tile").Tile;
43
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
44
+ export declare const HalfSizeBodyOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
45
+ tile: import("../../../types/tile").Tile;
46
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
47
+ export declare const HalfSizeTitleAndBody: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
48
+ tile: import("../../../types/tile").Tile;
49
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
50
+ export declare const ResponsiveTest: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
51
+ tile: import("../../../types/tile").Tile;
52
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
53
+ export declare const HalfSizeArtworkOnly: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
54
+ tile: import("../../../types/tile").Tile;
55
+ }, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
@@ -8,3 +8,4 @@ export declare const EmptySections: Story;
8
8
  export declare const FullGroup: Story;
9
9
  export declare const GamificationFullGroup: Story;
10
10
  export declare const AirMilesTravelFullGroup: Story;
11
+ export declare const ContentTileGroup: Story;
@@ -3,5 +3,5 @@ export declare const DIMENSION_MODES: {
3
3
  TABLET: "tablet";
4
4
  MOBILE: "mobile";
5
5
  };
6
- export declare const TABLET_SCREEN_WIDTH = 728;
7
- export declare const SMALL_SCREEN_WIDTH = 530;
6
+ export declare const TABLET_SCREEN_WIDTH = 768;
7
+ export declare const SMALL_SCREEN_WIDTH = 480;
package/dist/web.js CHANGED
@@ -8459,8 +8459,8 @@ var DIMENSION_MODES = {
8459
8459
  TABLET: 'tablet',
8460
8460
  MOBILE: 'mobile'
8461
8461
  };
8462
- var TABLET_SCREEN_WIDTH = 728;
8463
- var SMALL_SCREEN_WIDTH = 530;
8462
+ var TABLET_SCREEN_WIDTH = 768;
8463
+ var SMALL_SCREEN_WIDTH = 480;
8464
8464
 
8465
8465
  var isWeb = Platform$1.OS === 'web';
8466
8466
  function getDimensionMode(window) {
@@ -18992,7 +18992,7 @@ var Text = function (_a) {
18992
18992
  });
18993
18993
  case 'title':
18994
18994
  return __assign(__assign({}, baseStyle), {
18995
- fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.md, isDesktop, isTablet),
18995
+ fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
18996
18996
  fontWeight: 'bold'
18997
18997
  });
18998
18998
  case 'body':
@@ -19010,7 +19010,7 @@ var Text = function (_a) {
19010
19010
  case 'label':
19011
19011
  default:
19012
19012
  return __assign(__assign({}, baseStyle), {
19013
- fontSize: useResponsiveValue(theme.sizes.sm, theme.sizes.xs, isDesktop, isTablet)
19013
+ fontSize: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
19014
19014
  });
19015
19015
  }
19016
19016
  };
@@ -20083,6 +20083,7 @@ var BadgeTileDateEarned = function () {
20083
20083
  */
20084
20084
  var BadgeTileDescription = function () {
20085
20085
  var tileContext = useTileContext();
20086
+ var width = useWindowDimensions().width;
20086
20087
  if (!isContextValid(tileContext)) return null;
20087
20088
  var _a = tileContext.configuration,
20088
20089
  count = _a.count,
@@ -20092,13 +20093,23 @@ var BadgeTileDescription = function () {
20092
20093
  // For Latest type, hide description when count = 0
20093
20094
  // For Specific type, always show description
20094
20095
  if (count === 0 && type === exports.BadgeTileType.Latest) return null;
20096
+ var numberOfLines = React.useMemo(function () {
20097
+ if (width <= 480) return 2;
20098
+ if (width <= 768) return 3;
20099
+ if (width <= 1024) return 1;
20100
+ return 2;
20101
+ }, [width]);
20095
20102
  return /*#__PURE__*/React.createElement(View$2, {
20096
20103
  accessible: true,
20097
20104
  accessibilityLabel: "Badge description: ".concat(description),
20098
- testID: "badge-tile-description"
20105
+ testID: "badge-tile-description",
20106
+ style: {
20107
+ width: '100%',
20108
+ overflow: 'hidden'
20109
+ }
20099
20110
  }, /*#__PURE__*/React.createElement(Text, {
20100
20111
  variant: "body",
20101
- numberOfLines: 2,
20112
+ numberOfLines: numberOfLines,
20102
20113
  ellipsizeMode: "tail",
20103
20114
  accessibilityElementsHidden: true,
20104
20115
  importantForAccessibility: "no-hide-descendants"
@@ -20197,7 +20208,7 @@ var BadgeTileTitle = function () {
20197
20208
  }, /*#__PURE__*/React.createElement(Text, {
20198
20209
  variant: "title",
20199
20210
  style: styles.titleText,
20200
- numberOfLines: count === 0 ? 2 : 1,
20211
+ numberOfLines: 1,
20201
20212
  ellipsizeMode: "tail",
20202
20213
  accessibilityElementsHidden: true,
20203
20214
  importantForAccessibility: "no-hide-descendants"
@@ -20448,16 +20459,17 @@ var useContentTileStyles = function (hasArtwork) {
20448
20459
  return StyleSheet$1.create({
20449
20460
  imageContainer: {
20450
20461
  width: '100%',
20451
- marginBottom: 0
20462
+ marginBottom: 0,
20463
+ overflow: 'hidden'
20452
20464
  },
20453
20465
  image: {
20454
20466
  position: 'absolute',
20455
- top: 0,
20456
- left: 0,
20457
- bottom: 0,
20458
- right: 0,
20459
- width: '100%',
20460
- height: '100%',
20467
+ top: -1,
20468
+ left: -1,
20469
+ bottom: -1,
20470
+ right: -1,
20471
+ width: '102%',
20472
+ height: '102%',
20461
20473
  resizeMode: 'cover'
20462
20474
  },
20463
20475
  content: {
@@ -20502,21 +20514,30 @@ var ContentTileMedia = function (_a) {
20502
20514
 
20503
20515
  var ContentTileSummary = function () {
20504
20516
  var tileContext = useTileContext();
20517
+ var sizeInfo = useTileSize(tileContext);
20505
20518
  if (!isContextValid(tileContext)) return null;
20506
- var body = tileContext.configuration.body;
20519
+ var _a = tileContext.configuration,
20520
+ body = _a.body,
20521
+ title = _a.title,
20522
+ artworkUrl = _a.artworkUrl;
20507
20523
  if (!body) return null;
20508
- var sizeInfo = useTileSize(tileContext);
20509
20524
  if (!sizeInfo) return null;
20510
- var isFullSize = sizeInfo.isFullSize,
20511
- isHalfSize = sizeInfo.isHalfSize;
20512
- var getNumberOfLines = function () {
20513
- return isFullSize ? 3 : isHalfSize ? 4 : 3;
20514
- };
20525
+ var isHalfSize = sizeInfo.isHalfSize;
20526
+ var numberOfLines = React.useMemo(function () {
20527
+ if (!body) return undefined;
20528
+ if (isHalfSize) {
20529
+ if (!title && body) return 4;
20530
+ if (title && body) return 2;
20531
+ }
20532
+ if (artworkUrl) return 3;
20533
+ if (!title) return 8;
20534
+ return 6;
20535
+ }, [title, body, artworkUrl, isHalfSize]);
20515
20536
  return /*#__PURE__*/React.createElement(Text, {
20516
20537
  variant: "body",
20517
20538
  role: "article",
20518
20539
  accessibilityLabel: body,
20519
- numberOfLines: getNumberOfLines(),
20540
+ numberOfLines: numberOfLines,
20520
20541
  testID: "content-tile-summary"
20521
20542
  }, body);
20522
20543
  };
@@ -20524,10 +20545,25 @@ var ContentTileSummary = function () {
20524
20545
  var ContentTileTitle = function () {
20525
20546
  var tileContext = useTileContext();
20526
20547
  var styles = useContentTileStyles();
20548
+ var sizeInfo = useTileSize(tileContext);
20527
20549
  if (!isContextValid(tileContext)) return null;
20528
20550
  var _a = tileContext.configuration,
20529
20551
  title = _a.title,
20530
- ctaLink = _a.ctaLink;
20552
+ ctaLink = _a.ctaLink,
20553
+ body = _a.body,
20554
+ artworkUrl = _a.artworkUrl;
20555
+ if (!sizeInfo) return null;
20556
+ var isHalfSize = sizeInfo.isHalfSize;
20557
+ var numberOfLines = React.useMemo(function () {
20558
+ if (!title) return undefined;
20559
+ if (isHalfSize) {
20560
+ if (title && !body) return 3;
20561
+ if (title && body) return 1;
20562
+ }
20563
+ if (artworkUrl) return 1;
20564
+ if (!body) return 7;
20565
+ return 2;
20566
+ }, [title, body, artworkUrl, isHalfSize]);
20531
20567
  if (!title) return null;
20532
20568
  var handleTitleWidth = function () {
20533
20569
  if (IS_MOBILE && ctaLink) {
@@ -20538,7 +20574,7 @@ var ContentTileTitle = function () {
20538
20574
  variant: "title",
20539
20575
  role: "heading",
20540
20576
  accessibilityLabel: title,
20541
- numberOfLines: 1,
20577
+ numberOfLines: numberOfLines,
20542
20578
  style: handleTitleWidth(),
20543
20579
  testID: "content-tile-title"
20544
20580
  }, title);
@@ -20730,14 +20766,14 @@ var useSectionHeaderStyles = function () {
20730
20766
  marginBottom: useResponsiveValue(theme.sizes.lg, theme.sizes.xxs, isDesktop, isTablet)
20731
20767
  },
20732
20768
  sectionTitle: {
20733
- fontSize: useResponsiveValue(theme.sizes.xxxl, theme.sizes.xl, isDesktop, isTablet),
20769
+ fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.xl, isDesktop, isTablet),
20734
20770
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
20735
20771
  fontWeight: '700',
20736
20772
  color: theme.text,
20737
20773
  fontFamily: theme.fontFamily
20738
20774
  },
20739
20775
  sectionDescription: {
20740
- fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.md, isDesktop, isTablet),
20776
+ fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
20741
20777
  color: theme.alphaDerivedText[80],
20742
20778
  fontFamily: theme.fontFamily
20743
20779
  }
@@ -22244,13 +22280,21 @@ var RewardTilePoints = function () {
22244
22280
  var RewardTileSummary = function () {
22245
22281
  var tileContext = useTileContext();
22246
22282
  if (!isContextValid(tileContext)) return null;
22247
- var summary = tileContext.configuration.summary;
22283
+ var _a = tileContext.configuration,
22284
+ summary = _a.summary,
22285
+ _b = _a.showPrice,
22286
+ showPrice = _b === void 0 ? true : _b,
22287
+ price = _a.price;
22288
+ var shouldShowPrice = showPrice && price !== undefined && price !== null && price !== 0;
22289
+ var numberOfLines = shouldShowPrice ? 1 : 3;
22248
22290
  if (!summary) return null;
22249
22291
  return /*#__PURE__*/React.createElement(Text, {
22250
22292
  variant: "body",
22251
22293
  role: "article",
22252
22294
  accessibilityLabel: summary,
22253
- testID: "reward-tile-summary"
22295
+ testID: "reward-tile-summary",
22296
+ numberOfLines: numberOfLines,
22297
+ ellipsizeMode: "tail"
22254
22298
  }, summary);
22255
22299
  };
22256
22300