@wlloyalty/wll-react-sdk 1.2.1 → 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.
- package/dist/native.js +65 -19
- package/dist/native.js.map +1 -1
- package/dist/types/components/organisms/ContentTile/ContentTile.stories.d.ts +27 -0
- package/dist/types/components/organisms/Group/Group.stories.d.ts +1 -0
- package/dist/types/constants/responsive.d.ts +2 -2
- package/dist/web.js +64 -21
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -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>;
|
|
@@ -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 =
|
|
7
|
-
export declare const SMALL_SCREEN_WIDTH =
|
|
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 =
|
|
8463
|
-
var SMALL_SCREEN_WIDTH =
|
|
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.
|
|
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.
|
|
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:
|
|
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:
|
|
20211
|
+
numberOfLines: 1,
|
|
20201
20212
|
ellipsizeMode: "tail",
|
|
20202
20213
|
accessibilityElementsHidden: true,
|
|
20203
20214
|
importantForAccessibility: "no-hide-descendants"
|
|
@@ -20503,21 +20514,30 @@ var ContentTileMedia = function (_a) {
|
|
|
20503
20514
|
|
|
20504
20515
|
var ContentTileSummary = function () {
|
|
20505
20516
|
var tileContext = useTileContext();
|
|
20517
|
+
var sizeInfo = useTileSize(tileContext);
|
|
20506
20518
|
if (!isContextValid(tileContext)) return null;
|
|
20507
|
-
var
|
|
20519
|
+
var _a = tileContext.configuration,
|
|
20520
|
+
body = _a.body,
|
|
20521
|
+
title = _a.title,
|
|
20522
|
+
artworkUrl = _a.artworkUrl;
|
|
20508
20523
|
if (!body) return null;
|
|
20509
|
-
var sizeInfo = useTileSize(tileContext);
|
|
20510
20524
|
if (!sizeInfo) return null;
|
|
20511
|
-
var
|
|
20512
|
-
|
|
20513
|
-
|
|
20514
|
-
|
|
20515
|
-
|
|
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]);
|
|
20516
20536
|
return /*#__PURE__*/React.createElement(Text, {
|
|
20517
20537
|
variant: "body",
|
|
20518
20538
|
role: "article",
|
|
20519
20539
|
accessibilityLabel: body,
|
|
20520
|
-
numberOfLines:
|
|
20540
|
+
numberOfLines: numberOfLines,
|
|
20521
20541
|
testID: "content-tile-summary"
|
|
20522
20542
|
}, body);
|
|
20523
20543
|
};
|
|
@@ -20525,10 +20545,25 @@ var ContentTileSummary = function () {
|
|
|
20525
20545
|
var ContentTileTitle = function () {
|
|
20526
20546
|
var tileContext = useTileContext();
|
|
20527
20547
|
var styles = useContentTileStyles();
|
|
20548
|
+
var sizeInfo = useTileSize(tileContext);
|
|
20528
20549
|
if (!isContextValid(tileContext)) return null;
|
|
20529
20550
|
var _a = tileContext.configuration,
|
|
20530
20551
|
title = _a.title,
|
|
20531
|
-
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]);
|
|
20532
20567
|
if (!title) return null;
|
|
20533
20568
|
var handleTitleWidth = function () {
|
|
20534
20569
|
if (IS_MOBILE && ctaLink) {
|
|
@@ -20539,7 +20574,7 @@ var ContentTileTitle = function () {
|
|
|
20539
20574
|
variant: "title",
|
|
20540
20575
|
role: "heading",
|
|
20541
20576
|
accessibilityLabel: title,
|
|
20542
|
-
numberOfLines:
|
|
20577
|
+
numberOfLines: numberOfLines,
|
|
20543
20578
|
style: handleTitleWidth(),
|
|
20544
20579
|
testID: "content-tile-title"
|
|
20545
20580
|
}, title);
|
|
@@ -20731,14 +20766,14 @@ var useSectionHeaderStyles = function () {
|
|
|
20731
20766
|
marginBottom: useResponsiveValue(theme.sizes.lg, theme.sizes.xxs, isDesktop, isTablet)
|
|
20732
20767
|
},
|
|
20733
20768
|
sectionTitle: {
|
|
20734
|
-
fontSize: useResponsiveValue(theme.sizes.
|
|
20769
|
+
fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.xl, isDesktop, isTablet),
|
|
20735
20770
|
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
|
|
20736
20771
|
fontWeight: '700',
|
|
20737
20772
|
color: theme.text,
|
|
20738
20773
|
fontFamily: theme.fontFamily
|
|
20739
20774
|
},
|
|
20740
20775
|
sectionDescription: {
|
|
20741
|
-
fontSize: useResponsiveValue(theme.sizes.
|
|
20776
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
20742
20777
|
color: theme.alphaDerivedText[80],
|
|
20743
20778
|
fontFamily: theme.fontFamily
|
|
20744
20779
|
}
|
|
@@ -22245,13 +22280,21 @@ var RewardTilePoints = function () {
|
|
|
22245
22280
|
var RewardTileSummary = function () {
|
|
22246
22281
|
var tileContext = useTileContext();
|
|
22247
22282
|
if (!isContextValid(tileContext)) return null;
|
|
22248
|
-
var
|
|
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;
|
|
22249
22290
|
if (!summary) return null;
|
|
22250
22291
|
return /*#__PURE__*/React.createElement(Text, {
|
|
22251
22292
|
variant: "body",
|
|
22252
22293
|
role: "article",
|
|
22253
22294
|
accessibilityLabel: summary,
|
|
22254
|
-
testID: "reward-tile-summary"
|
|
22295
|
+
testID: "reward-tile-summary",
|
|
22296
|
+
numberOfLines: numberOfLines,
|
|
22297
|
+
ellipsizeMode: "tail"
|
|
22255
22298
|
}, summary);
|
|
22256
22299
|
};
|
|
22257
22300
|
|