@wlloyalty/wll-react-sdk 1.6.15 → 1.6.16
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 +2 -2
- package/dist/native.js +220 -205
- package/dist/native.js.map +1 -1
- package/dist/types/components/atoms/BaseTile/index.d.ts +4 -0
- package/dist/types/components/atoms/BaseTile/styles.d.ts +1 -0
- package/dist/types/components/atoms/ProgressiveImage/ProgressiveImage.stories.d.ts +1 -1
- package/dist/types/components/atoms/ProgressiveImage/index.d.ts +2 -2
- package/dist/types/components/molecules/Grid/Grid.stories.d.ts +3 -0
- package/dist/web.js +272 -254
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
3
|
import { Tile } from '../../../types/tile';
|
|
4
4
|
import { WithChildren } from '../../../types/helpers';
|
|
5
|
+
/**
|
|
6
|
+
* Context to provide the current tile to child components.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TileContext: React.Context<Tile | null>;
|
|
5
9
|
/**
|
|
6
10
|
* Custom hook to access the TileContext.
|
|
7
11
|
*
|
|
@@ -4,7 +4,7 @@ export default _default;
|
|
|
4
4
|
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
source: import("react-native").ImageSourcePropType;
|
|
7
|
-
style?: import("react-native").StyleProp<
|
|
7
|
+
style?: import("react-native").StyleProp<any>;
|
|
8
8
|
isDesaturated?: boolean;
|
|
9
9
|
alt?: string;
|
|
10
10
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ImageSourcePropType, StyleProp
|
|
2
|
+
import { ImageSourcePropType, StyleProp } from 'react-native';
|
|
3
3
|
type ProgressiveImageProps = {
|
|
4
4
|
source: ImageSourcePropType;
|
|
5
|
-
style?: StyleProp<
|
|
5
|
+
style?: StyleProp<any>;
|
|
6
6
|
isDesaturated?: boolean;
|
|
7
7
|
alt?: string;
|
|
8
8
|
[key: string]: any;
|
|
@@ -4,3 +4,6 @@ export default _default;
|
|
|
4
4
|
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
5
5
|
section: import("../../../types/section").TSection;
|
|
6
6
|
}>;
|
|
7
|
+
export declare const MixedHeights: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, {
|
|
8
|
+
section: import("../../../types/section").TSection;
|
|
9
|
+
}>;
|
package/dist/web.js
CHANGED
|
@@ -18935,181 +18935,6 @@ var ProgressBar = function (_a) {
|
|
|
18935
18935
|
}));
|
|
18936
18936
|
};
|
|
18937
18937
|
|
|
18938
|
-
var ProgressiveImage = function (_a) {
|
|
18939
|
-
var source = _a.source,
|
|
18940
|
-
style = _a.style,
|
|
18941
|
-
_b = _a.isDesaturated,
|
|
18942
|
-
isDesaturated = _b === void 0 ? false : _b,
|
|
18943
|
-
alt = _a.alt,
|
|
18944
|
-
props = __rest(_a, ["source", "style", "isDesaturated", "alt"]);
|
|
18945
|
-
var imageAnimated = React.useRef(new Animated$1.Value(0)).current;
|
|
18946
|
-
var theme = useWllSdk().theme;
|
|
18947
|
-
var onImageLoad = function () {
|
|
18948
|
-
requestAnimationFrame(function () {
|
|
18949
|
-
Animated$1.timing(imageAnimated, {
|
|
18950
|
-
toValue: 1,
|
|
18951
|
-
useNativeDriver: true,
|
|
18952
|
-
duration: 300
|
|
18953
|
-
}).start();
|
|
18954
|
-
});
|
|
18955
|
-
};
|
|
18956
|
-
var baseColor = theme.alphaDerivedPrimary[20];
|
|
18957
|
-
var desaturatedColor = desaturateColor(baseColor);
|
|
18958
|
-
var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
|
|
18959
|
-
var baseImage = /*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
|
|
18960
|
-
source: source,
|
|
18961
|
-
style: [styles$7.imageOverlay, __assign({
|
|
18962
|
-
opacity: imageAnimated
|
|
18963
|
-
}, IS_WEB && {
|
|
18964
|
-
filter: isDesaturated ? 'grayscale(100%)' : undefined
|
|
18965
|
-
})],
|
|
18966
|
-
onLoad: onImageLoad,
|
|
18967
|
-
accessibilityLabel: alt,
|
|
18968
|
-
accessible: true,
|
|
18969
|
-
role: "img"
|
|
18970
|
-
}));
|
|
18971
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
18972
|
-
style: [styles$7.container, style, {
|
|
18973
|
-
backgroundColor: backgroundColor
|
|
18974
|
-
}]
|
|
18975
|
-
}, /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
18976
|
-
style: [styles$7.imageOverlay, {
|
|
18977
|
-
backgroundColor: backgroundColor,
|
|
18978
|
-
opacity: imageAnimated.interpolate({
|
|
18979
|
-
inputRange: [0, 1],
|
|
18980
|
-
outputRange: [1, 0]
|
|
18981
|
-
})
|
|
18982
|
-
}]
|
|
18983
|
-
}), IS_WEB ? baseImage : (
|
|
18984
|
-
/*#__PURE__*/
|
|
18985
|
-
// For React Native, use the overlay technique
|
|
18986
|
-
React.createElement(React.Fragment, null, baseImage, isDesaturated && (/*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
|
|
18987
|
-
source: source,
|
|
18988
|
-
style: [styles$7.imageOverlay, {
|
|
18989
|
-
opacity: imageAnimated.interpolate({
|
|
18990
|
-
inputRange: [0, 1],
|
|
18991
|
-
outputRange: [0, 0.8]
|
|
18992
|
-
}),
|
|
18993
|
-
tintColor: 'gray'
|
|
18994
|
-
}]
|
|
18995
|
-
}))))));
|
|
18996
|
-
};
|
|
18997
|
-
var styles$7 = StyleSheet$1.create({
|
|
18998
|
-
imageOverlay: {
|
|
18999
|
-
position: 'absolute',
|
|
19000
|
-
left: 0,
|
|
19001
|
-
right: 0,
|
|
19002
|
-
bottom: 0,
|
|
19003
|
-
top: 0
|
|
19004
|
-
},
|
|
19005
|
-
container: {
|
|
19006
|
-
position: 'relative',
|
|
19007
|
-
alignItems: 'center',
|
|
19008
|
-
justifyContent: 'center',
|
|
19009
|
-
width: '100%',
|
|
19010
|
-
height: '100%',
|
|
19011
|
-
minHeight: 130
|
|
19012
|
-
}
|
|
19013
|
-
});
|
|
19014
|
-
|
|
19015
|
-
var Text = function (_a) {
|
|
19016
|
-
var _b = _a.variant,
|
|
19017
|
-
variant = _b === void 0 ? 'body' : _b,
|
|
19018
|
-
style = _a.style;
|
|
19019
|
-
_a.isSurface;
|
|
19020
|
-
var props = __rest(_a, ["variant", "style", "isSurface"]);
|
|
19021
|
-
var theme = useWllSdk().theme;
|
|
19022
|
-
var _d = useResponsive(),
|
|
19023
|
-
isDesktop = _d.isDesktop,
|
|
19024
|
-
isTablet = _d.isTablet;
|
|
19025
|
-
var getVariantStyle = function (variant) {
|
|
19026
|
-
var baseStyle = {
|
|
19027
|
-
color: theme.surfaceText
|
|
19028
|
-
};
|
|
19029
|
-
switch (variant) {
|
|
19030
|
-
case 'eyebrow':
|
|
19031
|
-
return __assign(__assign({}, baseStyle), {
|
|
19032
|
-
fontSize: useResponsiveValue(theme.sizes.md, theme.sizes.sm, isDesktop, isTablet),
|
|
19033
|
-
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
19034
|
-
});
|
|
19035
|
-
case 'title':
|
|
19036
|
-
return __assign(__assign({}, baseStyle), {
|
|
19037
|
-
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
19038
|
-
fontWeight: 'bold'
|
|
19039
|
-
});
|
|
19040
|
-
case 'body':
|
|
19041
|
-
return {
|
|
19042
|
-
color: theme.derivedSurfaceText[20],
|
|
19043
|
-
fontSize: useResponsiveValue(theme.sizes.md, theme.sizes.sm, isDesktop, isTablet)
|
|
19044
|
-
};
|
|
19045
|
-
case 'caption':
|
|
19046
|
-
return __assign(__assign({}, baseStyle), {
|
|
19047
|
-
fontWeight: 'bold',
|
|
19048
|
-
fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.xl, isDesktop, isTablet),
|
|
19049
|
-
color: theme.primary
|
|
19050
|
-
});
|
|
19051
|
-
case 'description':
|
|
19052
|
-
case 'label':
|
|
19053
|
-
default:
|
|
19054
|
-
return __assign(__assign({}, baseStyle), {
|
|
19055
|
-
fontSize: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
|
|
19056
|
-
});
|
|
19057
|
-
}
|
|
19058
|
-
};
|
|
19059
|
-
var variantStyle = getVariantStyle(variant);
|
|
19060
|
-
// NOTE: React Native Web has different style resolution rules compared to CSS.
|
|
19061
|
-
// 1. We create styles using StyleSheet.create for better performance
|
|
19062
|
-
// 2. Base styles set the initial fontFamily
|
|
19063
|
-
// 3. variantStyle contains responsive fontSize and other variant-specific styles
|
|
19064
|
-
// 4. webOverrides ensures fontFamily is correctly applied on web platform
|
|
19065
|
-
// (prevents system font stack from being incorrectly applied)
|
|
19066
|
-
// 5. custom style prop has highest precedence
|
|
19067
|
-
// The order matters because RN Web resolves styles by specific properties
|
|
19068
|
-
// rather than last-declaration-wins like in CSS
|
|
19069
|
-
// https://necolas.github.io/react-native-web/docs/styling/#how-it-works
|
|
19070
|
-
var styles = StyleSheet$1.create({
|
|
19071
|
-
base: {
|
|
19072
|
-
fontFamily: theme.fontFamily
|
|
19073
|
-
},
|
|
19074
|
-
webOverrides: IS_WEB ? {
|
|
19075
|
-
fontFamily: theme.fontFamily
|
|
19076
|
-
} : {}
|
|
19077
|
-
});
|
|
19078
|
-
// Determine appropriate accessibility role based on variant
|
|
19079
|
-
// This helps screen readers understand the semantic meaning
|
|
19080
|
-
var accessibilityRole;
|
|
19081
|
-
switch (variant) {
|
|
19082
|
-
case 'title':
|
|
19083
|
-
accessibilityRole = IS_MOBILE ? 'heading' : 'header';
|
|
19084
|
-
break;
|
|
19085
|
-
case 'caption':
|
|
19086
|
-
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19087
|
-
break;
|
|
19088
|
-
case 'eyebrow':
|
|
19089
|
-
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19090
|
-
break;
|
|
19091
|
-
case 'description':
|
|
19092
|
-
accessibilityRole = IS_MOBILE ? 'article' : 'paragraph';
|
|
19093
|
-
break;
|
|
19094
|
-
case 'label':
|
|
19095
|
-
accessibilityRole = IS_MOBILE ? 'option' : 'text';
|
|
19096
|
-
break;
|
|
19097
|
-
default:
|
|
19098
|
-
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19099
|
-
}
|
|
19100
|
-
var combinedStyles = [styles.base, variantStyle, styles.webOverrides, style];
|
|
19101
|
-
return /*#__PURE__*/React__namespace.createElement(RNText, __assign({
|
|
19102
|
-
style: combinedStyles
|
|
19103
|
-
}, props, {
|
|
19104
|
-
accessible: true,
|
|
19105
|
-
role: accessibilityRole
|
|
19106
|
-
}));
|
|
19107
|
-
};
|
|
19108
|
-
|
|
19109
|
-
var MAX_WIDTH = 1080;
|
|
19110
|
-
var SLIDE_WIDTH = MAX_WIDTH;
|
|
19111
|
-
var BUTTON_SIZE = 42;
|
|
19112
|
-
|
|
19113
18938
|
exports.CTALinkTarget = void 0;
|
|
19114
18939
|
(function (CTALinkTarget) {
|
|
19115
18940
|
CTALinkTarget["sameWindow"] = "SAME_FRAME";
|
|
@@ -19296,66 +19121,6 @@ var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
|
|
|
19296
19121
|
}, [tile, ctaLink, ctaLinkTarget, handleNavigation]);
|
|
19297
19122
|
};
|
|
19298
19123
|
|
|
19299
|
-
var BannerContext = /*#__PURE__*/React.createContext(null);
|
|
19300
|
-
var useBannerContext = function () {
|
|
19301
|
-
var context = React.useContext(BannerContext);
|
|
19302
|
-
if (!context) {
|
|
19303
|
-
throw new Error('Banner components must be used within a BaseBanner');
|
|
19304
|
-
}
|
|
19305
|
-
return context;
|
|
19306
|
-
};
|
|
19307
|
-
var BaseBanner = function (_a) {
|
|
19308
|
-
var tile = _a.tile,
|
|
19309
|
-
children = _a.children,
|
|
19310
|
-
style = _a.style,
|
|
19311
|
-
testID = _a.testID,
|
|
19312
|
-
accessibilityLabel = _a.accessibilityLabel;
|
|
19313
|
-
var theme = useWllSdk().theme;
|
|
19314
|
-
var _b = tile.configuration,
|
|
19315
|
-
ctaLink = _b.ctaLink,
|
|
19316
|
-
ctaLinkTarget = _b.ctaLinkTarget,
|
|
19317
|
-
title = _b.title,
|
|
19318
|
-
ctaText = _b.ctaText;
|
|
19319
|
-
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19320
|
-
var hasCTA = Boolean(ctaText);
|
|
19321
|
-
var isInteractive = Boolean(ctaLink && !hasCTA);
|
|
19322
|
-
var commonStyles = [styles$6.container, style, {
|
|
19323
|
-
backgroundColor: theme.surface,
|
|
19324
|
-
borderRadius: theme.sizes.borderRadiusLg
|
|
19325
|
-
}];
|
|
19326
|
-
return /*#__PURE__*/React.createElement(BannerContext.Provider, {
|
|
19327
|
-
value: tile
|
|
19328
|
-
}, isInteractive ? (/*#__PURE__*/React.createElement(Pressable$1, {
|
|
19329
|
-
testID: testID || 'banner-tile',
|
|
19330
|
-
style: function (_a) {
|
|
19331
|
-
var pressed = _a.pressed;
|
|
19332
|
-
return __spreadArray(__spreadArray([], commonStyles, true), [{
|
|
19333
|
-
opacity: pressed ? 0.7 : 1
|
|
19334
|
-
}], false);
|
|
19335
|
-
},
|
|
19336
|
-
onPress: handlePress,
|
|
19337
|
-
accessible: true,
|
|
19338
|
-
role: "button",
|
|
19339
|
-
accessibilityLabel: accessibilityLabel || "".concat(title, " - Click to open")
|
|
19340
|
-
}, children)) : (/*#__PURE__*/React.createElement(View$2, {
|
|
19341
|
-
testID: testID || 'banner-tile',
|
|
19342
|
-
style: commonStyles,
|
|
19343
|
-
accessible: true,
|
|
19344
|
-
role: "article",
|
|
19345
|
-
accessibilityLabel: accessibilityLabel || title || 'Banner'
|
|
19346
|
-
}, children)));
|
|
19347
|
-
};
|
|
19348
|
-
var styles$6 = StyleSheet$1.create({
|
|
19349
|
-
container: {
|
|
19350
|
-
width: '100%',
|
|
19351
|
-
maxWidth: MAX_WIDTH,
|
|
19352
|
-
flexDirection: 'row',
|
|
19353
|
-
alignItems: 'center',
|
|
19354
|
-
justifyContent: 'space-between',
|
|
19355
|
-
overflow: 'hidden'
|
|
19356
|
-
}
|
|
19357
|
-
});
|
|
19358
|
-
|
|
19359
19124
|
var useTileSize = function (tile) {
|
|
19360
19125
|
return React.useMemo(function () {
|
|
19361
19126
|
return {
|
|
@@ -19365,6 +19130,100 @@ var useTileSize = function (tile) {
|
|
|
19365
19130
|
}, [tile.tileHeight]);
|
|
19366
19131
|
};
|
|
19367
19132
|
|
|
19133
|
+
var Text = function (_a) {
|
|
19134
|
+
var _b = _a.variant,
|
|
19135
|
+
variant = _b === void 0 ? 'body' : _b,
|
|
19136
|
+
style = _a.style;
|
|
19137
|
+
_a.isSurface;
|
|
19138
|
+
var props = __rest(_a, ["variant", "style", "isSurface"]);
|
|
19139
|
+
var theme = useWllSdk().theme;
|
|
19140
|
+
var _d = useResponsive(),
|
|
19141
|
+
isDesktop = _d.isDesktop,
|
|
19142
|
+
isTablet = _d.isTablet;
|
|
19143
|
+
var getVariantStyle = function (variant) {
|
|
19144
|
+
var baseStyle = {
|
|
19145
|
+
color: theme.surfaceText
|
|
19146
|
+
};
|
|
19147
|
+
switch (variant) {
|
|
19148
|
+
case 'eyebrow':
|
|
19149
|
+
return __assign(__assign({}, baseStyle), {
|
|
19150
|
+
fontSize: useResponsiveValue(theme.sizes.md, theme.sizes.sm, isDesktop, isTablet),
|
|
19151
|
+
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
19152
|
+
});
|
|
19153
|
+
case 'title':
|
|
19154
|
+
return __assign(__assign({}, baseStyle), {
|
|
19155
|
+
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet),
|
|
19156
|
+
fontWeight: 'bold'
|
|
19157
|
+
});
|
|
19158
|
+
case 'body':
|
|
19159
|
+
return {
|
|
19160
|
+
color: theme.derivedSurfaceText[20],
|
|
19161
|
+
fontSize: useResponsiveValue(theme.sizes.md, theme.sizes.sm, isDesktop, isTablet)
|
|
19162
|
+
};
|
|
19163
|
+
case 'caption':
|
|
19164
|
+
return __assign(__assign({}, baseStyle), {
|
|
19165
|
+
fontWeight: 'bold',
|
|
19166
|
+
fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.xl, isDesktop, isTablet),
|
|
19167
|
+
color: theme.primary
|
|
19168
|
+
});
|
|
19169
|
+
case 'description':
|
|
19170
|
+
case 'label':
|
|
19171
|
+
default:
|
|
19172
|
+
return __assign(__assign({}, baseStyle), {
|
|
19173
|
+
fontSize: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
|
|
19174
|
+
});
|
|
19175
|
+
}
|
|
19176
|
+
};
|
|
19177
|
+
var variantStyle = getVariantStyle(variant);
|
|
19178
|
+
// NOTE: React Native Web has different style resolution rules compared to CSS.
|
|
19179
|
+
// 1. We create styles using StyleSheet.create for better performance
|
|
19180
|
+
// 2. Base styles set the initial fontFamily
|
|
19181
|
+
// 3. variantStyle contains responsive fontSize and other variant-specific styles
|
|
19182
|
+
// 4. webOverrides ensures fontFamily is correctly applied on web platform
|
|
19183
|
+
// (prevents system font stack from being incorrectly applied)
|
|
19184
|
+
// 5. custom style prop has highest precedence
|
|
19185
|
+
// The order matters because RN Web resolves styles by specific properties
|
|
19186
|
+
// rather than last-declaration-wins like in CSS
|
|
19187
|
+
// https://necolas.github.io/react-native-web/docs/styling/#how-it-works
|
|
19188
|
+
var styles = StyleSheet$1.create({
|
|
19189
|
+
base: {
|
|
19190
|
+
fontFamily: theme.fontFamily
|
|
19191
|
+
},
|
|
19192
|
+
webOverrides: IS_WEB ? {
|
|
19193
|
+
fontFamily: theme.fontFamily
|
|
19194
|
+
} : {}
|
|
19195
|
+
});
|
|
19196
|
+
// Determine appropriate accessibility role based on variant
|
|
19197
|
+
// This helps screen readers understand the semantic meaning
|
|
19198
|
+
var accessibilityRole;
|
|
19199
|
+
switch (variant) {
|
|
19200
|
+
case 'title':
|
|
19201
|
+
accessibilityRole = IS_MOBILE ? 'heading' : 'header';
|
|
19202
|
+
break;
|
|
19203
|
+
case 'caption':
|
|
19204
|
+
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19205
|
+
break;
|
|
19206
|
+
case 'eyebrow':
|
|
19207
|
+
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19208
|
+
break;
|
|
19209
|
+
case 'description':
|
|
19210
|
+
accessibilityRole = IS_MOBILE ? 'article' : 'paragraph';
|
|
19211
|
+
break;
|
|
19212
|
+
case 'label':
|
|
19213
|
+
accessibilityRole = IS_MOBILE ? 'option' : 'text';
|
|
19214
|
+
break;
|
|
19215
|
+
default:
|
|
19216
|
+
accessibilityRole = IS_MOBILE ? 'contentinfo' : 'text';
|
|
19217
|
+
}
|
|
19218
|
+
var combinedStyles = [styles.base, variantStyle, styles.webOverrides, style];
|
|
19219
|
+
return /*#__PURE__*/React__namespace.createElement(RNText, __assign({
|
|
19220
|
+
style: combinedStyles
|
|
19221
|
+
}, props, {
|
|
19222
|
+
accessible: true,
|
|
19223
|
+
role: accessibilityRole
|
|
19224
|
+
}));
|
|
19225
|
+
};
|
|
19226
|
+
|
|
19368
19227
|
/**
|
|
19369
19228
|
* Renders the body text of a BaseTile component.
|
|
19370
19229
|
*
|
|
@@ -19423,6 +19282,7 @@ var shouldHideContentForHalfTile = function (sizeInfo, artworkUrl) {
|
|
|
19423
19282
|
|
|
19424
19283
|
var baseStyles = StyleSheet$1.create({
|
|
19425
19284
|
imageContainer: {
|
|
19285
|
+
width: '100%',
|
|
19426
19286
|
position: 'relative'
|
|
19427
19287
|
},
|
|
19428
19288
|
container: {
|
|
@@ -19758,6 +19618,151 @@ var BaseTile = Object.assign(BaseTileRoot, {
|
|
|
19758
19618
|
Body: BaseTileBody
|
|
19759
19619
|
});
|
|
19760
19620
|
|
|
19621
|
+
var ProgressiveImage = function (_a) {
|
|
19622
|
+
var source = _a.source,
|
|
19623
|
+
style = _a.style,
|
|
19624
|
+
_b = _a.isDesaturated,
|
|
19625
|
+
isDesaturated = _b === void 0 ? false : _b,
|
|
19626
|
+
alt = _a.alt,
|
|
19627
|
+
props = __rest(_a, ["source", "style", "isDesaturated", "alt"]);
|
|
19628
|
+
var imageAnimated = React.useRef(new Animated$1.Value(0)).current;
|
|
19629
|
+
var theme = useWllSdk().theme;
|
|
19630
|
+
var tileContext = React.useContext(TileContext);
|
|
19631
|
+
var isHalfHeight = (tileContext === null || tileContext === void 0 ? void 0 : tileContext.tileHeight) === exports.TileHeight.Half;
|
|
19632
|
+
var onImageLoad = function () {
|
|
19633
|
+
requestAnimationFrame(function () {
|
|
19634
|
+
Animated$1.timing(imageAnimated, {
|
|
19635
|
+
toValue: 1,
|
|
19636
|
+
useNativeDriver: true,
|
|
19637
|
+
duration: 300
|
|
19638
|
+
}).start();
|
|
19639
|
+
});
|
|
19640
|
+
};
|
|
19641
|
+
var baseColor = theme.alphaDerivedPrimary[20];
|
|
19642
|
+
var desaturatedColor = desaturateColor(baseColor);
|
|
19643
|
+
var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
|
|
19644
|
+
var baseImage = /*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
|
|
19645
|
+
source: source,
|
|
19646
|
+
style: [styles$7.imageOverlay, style, __assign({
|
|
19647
|
+
opacity: imageAnimated
|
|
19648
|
+
}, IS_WEB && {
|
|
19649
|
+
filter: isDesaturated ? 'grayscale(100%)' : undefined
|
|
19650
|
+
})],
|
|
19651
|
+
onLoad: onImageLoad,
|
|
19652
|
+
accessibilityLabel: alt,
|
|
19653
|
+
accessible: true,
|
|
19654
|
+
role: "img"
|
|
19655
|
+
}));
|
|
19656
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19657
|
+
style: [styles$7.container, isHalfHeight && {
|
|
19658
|
+
minHeight: 0
|
|
19659
|
+
}, style, {
|
|
19660
|
+
backgroundColor: backgroundColor
|
|
19661
|
+
}]
|
|
19662
|
+
}, /*#__PURE__*/React.createElement(Animated$1.View, {
|
|
19663
|
+
style: [styles$7.imageOverlay, {
|
|
19664
|
+
backgroundColor: backgroundColor,
|
|
19665
|
+
opacity: imageAnimated.interpolate({
|
|
19666
|
+
inputRange: [0, 1],
|
|
19667
|
+
outputRange: [1, 0]
|
|
19668
|
+
})
|
|
19669
|
+
}]
|
|
19670
|
+
}), IS_WEB ? baseImage : (
|
|
19671
|
+
/*#__PURE__*/
|
|
19672
|
+
// For React Native, use the overlay technique
|
|
19673
|
+
React.createElement(React.Fragment, null, baseImage, isDesaturated && (/*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
|
|
19674
|
+
source: source,
|
|
19675
|
+
style: [styles$7.imageOverlay, style, {
|
|
19676
|
+
opacity: imageAnimated.interpolate({
|
|
19677
|
+
inputRange: [0, 1],
|
|
19678
|
+
outputRange: [0, 0.8]
|
|
19679
|
+
}),
|
|
19680
|
+
tintColor: 'gray'
|
|
19681
|
+
}]
|
|
19682
|
+
}))))));
|
|
19683
|
+
};
|
|
19684
|
+
var styles$7 = StyleSheet$1.create({
|
|
19685
|
+
imageOverlay: {
|
|
19686
|
+
position: 'absolute',
|
|
19687
|
+
left: 0,
|
|
19688
|
+
right: 0,
|
|
19689
|
+
bottom: 0,
|
|
19690
|
+
top: 0
|
|
19691
|
+
},
|
|
19692
|
+
container: {
|
|
19693
|
+
position: 'relative',
|
|
19694
|
+
alignItems: 'center',
|
|
19695
|
+
justifyContent: 'center',
|
|
19696
|
+
width: '100%',
|
|
19697
|
+
height: '100%',
|
|
19698
|
+
minHeight: 130
|
|
19699
|
+
}
|
|
19700
|
+
});
|
|
19701
|
+
|
|
19702
|
+
var MAX_WIDTH = 1080;
|
|
19703
|
+
var SLIDE_WIDTH = MAX_WIDTH;
|
|
19704
|
+
var BUTTON_SIZE = 42;
|
|
19705
|
+
|
|
19706
|
+
var BannerContext = /*#__PURE__*/React.createContext(null);
|
|
19707
|
+
var useBannerContext = function () {
|
|
19708
|
+
var context = React.useContext(BannerContext);
|
|
19709
|
+
if (!context) {
|
|
19710
|
+
throw new Error('Banner components must be used within a BaseBanner');
|
|
19711
|
+
}
|
|
19712
|
+
return context;
|
|
19713
|
+
};
|
|
19714
|
+
var BaseBanner = function (_a) {
|
|
19715
|
+
var tile = _a.tile,
|
|
19716
|
+
children = _a.children,
|
|
19717
|
+
style = _a.style,
|
|
19718
|
+
testID = _a.testID,
|
|
19719
|
+
accessibilityLabel = _a.accessibilityLabel;
|
|
19720
|
+
var theme = useWllSdk().theme;
|
|
19721
|
+
var _b = tile.configuration,
|
|
19722
|
+
ctaLink = _b.ctaLink,
|
|
19723
|
+
ctaLinkTarget = _b.ctaLinkTarget,
|
|
19724
|
+
title = _b.title,
|
|
19725
|
+
ctaText = _b.ctaText;
|
|
19726
|
+
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19727
|
+
var hasCTA = Boolean(ctaText);
|
|
19728
|
+
var isInteractive = Boolean(ctaLink && !hasCTA);
|
|
19729
|
+
var commonStyles = [styles$6.container, style, {
|
|
19730
|
+
backgroundColor: theme.surface,
|
|
19731
|
+
borderRadius: theme.sizes.borderRadiusLg
|
|
19732
|
+
}];
|
|
19733
|
+
return /*#__PURE__*/React.createElement(BannerContext.Provider, {
|
|
19734
|
+
value: tile
|
|
19735
|
+
}, isInteractive ? (/*#__PURE__*/React.createElement(Pressable$1, {
|
|
19736
|
+
testID: testID || 'banner-tile',
|
|
19737
|
+
style: function (_a) {
|
|
19738
|
+
var pressed = _a.pressed;
|
|
19739
|
+
return __spreadArray(__spreadArray([], commonStyles, true), [{
|
|
19740
|
+
opacity: pressed ? 0.7 : 1
|
|
19741
|
+
}], false);
|
|
19742
|
+
},
|
|
19743
|
+
onPress: handlePress,
|
|
19744
|
+
accessible: true,
|
|
19745
|
+
role: "button",
|
|
19746
|
+
accessibilityLabel: accessibilityLabel || "".concat(title, " - Click to open")
|
|
19747
|
+
}, children)) : (/*#__PURE__*/React.createElement(View$2, {
|
|
19748
|
+
testID: testID || 'banner-tile',
|
|
19749
|
+
style: commonStyles,
|
|
19750
|
+
accessible: true,
|
|
19751
|
+
role: "article",
|
|
19752
|
+
accessibilityLabel: accessibilityLabel || title || 'Banner'
|
|
19753
|
+
}, children)));
|
|
19754
|
+
};
|
|
19755
|
+
var styles$6 = StyleSheet$1.create({
|
|
19756
|
+
container: {
|
|
19757
|
+
width: '100%',
|
|
19758
|
+
maxWidth: MAX_WIDTH,
|
|
19759
|
+
flexDirection: 'row',
|
|
19760
|
+
alignItems: 'center',
|
|
19761
|
+
justifyContent: 'space-between',
|
|
19762
|
+
overflow: 'hidden'
|
|
19763
|
+
}
|
|
19764
|
+
});
|
|
19765
|
+
|
|
19761
19766
|
/* istanbul ignore file */
|
|
19762
19767
|
var Indicator = function () {
|
|
19763
19768
|
var _a = useResponsive$1(),
|
|
@@ -20182,12 +20187,16 @@ var useBadgeTileStyles = function () {
|
|
|
20182
20187
|
fontSize: 14,
|
|
20183
20188
|
fontWeight: 'bold'
|
|
20184
20189
|
},
|
|
20185
|
-
header: {
|
|
20190
|
+
header: __assign(__assign({
|
|
20191
|
+
width: '100%'
|
|
20192
|
+
}, !IS_WEB && {
|
|
20193
|
+
flexBasis: '50%'
|
|
20194
|
+
}), {
|
|
20186
20195
|
alignItems: 'center',
|
|
20187
20196
|
justifyContent: 'center',
|
|
20188
20197
|
position: 'relative',
|
|
20189
20198
|
marginBottom: useResponsiveValue(theme.sizes.lg, theme.sizes.xxs, isDesktop, isTablet)
|
|
20190
|
-
},
|
|
20199
|
+
}),
|
|
20191
20200
|
image: {
|
|
20192
20201
|
width: '100%',
|
|
20193
20202
|
height: '100%'
|
|
@@ -20373,14 +20382,14 @@ var useBannerTileStyles = function () {
|
|
|
20373
20382
|
slideContent: {
|
|
20374
20383
|
flex: 1
|
|
20375
20384
|
},
|
|
20376
|
-
mediaContainer:
|
|
20385
|
+
mediaContainer: {
|
|
20377
20386
|
aspectRatio: 1,
|
|
20378
20387
|
position: 'relative',
|
|
20379
|
-
overflow: 'hidden'
|
|
20380
|
-
|
|
20388
|
+
overflow: 'hidden',
|
|
20389
|
+
marginRight: useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet),
|
|
20381
20390
|
maxHeight: useResponsiveValue(253, 120, isDesktop, isTablet),
|
|
20382
20391
|
minHeight: 120
|
|
20383
|
-
}
|
|
20392
|
+
},
|
|
20384
20393
|
media: {
|
|
20385
20394
|
position: 'absolute',
|
|
20386
20395
|
width: '100%',
|
|
@@ -20553,6 +20562,7 @@ var useContentTileStyles = function (hasArtwork) {
|
|
|
20553
20562
|
overflow: 'hidden'
|
|
20554
20563
|
},
|
|
20555
20564
|
image: {
|
|
20565
|
+
width: '100%',
|
|
20556
20566
|
resizeMode: 'cover'
|
|
20557
20567
|
},
|
|
20558
20568
|
content: {
|
|
@@ -20578,11 +20588,9 @@ var ContentTileMedia = function (_a) {
|
|
|
20578
20588
|
if (!artworkUrl) return null;
|
|
20579
20589
|
var hasArtwork = Boolean(artworkUrl);
|
|
20580
20590
|
var styles = useContentTileStyles(hasArtwork);
|
|
20581
|
-
var containerStyle =
|
|
20591
|
+
var containerStyle = {
|
|
20582
20592
|
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
20583
|
-
}
|
|
20584
|
-
aspectRatio: 1
|
|
20585
|
-
});
|
|
20593
|
+
};
|
|
20586
20594
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20587
20595
|
style: [styles.imageContainer, containerStyle],
|
|
20588
20596
|
testID: "content-tile-media",
|
|
@@ -21886,13 +21894,19 @@ var FullFlex = function (_a) {
|
|
|
21886
21894
|
var children = _a.children,
|
|
21887
21895
|
style = _a.style,
|
|
21888
21896
|
rest = __rest(_a, ["children", "style"]);
|
|
21897
|
+
var _b = useResponsive$1(),
|
|
21898
|
+
isDesktop = _b.isDesktop,
|
|
21899
|
+
isTablet = _b.isTablet;
|
|
21900
|
+
var theme = useWllSdk().theme;
|
|
21889
21901
|
var isRTL = IS_WEB && typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
|
|
21890
21902
|
return /*#__PURE__*/React.createElement(View$2, __assign({
|
|
21891
|
-
style: [{
|
|
21903
|
+
style: [__assign({
|
|
21892
21904
|
flex: 1,
|
|
21893
21905
|
// If the language is Arabic (RTL), use 'rtl', otherwise 'ltr'.
|
|
21894
21906
|
direction: isRTL ? 'rtl' : 'ltr'
|
|
21895
|
-
},
|
|
21907
|
+
}, isRTL && {
|
|
21908
|
+
marginRight: useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet)
|
|
21909
|
+
}), style]
|
|
21896
21910
|
}, rest), children);
|
|
21897
21911
|
};
|
|
21898
21912
|
|
|
@@ -22239,9 +22253,9 @@ var useRewardCategoryTileStyles = function () {
|
|
|
22239
22253
|
* @returns React.ReactElement or null if showName is false or name is not present
|
|
22240
22254
|
*/
|
|
22241
22255
|
var RewardCategoryHeader = function () {
|
|
22256
|
+
var tileContext = useTileContext();
|
|
22242
22257
|
var styles = useRewardCategoryTileStyles();
|
|
22243
22258
|
var theme = useWllSdk().theme;
|
|
22244
|
-
var tileContext = useTileContext();
|
|
22245
22259
|
if (!isContextValid(tileContext)) return null;
|
|
22246
22260
|
var _a = tileContext.configuration,
|
|
22247
22261
|
_b = _a.showName,
|
|
@@ -22271,8 +22285,8 @@ var RewardCategoryHeader = function () {
|
|
|
22271
22285
|
* @returns React.ReactElement or null if no artwork URL is present
|
|
22272
22286
|
*/
|
|
22273
22287
|
var RewardCategoryMedia = function () {
|
|
22274
|
-
var styles = useRewardCategoryTileStyles();
|
|
22275
22288
|
var tileContext = useTileContext();
|
|
22289
|
+
var styles = useRewardCategoryTileStyles();
|
|
22276
22290
|
if (!isContextValid(tileContext)) return null;
|
|
22277
22291
|
var _a = tileContext.configuration,
|
|
22278
22292
|
artworkUrl = _a.artworkUrl,
|
|
@@ -22304,7 +22318,7 @@ var RewardCategoryTileRoot = function (_a) {
|
|
|
22304
22318
|
tile: tile
|
|
22305
22319
|
}, /*#__PURE__*/React.createElement(View$2, {
|
|
22306
22320
|
style: {
|
|
22307
|
-
aspectRatio: 1
|
|
22321
|
+
aspectRatio: tile.tileHeight === exports.TileHeight.Half ? 2 : 1
|
|
22308
22322
|
}
|
|
22309
22323
|
}, /*#__PURE__*/React.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React.createElement(RewardCategoryTile.Media, null)));
|
|
22310
22324
|
};
|
|
@@ -22433,10 +22447,12 @@ var RewardTileMedia = function (_a) {
|
|
|
22433
22447
|
height: '100%',
|
|
22434
22448
|
marginBottom: 0,
|
|
22435
22449
|
minHeight: 0,
|
|
22436
|
-
aspectRatio: 1
|
|
22437
|
-
} : {
|
|
22450
|
+
aspectRatio: tileContext.tileHeight === exports.TileHeight.Half ? 2 : 1
|
|
22451
|
+
} : __assign({
|
|
22438
22452
|
flexBasis: '50%'
|
|
22439
|
-
}
|
|
22453
|
+
}, tileContext.tileHeight === exports.TileHeight.Half && {
|
|
22454
|
+
minHeight: 0
|
|
22455
|
+
});
|
|
22440
22456
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
22441
22457
|
style: [styles.imageContainer, containerStyle],
|
|
22442
22458
|
testID: "reward-tile-media",
|
|
@@ -23210,7 +23226,9 @@ var TileContainer = function (_a) {
|
|
|
23210
23226
|
});
|
|
23211
23227
|
var halfHeightGap = allHalfHeight ? GRID_GAP / 2 : GRID_GAP;
|
|
23212
23228
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
23213
|
-
style: styles.container,
|
|
23229
|
+
style: [styles.container, allHalfHeight && {
|
|
23230
|
+
aspectRatio: 1
|
|
23231
|
+
}],
|
|
23214
23232
|
testID: "tile-container"
|
|
23215
23233
|
}, tiles.map(function (tile, index) {
|
|
23216
23234
|
var TileComponent = TILE_COMPONENTS[tile.type];
|