@wlloyalty/wll-react-sdk 1.0.107 → 1.0.109
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 +25 -8
- package/dist/native.js +224 -11
- package/dist/native.js.map +1 -1
- package/dist/types/components/atoms/Skeleton/Skeleton.stories.d.ts +8 -0
- package/dist/types/components/organisms/PointsTile/PointsTile.stories.d.ts +6 -0
- package/dist/types/components/organisms/PointsTile/index.d.ts +1 -0
- package/dist/types/components/organisms/PointsTile/points-tile-chevron.d.ts +6 -0
- package/dist/types/components/organisms/PointsTile/styles.d.ts +3 -0
- package/dist/types/components/organisms/RoundupTile/RoundupTile.spec.d.ts +1 -0
- package/dist/types/components/organisms/RoundupTile/RoundupTile.stories.d.ts +33 -0
- package/dist/types/components/organisms/RoundupTile/index.d.ts +18 -0
- package/dist/types/components/organisms/RoundupTile/roundup-tile-chevron.d.ts +6 -0
- package/dist/types/components/organisms/RoundupTile/roundup-tile-formatted-points.d.ts +6 -0
- package/dist/types/components/organisms/RoundupTile/roundup-tile-media.d.ts +10 -0
- package/dist/types/components/organisms/RoundupTile/roundup-tile-title.d.ts +6 -0
- package/dist/types/components/organisms/RoundupTile/styles.d.ts +18 -0
- package/dist/types/components/organisms/index.d.ts +1 -0
- package/dist/types/mocks/tiles/pointsTile.d.ts +2 -0
- package/dist/types/mocks/tiles/roundupTile.d.ts +23 -0
- package/dist/types/types/tile.d.ts +13 -1
- package/dist/web.js +320 -51
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -19038,22 +19038,22 @@ var Text = function (_a) {
|
|
|
19038
19038
|
var accessibilityRole;
|
|
19039
19039
|
switch (variant) {
|
|
19040
19040
|
case 'title':
|
|
19041
|
-
accessibilityRole = 'header';
|
|
19041
|
+
accessibilityRole = IS_MOBILE ? 'heading' : 'header';
|
|
19042
19042
|
break;
|
|
19043
19043
|
case 'caption':
|
|
19044
|
-
accessibilityRole = 'text';
|
|
19044
|
+
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19045
19045
|
break;
|
|
19046
19046
|
case 'eyebrow':
|
|
19047
|
-
accessibilityRole = 'text';
|
|
19047
|
+
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19048
19048
|
break;
|
|
19049
19049
|
case 'description':
|
|
19050
|
-
accessibilityRole = 'paragraph';
|
|
19050
|
+
accessibilityRole = IS_MOBILE ? 'article' : 'paragraph';
|
|
19051
19051
|
break;
|
|
19052
19052
|
case 'label':
|
|
19053
|
-
accessibilityRole = 'text';
|
|
19053
|
+
accessibilityRole = IS_MOBILE ? 'option' : 'text';
|
|
19054
19054
|
break;
|
|
19055
19055
|
default:
|
|
19056
|
-
accessibilityRole = 'text';
|
|
19056
|
+
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19057
19057
|
}
|
|
19058
19058
|
var combinedStyles = [styles.base, variantStyle, styles.webOverrides, style];
|
|
19059
19059
|
return /*#__PURE__*/React__namespace.createElement(Text$3, __assign({
|
|
@@ -19091,6 +19091,7 @@ exports.TileType = void 0;
|
|
|
19091
19091
|
TileType["Badge"] = "BADGE";
|
|
19092
19092
|
TileType["RewardCategory"] = "REWARD_CATEGORY";
|
|
19093
19093
|
TileType["Tier"] = "TIER";
|
|
19094
|
+
TileType["Roundup"] = "ROUND_UP_BALANCE";
|
|
19094
19095
|
})(exports.TileType || (exports.TileType = {}));
|
|
19095
19096
|
exports.TileHeight = void 0;
|
|
19096
19097
|
(function (TileHeight) {
|
|
@@ -19105,6 +19106,10 @@ var PointsTileConfig = /** @class */function () {
|
|
|
19105
19106
|
function PointsTileConfig() {}
|
|
19106
19107
|
return PointsTileConfig;
|
|
19107
19108
|
}();
|
|
19109
|
+
var RoundupTileConfig = /** @class */function () {
|
|
19110
|
+
function RoundupTileConfig() {}
|
|
19111
|
+
return RoundupTileConfig;
|
|
19112
|
+
}();
|
|
19108
19113
|
var ContentTileConfig = /** @class */function () {
|
|
19109
19114
|
function ContentTileConfig() {}
|
|
19110
19115
|
return ContentTileConfig;
|
|
@@ -19680,11 +19685,51 @@ var styles$5 = StyleSheet$1.create({
|
|
|
19680
19685
|
|
|
19681
19686
|
var GRID_GAP = 16;
|
|
19682
19687
|
|
|
19688
|
+
/**
|
|
19689
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
19690
|
+
*
|
|
19691
|
+
* This source code is licensed under the MIT license found in the
|
|
19692
|
+
* LICENSE file in the root directory of this source tree.
|
|
19693
|
+
*
|
|
19694
|
+
* @format
|
|
19695
|
+
*
|
|
19696
|
+
*/
|
|
19697
|
+
|
|
19698
|
+
function useWindowDimensions() {
|
|
19699
|
+
var _useState = React.useState(() => Dimensions.get('window')),
|
|
19700
|
+
dims = _useState[0],
|
|
19701
|
+
setDims = _useState[1];
|
|
19702
|
+
React.useEffect(() => {
|
|
19703
|
+
function handleChange(_ref) {
|
|
19704
|
+
var window = _ref.window;
|
|
19705
|
+
if (window != null) {
|
|
19706
|
+
setDims(window);
|
|
19707
|
+
}
|
|
19708
|
+
}
|
|
19709
|
+
Dimensions.addEventListener('change', handleChange);
|
|
19710
|
+
// We might have missed an update between calling `get` in render and
|
|
19711
|
+
// `addEventListener` in this handler, so we set it here. If there was
|
|
19712
|
+
// no change, React will filter out this update as a no-op.
|
|
19713
|
+
setDims(Dimensions.get('window'));
|
|
19714
|
+
return () => {
|
|
19715
|
+
Dimensions.removeEventListener('change', handleChange);
|
|
19716
|
+
};
|
|
19717
|
+
}, []);
|
|
19718
|
+
return dims;
|
|
19719
|
+
}
|
|
19720
|
+
|
|
19683
19721
|
/* istanbul ignore file */
|
|
19684
19722
|
var SkeletonTile = function (_a) {
|
|
19685
19723
|
var style = _a.style;
|
|
19686
19724
|
var theme = useWllSdk().theme;
|
|
19687
19725
|
var animatedValue = React__namespace.useRef(new Animated$1.Value(0)).current;
|
|
19726
|
+
var width = useWindowDimensions().width;
|
|
19727
|
+
var tileWidth = 1000 / 4;
|
|
19728
|
+
var tileHeight = tileWidth;
|
|
19729
|
+
if (IS_MOBILE) {
|
|
19730
|
+
tileWidth = width / 2 - theme.sizes.lg * 2;
|
|
19731
|
+
tileHeight = tileWidth;
|
|
19732
|
+
}
|
|
19688
19733
|
React__namespace.useEffect(function () {
|
|
19689
19734
|
var pulseAnimation = Animated$1.loop(Animated$1.sequence([Animated$1.timing(animatedValue, {
|
|
19690
19735
|
toValue: 1,
|
|
@@ -19708,15 +19753,16 @@ var SkeletonTile = function (_a) {
|
|
|
19708
19753
|
style: [styles$4.container, {
|
|
19709
19754
|
opacity: opacity,
|
|
19710
19755
|
backgroundColor: theme.alphaDerivedText[20],
|
|
19711
|
-
borderRadius: theme.sizes.borderRadiusLg
|
|
19756
|
+
borderRadius: theme.sizes.borderRadiusLg,
|
|
19757
|
+
width: tileWidth,
|
|
19758
|
+
height: tileHeight
|
|
19712
19759
|
}, style]
|
|
19713
19760
|
});
|
|
19714
19761
|
};
|
|
19715
19762
|
var styles$4 = StyleSheet$1.create({
|
|
19716
19763
|
container: {
|
|
19717
19764
|
aspectRatio: 1,
|
|
19718
|
-
overflow: 'hidden'
|
|
19719
|
-
width: 1000 / 4
|
|
19765
|
+
overflow: 'hidden'
|
|
19720
19766
|
}
|
|
19721
19767
|
});
|
|
19722
19768
|
|
|
@@ -20556,39 +20602,6 @@ exports.SectionType = void 0;
|
|
|
20556
20602
|
SectionType["Banner"] = "BANNER";
|
|
20557
20603
|
})(exports.SectionType || (exports.SectionType = {}));
|
|
20558
20604
|
|
|
20559
|
-
/**
|
|
20560
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
20561
|
-
*
|
|
20562
|
-
* This source code is licensed under the MIT license found in the
|
|
20563
|
-
* LICENSE file in the root directory of this source tree.
|
|
20564
|
-
*
|
|
20565
|
-
* @format
|
|
20566
|
-
*
|
|
20567
|
-
*/
|
|
20568
|
-
|
|
20569
|
-
function useWindowDimensions() {
|
|
20570
|
-
var _useState = React.useState(() => Dimensions.get('window')),
|
|
20571
|
-
dims = _useState[0],
|
|
20572
|
-
setDims = _useState[1];
|
|
20573
|
-
React.useEffect(() => {
|
|
20574
|
-
function handleChange(_ref) {
|
|
20575
|
-
var window = _ref.window;
|
|
20576
|
-
if (window != null) {
|
|
20577
|
-
setDims(window);
|
|
20578
|
-
}
|
|
20579
|
-
}
|
|
20580
|
-
Dimensions.addEventListener('change', handleChange);
|
|
20581
|
-
// We might have missed an update between calling `get` in render and
|
|
20582
|
-
// `addEventListener` in this handler, so we set it here. If there was
|
|
20583
|
-
// no change, React will filter out this update as a no-op.
|
|
20584
|
-
setDims(Dimensions.get('window'));
|
|
20585
|
-
return () => {
|
|
20586
|
-
Dimensions.removeEventListener('change', handleChange);
|
|
20587
|
-
};
|
|
20588
|
-
}, []);
|
|
20589
|
-
return dims;
|
|
20590
|
-
}
|
|
20591
|
-
|
|
20592
20605
|
var useSectionHeaderStyles = function () {
|
|
20593
20606
|
var _a = useResponsive$1(),
|
|
20594
20607
|
isDesktop = _a.isDesktop,
|
|
@@ -21214,7 +21227,7 @@ var Section = function (_a) {
|
|
|
21214
21227
|
if (isLoading) {
|
|
21215
21228
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
21216
21229
|
"aria-label": "Loading section content",
|
|
21217
|
-
numberOfSquares: 4
|
|
21230
|
+
numberOfSquares: IS_WEB ? 4 : 2
|
|
21218
21231
|
});
|
|
21219
21232
|
}
|
|
21220
21233
|
if (error || !sectionData) {
|
|
@@ -21478,12 +21491,18 @@ var Group = function (_a) {
|
|
|
21478
21491
|
groupData = _b.groupData,
|
|
21479
21492
|
isLoading = _b.isLoading,
|
|
21480
21493
|
error = _b.error;
|
|
21494
|
+
var theme = useWllSdk().theme;
|
|
21481
21495
|
if (isLoading) {
|
|
21482
21496
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
21483
|
-
style:
|
|
21497
|
+
style: {
|
|
21498
|
+
flex: 1,
|
|
21499
|
+
padding: theme.sizes.lg
|
|
21500
|
+
},
|
|
21484
21501
|
accessible: true,
|
|
21485
21502
|
accessibilityLabel: "Loading group data"
|
|
21486
|
-
}, /*#__PURE__*/React.createElement(Skeleton,
|
|
21503
|
+
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
21504
|
+
numberOfSquares: IS_WEB ? 4 : 2
|
|
21505
|
+
}));
|
|
21487
21506
|
}
|
|
21488
21507
|
if (error || !groupData) {
|
|
21489
21508
|
return /*#__PURE__*/React.createElement(GroupEmptyState, {
|
|
@@ -21725,7 +21744,14 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
21725
21744
|
justifyContent: 'space-between'
|
|
21726
21745
|
},
|
|
21727
21746
|
contentContainer: {
|
|
21728
|
-
width:
|
|
21747
|
+
width: '100%'
|
|
21748
|
+
},
|
|
21749
|
+
contentColumn: {
|
|
21750
|
+
flexGrow: 1
|
|
21751
|
+
},
|
|
21752
|
+
mediaColumn: {
|
|
21753
|
+
flexDirection: 'row',
|
|
21754
|
+
alignItems: 'center'
|
|
21729
21755
|
},
|
|
21730
21756
|
suffix: {
|
|
21731
21757
|
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
@@ -21736,6 +21762,9 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
21736
21762
|
alignItems: 'center',
|
|
21737
21763
|
justifyContent: 'center'
|
|
21738
21764
|
},
|
|
21765
|
+
chevronContainer: {
|
|
21766
|
+
marginLeft: !isFullSize ? useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet) : 0
|
|
21767
|
+
},
|
|
21739
21768
|
imageContainer: {
|
|
21740
21769
|
width: isFullSize ? '100%' : isDesktop ? 57 : 40,
|
|
21741
21770
|
height: isFullSize ? '50%' : isDesktop ? 57 : 40,
|
|
@@ -21842,6 +21871,30 @@ var PointsTileTitle = function () {
|
|
|
21842
21871
|
}, title);
|
|
21843
21872
|
};
|
|
21844
21873
|
|
|
21874
|
+
/**
|
|
21875
|
+
* Renders a chevron icon for a Roundup Tile.
|
|
21876
|
+
*
|
|
21877
|
+
* @returns JSX.Element
|
|
21878
|
+
*/
|
|
21879
|
+
var PointsTileChevron = function () {
|
|
21880
|
+
var _a, _b;
|
|
21881
|
+
var tileContext = useTileContext();
|
|
21882
|
+
var sdk = useWllSdk();
|
|
21883
|
+
var styles = usePointsTileStyles();
|
|
21884
|
+
if (!isContextValid(tileContext)) return null;
|
|
21885
|
+
var ctaLink = tileContext.configuration.ctaLink;
|
|
21886
|
+
if (!ctaLink) return null;
|
|
21887
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21888
|
+
style: styles.chevronContainer
|
|
21889
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
21890
|
+
name: "ChevronRight",
|
|
21891
|
+
size: 16,
|
|
21892
|
+
color: ((_b = (_a = sdk.theme) === null || _a === void 0 ? void 0 : _a.derivedSurfaceText) === null || _b === void 0 ? void 0 : _b[20]) || '#000000',
|
|
21893
|
+
role: "img",
|
|
21894
|
+
accessibilityLabel: "View balance"
|
|
21895
|
+
}));
|
|
21896
|
+
};
|
|
21897
|
+
|
|
21845
21898
|
/**
|
|
21846
21899
|
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
21847
21900
|
*
|
|
@@ -21861,11 +21914,15 @@ var PointsTileRoot = function (_a) {
|
|
|
21861
21914
|
isFullSize: true
|
|
21862
21915
|
}), /*#__PURE__*/React.createElement(View$2, {
|
|
21863
21916
|
style: styles.container
|
|
21917
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
21918
|
+
style: styles.contentContainer
|
|
21919
|
+
}, /*#__PURE__*/React.createElement(Column, {
|
|
21920
|
+
style: styles.contentColumn
|
|
21921
|
+
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null)), /*#__PURE__*/React.createElement(Column, {
|
|
21922
|
+
style: styles.mediaColumn
|
|
21864
21923
|
}, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
21865
21924
|
isFullSize: false
|
|
21866
|
-
}), /*#__PURE__*/React.createElement(
|
|
21867
|
-
style: styles.contentContainer
|
|
21868
|
-
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
|
|
21925
|
+
}), /*#__PURE__*/React.createElement(PointsTile.Chevron, null)))));
|
|
21869
21926
|
};
|
|
21870
21927
|
/**
|
|
21871
21928
|
* The PointsTile component with subcomponents attached.
|
|
@@ -21873,7 +21930,8 @@ var PointsTileRoot = function (_a) {
|
|
|
21873
21930
|
var PointsTile = Object.assign(PointsTileRoot, {
|
|
21874
21931
|
Title: PointsTileTitle,
|
|
21875
21932
|
Points: PointsTileFormattedPoints,
|
|
21876
|
-
Media: PointsTileMedia
|
|
21933
|
+
Media: PointsTileMedia,
|
|
21934
|
+
Chevron: PointsTileChevron
|
|
21877
21935
|
});
|
|
21878
21936
|
var PointsTile$1 = withTileFetching(PointsTile);
|
|
21879
21937
|
|
|
@@ -22424,8 +22482,217 @@ TierTile.Full = TierTileFull;
|
|
|
22424
22482
|
TierTile.Half = TierTileHalf;
|
|
22425
22483
|
TierTile.Empty = TierTileEmpty;
|
|
22426
22484
|
|
|
22485
|
+
/**
|
|
22486
|
+
* Custom hook that returns the styles for the RoundupTile component.
|
|
22487
|
+
* Applies responsive styling based on the current device.
|
|
22488
|
+
*
|
|
22489
|
+
* @returns StyleSheet styles for the RoundupTile component
|
|
22490
|
+
*/
|
|
22491
|
+
var useRoundupTileStyles = function (isFullSize) {
|
|
22492
|
+
var _a = useResponsive$1(),
|
|
22493
|
+
isDesktop = _a.isDesktop,
|
|
22494
|
+
isTablet = _a.isTablet;
|
|
22495
|
+
var theme = useWllSdk().theme;
|
|
22496
|
+
return StyleSheet$1.create({
|
|
22497
|
+
container: {
|
|
22498
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
22499
|
+
width: '100%',
|
|
22500
|
+
flexDirection: isFullSize ? 'row' : 'row-reverse',
|
|
22501
|
+
alignItems: 'center',
|
|
22502
|
+
justifyContent: 'space-between'
|
|
22503
|
+
},
|
|
22504
|
+
contentContainer: {
|
|
22505
|
+
width: '100%',
|
|
22506
|
+
marginTop: isFullSize ? useResponsiveValue(theme.sizes.xxl, theme.sizes.md, isDesktop, isTablet) : 0
|
|
22507
|
+
},
|
|
22508
|
+
contentColumn: {
|
|
22509
|
+
flexGrow: 1
|
|
22510
|
+
},
|
|
22511
|
+
mediaColumn: {
|
|
22512
|
+
flexDirection: 'row',
|
|
22513
|
+
alignItems: 'center'
|
|
22514
|
+
},
|
|
22515
|
+
suffix: {
|
|
22516
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
22517
|
+
color: theme.primary
|
|
22518
|
+
},
|
|
22519
|
+
pointsWithSuffix: {
|
|
22520
|
+
flexDirection: 'row',
|
|
22521
|
+
alignItems: 'center',
|
|
22522
|
+
justifyContent: 'center'
|
|
22523
|
+
},
|
|
22524
|
+
chevronContainer: {
|
|
22525
|
+
marginLeft: !isFullSize ? useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet) : 0
|
|
22526
|
+
},
|
|
22527
|
+
imageContainer: {
|
|
22528
|
+
width: isFullSize ? '100%' : isDesktop ? 57 : 40,
|
|
22529
|
+
height: isFullSize ? '50%' : isDesktop ? 57 : 40,
|
|
22530
|
+
marginBottom: isFullSize ? useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet) : 0,
|
|
22531
|
+
backgroundColor: isFullSize ? theme.alphaDerivedPrimary[20] : theme.surface,
|
|
22532
|
+
justifyContent: 'center',
|
|
22533
|
+
alignItems: 'center',
|
|
22534
|
+
overflow: 'hidden'
|
|
22535
|
+
},
|
|
22536
|
+
image: {
|
|
22537
|
+
width: '100%',
|
|
22538
|
+
height: '100%',
|
|
22539
|
+
position: 'absolute',
|
|
22540
|
+
resizeMode: 'contain'
|
|
22541
|
+
}
|
|
22542
|
+
});
|
|
22543
|
+
};
|
|
22544
|
+
|
|
22545
|
+
/**
|
|
22546
|
+
* Renders formatted points value for a Roundup Tile.
|
|
22547
|
+
*
|
|
22548
|
+
* @returns JSX.Element or null if points are undefined or zero
|
|
22549
|
+
*/
|
|
22550
|
+
var RoundupTileFormattedPoints = function () {
|
|
22551
|
+
var styles = useRoundupTileStyles();
|
|
22552
|
+
var tileContext = useTileContext();
|
|
22553
|
+
if (!isContextValid(tileContext)) return null;
|
|
22554
|
+
var _a = tileContext.configuration,
|
|
22555
|
+
_b = _a.amountPrefix,
|
|
22556
|
+
amountPrefix = _b === void 0 ? '' : _b,
|
|
22557
|
+
_c = _a.amountSuffix,
|
|
22558
|
+
amountSuffix = _c === void 0 ? '' : _c,
|
|
22559
|
+
_d = _a.amount,
|
|
22560
|
+
amount = _d === void 0 ? 0 : _d;
|
|
22561
|
+
if (amount === undefined) return null;
|
|
22562
|
+
var fullPointsText = "".concat(amountPrefix).concat(amount, " ").concat(amountSuffix).trim();
|
|
22563
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
22564
|
+
testID: "roundup-tile-amount",
|
|
22565
|
+
role: "article",
|
|
22566
|
+
accessibilityLabel: "Amount: ".concat(fullPointsText)
|
|
22567
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
22568
|
+
align: "center",
|
|
22569
|
+
justify: "start"
|
|
22570
|
+
}, amountPrefix ? (/*#__PURE__*/React.createElement(Text, {
|
|
22571
|
+
variant: "caption",
|
|
22572
|
+
testID: "roundup-tile-prefix"
|
|
22573
|
+
}, amountPrefix)) : null, /*#__PURE__*/React.createElement(Text, {
|
|
22574
|
+
variant: "caption",
|
|
22575
|
+
testID: "roundup-tile-value"
|
|
22576
|
+
}, amount), amountSuffix ? (/*#__PURE__*/React.createElement(Text, {
|
|
22577
|
+
variant: "caption",
|
|
22578
|
+
style: styles.suffix,
|
|
22579
|
+
testID: "roundup-tile-suffix"
|
|
22580
|
+
}, amountSuffix)) : null));
|
|
22581
|
+
};
|
|
22582
|
+
|
|
22583
|
+
/**
|
|
22584
|
+
* Renders the media of a Points Tile.
|
|
22585
|
+
*
|
|
22586
|
+
* @returns JSX.Element or null if media is not present
|
|
22587
|
+
*/
|
|
22588
|
+
var RoundupTileMedia = function (_a) {
|
|
22589
|
+
var isFullSize = _a.isFullSize;
|
|
22590
|
+
var tileContext = useTileContext();
|
|
22591
|
+
if (!isContextValid(tileContext)) return null;
|
|
22592
|
+
var _b = tileContext.configuration,
|
|
22593
|
+
artworkUrl = _b.artworkUrl,
|
|
22594
|
+
_c = _b.title,
|
|
22595
|
+
title = _c === void 0 ? 'Balance' : _c;
|
|
22596
|
+
var styles = useRoundupTileStyles(isFullSize);
|
|
22597
|
+
if (!artworkUrl) return null;
|
|
22598
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
22599
|
+
testID: "roundup-tile-media",
|
|
22600
|
+
style: styles.imageContainer,
|
|
22601
|
+
role: "img",
|
|
22602
|
+
accessibilityLabel: "Roundup tile image for ".concat(title)
|
|
22603
|
+
}, /*#__PURE__*/React.createElement(Image$2, {
|
|
22604
|
+
source: {
|
|
22605
|
+
uri: artworkUrl
|
|
22606
|
+
},
|
|
22607
|
+
style: styles.image,
|
|
22608
|
+
resizeMode: isFullSize ? 'cover' : 'contain'
|
|
22609
|
+
}));
|
|
22610
|
+
};
|
|
22611
|
+
|
|
22612
|
+
/**
|
|
22613
|
+
* Renders the title of a Roundup Tile.
|
|
22614
|
+
*
|
|
22615
|
+
* @returns JSX.Element or null if no title is present
|
|
22616
|
+
*/
|
|
22617
|
+
var RoundupTileTitle = function () {
|
|
22618
|
+
var tileContext = useTileContext();
|
|
22619
|
+
if (!isContextValid(tileContext)) return null;
|
|
22620
|
+
var title = tileContext.configuration.title;
|
|
22621
|
+
if (!title) return null;
|
|
22622
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
22623
|
+
variant: "eyebrow",
|
|
22624
|
+
testID: "roundup-tile-title",
|
|
22625
|
+
role: "heading",
|
|
22626
|
+
accessibilityLabel: title
|
|
22627
|
+
}, title);
|
|
22628
|
+
};
|
|
22629
|
+
|
|
22630
|
+
/**
|
|
22631
|
+
* Renders a chevron icon for a Roundup Tile.
|
|
22632
|
+
*
|
|
22633
|
+
* @returns JSX.Element
|
|
22634
|
+
*/
|
|
22635
|
+
var RoundupTileChevron = function () {
|
|
22636
|
+
var _a, _b;
|
|
22637
|
+
var tileContext = useTileContext();
|
|
22638
|
+
var sdk = useWllSdk();
|
|
22639
|
+
var styles = useRoundupTileStyles();
|
|
22640
|
+
if (!isContextValid(tileContext)) return null;
|
|
22641
|
+
var ctaLink = tileContext.configuration.ctaLink;
|
|
22642
|
+
if (!ctaLink) return null;
|
|
22643
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
22644
|
+
style: styles.chevronContainer
|
|
22645
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
22646
|
+
name: "ChevronRight",
|
|
22647
|
+
size: 16,
|
|
22648
|
+
color: ((_b = (_a = sdk.theme) === null || _a === void 0 ? void 0 : _a.derivedSurfaceText) === null || _b === void 0 ? void 0 : _b[20]) || '#000000',
|
|
22649
|
+
role: "img",
|
|
22650
|
+
accessibilityLabel: "View balance"
|
|
22651
|
+
}));
|
|
22652
|
+
};
|
|
22653
|
+
|
|
22654
|
+
/**
|
|
22655
|
+
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
22656
|
+
*
|
|
22657
|
+
* @param props - Component props
|
|
22658
|
+
* @returns JSX.Element or null if tile is inactive or missing required props
|
|
22659
|
+
*/
|
|
22660
|
+
var RoundupTileRoot = function (_a) {
|
|
22661
|
+
var tile = _a.tile;
|
|
22662
|
+
if (!tile || !tile.active || !tile.configuration) return null;
|
|
22663
|
+
var config = tile.configuration;
|
|
22664
|
+
if (!config) return null;
|
|
22665
|
+
var isFullSize = useTileSize(tile).isFullSize;
|
|
22666
|
+
var styles = useRoundupTileStyles(isFullSize);
|
|
22667
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
22668
|
+
tile: tile
|
|
22669
|
+
}, isFullSize && /*#__PURE__*/React.createElement(RoundupTile.Media, {
|
|
22670
|
+
isFullSize: true
|
|
22671
|
+
}), /*#__PURE__*/React.createElement(View$2, {
|
|
22672
|
+
style: styles.container
|
|
22673
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
22674
|
+
style: styles.contentContainer
|
|
22675
|
+
}, /*#__PURE__*/React.createElement(Column, {
|
|
22676
|
+
style: styles.contentColumn
|
|
22677
|
+
}, /*#__PURE__*/React.createElement(RoundupTile.Title, null), /*#__PURE__*/React.createElement(RoundupTile.Points, null)), /*#__PURE__*/React.createElement(Column, {
|
|
22678
|
+
style: styles.mediaColumn
|
|
22679
|
+
}, !isFullSize && /*#__PURE__*/React.createElement(RoundupTile.Media, {
|
|
22680
|
+
isFullSize: false
|
|
22681
|
+
}), /*#__PURE__*/React.createElement(RoundupTile.Chevron, null)))));
|
|
22682
|
+
};
|
|
22683
|
+
/**
|
|
22684
|
+
* The PointsTile component with subcomponents attached.
|
|
22685
|
+
*/
|
|
22686
|
+
var RoundupTile = Object.assign(RoundupTileRoot, {
|
|
22687
|
+
Title: RoundupTileTitle,
|
|
22688
|
+
Points: RoundupTileFormattedPoints,
|
|
22689
|
+
Media: RoundupTileMedia,
|
|
22690
|
+
Chevron: RoundupTileChevron
|
|
22691
|
+
});
|
|
22692
|
+
var RoundupTile$1 = withTileFetching(RoundupTile);
|
|
22693
|
+
|
|
22427
22694
|
var _a;
|
|
22428
|
-
var TILE_COMPONENTS = (_a = {}, _a[exports.TileType.Content] = ContentTile$1, _a[exports.TileType.Badge] = BadgeTile$1, _a[exports.TileType.Tier] = TierTile, _a[exports.TileType.Points] = PointsTile$1, _a[exports.TileType.Reward] = RewardTile$1, _a[exports.TileType.RewardCategory] = RewardCategoryTile$1, _a[exports.TileType.Banner] = BannerTile$1, _a);
|
|
22695
|
+
var TILE_COMPONENTS = (_a = {}, _a[exports.TileType.Content] = ContentTile$1, _a[exports.TileType.Badge] = BadgeTile$1, _a[exports.TileType.Tier] = TierTile, _a[exports.TileType.Points] = PointsTile$1, _a[exports.TileType.Reward] = RewardTile$1, _a[exports.TileType.RewardCategory] = RewardCategoryTile$1, _a[exports.TileType.Banner] = BannerTile$1, _a[exports.TileType.Roundup] = RoundupTile$1, _a);
|
|
22429
22696
|
/**
|
|
22430
22697
|
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
22431
22698
|
*/
|
|
@@ -22502,6 +22769,8 @@ exports.RewardCategoryTile = RewardCategoryTile$1;
|
|
|
22502
22769
|
exports.RewardCategoryTileConfig = RewardCategoryTileConfig;
|
|
22503
22770
|
exports.RewardTile = RewardTile$1;
|
|
22504
22771
|
exports.RewardTileConfig = RewardTileConfig;
|
|
22772
|
+
exports.RoundupTile = RoundupTile$1;
|
|
22773
|
+
exports.RoundupTileConfig = RoundupTileConfig;
|
|
22505
22774
|
exports.Row = Row;
|
|
22506
22775
|
exports.Section = Section;
|
|
22507
22776
|
exports.SectionHeader = SectionHeader;
|