@wlloyalty/wll-react-sdk 1.0.108 → 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 +203 -2
- package/dist/native.js.map +1 -1
- 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 +261 -6
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -31,3 +31,9 @@ export declare const HalfWithMultiplier: import("@storybook/csf").AnnotatedStory
|
|
|
31
31
|
export declare const FullWithMultiplier: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
32
32
|
tile: import("../../../types/tile").Tile;
|
|
33
33
|
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
34
|
+
export declare const WithCtaLink: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
35
|
+
tile: import("../../../types/tile").Tile;
|
|
36
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
37
|
+
export declare const WithCtaLinkHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
38
|
+
tile: import("../../../types/tile").Tile;
|
|
39
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
@@ -12,6 +12,7 @@ export declare const PointsTile: (({ tile }: PointsTileProps) => JSX.Element | n
|
|
|
12
12
|
Media: ({ isFullSize, }: {
|
|
13
13
|
isFullSize: boolean;
|
|
14
14
|
}) => JSX.Element | null;
|
|
15
|
+
Chevron: () => JSX.Element | null;
|
|
15
16
|
};
|
|
16
17
|
declare const _default: (props: Omit<PointsTileProps, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps) => React.JSX.Element;
|
|
17
18
|
export default _default;
|
|
@@ -8,6 +8,9 @@ import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
|
8
8
|
export declare const usePointsTileStyles: (isFullSize?: boolean) => {
|
|
9
9
|
container: ViewStyle;
|
|
10
10
|
contentContainer: ViewStyle;
|
|
11
|
+
contentColumn: ViewStyle;
|
|
12
|
+
mediaColumn: ViewStyle;
|
|
13
|
+
chevronContainer: ViewStyle;
|
|
11
14
|
suffix: TextStyle;
|
|
12
15
|
pointsWithSuffix: ViewStyle;
|
|
13
16
|
imageContainer: ViewStyle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const ZeroBalance: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
5
|
+
tile: import("../../../types/tile").Tile;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const StandardBalance: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
8
|
+
tile: import("../../../types/tile").Tile;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const CashbackRewards: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
11
|
+
tile: import("../../../types/tile").Tile;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const StarRewards: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
14
|
+
tile: import("../../../types/tile").Tile;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const MileageProgram: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
17
|
+
tile: import("../../../types/tile").Tile;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const AccountBalance: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
20
|
+
tile: import("../../../types/tile").Tile;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const RewardBalance: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
23
|
+
tile: import("../../../types/tile").Tile;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const EliteBalance: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
26
|
+
tile: import("../../../types/tile").Tile;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const WithCtaLink: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
29
|
+
tile: import("../../../types/tile").Tile;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const WithCtaLinkHalf: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
32
|
+
tile: import("../../../types/tile").Tile;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tile } from '../../../types/tile';
|
|
3
|
+
type RoundupTileProps = {
|
|
4
|
+
tile: Tile;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The PointsTile component with subcomponents attached.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RoundupTile: (({ tile }: RoundupTileProps) => JSX.Element | null) & {
|
|
10
|
+
Title: () => JSX.Element | null;
|
|
11
|
+
Points: () => JSX.Element | null;
|
|
12
|
+
Media: ({ isFullSize, }: {
|
|
13
|
+
isFullSize: boolean;
|
|
14
|
+
}) => JSX.Element | null;
|
|
15
|
+
Chevron: () => JSX.Element | null;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: (props: Omit<RoundupTileProps, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps) => React.JSX.Element;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type RoundupTileMediaProps = {
|
|
2
|
+
isFullSize: boolean;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Renders the media of a Points Tile.
|
|
6
|
+
*
|
|
7
|
+
* @returns JSX.Element or null if media is not present
|
|
8
|
+
*/
|
|
9
|
+
export declare const RoundupTileMedia: ({ isFullSize, }: RoundupTileMediaProps) => JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the RoundupTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the RoundupTile component
|
|
7
|
+
*/
|
|
8
|
+
export declare const useRoundupTileStyles: (isFullSize?: boolean) => {
|
|
9
|
+
container: ViewStyle;
|
|
10
|
+
contentContainer: ViewStyle;
|
|
11
|
+
contentColumn: ViewStyle;
|
|
12
|
+
mediaColumn: ViewStyle;
|
|
13
|
+
chevronContainer: ViewStyle;
|
|
14
|
+
suffix: TextStyle;
|
|
15
|
+
pointsWithSuffix: ViewStyle;
|
|
16
|
+
imageContainer: ViewStyle;
|
|
17
|
+
image: ImageStyle;
|
|
18
|
+
};
|
|
@@ -7,3 +7,4 @@ export { default as RewardCategoryTile } from './RewardCategoryTile';
|
|
|
7
7
|
export { default as RewardTile } from './RewardTile';
|
|
8
8
|
export { default as Section } from './Section';
|
|
9
9
|
export { default as TierTileUpdated } from './TierTileUpdated';
|
|
10
|
+
export { default as RoundupTile } from './RoundupTile';
|
|
@@ -18,5 +18,7 @@ export declare const createPointsTileMock: (config?: PointsTileMockConfig) => {
|
|
|
18
18
|
pointsPrefix: string | null;
|
|
19
19
|
pointsSuffix: string | null;
|
|
20
20
|
artworkUrl: string | null;
|
|
21
|
+
ctaLink: string | null | undefined;
|
|
22
|
+
ctaLinkTarget: import("../../types/tile").CTALinkTarget | undefined;
|
|
21
23
|
};
|
|
22
24
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CTALinkTarget, RoundupTileConfig, TileHeight, TileType } from '../../types/tile';
|
|
2
|
+
export type RoundupTileMockConfig = Partial<RoundupTileConfig> & {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
tileHeight?: TileHeight;
|
|
5
|
+
};
|
|
6
|
+
export declare const createRoundupTileMock: (config?: RoundupTileMockConfig) => {
|
|
7
|
+
id: string;
|
|
8
|
+
type: TileType;
|
|
9
|
+
active: boolean;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
tileHeight: TileHeight;
|
|
13
|
+
priority: number;
|
|
14
|
+
configuration: {
|
|
15
|
+
title: string | null;
|
|
16
|
+
amount: number;
|
|
17
|
+
amountPrefix: string | null;
|
|
18
|
+
amountSuffix: string | null;
|
|
19
|
+
artworkUrl: string | null;
|
|
20
|
+
ctaLink: string | null | undefined;
|
|
21
|
+
ctaLinkTarget: CTALinkTarget | undefined;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -18,7 +18,8 @@ export declare enum TileType {
|
|
|
18
18
|
Reward = "REWARD",
|
|
19
19
|
Badge = "BADGE",
|
|
20
20
|
RewardCategory = "REWARD_CATEGORY",
|
|
21
|
-
Tier = "TIER"
|
|
21
|
+
Tier = "TIER",
|
|
22
|
+
Roundup = "ROUND_UP_BALANCE"
|
|
22
23
|
}
|
|
23
24
|
export declare enum TileHeight {
|
|
24
25
|
Half = "HALF",
|
|
@@ -40,6 +41,17 @@ export declare class PointsTileConfig {
|
|
|
40
41
|
pointsSuffix?: string | null;
|
|
41
42
|
artworkUrl?: string | null;
|
|
42
43
|
points?: number;
|
|
44
|
+
ctaLink?: string | null;
|
|
45
|
+
ctaLinkTarget?: CTALinkTarget;
|
|
46
|
+
}
|
|
47
|
+
export declare class RoundupTileConfig {
|
|
48
|
+
title?: string | null;
|
|
49
|
+
amountPrefix?: string | null;
|
|
50
|
+
amountSuffix?: string | null;
|
|
51
|
+
artworkUrl?: string | null;
|
|
52
|
+
amount?: number;
|
|
53
|
+
ctaLink?: string | null;
|
|
54
|
+
ctaLinkTarget?: CTALinkTarget;
|
|
43
55
|
}
|
|
44
56
|
export declare class ContentTileConfig {
|
|
45
57
|
title?: string | null;
|
package/dist/web.js
CHANGED
|
@@ -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;
|
|
@@ -21739,7 +21744,14 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
21739
21744
|
justifyContent: 'space-between'
|
|
21740
21745
|
},
|
|
21741
21746
|
contentContainer: {
|
|
21742
|
-
width:
|
|
21747
|
+
width: '100%'
|
|
21748
|
+
},
|
|
21749
|
+
contentColumn: {
|
|
21750
|
+
flexGrow: 1
|
|
21751
|
+
},
|
|
21752
|
+
mediaColumn: {
|
|
21753
|
+
flexDirection: 'row',
|
|
21754
|
+
alignItems: 'center'
|
|
21743
21755
|
},
|
|
21744
21756
|
suffix: {
|
|
21745
21757
|
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
@@ -21750,6 +21762,9 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
21750
21762
|
alignItems: 'center',
|
|
21751
21763
|
justifyContent: 'center'
|
|
21752
21764
|
},
|
|
21765
|
+
chevronContainer: {
|
|
21766
|
+
marginLeft: !isFullSize ? useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet) : 0
|
|
21767
|
+
},
|
|
21753
21768
|
imageContainer: {
|
|
21754
21769
|
width: isFullSize ? '100%' : isDesktop ? 57 : 40,
|
|
21755
21770
|
height: isFullSize ? '50%' : isDesktop ? 57 : 40,
|
|
@@ -21856,6 +21871,30 @@ var PointsTileTitle = function () {
|
|
|
21856
21871
|
}, title);
|
|
21857
21872
|
};
|
|
21858
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
|
+
|
|
21859
21898
|
/**
|
|
21860
21899
|
* The PointsTile component renders a tile with media, title, and formatted points.
|
|
21861
21900
|
*
|
|
@@ -21875,11 +21914,15 @@ var PointsTileRoot = function (_a) {
|
|
|
21875
21914
|
isFullSize: true
|
|
21876
21915
|
}), /*#__PURE__*/React.createElement(View$2, {
|
|
21877
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
|
|
21878
21923
|
}, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
21879
21924
|
isFullSize: false
|
|
21880
|
-
}), /*#__PURE__*/React.createElement(
|
|
21881
|
-
style: styles.contentContainer
|
|
21882
|
-
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
|
|
21925
|
+
}), /*#__PURE__*/React.createElement(PointsTile.Chevron, null)))));
|
|
21883
21926
|
};
|
|
21884
21927
|
/**
|
|
21885
21928
|
* The PointsTile component with subcomponents attached.
|
|
@@ -21887,7 +21930,8 @@ var PointsTileRoot = function (_a) {
|
|
|
21887
21930
|
var PointsTile = Object.assign(PointsTileRoot, {
|
|
21888
21931
|
Title: PointsTileTitle,
|
|
21889
21932
|
Points: PointsTileFormattedPoints,
|
|
21890
|
-
Media: PointsTileMedia
|
|
21933
|
+
Media: PointsTileMedia,
|
|
21934
|
+
Chevron: PointsTileChevron
|
|
21891
21935
|
});
|
|
21892
21936
|
var PointsTile$1 = withTileFetching(PointsTile);
|
|
21893
21937
|
|
|
@@ -22438,8 +22482,217 @@ TierTile.Full = TierTileFull;
|
|
|
22438
22482
|
TierTile.Half = TierTileHalf;
|
|
22439
22483
|
TierTile.Empty = TierTileEmpty;
|
|
22440
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
|
+
|
|
22441
22694
|
var _a;
|
|
22442
|
-
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);
|
|
22443
22696
|
/**
|
|
22444
22697
|
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
22445
22698
|
*/
|
|
@@ -22516,6 +22769,8 @@ exports.RewardCategoryTile = RewardCategoryTile$1;
|
|
|
22516
22769
|
exports.RewardCategoryTileConfig = RewardCategoryTileConfig;
|
|
22517
22770
|
exports.RewardTile = RewardTile$1;
|
|
22518
22771
|
exports.RewardTileConfig = RewardTileConfig;
|
|
22772
|
+
exports.RoundupTile = RoundupTile$1;
|
|
22773
|
+
exports.RoundupTileConfig = RoundupTileConfig;
|
|
22519
22774
|
exports.Row = Row;
|
|
22520
22775
|
exports.Section = Section;
|
|
22521
22776
|
exports.SectionHeader = SectionHeader;
|