@wlloyalty/wll-react-sdk 1.4.8 → 1.4.10
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 +272 -17
- package/dist/native.js +1561 -362
- package/dist/native.js.map +1 -1
- package/dist/types/components/atoms/Button/Button.stories.d.ts +2 -0
- package/dist/types/components/atoms/Button/index.d.ts +2 -1
- package/dist/types/components/organisms/VenueTile/VenueTile.spec.d.ts +1 -0
- package/dist/types/components/organisms/VenueTile/VenueTile.stories.d.ts +12 -0
- package/dist/types/components/organisms/VenueTile/index.d.ts +18 -0
- package/dist/types/components/organisms/VenueTile/styles.d.ts +8 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-chevron.d.ts +7 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-description.d.ts +7 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-media.d.ts +13 -0
- package/dist/types/components/organisms/VenueTile/venue-tile-title.d.ts +7 -0
- package/dist/types/components/organisms/index.d.ts +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/mocks/tiles/venueTile.d.ts +6 -0
- package/dist/types/types/tile.d.ts +9 -2
- package/dist/web.js +301 -7
- package/dist/web.js.map +1 -1
- package/package.json +12 -13
|
@@ -7,7 +7,8 @@ type ButtonProps = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
accessibilityLabel?: string;
|
|
9
9
|
accessibilityHint?: string;
|
|
10
|
+
icon?: React.ReactNode;
|
|
10
11
|
testID?: string;
|
|
11
12
|
};
|
|
12
|
-
declare const Button: ({ title, onPress, variant, disabled, accessibilityLabel, accessibilityHint, testID, }: ButtonProps) => React.ReactElement;
|
|
13
|
+
declare const Button: ({ title, onPress, variant, disabled, accessibilityLabel, accessibilityHint, icon, testID, }: ButtonProps) => React.ReactElement;
|
|
13
14
|
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
declare const _default: Meta;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
5
|
+
tile: import("../../..").Tile;
|
|
6
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
7
|
+
export declare const WithDescription: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
8
|
+
tile: import("../../..").Tile;
|
|
9
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
10
|
+
export declare const WithoutDescription: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<{
|
|
11
|
+
tile: import("../../..").Tile;
|
|
12
|
+
}, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tile } from '../../../types/tile';
|
|
3
|
+
type VenueTileProps = {
|
|
4
|
+
tile: Tile;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The VenueTile component with subcomponents attached.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VenueTile: (({ tile }: VenueTileProps) => React.ReactElement | null) & {
|
|
10
|
+
Media: ({ isArtworkOnly, }: {
|
|
11
|
+
isArtworkOnly: boolean;
|
|
12
|
+
}) => React.ReactElement | null;
|
|
13
|
+
Title: () => React.ReactElement | null;
|
|
14
|
+
Description: () => React.ReactElement | null;
|
|
15
|
+
Chevron: () => React.ReactElement;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: (props: Omit<VenueTileProps, "tile"> & import("../../hoc/withTileFetching").WithTileFetchingProps) => React.JSX.Element;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that returns the styles for the VenueTile component.
|
|
4
|
+
* Applies responsive styling based on the current device.
|
|
5
|
+
*
|
|
6
|
+
* @returns StyleSheet styles for the VenueTile component
|
|
7
|
+
*/
|
|
8
|
+
export declare const useVenueTileStyles: () => ReturnType<typeof StyleSheet.create>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type VenueTileMediaProps = {
|
|
3
|
+
isArtworkOnly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Renders the media for a Venue Tile.
|
|
7
|
+
*
|
|
8
|
+
* @param props {VenueTileMediaProps} - Component props
|
|
9
|
+
* @param props.isArtworkOnly {boolean} - Whether the media should be rendered as an artwork only component
|
|
10
|
+
* @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
|
|
11
|
+
*/
|
|
12
|
+
export declare const VenueTileMedia: ({ isArtworkOnly, }: VenueTileMediaProps) => React.ReactElement | null;
|
|
13
|
+
export {};
|
|
@@ -8,3 +8,4 @@ export { default as RewardTile } from './RewardTile';
|
|
|
8
8
|
export { default as Section } from './Section';
|
|
9
9
|
export { default as TierTileUpdated } from './TierTileUpdated';
|
|
10
10
|
export { default as RoundupTile } from './RoundupTile';
|
|
11
|
+
export { default as VenueTile } from './VenueTile';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,3 +11,21 @@ export * from './types/section';
|
|
|
11
11
|
export * from './types/theme';
|
|
12
12
|
export * from './types/tile';
|
|
13
13
|
export * from './types/wll';
|
|
14
|
+
export * from './constants/device';
|
|
15
|
+
export * from './constants/responsive';
|
|
16
|
+
export * from './constants/theme';
|
|
17
|
+
export * from './constants/grid';
|
|
18
|
+
export * from './constants/index';
|
|
19
|
+
export * from './utils/apiHelpers';
|
|
20
|
+
export * from './utils/eventEmitter';
|
|
21
|
+
export * from './utils/styling';
|
|
22
|
+
export * from './utils/themeHelpers';
|
|
23
|
+
export * from './utils/transforms';
|
|
24
|
+
export * from './utils/responsiveHelper';
|
|
25
|
+
export * from './hooks/useResponsive';
|
|
26
|
+
export * from './hooks/useTileSize';
|
|
27
|
+
export * from './hooks/useGroupRefresh';
|
|
28
|
+
export * from './hooks/useInitialGroupFetch';
|
|
29
|
+
export * from './hooks/usePullToRefresh';
|
|
30
|
+
export * from './hooks/useInvalidateData';
|
|
31
|
+
export * from './hooks/useNavigationHandler';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VenueTileConfig, Tile, TileHeight } from '../../types/tile';
|
|
2
|
+
export type VenueTileMockConfig = Partial<VenueTileConfig> & {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
tileHeight?: TileHeight;
|
|
5
|
+
};
|
|
6
|
+
export declare const createVenueTileMock: (config?: VenueTileMockConfig) => Tile;
|
|
@@ -19,7 +19,8 @@ export declare enum TileType {
|
|
|
19
19
|
Badge = "BADGE",
|
|
20
20
|
RewardCategory = "REWARD_CATEGORY",
|
|
21
21
|
Tier = "TIER",
|
|
22
|
-
Roundup = "ROUND_UP_BALANCE"
|
|
22
|
+
Roundup = "ROUND_UP_BALANCE",
|
|
23
|
+
Venue = "VENUE"
|
|
23
24
|
}
|
|
24
25
|
export declare enum TileHeight {
|
|
25
26
|
Half = "HALF",
|
|
@@ -98,6 +99,12 @@ export declare class RewardTileConfig {
|
|
|
98
99
|
pointsPrefix: string | null;
|
|
99
100
|
pointsSuffix: string | null;
|
|
100
101
|
}
|
|
102
|
+
export declare class VenueTileConfig {
|
|
103
|
+
venueId: string;
|
|
104
|
+
name: string;
|
|
105
|
+
artworkUrl: string;
|
|
106
|
+
description: string;
|
|
107
|
+
}
|
|
101
108
|
export declare enum BadgeTileType {
|
|
102
109
|
Specific = "SPECIFIC",
|
|
103
110
|
Latest = "LATEST_EARNED"
|
|
@@ -171,7 +178,7 @@ export type Tile = {
|
|
|
171
178
|
configuration: TileConfig;
|
|
172
179
|
priority: number;
|
|
173
180
|
};
|
|
174
|
-
declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
|
|
181
|
+
declare const getConfigForTileType: (tileType: TileType) => typeof BannerTileConfig | typeof PointsTileConfig | typeof ContentTileConfig | typeof RewardTileConfig | typeof VenueTileConfig | typeof BadgeTileConfig | typeof RewardCategoryTileConfig | typeof TierTileConfig;
|
|
175
182
|
export type TileConfig = InstanceType<ReturnType<typeof getConfigForTileType>>;
|
|
176
183
|
export type TileSizeInfo = {
|
|
177
184
|
isFullSize: boolean;
|
package/dist/web.js
CHANGED
|
@@ -8185,10 +8185,12 @@ var IS_WEB = Platform$1.OS === "web";
|
|
|
8185
8185
|
var IS_IOS = Platform$1.OS === "ios";
|
|
8186
8186
|
var IS_ANDROID = Platform$1.OS === "android";
|
|
8187
8187
|
var IS_MOBILE = IS_IOS || IS_ANDROID;
|
|
8188
|
+
var IS_DESKTOP = !IS_MOBILE;
|
|
8188
8189
|
var _a$1 = Dimensions.get("window"),
|
|
8189
|
-
width = _a$1.width
|
|
8190
|
-
_a$1.height;
|
|
8190
|
+
width = _a$1.width,
|
|
8191
|
+
height = _a$1.height;
|
|
8191
8192
|
var SCREEN_WIDTH = width;
|
|
8193
|
+
var SCREEN_HEIGHT = height;
|
|
8192
8194
|
|
|
8193
8195
|
var sizes = {
|
|
8194
8196
|
borderRadiusSm: 15,
|
|
@@ -8261,7 +8263,7 @@ var COLOR_CONSTANTS = {
|
|
|
8261
8263
|
};
|
|
8262
8264
|
|
|
8263
8265
|
// Storybook Themes
|
|
8264
|
-
|
|
8266
|
+
var storyBookThemes = {
|
|
8265
8267
|
modern: __assign(__assign({}, defaultTheme), {
|
|
8266
8268
|
primary: '#f72585',
|
|
8267
8269
|
accent: '#ffc300',
|
|
@@ -8298,7 +8300,36 @@ var COLOR_CONSTANTS = {
|
|
|
8298
8300
|
surface: '#f0dfad',
|
|
8299
8301
|
surfaceText: '#2d3436'
|
|
8300
8302
|
})
|
|
8301
|
-
}
|
|
8303
|
+
};
|
|
8304
|
+
// Create the themes object
|
|
8305
|
+
var themes = {
|
|
8306
|
+
default: defaultTheme,
|
|
8307
|
+
dark: storyBookThemes.dark,
|
|
8308
|
+
modern: storyBookThemes.modern,
|
|
8309
|
+
warm: storyBookThemes.warm,
|
|
8310
|
+
forest: storyBookThemes.forest,
|
|
8311
|
+
sunset: storyBookThemes.sunset
|
|
8312
|
+
};
|
|
8313
|
+
// Theme selector items
|
|
8314
|
+
var themeItems = [{
|
|
8315
|
+
value: 'default',
|
|
8316
|
+
title: 'Default'
|
|
8317
|
+
}, {
|
|
8318
|
+
value: 'dark',
|
|
8319
|
+
title: 'Dark'
|
|
8320
|
+
}, {
|
|
8321
|
+
value: 'modern',
|
|
8322
|
+
title: 'Modern'
|
|
8323
|
+
}, {
|
|
8324
|
+
value: 'warm',
|
|
8325
|
+
title: 'Warm'
|
|
8326
|
+
}, {
|
|
8327
|
+
value: 'forest',
|
|
8328
|
+
title: 'Forest'
|
|
8329
|
+
}, {
|
|
8330
|
+
value: 'sunset',
|
|
8331
|
+
title: 'Sunset'
|
|
8332
|
+
}];
|
|
8302
8333
|
|
|
8303
8334
|
var isValidColor = function (color) {
|
|
8304
8335
|
try {
|
|
@@ -8443,6 +8474,16 @@ var desaturateColor = function (color) {
|
|
|
8443
8474
|
if (!baseColor) return COLOR_CONSTANTS.DEFAULT_COLOR;
|
|
8444
8475
|
return baseColor.grayscale().lighten(COLOR_CONSTANTS.DESATURATION_LIGHTEN_AMOUNT).toString();
|
|
8445
8476
|
};
|
|
8477
|
+
/**
|
|
8478
|
+
* Gets the appropriate state color based on type and count
|
|
8479
|
+
* @param baseColor - Base color to process
|
|
8480
|
+
* @param type - Type of state
|
|
8481
|
+
* @param count - Count affecting the state
|
|
8482
|
+
* @returns Processed color string
|
|
8483
|
+
*/
|
|
8484
|
+
var getStateColor = function (baseColor, type, count) {
|
|
8485
|
+
return shouldDesaturate(type, count) ? desaturateColor(baseColor) : baseColor;
|
|
8486
|
+
};
|
|
8446
8487
|
|
|
8447
8488
|
var DIMENSION_MODES = {
|
|
8448
8489
|
DESKTOP: 'desktop',
|
|
@@ -8717,6 +8758,7 @@ var useButtonDynamicStyles = function () {
|
|
|
8717
8758
|
button: {
|
|
8718
8759
|
justifyContent: 'center',
|
|
8719
8760
|
alignItems: 'center',
|
|
8761
|
+
flexDirection: 'row',
|
|
8720
8762
|
paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
|
|
8721
8763
|
paddingVertical: theme.sizes.sm,
|
|
8722
8764
|
alignSelf: 'flex-start'
|
|
@@ -8770,6 +8812,7 @@ var Button = function (_a) {
|
|
|
8770
8812
|
disabled = _b === void 0 ? false : _b,
|
|
8771
8813
|
accessibilityLabel = _a.accessibilityLabel,
|
|
8772
8814
|
accessibilityHint = _a.accessibilityHint,
|
|
8815
|
+
icon = _a.icon,
|
|
8773
8816
|
testID = _a.testID;
|
|
8774
8817
|
var theme = useWllSdk().theme;
|
|
8775
8818
|
var buttonStyle = useButtonStyles(theme, variant);
|
|
@@ -8796,7 +8839,7 @@ var Button = function (_a) {
|
|
|
8796
8839
|
disabled: disabled
|
|
8797
8840
|
},
|
|
8798
8841
|
testID: testID
|
|
8799
|
-
}, /*#__PURE__*/React__namespace.createElement(RNText, {
|
|
8842
|
+
}, icon && icon, title && /*#__PURE__*/React__namespace.createElement(RNText, {
|
|
8800
8843
|
style: [styles.text, textStyle]
|
|
8801
8844
|
}, title));
|
|
8802
8845
|
};
|
|
@@ -19063,6 +19106,7 @@ var Text = function (_a) {
|
|
|
19063
19106
|
};
|
|
19064
19107
|
|
|
19065
19108
|
var MAX_WIDTH = 1080;
|
|
19109
|
+
var SLIDE_WIDTH = MAX_WIDTH;
|
|
19066
19110
|
var BUTTON_SIZE = 42;
|
|
19067
19111
|
|
|
19068
19112
|
exports.CTALinkTarget = void 0;
|
|
@@ -19090,6 +19134,7 @@ exports.TileType = void 0;
|
|
|
19090
19134
|
TileType["RewardCategory"] = "REWARD_CATEGORY";
|
|
19091
19135
|
TileType["Tier"] = "TIER";
|
|
19092
19136
|
TileType["Roundup"] = "ROUND_UP_BALANCE";
|
|
19137
|
+
TileType["Venue"] = "VENUE";
|
|
19093
19138
|
})(exports.TileType || (exports.TileType = {}));
|
|
19094
19139
|
exports.TileHeight = void 0;
|
|
19095
19140
|
(function (TileHeight) {
|
|
@@ -19165,6 +19210,15 @@ var RewardTileConfig = /** @class */function () {
|
|
|
19165
19210
|
}
|
|
19166
19211
|
return RewardTileConfig;
|
|
19167
19212
|
}();
|
|
19213
|
+
var VenueTileConfig = /** @class */function () {
|
|
19214
|
+
function VenueTileConfig() {
|
|
19215
|
+
this.venueId = '';
|
|
19216
|
+
this.name = '';
|
|
19217
|
+
this.artworkUrl = '';
|
|
19218
|
+
this.description = '';
|
|
19219
|
+
}
|
|
19220
|
+
return VenueTileConfig;
|
|
19221
|
+
}();
|
|
19168
19222
|
exports.BadgeTileType = void 0;
|
|
19169
19223
|
(function (BadgeTileType) {
|
|
19170
19224
|
BadgeTileType["Specific"] = "SPECIFIC";
|
|
@@ -19220,6 +19274,13 @@ var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
|
19220
19274
|
return handleNavigation(url, exports.CTALinkTarget.sameWindow);
|
|
19221
19275
|
}
|
|
19222
19276
|
}
|
|
19277
|
+
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.Venue) {
|
|
19278
|
+
var config = tile.configuration;
|
|
19279
|
+
if (config === null || config === void 0 ? void 0 : config.venueId) {
|
|
19280
|
+
var url = "/venue?id=".concat(config.venueId);
|
|
19281
|
+
return handleNavigation(url, exports.CTALinkTarget.sameWindow);
|
|
19282
|
+
}
|
|
19283
|
+
}
|
|
19223
19284
|
if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.RewardCategory) {
|
|
19224
19285
|
var config = tile.configuration;
|
|
19225
19286
|
var url = "/category?id=".concat(config.rewardCategoryId);
|
|
@@ -19588,7 +19649,7 @@ var BaseTileContainer = function (_a) {
|
|
|
19588
19649
|
surface: '#ffffff'
|
|
19589
19650
|
};
|
|
19590
19651
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19591
|
-
var isInteractive = Boolean(ctaLink || tile.type === 'REWARD' || tile.type === 'REWARD_CATEGORY');
|
|
19652
|
+
var isInteractive = Boolean(ctaLink || tile.type === 'REWARD' || tile.type === 'REWARD_CATEGORY' || tile.type === 'VENUE');
|
|
19592
19653
|
var layout = {
|
|
19593
19654
|
flexDirection: 'column',
|
|
19594
19655
|
justifyContent: isHalfSize ? 'center' : 'flex-start',
|
|
@@ -22855,8 +22916,191 @@ var RoundupTile = Object.assign(RoundupTileRoot, {
|
|
|
22855
22916
|
});
|
|
22856
22917
|
var RoundupTile$1 = withTileFetching(RoundupTile);
|
|
22857
22918
|
|
|
22919
|
+
/**
|
|
22920
|
+
* Renders a chevron icon for a Venue Tile.
|
|
22921
|
+
*
|
|
22922
|
+
* @returns React.ReactElement
|
|
22923
|
+
*/
|
|
22924
|
+
var VenueTileChevron = function () {
|
|
22925
|
+
var _a;
|
|
22926
|
+
var theme = useWllSdk().theme;
|
|
22927
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
22928
|
+
name: "ChevronRight",
|
|
22929
|
+
size: IS_MOBILE ? 16 : undefined,
|
|
22930
|
+
color: ((_a = theme === null || theme === void 0 ? void 0 : theme.derivedSurfaceText) === null || _a === void 0 ? void 0 : _a[20]) || '#000000',
|
|
22931
|
+
role: "img",
|
|
22932
|
+
accessibilityLabel: "View venue details"
|
|
22933
|
+
});
|
|
22934
|
+
};
|
|
22935
|
+
|
|
22936
|
+
/**
|
|
22937
|
+
* Custom hook that returns the styles for the VenueTile component.
|
|
22938
|
+
* Applies responsive styling based on the current device.
|
|
22939
|
+
*
|
|
22940
|
+
* @returns StyleSheet styles for the VenueTile component
|
|
22941
|
+
*/
|
|
22942
|
+
var useVenueTileStyles = function () {
|
|
22943
|
+
var _a = useResponsive$1(),
|
|
22944
|
+
isDesktop = _a.isDesktop,
|
|
22945
|
+
isTablet = _a.isTablet;
|
|
22946
|
+
var theme = useWllSdk().theme;
|
|
22947
|
+
return StyleSheet$1.create({
|
|
22948
|
+
imageContainer: {
|
|
22949
|
+
width: '100%',
|
|
22950
|
+
marginBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
|
|
22951
|
+
},
|
|
22952
|
+
image: {
|
|
22953
|
+
position: 'absolute',
|
|
22954
|
+
top: 0,
|
|
22955
|
+
left: 0,
|
|
22956
|
+
bottom: 0,
|
|
22957
|
+
right: 0,
|
|
22958
|
+
width: '100%',
|
|
22959
|
+
height: '100%',
|
|
22960
|
+
resizeMode: 'cover'
|
|
22961
|
+
},
|
|
22962
|
+
content: {
|
|
22963
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
22964
|
+
flex: 1
|
|
22965
|
+
},
|
|
22966
|
+
footer: {
|
|
22967
|
+
marginTop: 8
|
|
22968
|
+
},
|
|
22969
|
+
pointsContainer: {
|
|
22970
|
+
flexDirection: 'row',
|
|
22971
|
+
alignItems: 'center',
|
|
22972
|
+
justifyContent: 'center'
|
|
22973
|
+
},
|
|
22974
|
+
suffix: {
|
|
22975
|
+
color: theme.primary,
|
|
22976
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
|
|
22977
|
+
},
|
|
22978
|
+
header: {
|
|
22979
|
+
width: '100%',
|
|
22980
|
+
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
22981
|
+
},
|
|
22982
|
+
tileTitle: __assign({
|
|
22983
|
+
maxWidth: '90%',
|
|
22984
|
+
flex: 1
|
|
22985
|
+
}, getDirectionalMargin(8))
|
|
22986
|
+
});
|
|
22987
|
+
};
|
|
22988
|
+
|
|
22989
|
+
/**
|
|
22990
|
+
* Renders the media for a Venue Tile.
|
|
22991
|
+
*
|
|
22992
|
+
* @param props {VenueTileMediaProps} - Component props
|
|
22993
|
+
* @param props.isArtworkOnly {boolean} - Whether the media should be rendered as an artwork only component
|
|
22994
|
+
* @returns React.ReactElement or null if no artwork URL is present or artwork should not be shown
|
|
22995
|
+
*/
|
|
22996
|
+
var VenueTileMedia = function (_a) {
|
|
22997
|
+
var isArtworkOnly = _a.isArtworkOnly;
|
|
22998
|
+
var styles = useVenueTileStyles();
|
|
22999
|
+
var tileContext = useTileContext();
|
|
23000
|
+
if (!isContextValid(tileContext)) return null;
|
|
23001
|
+
var _b = tileContext.configuration,
|
|
23002
|
+
artworkUrl = _b.artworkUrl,
|
|
23003
|
+
_c = _b.name,
|
|
23004
|
+
name = _c === void 0 ? 'Venue' : _c;
|
|
23005
|
+
if (!artworkUrl) return null;
|
|
23006
|
+
var containerStyle = {
|
|
23007
|
+
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
23008
|
+
};
|
|
23009
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
23010
|
+
style: [styles.imageContainer, containerStyle],
|
|
23011
|
+
testID: "venue-tile-media",
|
|
23012
|
+
role: "img",
|
|
23013
|
+
accessibilityLabel: "Venue image for ".concat(name)
|
|
23014
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
23015
|
+
source: {
|
|
23016
|
+
uri: artworkUrl
|
|
23017
|
+
},
|
|
23018
|
+
style: styles.image,
|
|
23019
|
+
alt: "Venue image for ".concat(name)
|
|
23020
|
+
}));
|
|
23021
|
+
};
|
|
23022
|
+
|
|
23023
|
+
/**
|
|
23024
|
+
* Renders the summary of a Venue Tile.
|
|
23025
|
+
*
|
|
23026
|
+
* @returns React.ReactElement or null if no summary is present
|
|
23027
|
+
*/
|
|
23028
|
+
var VenueTileDescription = function () {
|
|
23029
|
+
var tileContext = useTileContext();
|
|
23030
|
+
if (!isContextValid(tileContext)) return null;
|
|
23031
|
+
var description = tileContext.configuration.description;
|
|
23032
|
+
if (!description) return null;
|
|
23033
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
23034
|
+
variant: "body",
|
|
23035
|
+
role: "article",
|
|
23036
|
+
accessibilityLabel: description,
|
|
23037
|
+
testID: "venue-tile-description",
|
|
23038
|
+
numberOfLines: 3,
|
|
23039
|
+
ellipsizeMode: "tail"
|
|
23040
|
+
}, description);
|
|
23041
|
+
};
|
|
23042
|
+
|
|
23043
|
+
/**
|
|
23044
|
+
* Renders the title of a Venue Tile.
|
|
23045
|
+
*
|
|
23046
|
+
* @returns React.ReactElement or null if no name is present
|
|
23047
|
+
*/
|
|
23048
|
+
var VenueTileTitle = function () {
|
|
23049
|
+
var tileContext = useTileContext();
|
|
23050
|
+
var styles = useVenueTileStyles();
|
|
23051
|
+
if (!isContextValid(tileContext)) return null;
|
|
23052
|
+
var name = tileContext.configuration.name;
|
|
23053
|
+
if (!name) return null;
|
|
23054
|
+
var handleTitleWidth = function () {
|
|
23055
|
+
if (IS_MOBILE) {
|
|
23056
|
+
return styles.tileTitle;
|
|
23057
|
+
}
|
|
23058
|
+
};
|
|
23059
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
23060
|
+
variant: "title",
|
|
23061
|
+
ellipsizeMode: "tail",
|
|
23062
|
+
numberOfLines: 1,
|
|
23063
|
+
role: "heading",
|
|
23064
|
+
accessibilityLabel: "Venue title: ".concat(name),
|
|
23065
|
+
testID: "venue-tile-title",
|
|
23066
|
+
style: handleTitleWidth()
|
|
23067
|
+
}, name);
|
|
23068
|
+
};
|
|
23069
|
+
|
|
23070
|
+
/**
|
|
23071
|
+
* The VenueTile component renders a tile with media, title, summary, points, and a chevron.
|
|
23072
|
+
*
|
|
23073
|
+
* @param {VenueTileProps} props - Component props
|
|
23074
|
+
* @param {Tile} props.tile - The tile data to render
|
|
23075
|
+
* @returns React.ReactElement or null if tile is inactive or not a full-height tile
|
|
23076
|
+
*/
|
|
23077
|
+
var VenueTileRoot = function (_a) {
|
|
23078
|
+
var tile = _a.tile;
|
|
23079
|
+
var styles = useVenueTileStyles();
|
|
23080
|
+
if (!tile || tile.tileHeight !== exports.TileHeight.Full || !tile.active || !tile.configuration) return null;
|
|
23081
|
+
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
23082
|
+
tile: tile
|
|
23083
|
+
}, /*#__PURE__*/React.createElement(VenueTile.Media, {
|
|
23084
|
+
isArtworkOnly: false
|
|
23085
|
+
}), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Row, {
|
|
23086
|
+
justify: "between",
|
|
23087
|
+
align: "center",
|
|
23088
|
+
style: styles.header
|
|
23089
|
+
}, /*#__PURE__*/React.createElement(VenueTile.Title, null), /*#__PURE__*/React.createElement(VenueTile.Chevron, null)), /*#__PURE__*/React.createElement(VenueTile.Description, null)));
|
|
23090
|
+
};
|
|
23091
|
+
/**
|
|
23092
|
+
* The VenueTile component with subcomponents attached.
|
|
23093
|
+
*/
|
|
23094
|
+
var VenueTile = Object.assign(VenueTileRoot, {
|
|
23095
|
+
Media: VenueTileMedia,
|
|
23096
|
+
Title: VenueTileTitle,
|
|
23097
|
+
Description: VenueTileDescription,
|
|
23098
|
+
Chevron: VenueTileChevron
|
|
23099
|
+
});
|
|
23100
|
+
var VenueTile$1 = withTileFetching(VenueTile);
|
|
23101
|
+
|
|
22858
23102
|
var _a;
|
|
22859
|
-
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);
|
|
23103
|
+
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[exports.TileType.Venue] = VenueTile$1, _a);
|
|
22860
23104
|
/**
|
|
22861
23105
|
* TileContainer component to render a list of tiles with proper layout and spacing.
|
|
22862
23106
|
*/
|
|
@@ -23027,6 +23271,7 @@ var Reward = /** @class */function () {
|
|
|
23027
23271
|
return Reward;
|
|
23028
23272
|
}();
|
|
23029
23273
|
|
|
23274
|
+
exports.BUTTON_SIZE = BUTTON_SIZE;
|
|
23030
23275
|
exports.BadgeTile = BadgeTile$1;
|
|
23031
23276
|
exports.BadgeTileConfig = BadgeTileConfig;
|
|
23032
23277
|
exports.BannerTile = BannerTile$1;
|
|
@@ -23034,19 +23279,29 @@ exports.BannerTileConfig = BannerTileConfig;
|
|
|
23034
23279
|
exports.BaseBanner = BaseBanner;
|
|
23035
23280
|
exports.BaseTile = BaseTile;
|
|
23036
23281
|
exports.Button = Button;
|
|
23282
|
+
exports.COLOR_CONSTANTS = COLOR_CONSTANTS;
|
|
23037
23283
|
exports.Carousel = Carousel;
|
|
23038
23284
|
exports.CarouselNavButton = CarouselNavButton;
|
|
23039
23285
|
exports.Chip = Chip;
|
|
23040
23286
|
exports.Column = Column;
|
|
23041
23287
|
exports.ContentTile = ContentTile$1;
|
|
23042
23288
|
exports.ContentTileConfig = ContentTileConfig;
|
|
23289
|
+
exports.DIMENSION_MODES = DIMENSION_MODES;
|
|
23290
|
+
exports.EventEmitter = EventEmitter$1;
|
|
23043
23291
|
exports.FullFlex = FullFlex;
|
|
23292
|
+
exports.GRID_GAP = GRID_GAP;
|
|
23044
23293
|
exports.Grid = Grid;
|
|
23045
23294
|
exports.Group = Group;
|
|
23295
|
+
exports.IS_ANDROID = IS_ANDROID;
|
|
23296
|
+
exports.IS_DESKTOP = IS_DESKTOP;
|
|
23297
|
+
exports.IS_IOS = IS_IOS;
|
|
23298
|
+
exports.IS_MOBILE = IS_MOBILE;
|
|
23299
|
+
exports.IS_WEB = IS_WEB;
|
|
23046
23300
|
exports.Icon = Icon;
|
|
23047
23301
|
exports.Indicator = Indicator;
|
|
23048
23302
|
exports.Layout = Layout;
|
|
23049
23303
|
exports.LoadingIndicator = LoadingIndicator;
|
|
23304
|
+
exports.MAX_WIDTH = MAX_WIDTH;
|
|
23050
23305
|
exports.PointsTile = PointsTile$1;
|
|
23051
23306
|
exports.PointsTileConfig = PointsTileConfig;
|
|
23052
23307
|
exports.ProgressBar = ProgressBar;
|
|
@@ -23060,18 +23315,57 @@ exports.RewardTileConfig = RewardTileConfig;
|
|
|
23060
23315
|
exports.RoundupTile = RoundupTile$1;
|
|
23061
23316
|
exports.RoundupTileConfig = RoundupTileConfig;
|
|
23062
23317
|
exports.Row = Row;
|
|
23318
|
+
exports.SCREEN_HEIGHT = SCREEN_HEIGHT;
|
|
23319
|
+
exports.SCREEN_WIDTH = SCREEN_WIDTH;
|
|
23320
|
+
exports.SLIDE_WIDTH = SLIDE_WIDTH;
|
|
23321
|
+
exports.SMALL_SCREEN_WIDTH = SMALL_SCREEN_WIDTH;
|
|
23063
23322
|
exports.Section = Section;
|
|
23064
23323
|
exports.SectionHeader = SectionHeader;
|
|
23065
23324
|
exports.Skeleton = Skeleton;
|
|
23066
23325
|
exports.Spacer = Spacer;
|
|
23326
|
+
exports.TABLET_SCREEN_WIDTH = TABLET_SCREEN_WIDTH;
|
|
23067
23327
|
exports.Text = Text;
|
|
23068
23328
|
exports.TierTileConfig = TierTileConfig;
|
|
23069
23329
|
exports.TierTileUpdated = TierTile;
|
|
23070
23330
|
exports.TileContainer = TileContainer;
|
|
23331
|
+
exports.VenueTile = VenueTile$1;
|
|
23332
|
+
exports.VenueTileConfig = VenueTileConfig;
|
|
23071
23333
|
exports.WllSdkProvider = WllSdkProvider;
|
|
23072
23334
|
exports.alignMap = alignMap;
|
|
23335
|
+
exports.commonStyles = commonStyles;
|
|
23336
|
+
exports.createResourceGetter = createResourceGetter;
|
|
23337
|
+
exports.defaultTheme = defaultTheme;
|
|
23338
|
+
exports.desaturateColor = desaturateColor;
|
|
23339
|
+
exports.getAlphaDerivedColors = getAlphaDerivedColors;
|
|
23340
|
+
exports.getDerivedColor = getDerivedColor;
|
|
23341
|
+
exports.getDerivedColorPercentages = getDerivedColorPercentages;
|
|
23342
|
+
exports.getDimensionMode = getDimensionMode;
|
|
23343
|
+
exports.getDirectionalMargin = getDirectionalMargin;
|
|
23344
|
+
exports.getReadableTextColor = getReadableTextColor;
|
|
23345
|
+
exports.getResponsiveValue = getResponsiveValue;
|
|
23346
|
+
exports.getStateColor = getStateColor;
|
|
23347
|
+
exports.handleLastEarnedDate = handleLastEarnedDate;
|
|
23073
23348
|
exports.justifyMap = justifyMap;
|
|
23349
|
+
exports.sdkEventEmitter = sdkEventEmitter;
|
|
23350
|
+
exports.shouldDesaturate = shouldDesaturate;
|
|
23351
|
+
exports.sizes = sizes;
|
|
23352
|
+
exports.sortByPriority = sortByPriority;
|
|
23353
|
+
exports.themeItems = themeItems;
|
|
23354
|
+
exports.themes = themes;
|
|
23355
|
+
exports.transformLocale = transformLocale;
|
|
23356
|
+
exports.useCreateRequestOptions = useCreateRequestOptions;
|
|
23357
|
+
exports.useGetGroupByID = useGetGroupByID;
|
|
23358
|
+
exports.useGetSectionByID = useGetSectionByID;
|
|
23359
|
+
exports.useGetTileByID = useGetTileByID;
|
|
23360
|
+
exports.useGroupRefresh = useGroupRefresh;
|
|
23361
|
+
exports.useInitialGroupFetch = useInitialGroupFetch;
|
|
23074
23362
|
exports.useInvalidateData = useInvalidateData;
|
|
23363
|
+
exports.useMakeRequest = useMakeRequest;
|
|
23364
|
+
exports.useNavigation = useNavigation;
|
|
23075
23365
|
exports.usePullToRefresh = usePullToRefresh;
|
|
23366
|
+
exports.useResponsive = useResponsive$1;
|
|
23367
|
+
exports.useResponsiveValue = useResponsiveValue;
|
|
23368
|
+
exports.useTileSize = useTileSize;
|
|
23076
23369
|
exports.useWllSdk = useWllSdk;
|
|
23370
|
+
exports.validateTheme = validateTheme;
|
|
23077
23371
|
//# sourceMappingURL=web.js.map
|