@wlloyalty/wll-react-sdk 1.0.44 → 1.0.46
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 +82 -68
- package/dist/index.js +455 -349
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8035,7 +8035,12 @@ var useTextStyles = createVariantSystem({}, function (theme) {
|
|
|
8035
8035
|
var Button = function (_a) {
|
|
8036
8036
|
var title = _a.title,
|
|
8037
8037
|
onPress = _a.onPress,
|
|
8038
|
-
variant = _a.variant
|
|
8038
|
+
variant = _a.variant,
|
|
8039
|
+
_b = _a.disabled,
|
|
8040
|
+
disabled = _b === void 0 ? false : _b,
|
|
8041
|
+
accessibilityLabel = _a.accessibilityLabel,
|
|
8042
|
+
accessibilityHint = _a.accessibilityHint,
|
|
8043
|
+
testID = _a.testID;
|
|
8039
8044
|
var theme = useWllSdk().theme;
|
|
8040
8045
|
var buttonStyle = useButtonStyles(theme, variant);
|
|
8041
8046
|
var textStyle = useTextStyles(theme, variant);
|
|
@@ -8043,8 +8048,19 @@ var Button = function (_a) {
|
|
|
8043
8048
|
return /*#__PURE__*/React__namespace.createElement(TouchableOpacity$1, {
|
|
8044
8049
|
style: [styles.button, buttonStyle, {
|
|
8045
8050
|
borderRadius: theme.sizes.borderRadiusButton
|
|
8051
|
+
}, disabled && {
|
|
8052
|
+
opacity: 0.5
|
|
8046
8053
|
}],
|
|
8047
|
-
onPress: onPress
|
|
8054
|
+
onPress: onPress,
|
|
8055
|
+
disabled: disabled,
|
|
8056
|
+
accessible: true,
|
|
8057
|
+
accessibilityRole: "button",
|
|
8058
|
+
accessibilityLabel: accessibilityLabel || title,
|
|
8059
|
+
accessibilityHint: accessibilityHint,
|
|
8060
|
+
accessibilityState: {
|
|
8061
|
+
disabled: disabled
|
|
8062
|
+
},
|
|
8063
|
+
testID: testID
|
|
8048
8064
|
}, /*#__PURE__*/React__namespace.createElement(Text$3, {
|
|
8049
8065
|
style: [styles.text, textStyle]
|
|
8050
8066
|
}, title));
|
|
@@ -18198,27 +18214,6 @@ var styles$8 = StyleSheet$1.create({
|
|
|
18198
18214
|
}
|
|
18199
18215
|
});
|
|
18200
18216
|
|
|
18201
|
-
var RowHeader = function (_a) {
|
|
18202
|
-
var children = _a.children,
|
|
18203
|
-
style = _a.style,
|
|
18204
|
-
props = __rest(_a, ["children", "style"]);
|
|
18205
|
-
var _b = useResponsive$1(),
|
|
18206
|
-
isDesktop = _b.isDesktop,
|
|
18207
|
-
isTablet = _b.isTablet;
|
|
18208
|
-
var theme = useWllSdk().theme;
|
|
18209
|
-
var dynamicStyles = StyleSheet$1.create({
|
|
18210
|
-
header: {
|
|
18211
|
-
flexDirection: 'row',
|
|
18212
|
-
alignItems: 'center',
|
|
18213
|
-
justifyContent: 'space-between',
|
|
18214
|
-
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
18215
|
-
}
|
|
18216
|
-
});
|
|
18217
|
-
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
18218
|
-
style: [dynamicStyles.header, style]
|
|
18219
|
-
}, props), children);
|
|
18220
|
-
};
|
|
18221
|
-
|
|
18222
18217
|
var Text = function (_a) {
|
|
18223
18218
|
var _b = _a.variant,
|
|
18224
18219
|
variant = _b === void 0 ? 'body' : _b,
|
|
@@ -19015,7 +19010,7 @@ var BannerContext = /*#__PURE__*/React.createContext(null);
|
|
|
19015
19010
|
var useBannerContext = function () {
|
|
19016
19011
|
var context = React.useContext(BannerContext);
|
|
19017
19012
|
if (!context) {
|
|
19018
|
-
throw new Error('
|
|
19013
|
+
throw new Error('Banner components must be used within a BaseBanner');
|
|
19019
19014
|
}
|
|
19020
19015
|
return context;
|
|
19021
19016
|
};
|
|
@@ -19179,11 +19174,7 @@ var BaseTileHeader = function (_a) {
|
|
|
19179
19174
|
|
|
19180
19175
|
var BaseTileMedia = function (props) {
|
|
19181
19176
|
var tile = useTileContext();
|
|
19182
|
-
var
|
|
19183
|
-
artworkUrl = _a.artworkUrl;
|
|
19184
|
-
_a.title;
|
|
19185
|
-
_a.body;
|
|
19186
|
-
useTileSize(tile).isHalfSize;
|
|
19177
|
+
var artworkUrl = tile.configuration.artworkUrl;
|
|
19187
19178
|
var styles = useBaseTileStyles();
|
|
19188
19179
|
if (!artworkUrl) return null;
|
|
19189
19180
|
return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
|
|
@@ -19229,9 +19220,9 @@ var useTileContext = function () {
|
|
|
19229
19220
|
return context;
|
|
19230
19221
|
};
|
|
19231
19222
|
/**
|
|
19232
|
-
*
|
|
19223
|
+
* BaseTileContainer component to handle layout and pressable behavior.
|
|
19233
19224
|
*/
|
|
19234
|
-
var
|
|
19225
|
+
var BaseTileContainer = function (_a) {
|
|
19235
19226
|
var children = _a.children,
|
|
19236
19227
|
style = _a.style;
|
|
19237
19228
|
var tile = useTileContext();
|
|
@@ -19265,20 +19256,20 @@ var BaseTileRoot = function (_a) {
|
|
|
19265
19256
|
}, children);
|
|
19266
19257
|
};
|
|
19267
19258
|
/**
|
|
19268
|
-
*
|
|
19259
|
+
* BaseTileRoot component to provide context and render children.
|
|
19269
19260
|
*/
|
|
19270
|
-
var
|
|
19261
|
+
var BaseTileRoot = function (_a) {
|
|
19271
19262
|
var tile = _a.tile,
|
|
19272
19263
|
children = _a.children;
|
|
19273
19264
|
return /*#__PURE__*/React.createElement(TileContext.Provider, {
|
|
19274
19265
|
value: tile
|
|
19275
|
-
}, /*#__PURE__*/React.createElement(BaseTile.
|
|
19266
|
+
}, /*#__PURE__*/React.createElement(BaseTile.Container, null, children));
|
|
19276
19267
|
};
|
|
19277
19268
|
/**
|
|
19278
19269
|
* BaseTile component with subcomponents attached.
|
|
19279
19270
|
*/
|
|
19280
|
-
var BaseTile = Object.assign(
|
|
19281
|
-
|
|
19271
|
+
var BaseTile = Object.assign(BaseTileRoot, {
|
|
19272
|
+
Container: BaseTileContainer,
|
|
19282
19273
|
Media: BaseTileMedia,
|
|
19283
19274
|
Content: BaseTileContent,
|
|
19284
19275
|
Header: BaseTileHeader,
|
|
@@ -19577,25 +19568,22 @@ var BadgeTileDateEarned = function () {
|
|
|
19577
19568
|
if (type === exports.BadgeTileType.Latest && count === 0) {
|
|
19578
19569
|
return null;
|
|
19579
19570
|
}
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
19584
|
-
variant: "label",
|
|
19585
|
-
style: {
|
|
19586
|
-
color: textColor
|
|
19587
|
-
}
|
|
19588
|
-
}, badgeNotEarnedMessage));
|
|
19589
|
-
}
|
|
19590
|
-
var formattedDate = new Date(createdAt).toLocaleDateString();
|
|
19571
|
+
var displayText = count === 0 ? badgeNotEarnedMessage : "".concat(awardedDatePrefix, " ").concat(new Date(createdAt).toLocaleDateString());
|
|
19572
|
+
var accessibilityLabel = count === 0 ? 'Badge not yet earned' : "Badge earned on ".concat(new Date(createdAt).toLocaleDateString());
|
|
19573
|
+
if (!displayText) return null;
|
|
19591
19574
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
19592
|
-
style: containerStyle
|
|
19575
|
+
style: containerStyle,
|
|
19576
|
+
accessible: true,
|
|
19577
|
+
accessibilityRole: "text",
|
|
19578
|
+
accessibilityLabel: accessibilityLabel
|
|
19593
19579
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
19594
19580
|
variant: "label",
|
|
19595
19581
|
style: {
|
|
19596
19582
|
color: textColor
|
|
19597
|
-
}
|
|
19598
|
-
|
|
19583
|
+
},
|
|
19584
|
+
accessibilityElementsHidden: true,
|
|
19585
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19586
|
+
}, displayText));
|
|
19599
19587
|
};
|
|
19600
19588
|
|
|
19601
19589
|
var BadgeTileDescription = function () {
|
|
@@ -19604,11 +19592,17 @@ var BadgeTileDescription = function () {
|
|
|
19604
19592
|
var count = configuration.count,
|
|
19605
19593
|
description = configuration.description;
|
|
19606
19594
|
if (count === 0 || !description) return null;
|
|
19607
|
-
return /*#__PURE__*/React.createElement(
|
|
19595
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19596
|
+
accessible: true,
|
|
19597
|
+
accessibilityRole: "text",
|
|
19598
|
+
accessibilityLabel: "Badge description: ".concat(description)
|
|
19599
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19608
19600
|
variant: "body",
|
|
19609
19601
|
numberOfLines: 2,
|
|
19610
|
-
ellipsizeMode: "tail"
|
|
19611
|
-
|
|
19602
|
+
ellipsizeMode: "tail",
|
|
19603
|
+
accessibilityElementsHidden: true,
|
|
19604
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19605
|
+
}, description));
|
|
19612
19606
|
};
|
|
19613
19607
|
|
|
19614
19608
|
var BadgeTileMedia = function (_a) {
|
|
@@ -19644,13 +19638,22 @@ var BadgeTileStatus = function () {
|
|
|
19644
19638
|
if (type !== exports.BadgeTileType.Specific || count === 1) {
|
|
19645
19639
|
return null;
|
|
19646
19640
|
}
|
|
19641
|
+
var isLocked = count === 0;
|
|
19642
|
+
var statusLabel = isLocked ? 'Badge locked' : "Earned ".concat(count, " times");
|
|
19647
19643
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
19648
|
-
style: styles.indicatorContainer
|
|
19649
|
-
|
|
19644
|
+
style: styles.indicatorContainer,
|
|
19645
|
+
accessible: true,
|
|
19646
|
+
accessibilityRole: "text",
|
|
19647
|
+
accessibilityLabel: statusLabel
|
|
19648
|
+
}, isLocked ? /*#__PURE__*/React.createElement(Icon, {
|
|
19649
|
+
name: "LockKeyhole",
|
|
19650
19650
|
color: "#FFF",
|
|
19651
|
-
size: 20
|
|
19651
|
+
size: 20,
|
|
19652
|
+
accessibilityElementsHidden: true
|
|
19652
19653
|
}) : /*#__PURE__*/React.createElement(Text, {
|
|
19653
|
-
style: styles.countText
|
|
19654
|
+
style: styles.countText,
|
|
19655
|
+
accessibilityElementsHidden: true,
|
|
19656
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19654
19657
|
}, count, "x"));
|
|
19655
19658
|
};
|
|
19656
19659
|
|
|
@@ -19663,11 +19666,17 @@ var BadgeTileTitle = function () {
|
|
|
19663
19666
|
emptyBadgeMessage = configuration.emptyBadgeMessage;
|
|
19664
19667
|
var displayText = count === 0 ? emptyBadgeMessage : name;
|
|
19665
19668
|
if (!displayText) return null;
|
|
19666
|
-
return /*#__PURE__*/React.createElement(View$2,
|
|
19669
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19670
|
+
accessible: true,
|
|
19671
|
+
accessibilityRole: "header",
|
|
19672
|
+
accessibilityLabel: "Badge title: ".concat(displayText)
|
|
19673
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19667
19674
|
variant: "title",
|
|
19668
19675
|
style: styles.titleText,
|
|
19669
19676
|
numberOfLines: count === 0 ? 2 : 1,
|
|
19670
|
-
ellipsizeMode: "tail"
|
|
19677
|
+
ellipsizeMode: "tail",
|
|
19678
|
+
accessibilityElementsHidden: true,
|
|
19679
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19671
19680
|
}, displayText));
|
|
19672
19681
|
};
|
|
19673
19682
|
|
|
@@ -19681,7 +19690,7 @@ var BadgeTileRoot = function (_a) {
|
|
|
19681
19690
|
if (!tile) return null;
|
|
19682
19691
|
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19683
19692
|
tile: tile
|
|
19684
|
-
}, /*#__PURE__*/React.createElement(BadgeTile.Media, null, /*#__PURE__*/React.createElement(BadgeTile.Status, null)), /*#__PURE__*/React.createElement(
|
|
19693
|
+
}, /*#__PURE__*/React.createElement(BadgeTile.Media, null, /*#__PURE__*/React.createElement(BadgeTile.Status, null)), /*#__PURE__*/React.createElement(Layout, {
|
|
19685
19694
|
justify: "between",
|
|
19686
19695
|
align: "start"
|
|
19687
19696
|
}, /*#__PURE__*/React.createElement(BadgeTile.Title, null), /*#__PURE__*/React.createElement(BadgeTile.Description, null), /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(BadgeTile.DateEarned, null)));
|
|
@@ -19706,10 +19715,12 @@ var BannerTileCTA = function () {
|
|
|
19706
19715
|
ctaLinkTarget = _a.ctaLinkTarget;
|
|
19707
19716
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
19708
19717
|
if (!ctaText) return null;
|
|
19718
|
+
var hint = ctaLinkTarget === 'NEW_WINDOW' ? "Opens ".concat(ctaLink, " in a new window") : "Takes you to ".concat(ctaLink);
|
|
19709
19719
|
return /*#__PURE__*/React.createElement(Button, {
|
|
19710
19720
|
title: ctaText,
|
|
19711
19721
|
variant: "accent",
|
|
19712
|
-
onPress: handlePress
|
|
19722
|
+
onPress: handlePress,
|
|
19723
|
+
accessibilityHint: hint
|
|
19713
19724
|
});
|
|
19714
19725
|
};
|
|
19715
19726
|
|
|
@@ -19755,34 +19766,45 @@ var BannerTileDescription = function () {
|
|
|
19755
19766
|
var description = configuration.description;
|
|
19756
19767
|
var theme = useWllSdk().theme;
|
|
19757
19768
|
if (!description) return null;
|
|
19758
|
-
return /*#__PURE__*/React.createElement(
|
|
19769
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19770
|
+
accessible: true,
|
|
19771
|
+
accessibilityRole: "text",
|
|
19772
|
+
accessibilityLabel: description
|
|
19773
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19759
19774
|
style: [styles.description, {
|
|
19760
19775
|
color: theme.derivedSurfaceText[20]
|
|
19761
|
-
}]
|
|
19762
|
-
|
|
19776
|
+
}],
|
|
19777
|
+
accessibilityElementsHidden: true,
|
|
19778
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19779
|
+
}, description));
|
|
19763
19780
|
};
|
|
19764
19781
|
|
|
19765
19782
|
var BannerTileMedia = function (_a) {
|
|
19766
19783
|
var isArtworkOnly = _a.isArtworkOnly;
|
|
19767
19784
|
var styles = useBannerTileStyles();
|
|
19768
19785
|
var configuration = useBannerContext().configuration;
|
|
19769
|
-
var
|
|
19786
|
+
var _b = configuration,
|
|
19787
|
+
artworkUrl = _b.artworkUrl,
|
|
19788
|
+
title = _b.title;
|
|
19770
19789
|
if (!artworkUrl) return null;
|
|
19771
19790
|
var containerStyle = {
|
|
19772
19791
|
width: isArtworkOnly ? '100%' : '30%'
|
|
19773
19792
|
};
|
|
19774
|
-
return (
|
|
19775
|
-
|
|
19776
|
-
|
|
19777
|
-
|
|
19778
|
-
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
}
|
|
19785
|
-
|
|
19793
|
+
return /*#__PURE__*/React.createElement(View$2
|
|
19794
|
+
// @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
|
|
19795
|
+
, {
|
|
19796
|
+
style: [styles.mediaContainer, containerStyle],
|
|
19797
|
+
accessible: true,
|
|
19798
|
+
accessibilityRole: "image",
|
|
19799
|
+
accessibilityLabel: "Banner image".concat(title ? " for ".concat(title) : '')
|
|
19800
|
+
}, /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
19801
|
+
source: {
|
|
19802
|
+
uri: artworkUrl
|
|
19803
|
+
},
|
|
19804
|
+
style: styles.media,
|
|
19805
|
+
accessibilityElementsHidden: true,
|
|
19806
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19807
|
+
}));
|
|
19786
19808
|
};
|
|
19787
19809
|
|
|
19788
19810
|
var BannerTileTitle = function () {
|
|
@@ -19790,10 +19812,16 @@ var BannerTileTitle = function () {
|
|
|
19790
19812
|
var configuration = useBannerContext().configuration;
|
|
19791
19813
|
var title = configuration.title;
|
|
19792
19814
|
if (!title) return null;
|
|
19793
|
-
return /*#__PURE__*/React.createElement(
|
|
19815
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
19816
|
+
accessible: true,
|
|
19817
|
+
accessibilityRole: "header",
|
|
19818
|
+
accessibilityLabel: title
|
|
19819
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
19794
19820
|
variant: "title",
|
|
19795
|
-
style: styles.title
|
|
19796
|
-
|
|
19821
|
+
style: styles.title,
|
|
19822
|
+
accessibilityElementsHidden: true,
|
|
19823
|
+
importantForAccessibility: "no-hide-descendants"
|
|
19824
|
+
}, title));
|
|
19797
19825
|
};
|
|
19798
19826
|
|
|
19799
19827
|
/**
|
|
@@ -19813,15 +19841,12 @@ var isArtworkOnly$1 = function (configuration) {
|
|
|
19813
19841
|
var BannerTileRoot = function (_a) {
|
|
19814
19842
|
var tile = _a.tile;
|
|
19815
19843
|
if (!tile) return null;
|
|
19816
|
-
var styles = useBannerTileStyles();
|
|
19817
19844
|
var configuration = tile.configuration;
|
|
19818
19845
|
return /*#__PURE__*/React.createElement(BaseBanner, {
|
|
19819
19846
|
tile: tile
|
|
19820
19847
|
}, /*#__PURE__*/React.createElement(BannerTile.Media, {
|
|
19821
19848
|
isArtworkOnly: isArtworkOnly$1(configuration)
|
|
19822
|
-
}), /*#__PURE__*/React.createElement(
|
|
19823
|
-
style: styles.slideContent
|
|
19824
|
-
}, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
|
|
19849
|
+
}), /*#__PURE__*/React.createElement(FullFlex, null, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
|
|
19825
19850
|
};
|
|
19826
19851
|
/**
|
|
19827
19852
|
* The BannerTile component with subcomponents attached.
|
|
@@ -19838,6 +19863,11 @@ var ContentTileBody = function () {
|
|
|
19838
19863
|
return /*#__PURE__*/React.createElement(BaseTile.Body, null);
|
|
19839
19864
|
};
|
|
19840
19865
|
|
|
19866
|
+
var ContentTileContainer = function (_a) {
|
|
19867
|
+
var children = _a.children;
|
|
19868
|
+
return /*#__PURE__*/React.createElement(BaseTile.Container, null, children);
|
|
19869
|
+
};
|
|
19870
|
+
|
|
19841
19871
|
var useContentTileStyles = function () {
|
|
19842
19872
|
var theme = useWllSdk().theme;
|
|
19843
19873
|
var _a = useResponsive$1(),
|
|
@@ -19877,28 +19907,23 @@ var ContentTileMedia = function () {
|
|
|
19877
19907
|
});
|
|
19878
19908
|
};
|
|
19879
19909
|
|
|
19880
|
-
var ContentTileRoot = function (_a) {
|
|
19881
|
-
var children = _a.children;
|
|
19882
|
-
return /*#__PURE__*/React.createElement(BaseTile.Root, null, children);
|
|
19883
|
-
};
|
|
19884
|
-
|
|
19885
19910
|
/**
|
|
19886
|
-
* The ContentTile component renders a tile with a
|
|
19911
|
+
* The ContentTile component renders a tile with a container, media, content, header, and body.
|
|
19887
19912
|
*
|
|
19888
19913
|
* @param tile - The tile data to render.
|
|
19889
19914
|
*/
|
|
19890
|
-
var
|
|
19915
|
+
var ContentTileRoot = function (_a) {
|
|
19891
19916
|
var tile = _a.tile;
|
|
19892
19917
|
if (!tile) return null;
|
|
19893
19918
|
return /*#__PURE__*/React.createElement(BaseTile, {
|
|
19894
19919
|
tile: tile
|
|
19895
|
-
}, /*#__PURE__*/React.createElement(ContentTile.
|
|
19920
|
+
}, /*#__PURE__*/React.createElement(ContentTile.Container, null, /*#__PURE__*/React.createElement(ContentTile.Media, null), /*#__PURE__*/React.createElement(ContentTile.Content, null, /*#__PURE__*/React.createElement(ContentTile.Header, null), /*#__PURE__*/React.createElement(ContentTile.Body, null))));
|
|
19896
19921
|
};
|
|
19897
19922
|
/**
|
|
19898
19923
|
* The ContentTile component with subcomponents attached.
|
|
19899
19924
|
*/
|
|
19900
|
-
var ContentTile = Object.assign(
|
|
19901
|
-
|
|
19925
|
+
var ContentTile = Object.assign(ContentTileRoot, {
|
|
19926
|
+
Container: ContentTileContainer,
|
|
19902
19927
|
Media: ContentTileMedia,
|
|
19903
19928
|
Content: ContentTileContent,
|
|
19904
19929
|
Header: ContentTileHeader,
|
|
@@ -20128,10 +20153,9 @@ var Carousel = function (_a) {
|
|
|
20128
20153
|
dispatch = _c[1];
|
|
20129
20154
|
var currentIndex = state.currentIndex,
|
|
20130
20155
|
containerWidth = state.containerWidth;
|
|
20131
|
-
var
|
|
20156
|
+
var sortedTiles = sortByPriority(section.tiles.filter(function (tile) {
|
|
20132
20157
|
return tile.type === exports.TileType.Banner;
|
|
20133
|
-
});
|
|
20134
|
-
var sortedTiles = sortByPriority(bannerTiles);
|
|
20158
|
+
}));
|
|
20135
20159
|
var handleScroll = React.useCallback(function (event) {
|
|
20136
20160
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
20137
20161
|
var newIndex = contentOffsetX / containerWidth;
|
|
@@ -20473,8 +20497,14 @@ var useSectionData = function (section, sectionId) {
|
|
|
20473
20497
|
var EmptyState = function (_a) {
|
|
20474
20498
|
var message = _a.message;
|
|
20475
20499
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20476
|
-
style: commonStyles.emptyContainer
|
|
20477
|
-
|
|
20500
|
+
style: commonStyles.emptyContainer,
|
|
20501
|
+
accessible: true,
|
|
20502
|
+
accessibilityRole: "text",
|
|
20503
|
+
accessibilityLabel: "Empty state: ".concat(message)
|
|
20504
|
+
}, /*#__PURE__*/React.createElement(Text$3, {
|
|
20505
|
+
accessibilityElementsHidden: true,
|
|
20506
|
+
importantForAccessibility: "no-hide-descendants"
|
|
20507
|
+
}, message));
|
|
20478
20508
|
};
|
|
20479
20509
|
/**
|
|
20480
20510
|
* The Section component renders a section based on its type (e.g., Banner, Grid).
|
|
@@ -20494,7 +20524,13 @@ var Section = function (_a) {
|
|
|
20494
20524
|
var renderSectionContent = function () {
|
|
20495
20525
|
if (isLoading) {
|
|
20496
20526
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20497
|
-
style: commonStyles.emptyContainer
|
|
20527
|
+
style: commonStyles.emptyContainer,
|
|
20528
|
+
accessible: true,
|
|
20529
|
+
accessibilityRole: "none",
|
|
20530
|
+
accessibilityLabel: "Loading section content",
|
|
20531
|
+
accessibilityState: {
|
|
20532
|
+
busy: true
|
|
20533
|
+
}
|
|
20498
20534
|
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20499
20535
|
}
|
|
20500
20536
|
if (error || !sectionData) {
|
|
@@ -20523,48 +20559,62 @@ var Section = function (_a) {
|
|
|
20523
20559
|
sectionData: sectionData
|
|
20524
20560
|
}
|
|
20525
20561
|
}, /*#__PURE__*/React.createElement(View$2, {
|
|
20526
|
-
style: styles.section
|
|
20562
|
+
style: styles.section,
|
|
20563
|
+
accessible: true,
|
|
20564
|
+
accessibilityRole: "none",
|
|
20565
|
+
accessibilityLabel: "Section: ".concat(sectionData.title || 'Untitled section'),
|
|
20566
|
+
accessibilityHint: sectionData.description || undefined
|
|
20527
20567
|
}, renderSectionContent())) : null;
|
|
20528
20568
|
};
|
|
20529
20569
|
|
|
20530
|
-
|
|
20531
|
-
|
|
20532
|
-
|
|
20533
|
-
|
|
20534
|
-
|
|
20535
|
-
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
|
|
20539
|
-
|
|
20540
|
-
var Group = function (_a) {
|
|
20541
|
-
var id = _a.id;
|
|
20542
|
-
if (!id) return null;
|
|
20570
|
+
var GroupContext = /*#__PURE__*/React.createContext(undefined);
|
|
20571
|
+
var useGroupContext = function () {
|
|
20572
|
+
var context = React.useContext(GroupContext);
|
|
20573
|
+
if (!context) {
|
|
20574
|
+
throw new Error('useGroupContext must be used within a GroupProvider');
|
|
20575
|
+
}
|
|
20576
|
+
return context;
|
|
20577
|
+
};
|
|
20578
|
+
// Custom Hook for Group Data
|
|
20579
|
+
var useGroupData = function (id) {
|
|
20543
20580
|
var getGroupByID = useWllSdk().getGroupByID;
|
|
20581
|
+
var _a = React.useState(null),
|
|
20582
|
+
groupData = _a[0],
|
|
20583
|
+
setGroupData = _a[1];
|
|
20544
20584
|
var _b = React.useState(null),
|
|
20545
|
-
|
|
20546
|
-
|
|
20547
|
-
var _c = React.useState(
|
|
20548
|
-
|
|
20549
|
-
|
|
20585
|
+
error = _b[0],
|
|
20586
|
+
setError = _b[1];
|
|
20587
|
+
var _c = React.useState(true),
|
|
20588
|
+
isLoading = _c[0],
|
|
20589
|
+
setIsLoading = _c[1];
|
|
20550
20590
|
var fetchGroup = React.useCallback(function () {
|
|
20551
20591
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20552
20592
|
var response;
|
|
20553
20593
|
return __generator(this, function (_a) {
|
|
20554
20594
|
switch (_a.label) {
|
|
20555
20595
|
case 0:
|
|
20556
|
-
|
|
20596
|
+
setIsLoading(true);
|
|
20557
20597
|
setError(null);
|
|
20558
|
-
|
|
20598
|
+
_a.label = 1;
|
|
20559
20599
|
case 1:
|
|
20560
|
-
|
|
20561
|
-
|
|
20562
|
-
return [3 /*break*/, 3];
|
|
20600
|
+
_a.trys.push([1, 3, 4, 5]);
|
|
20601
|
+
return [4 /*yield*/, getGroupByID(id)];
|
|
20563
20602
|
case 2:
|
|
20603
|
+
response = _a.sent();
|
|
20604
|
+
if (response.status === 'success' && response.data) {
|
|
20605
|
+
setGroupData(response.data);
|
|
20606
|
+
} else {
|
|
20607
|
+
setError(response.error || 'Failed to fetch group data.');
|
|
20608
|
+
}
|
|
20609
|
+
return [3 /*break*/, 5];
|
|
20610
|
+
case 3:
|
|
20564
20611
|
_a.sent();
|
|
20565
20612
|
setError('Failed to fetch group data. Please try again later.');
|
|
20566
|
-
return [3 /*break*/,
|
|
20567
|
-
case
|
|
20613
|
+
return [3 /*break*/, 5];
|
|
20614
|
+
case 4:
|
|
20615
|
+
setIsLoading(false);
|
|
20616
|
+
return [7 /*endfinally*/];
|
|
20617
|
+
case 5:
|
|
20568
20618
|
return [2 /*return*/];
|
|
20569
20619
|
}
|
|
20570
20620
|
});
|
|
@@ -20573,35 +20623,51 @@ var Group = function (_a) {
|
|
|
20573
20623
|
React.useEffect(function () {
|
|
20574
20624
|
fetchGroup();
|
|
20575
20625
|
}, [fetchGroup]);
|
|
20576
|
-
|
|
20577
|
-
|
|
20626
|
+
return {
|
|
20627
|
+
groupData: groupData,
|
|
20628
|
+
isLoading: isLoading,
|
|
20629
|
+
error: error
|
|
20630
|
+
};
|
|
20631
|
+
};
|
|
20632
|
+
/**
|
|
20633
|
+
* A page-level component that represents a Group view in the application.
|
|
20634
|
+
*
|
|
20635
|
+
* This component serves as a container page that manages the fetching and display
|
|
20636
|
+
* of a group's data and its associated sections. It handles various states including
|
|
20637
|
+
* loading, errors, and empty states, providing a complete page experience for
|
|
20638
|
+
* viewing group content.
|
|
20639
|
+
*
|
|
20640
|
+
* @param id - The unique identifier of the group to fetch and display.
|
|
20641
|
+
*/
|
|
20642
|
+
var Group = function (_a) {
|
|
20643
|
+
var id = _a.id;
|
|
20644
|
+
if (!id) return null;
|
|
20645
|
+
var _b = useGroupData(id),
|
|
20646
|
+
groupData = _b.groupData,
|
|
20647
|
+
isLoading = _b.isLoading,
|
|
20648
|
+
error = _b.error;
|
|
20649
|
+
if (isLoading) {
|
|
20578
20650
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20579
20651
|
style: commonStyles.emptyContainer
|
|
20580
20652
|
}, /*#__PURE__*/React.createElement(Skeleton, null));
|
|
20581
20653
|
}
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
20587
|
-
variant: "body"
|
|
20588
|
-
}, error));
|
|
20589
|
-
}
|
|
20590
|
-
// Handle empty group data
|
|
20591
|
-
if (!groupData) {
|
|
20592
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
20593
|
-
style: commonStyles.emptyContainer
|
|
20594
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
20595
|
-
variant: "body"
|
|
20596
|
-
}, "No group data available"));
|
|
20654
|
+
if (error || !groupData) {
|
|
20655
|
+
return /*#__PURE__*/React.createElement(GroupEmptyState, {
|
|
20656
|
+
message: error || 'No group data available'
|
|
20657
|
+
});
|
|
20597
20658
|
}
|
|
20598
|
-
|
|
20659
|
+
return /*#__PURE__*/React.createElement(GroupContext.Provider, {
|
|
20660
|
+
value: {
|
|
20661
|
+
groupData: groupData
|
|
20662
|
+
}
|
|
20663
|
+
}, /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(GroupSections, null)));
|
|
20664
|
+
};
|
|
20665
|
+
var GroupSections = function () {
|
|
20666
|
+
var groupData = useGroupContext().groupData;
|
|
20599
20667
|
if (!groupData.sections || groupData.sections.length === 0) {
|
|
20600
|
-
return /*#__PURE__*/React.createElement(
|
|
20601
|
-
|
|
20602
|
-
}
|
|
20603
|
-
variant: "body"
|
|
20604
|
-
}, "No sections available"));
|
|
20668
|
+
return /*#__PURE__*/React.createElement(GroupEmptyState, {
|
|
20669
|
+
message: "This group doesn't have any sections"
|
|
20670
|
+
});
|
|
20605
20671
|
}
|
|
20606
20672
|
var sortedSections = sortByPriority(groupData.sections);
|
|
20607
20673
|
return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
|
|
@@ -20611,6 +20677,170 @@ var Group = function (_a) {
|
|
|
20611
20677
|
});
|
|
20612
20678
|
}));
|
|
20613
20679
|
};
|
|
20680
|
+
var GroupEmptyState = function (_a) {
|
|
20681
|
+
var message = _a.message;
|
|
20682
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20683
|
+
style: commonStyles.emptyContainer
|
|
20684
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20685
|
+
variant: "body"
|
|
20686
|
+
}, message));
|
|
20687
|
+
};
|
|
20688
|
+
|
|
20689
|
+
var justifyMap = {
|
|
20690
|
+
start: 'flex-start',
|
|
20691
|
+
end: 'flex-end',
|
|
20692
|
+
center: 'center',
|
|
20693
|
+
between: 'space-between',
|
|
20694
|
+
around: 'space-around',
|
|
20695
|
+
evenly: 'space-evenly'
|
|
20696
|
+
};
|
|
20697
|
+
var alignMap = {
|
|
20698
|
+
start: 'flex-start',
|
|
20699
|
+
end: 'flex-end',
|
|
20700
|
+
center: 'center',
|
|
20701
|
+
stretch: 'stretch',
|
|
20702
|
+
baseline: 'baseline'
|
|
20703
|
+
};
|
|
20704
|
+
|
|
20705
|
+
/**
|
|
20706
|
+
* A primitive Column component that extends Layout with vertical direction.
|
|
20707
|
+
* Provides a cleaner API for creating vertically aligned layouts.
|
|
20708
|
+
* @param reverse - When true, reverses the direction of the column (column-reverse)
|
|
20709
|
+
* @param justify - The justify content of the column
|
|
20710
|
+
* @param align - The align items of the column
|
|
20711
|
+
* @param flex - Optional flex number to control the column's flex behavior
|
|
20712
|
+
* @param style - Additional styles to apply to the column
|
|
20713
|
+
*/
|
|
20714
|
+
var Column = function (_a) {
|
|
20715
|
+
var children = _a.children,
|
|
20716
|
+
_b = _a.justify,
|
|
20717
|
+
justify = _b === void 0 ? 'start' : _b,
|
|
20718
|
+
_c = _a.align,
|
|
20719
|
+
align = _c === void 0 ? 'start' : _c,
|
|
20720
|
+
_d = _a.reverse,
|
|
20721
|
+
reverse = _d === void 0 ? false : _d,
|
|
20722
|
+
flex = _a.flex,
|
|
20723
|
+
style = _a.style,
|
|
20724
|
+
rest = __rest(_a, ["children", "justify", "align", "reverse", "flex", "style"]);
|
|
20725
|
+
var styles = StyleSheet$1.create({
|
|
20726
|
+
container: __assign({
|
|
20727
|
+
justifyContent: justifyMap[justify],
|
|
20728
|
+
alignItems: alignMap[align],
|
|
20729
|
+
flexDirection: reverse ? 'column-reverse' : 'column'
|
|
20730
|
+
}, flex !== undefined && {
|
|
20731
|
+
flex: flex
|
|
20732
|
+
})
|
|
20733
|
+
});
|
|
20734
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
20735
|
+
style: [styles.container, style]
|
|
20736
|
+
}, rest), children);
|
|
20737
|
+
};
|
|
20738
|
+
|
|
20739
|
+
/**
|
|
20740
|
+
* A FullFlex component that provides a flexible container with `flex: 1`.
|
|
20741
|
+
*
|
|
20742
|
+
* This component is commonly used to create a full-flex container that expands
|
|
20743
|
+
* to fill available space in a layout.
|
|
20744
|
+
*/
|
|
20745
|
+
var FullFlex = function (_a) {
|
|
20746
|
+
var children = _a.children,
|
|
20747
|
+
style = _a.style,
|
|
20748
|
+
rest = __rest(_a, ["children", "style"]);
|
|
20749
|
+
return /*#__PURE__*/React.createElement(View$2, _extends({
|
|
20750
|
+
style: [{
|
|
20751
|
+
flex: 1
|
|
20752
|
+
}, style]
|
|
20753
|
+
}, rest), children);
|
|
20754
|
+
};
|
|
20755
|
+
|
|
20756
|
+
/**
|
|
20757
|
+
* A primitive Layout component that provides flexible layout options.
|
|
20758
|
+
* @param direction - The direction of the layout (column or row)
|
|
20759
|
+
* @param justify - The justify content of the layout
|
|
20760
|
+
* @param align - The align items of the layout
|
|
20761
|
+
* @param style - Additional styles to apply to the layout
|
|
20762
|
+
* @param children - The child components to render inside the layout
|
|
20763
|
+
* @returns The rendered Layout component with special paddings
|
|
20764
|
+
*/
|
|
20765
|
+
var Layout = function (_a) {
|
|
20766
|
+
var children = _a.children,
|
|
20767
|
+
_b = _a.direction,
|
|
20768
|
+
direction = _b === void 0 ? 'column' : _b,
|
|
20769
|
+
_c = _a.justify,
|
|
20770
|
+
justify = _c === void 0 ? 'start' : _c,
|
|
20771
|
+
_d = _a.align,
|
|
20772
|
+
align = _d === void 0 ? 'start' : _d,
|
|
20773
|
+
_e = _a.style,
|
|
20774
|
+
style = _e === void 0 ? {} : _e,
|
|
20775
|
+
rest = __rest(_a, ["children", "direction", "justify", "align", "style"]);
|
|
20776
|
+
var theme = useWllSdk().theme;
|
|
20777
|
+
var _f = useResponsive$1(),
|
|
20778
|
+
isDesktop = _f.isDesktop,
|
|
20779
|
+
isTablet = _f.isTablet;
|
|
20780
|
+
var dynamicStyles = StyleSheet$1.create({
|
|
20781
|
+
container: {
|
|
20782
|
+
flex: 1,
|
|
20783
|
+
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
20784
|
+
paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
20785
|
+
justifyContent: justifyMap[justify],
|
|
20786
|
+
alignItems: alignMap[align],
|
|
20787
|
+
flexDirection: direction
|
|
20788
|
+
}
|
|
20789
|
+
});
|
|
20790
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
20791
|
+
style: [dynamicStyles.container, style]
|
|
20792
|
+
}, rest), children);
|
|
20793
|
+
};
|
|
20794
|
+
|
|
20795
|
+
/**
|
|
20796
|
+
* A primitive Row component that extends Layout with horizontal direction.
|
|
20797
|
+
* Provides a cleaner API for creating horizontally aligned layouts.
|
|
20798
|
+
* @param reverse - When true, reverses the direction of the row (row-reverse)
|
|
20799
|
+
* @param justify - The justify content of the row
|
|
20800
|
+
* @param align - The align items of the row
|
|
20801
|
+
* @param flex - Optional flex number to control the row's flex behavior
|
|
20802
|
+
* @param style - Additional styles to apply to the row
|
|
20803
|
+
*/
|
|
20804
|
+
var Row = function (_a) {
|
|
20805
|
+
var children = _a.children,
|
|
20806
|
+
_b = _a.justify,
|
|
20807
|
+
justify = _b === void 0 ? 'start' : _b,
|
|
20808
|
+
_c = _a.align,
|
|
20809
|
+
align = _c === void 0 ? 'center' : _c,
|
|
20810
|
+
_d = _a.reverse,
|
|
20811
|
+
reverse = _d === void 0 ? false : _d,
|
|
20812
|
+
flex = _a.flex,
|
|
20813
|
+
style = _a.style,
|
|
20814
|
+
rest = __rest(_a, ["children", "justify", "align", "reverse", "flex", "style"]);
|
|
20815
|
+
var styles = StyleSheet$1.create({
|
|
20816
|
+
container: __assign({
|
|
20817
|
+
justifyContent: justifyMap[justify],
|
|
20818
|
+
alignItems: alignMap[align],
|
|
20819
|
+
flexDirection: reverse ? 'row-reverse' : 'row'
|
|
20820
|
+
}, flex !== undefined && {
|
|
20821
|
+
flex: flex
|
|
20822
|
+
})
|
|
20823
|
+
});
|
|
20824
|
+
return /*#__PURE__*/React__namespace.createElement(View$2, _extends({
|
|
20825
|
+
style: [styles.container, style]
|
|
20826
|
+
}, rest), children);
|
|
20827
|
+
};
|
|
20828
|
+
|
|
20829
|
+
/**
|
|
20830
|
+
* A simple Spacer component that creates flexible space in layouts.
|
|
20831
|
+
*
|
|
20832
|
+
* The Spacer is commonly used in flexbox layouts to create adjustable empty space
|
|
20833
|
+
* between child elements, avoiding the need for explicit margins or padding.
|
|
20834
|
+
*/
|
|
20835
|
+
var Spacer = function (_a) {
|
|
20836
|
+
var style = _a.style,
|
|
20837
|
+
rest = __rest(_a, ["style"]);
|
|
20838
|
+
return /*#__PURE__*/React.createElement(View$2, _extends({
|
|
20839
|
+
style: [{
|
|
20840
|
+
flex: 1
|
|
20841
|
+
}, style]
|
|
20842
|
+
}, rest));
|
|
20843
|
+
};
|
|
20614
20844
|
|
|
20615
20845
|
var usePointsTileStyles = function (isFullSize) {
|
|
20616
20846
|
var _a = useResponsive$1(),
|
|
@@ -20626,7 +20856,6 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
20626
20856
|
justifyContent: 'space-between'
|
|
20627
20857
|
},
|
|
20628
20858
|
contentContainer: {
|
|
20629
|
-
flexDirection: 'column',
|
|
20630
20859
|
width: isFullSize ? '100%' : 'auto'
|
|
20631
20860
|
},
|
|
20632
20861
|
suffix: {
|
|
@@ -20656,6 +20885,11 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
20656
20885
|
});
|
|
20657
20886
|
};
|
|
20658
20887
|
|
|
20888
|
+
var TextProps = {
|
|
20889
|
+
variant: 'caption',
|
|
20890
|
+
accessibilityElementsHidden: true,
|
|
20891
|
+
importantForAccessibility: 'no-hide-descendants'
|
|
20892
|
+
};
|
|
20659
20893
|
var PointsTileFormattedPoints = function () {
|
|
20660
20894
|
var styles = usePointsTileStyles();
|
|
20661
20895
|
var configuration = useTileContext().configuration;
|
|
@@ -20669,36 +20903,56 @@ var PointsTileFormattedPoints = function () {
|
|
|
20669
20903
|
points = _a.points;
|
|
20670
20904
|
if (points === undefined) return null;
|
|
20671
20905
|
var calculatedPoints = points * multiplier;
|
|
20672
|
-
|
|
20673
|
-
|
|
20674
|
-
|
|
20906
|
+
var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix);
|
|
20907
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20908
|
+
accessible: true,
|
|
20909
|
+
accessibilityRole: "text",
|
|
20910
|
+
accessibilityLabel: "Points value: ".concat(fullPointsText)
|
|
20911
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
20912
|
+
align: "center",
|
|
20913
|
+
justify: "start"
|
|
20914
|
+
}, /*#__PURE__*/React.createElement(Text, TextProps, pointsPrefix, calculatedPoints), pointsSuffix && /*#__PURE__*/React.createElement(Text, _extends({}, TextProps, {
|
|
20675
20915
|
style: styles.suffix
|
|
20676
|
-
}, pointsSuffix)));
|
|
20916
|
+
}), pointsSuffix)));
|
|
20677
20917
|
};
|
|
20678
20918
|
|
|
20679
20919
|
var PointsTileMedia = function (_a) {
|
|
20680
20920
|
var isFullSize = _a.isFullSize;
|
|
20681
20921
|
var configuration = useTileContext().configuration;
|
|
20682
|
-
var
|
|
20922
|
+
var _b = configuration,
|
|
20923
|
+
artworkUrl = _b.artworkUrl,
|
|
20924
|
+
title = _b.title;
|
|
20683
20925
|
var styles = usePointsTileStyles(isFullSize);
|
|
20684
20926
|
if (!artworkUrl) return null;
|
|
20685
20927
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20686
|
-
style: styles.imageContainer
|
|
20928
|
+
style: styles.imageContainer,
|
|
20929
|
+
accessible: true,
|
|
20930
|
+
accessibilityRole: "image",
|
|
20931
|
+
accessibilityLabel: "Points tile image".concat(title ? " for ".concat(title) : '')
|
|
20687
20932
|
}, /*#__PURE__*/React.createElement(Image$2, {
|
|
20688
20933
|
source: {
|
|
20689
20934
|
uri: artworkUrl
|
|
20690
20935
|
},
|
|
20691
20936
|
style: styles.image,
|
|
20692
|
-
resizeMode: "contain"
|
|
20937
|
+
resizeMode: "contain",
|
|
20938
|
+
accessibilityElementsHidden: true,
|
|
20939
|
+
importantForAccessibility: "no-hide-descendants"
|
|
20693
20940
|
}));
|
|
20694
20941
|
};
|
|
20695
20942
|
|
|
20696
20943
|
var PointsTileTitle = function () {
|
|
20697
20944
|
var configuration = useTileContext().configuration;
|
|
20698
20945
|
var title = configuration.title;
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
20946
|
+
if (!title) return null;
|
|
20947
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
20948
|
+
accessible: true,
|
|
20949
|
+
accessibilityRole: "header",
|
|
20950
|
+
accessibilityLabel: title
|
|
20951
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20952
|
+
variant: "eyebrow",
|
|
20953
|
+
accessibilityElementsHidden: true,
|
|
20954
|
+
importantForAccessibility: "no-hide-descendants"
|
|
20955
|
+
}, title));
|
|
20702
20956
|
};
|
|
20703
20957
|
|
|
20704
20958
|
/**
|
|
@@ -20719,7 +20973,7 @@ var PointsTileRoot = function (_a) {
|
|
|
20719
20973
|
style: styles.container
|
|
20720
20974
|
}, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
|
|
20721
20975
|
isFullSize: false
|
|
20722
|
-
}), /*#__PURE__*/React.createElement(
|
|
20976
|
+
}), /*#__PURE__*/React.createElement(Column, {
|
|
20723
20977
|
style: styles.contentContainer
|
|
20724
20978
|
}, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
|
|
20725
20979
|
};
|
|
@@ -20775,26 +21029,34 @@ var RewardCategoryHeader = function () {
|
|
|
20775
21029
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20776
21030
|
style: [styles.header, {
|
|
20777
21031
|
backgroundColor: theme.primary
|
|
20778
|
-
}]
|
|
21032
|
+
}],
|
|
21033
|
+
accessible: true,
|
|
21034
|
+
accessibilityRole: "header",
|
|
21035
|
+
accessibilityLabel: "Reward category: ".concat(name)
|
|
20779
21036
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
20780
21037
|
style: [styles.headerText, {
|
|
20781
21038
|
color: theme.primaryText
|
|
20782
21039
|
}],
|
|
20783
21040
|
ellipsizeMode: "tail",
|
|
20784
|
-
numberOfLines: 1
|
|
21041
|
+
numberOfLines: 1,
|
|
21042
|
+
accessibilityElementsHidden: true,
|
|
21043
|
+
importantForAccessibility: "no-hide-descendants"
|
|
20785
21044
|
}, name));
|
|
20786
21045
|
};
|
|
20787
21046
|
|
|
20788
21047
|
var RewardCategoryMedia = function () {
|
|
20789
21048
|
var styles = useRewardCategoryTileStyles();
|
|
20790
21049
|
var configuration = useTileContext().configuration;
|
|
20791
|
-
var
|
|
21050
|
+
var _a = configuration,
|
|
21051
|
+
artworkUrl = _a.artworkUrl,
|
|
21052
|
+
name = _a.name;
|
|
20792
21053
|
if (!artworkUrl) return null;
|
|
20793
21054
|
return /*#__PURE__*/React.createElement(ProgressiveImage, {
|
|
20794
21055
|
source: {
|
|
20795
21056
|
uri: artworkUrl
|
|
20796
21057
|
},
|
|
20797
|
-
style: styles.background
|
|
21058
|
+
style: styles.background,
|
|
21059
|
+
alt: name
|
|
20798
21060
|
});
|
|
20799
21061
|
};
|
|
20800
21062
|
|
|
@@ -20864,6 +21126,7 @@ var useRewardTileStyles = function () {
|
|
|
20864
21126
|
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
|
|
20865
21127
|
},
|
|
20866
21128
|
header: {
|
|
21129
|
+
width: '100%',
|
|
20867
21130
|
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
|
|
20868
21131
|
}
|
|
20869
21132
|
});
|
|
@@ -20911,23 +21174,36 @@ var RewardTilePoints = function () {
|
|
|
20911
21174
|
if (!showPrice || price === undefined) return null;
|
|
20912
21175
|
// Calculate points
|
|
20913
21176
|
var calculatedPoints = price * Number(pointsMultiplier);
|
|
20914
|
-
|
|
21177
|
+
var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix);
|
|
21178
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21179
|
+
accessible: true,
|
|
21180
|
+
accessibilityRole: "text",
|
|
21181
|
+
accessibilityLabel: "Reward points: ".concat(fullPointsText)
|
|
21182
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
20915
21183
|
variant: "caption",
|
|
20916
|
-
style: styles.footer
|
|
21184
|
+
style: styles.footer,
|
|
21185
|
+
accessibilityElementsHidden: true,
|
|
21186
|
+
importantForAccessibility: "no-hide-descendants"
|
|
20917
21187
|
}, pointsPrefix, /*#__PURE__*/React.createElement(View$2, {
|
|
20918
21188
|
style: styles.pointsContainer
|
|
20919
21189
|
}, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
|
|
20920
21190
|
style: styles.suffix
|
|
20921
|
-
}, pointsSuffix)));
|
|
21191
|
+
}, pointsSuffix))));
|
|
20922
21192
|
};
|
|
20923
21193
|
|
|
20924
21194
|
var RewardTileSummary = function () {
|
|
20925
21195
|
var configuration = useTileContext().configuration;
|
|
20926
21196
|
var summary = configuration.summary;
|
|
20927
21197
|
if (!summary) return null;
|
|
20928
|
-
return /*#__PURE__*/React.createElement(
|
|
20929
|
-
|
|
20930
|
-
|
|
21198
|
+
return /*#__PURE__*/React.createElement(View$2, {
|
|
21199
|
+
accessible: true,
|
|
21200
|
+
accessibilityRole: "text",
|
|
21201
|
+
accessibilityLabel: summary
|
|
21202
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
21203
|
+
variant: "body",
|
|
21204
|
+
accessibilityElementsHidden: true,
|
|
21205
|
+
importantForAccessibility: "no-hide-descendants"
|
|
21206
|
+
}, summary));
|
|
20931
21207
|
};
|
|
20932
21208
|
|
|
20933
21209
|
var RewardTileTitle = function () {
|
|
@@ -20964,7 +21240,7 @@ var RewardTileRoot = function (_a) {
|
|
|
20964
21240
|
tile: tile
|
|
20965
21241
|
}, /*#__PURE__*/React.createElement(RewardTile.Media, {
|
|
20966
21242
|
isArtworkOnly: isArtworkOnly(configuration)
|
|
20967
|
-
}), /*#__PURE__*/React.createElement(
|
|
21243
|
+
}), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Row, {
|
|
20968
21244
|
justify: "between",
|
|
20969
21245
|
align: "center",
|
|
20970
21246
|
style: styles.header
|
|
@@ -20982,169 +21258,6 @@ var RewardTile = Object.assign(RewardTileRoot, {
|
|
|
20982
21258
|
});
|
|
20983
21259
|
var RewardTile$1 = withTileFetching(RewardTile);
|
|
20984
21260
|
|
|
20985
|
-
var justifyMap = {
|
|
20986
|
-
start: 'flex-start',
|
|
20987
|
-
end: 'flex-end',
|
|
20988
|
-
center: 'center',
|
|
20989
|
-
between: 'space-between',
|
|
20990
|
-
around: 'space-around',
|
|
20991
|
-
evenly: 'space-evenly'
|
|
20992
|
-
};
|
|
20993
|
-
var alignMap = {
|
|
20994
|
-
start: 'flex-start',
|
|
20995
|
-
end: 'flex-end',
|
|
20996
|
-
center: 'center',
|
|
20997
|
-
stretch: 'stretch',
|
|
20998
|
-
baseline: 'baseline'
|
|
20999
|
-
};
|
|
21000
|
-
|
|
21001
|
-
/**
|
|
21002
|
-
* A Column layout component that arranges its children in a vertical stack.
|
|
21003
|
-
*
|
|
21004
|
-
* @param children - The child components to render inside the column.
|
|
21005
|
-
* @param justify - Defines how children are aligned along the main axis.
|
|
21006
|
-
* @param align - Defines how children are aligned along the cross axis.
|
|
21007
|
-
* @param style - Additional styles to apply to the container.
|
|
21008
|
-
*/
|
|
21009
|
-
var Column = /*#__PURE__*/React.memo(function (_a) {
|
|
21010
|
-
var _b, _c;
|
|
21011
|
-
var children = _a.children,
|
|
21012
|
-
_d = _a.justify,
|
|
21013
|
-
justify = _d === void 0 ? 'start' : _d,
|
|
21014
|
-
_e = _a.align,
|
|
21015
|
-
align = _e === void 0 ? 'stretch' : _e,
|
|
21016
|
-
style = _a.style;
|
|
21017
|
-
var _f = useResponsive$1(),
|
|
21018
|
-
isDesktop = _f.isDesktop,
|
|
21019
|
-
isTablet = _f.isTablet;
|
|
21020
|
-
var theme = useWllSdk().theme;
|
|
21021
|
-
var spacing = useResponsiveValue((_b = theme === null || theme === void 0 ? void 0 : theme.sizes) === null || _b === void 0 ? void 0 : _b.sm, (_c = theme === null || theme === void 0 ? void 0 : theme.sizes) === null || _c === void 0 ? void 0 : _c.xxxs, isDesktop, isTablet);
|
|
21022
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
21023
|
-
style: [{
|
|
21024
|
-
flex: 1,
|
|
21025
|
-
flexDirection: 'column',
|
|
21026
|
-
justifyContent: justifyMap[justify],
|
|
21027
|
-
alignItems: alignMap[align],
|
|
21028
|
-
paddingHorizontal: spacing,
|
|
21029
|
-
paddingBottom: spacing
|
|
21030
|
-
}, style]
|
|
21031
|
-
}, children);
|
|
21032
|
-
});
|
|
21033
|
-
|
|
21034
|
-
/**
|
|
21035
|
-
* A FlexBox component that provides a flexible container with `flex: 1`.
|
|
21036
|
-
*
|
|
21037
|
-
* This component is commonly used to create a full-flex container that expands
|
|
21038
|
-
* to fill available space in a layout.
|
|
21039
|
-
*/
|
|
21040
|
-
var FlexBox = function (_a) {
|
|
21041
|
-
var children = _a.children,
|
|
21042
|
-
style = _a.style;
|
|
21043
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
21044
|
-
style: [{
|
|
21045
|
-
flex: 1
|
|
21046
|
-
}, style]
|
|
21047
|
-
}, children);
|
|
21048
|
-
};
|
|
21049
|
-
|
|
21050
|
-
var Layout = function (_a) {
|
|
21051
|
-
var children = _a.children,
|
|
21052
|
-
_b = _a.justify,
|
|
21053
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
21054
|
-
_c = _a.align,
|
|
21055
|
-
align = _c === void 0 ? 'stretch' : _c,
|
|
21056
|
-
_d = _a.direction,
|
|
21057
|
-
direction = _d === void 0 ? 'column' : _d,
|
|
21058
|
-
_e = _a.style,
|
|
21059
|
-
style = _e === void 0 ? {} : _e;
|
|
21060
|
-
var theme = useWllSdk().theme;
|
|
21061
|
-
var _f = useResponsive$1(),
|
|
21062
|
-
isDesktop = _f.isDesktop,
|
|
21063
|
-
isTablet = _f.isTablet;
|
|
21064
|
-
var dynamicStyles = StyleSheet$1.create({
|
|
21065
|
-
column: {
|
|
21066
|
-
flex: 1,
|
|
21067
|
-
paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21068
|
-
paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
|
|
21069
|
-
justifyContent: justifyMap[justify],
|
|
21070
|
-
alignItems: alignMap[align],
|
|
21071
|
-
flexDirection: direction
|
|
21072
|
-
}
|
|
21073
|
-
});
|
|
21074
|
-
return /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21075
|
-
style: [dynamicStyles.column, style]
|
|
21076
|
-
}, children);
|
|
21077
|
-
};
|
|
21078
|
-
|
|
21079
|
-
/**
|
|
21080
|
-
* A Row layout component that arranges its children in a horizontal stack.
|
|
21081
|
-
*
|
|
21082
|
-
* @param children - The child components to render inside the row.
|
|
21083
|
-
* @param justify - Defines how children are aligned along the main axis (horizontal).
|
|
21084
|
-
* @param align - Defines how children are aligned along the cross axis (vertical).
|
|
21085
|
-
* @param direction - The flex direction for the row (default is 'row').
|
|
21086
|
-
* @param style - Additional styles to apply to the container.
|
|
21087
|
-
*/
|
|
21088
|
-
var Row = function (_a) {
|
|
21089
|
-
var children = _a.children,
|
|
21090
|
-
_b = _a.justify,
|
|
21091
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
21092
|
-
_c = _a.align,
|
|
21093
|
-
align = _c === void 0 ? 'center' : _c,
|
|
21094
|
-
_d = _a.direction,
|
|
21095
|
-
direction = _d === void 0 ? 'row' : _d,
|
|
21096
|
-
style = _a.style;
|
|
21097
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
21098
|
-
style: [{
|
|
21099
|
-
flexDirection: direction,
|
|
21100
|
-
justifyContent: justifyMap[justify],
|
|
21101
|
-
alignItems: alignMap[align]
|
|
21102
|
-
}, style]
|
|
21103
|
-
}, children);
|
|
21104
|
-
};
|
|
21105
|
-
|
|
21106
|
-
/**
|
|
21107
|
-
* A simple Spacer component that creates flexible space in layouts.
|
|
21108
|
-
*
|
|
21109
|
-
* The Spacer is commonly used in flexbox layouts to create adjustable empty space
|
|
21110
|
-
* between child elements, avoiding the need for explicit margins or padding.
|
|
21111
|
-
*/
|
|
21112
|
-
var Spacer = function (_a) {
|
|
21113
|
-
var style = _a.style;
|
|
21114
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
21115
|
-
style: [{
|
|
21116
|
-
flex: 1
|
|
21117
|
-
}, style]
|
|
21118
|
-
});
|
|
21119
|
-
};
|
|
21120
|
-
|
|
21121
|
-
/**
|
|
21122
|
-
* A Stack layout component that arranges its children in a flexible stack.
|
|
21123
|
-
*
|
|
21124
|
-
* @param children - The child components to render inside the stack.
|
|
21125
|
-
* @param justify - Defines how children are aligned along the main axis.
|
|
21126
|
-
* @param align - Defines how children are aligned along the cross axis.
|
|
21127
|
-
* @param direction - The flex direction for the stack (default is 'column').
|
|
21128
|
-
* @param style - Additional styles to apply to the container.
|
|
21129
|
-
*/
|
|
21130
|
-
var Stack = function (_a) {
|
|
21131
|
-
var children = _a.children,
|
|
21132
|
-
_b = _a.justify,
|
|
21133
|
-
justify = _b === void 0 ? 'start' : _b,
|
|
21134
|
-
_c = _a.align,
|
|
21135
|
-
align = _c === void 0 ? 'stretch' : _c,
|
|
21136
|
-
_d = _a.direction,
|
|
21137
|
-
direction = _d === void 0 ? 'column' : _d,
|
|
21138
|
-
style = _a.style;
|
|
21139
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
21140
|
-
style: [{
|
|
21141
|
-
flexDirection: direction,
|
|
21142
|
-
justifyContent: justifyMap[justify],
|
|
21143
|
-
alignItems: alignMap[align]
|
|
21144
|
-
}, style]
|
|
21145
|
-
}, children);
|
|
21146
|
-
};
|
|
21147
|
-
|
|
21148
21261
|
var useTierTileStyles = function () {
|
|
21149
21262
|
var _a = useResponsive$1(),
|
|
21150
21263
|
isDesktop = _a.isDesktop,
|
|
@@ -21227,8 +21340,7 @@ var TierTileFull = function (_a) {
|
|
|
21227
21340
|
resizeMode: "center"
|
|
21228
21341
|
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
21229
21342
|
align: "stretch",
|
|
21230
|
-
justify: artworkUrl ? 'start' : 'center'
|
|
21231
|
-
direction: "column"
|
|
21343
|
+
justify: artworkUrl ? 'start' : 'center'
|
|
21232
21344
|
}, /*#__PURE__*/React__namespace.createElement(View$2, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21233
21345
|
variant: "eyebrow",
|
|
21234
21346
|
style: styles.title
|
|
@@ -21299,16 +21411,12 @@ var TierTileEmpty = function (_a) {
|
|
|
21299
21411
|
style: {
|
|
21300
21412
|
paddingTop: 16
|
|
21301
21413
|
}
|
|
21302
|
-
}, /*#__PURE__*/React__namespace.createElement(
|
|
21303
|
-
style: {
|
|
21304
|
-
flex: 1
|
|
21305
|
-
}
|
|
21306
|
-
}, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21414
|
+
}, /*#__PURE__*/React__namespace.createElement(FullFlex, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21307
21415
|
variant: "title",
|
|
21308
21416
|
style: styles.title
|
|
21309
21417
|
}, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21310
21418
|
variant: "body"
|
|
21311
|
-
}, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(
|
|
21419
|
+
}, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
21312
21420
|
style: styles.smallImageContainer
|
|
21313
21421
|
}, /*#__PURE__*/React__namespace.createElement(Image$2, {
|
|
21314
21422
|
source: {
|
|
@@ -21330,9 +21438,8 @@ var TierTileEmpty = function (_a) {
|
|
|
21330
21438
|
resizeMode: "center"
|
|
21331
21439
|
})), /*#__PURE__*/React__namespace.createElement(Layout, {
|
|
21332
21440
|
align: "stretch",
|
|
21333
|
-
justify: "center"
|
|
21334
|
-
|
|
21335
|
-
}, /*#__PURE__*/React__namespace.createElement(Column, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21441
|
+
justify: "center"
|
|
21442
|
+
}, /*#__PURE__*/React__namespace.createElement(Layout, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
21336
21443
|
variant: "title",
|
|
21337
21444
|
style: styles.title
|
|
21338
21445
|
}, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
|
|
@@ -21398,11 +21505,12 @@ exports.Carousel = Carousel;
|
|
|
21398
21505
|
exports.Column = Column;
|
|
21399
21506
|
exports.ContentTile = ContentTile$1;
|
|
21400
21507
|
exports.ContentTileConfig = ContentTileConfig;
|
|
21401
|
-
exports.
|
|
21508
|
+
exports.FullFlex = FullFlex;
|
|
21402
21509
|
exports.Grid = Grid;
|
|
21403
21510
|
exports.Group = Group;
|
|
21404
21511
|
exports.Icon = Icon;
|
|
21405
21512
|
exports.Indicator = Indicator;
|
|
21513
|
+
exports.Layout = Layout;
|
|
21406
21514
|
exports.LoadingIndicator = LoadingIndicator;
|
|
21407
21515
|
exports.PointsTile = PointsTile$1;
|
|
21408
21516
|
exports.PointsTileConfig = PointsTileConfig;
|
|
@@ -21415,12 +21523,10 @@ exports.RewardCategoryTileConfig = RewardCategoryTileConfig;
|
|
|
21415
21523
|
exports.RewardTile = RewardTile$1;
|
|
21416
21524
|
exports.RewardTileConfig = RewardTileConfig;
|
|
21417
21525
|
exports.Row = Row;
|
|
21418
|
-
exports.RowHeader = RowHeader;
|
|
21419
21526
|
exports.Section = Section;
|
|
21420
21527
|
exports.SectionHeader = SectionHeader;
|
|
21421
21528
|
exports.Skeleton = Skeleton;
|
|
21422
21529
|
exports.Spacer = Spacer;
|
|
21423
|
-
exports.Stack = Stack;
|
|
21424
21530
|
exports.Text = Text;
|
|
21425
21531
|
exports.TierTileConfig = TierTileConfig;
|
|
21426
21532
|
exports.TierTileUpdated = TierTile;
|