@wlloyalty/wll-react-sdk 1.0.103 → 1.0.105
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 +1 -0
- package/dist/native.js +149 -69
- package/dist/native.js.map +1 -1
- package/dist/types/mocks/tiles/badgeTile.d.ts +1 -0
- package/dist/types/types/tile.d.ts +1 -0
- package/dist/types/utils/transforms.d.ts +13 -0
- package/dist/web.js +178 -86
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/native.js
CHANGED
|
@@ -2312,13 +2312,12 @@ var ProgressiveImage = function (_a) {
|
|
|
2312
2312
|
var baseColor = theme.alphaDerivedPrimary[20];
|
|
2313
2313
|
var desaturatedColor = desaturateColor(baseColor);
|
|
2314
2314
|
var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
|
|
2315
|
-
// Create base animated image
|
|
2316
2315
|
var baseImage = (jsxRuntimeExports.jsx(reactNative.Animated.Image, __assign({}, props, { source: source, style: [
|
|
2317
2316
|
styles$7.imageOverlay,
|
|
2318
2317
|
__assign({ opacity: imageAnimated }, (IS_WEB && {
|
|
2319
2318
|
filter: isDesaturated ? 'grayscale(100%)' : undefined,
|
|
2320
2319
|
})),
|
|
2321
|
-
], onLoad: onImageLoad, accessibilityLabel: alt })));
|
|
2320
|
+
], onLoad: onImageLoad, accessibilityLabel: alt, accessible: true, role: "img" })));
|
|
2322
2321
|
return (jsxRuntimeExports.jsxs(reactNative.View, { style: [styles$7.container, style, { backgroundColor: backgroundColor }], children: [jsxRuntimeExports.jsx(reactNative.Animated.View, { style: [
|
|
2323
2322
|
styles$7.imageOverlay,
|
|
2324
2323
|
{
|
|
@@ -2405,13 +2404,35 @@ var Text = function (_a) {
|
|
|
2405
2404
|
}
|
|
2406
2405
|
: {},
|
|
2407
2406
|
});
|
|
2407
|
+
// Determine appropriate accessibility role based on variant
|
|
2408
|
+
// This helps screen readers understand the semantic meaning
|
|
2409
|
+
var accessibilityRole;
|
|
2410
|
+
switch (variant) {
|
|
2411
|
+
case 'title':
|
|
2412
|
+
accessibilityRole = 'header';
|
|
2413
|
+
break;
|
|
2414
|
+
case 'caption':
|
|
2415
|
+
accessibilityRole = 'text';
|
|
2416
|
+
break;
|
|
2417
|
+
case 'eyebrow':
|
|
2418
|
+
accessibilityRole = 'text';
|
|
2419
|
+
break;
|
|
2420
|
+
case 'description':
|
|
2421
|
+
accessibilityRole = 'paragraph';
|
|
2422
|
+
break;
|
|
2423
|
+
case 'label':
|
|
2424
|
+
accessibilityRole = 'text';
|
|
2425
|
+
break;
|
|
2426
|
+
default:
|
|
2427
|
+
accessibilityRole = 'text';
|
|
2428
|
+
}
|
|
2408
2429
|
var combinedStyles = [
|
|
2409
2430
|
styles.base,
|
|
2410
2431
|
variantStyle,
|
|
2411
2432
|
styles.webOverrides,
|
|
2412
2433
|
style,
|
|
2413
2434
|
];
|
|
2414
|
-
return jsxRuntimeExports.jsx(reactNative.Text, __assign({ style: combinedStyles }, props));
|
|
2435
|
+
return (jsxRuntimeExports.jsx(reactNative.Text, __assign({ style: combinedStyles }, props, { accessible: true, role: accessibilityRole })));
|
|
2415
2436
|
};
|
|
2416
2437
|
|
|
2417
2438
|
var MAX_WIDTH = 1080;
|
|
@@ -2592,19 +2613,26 @@ var BaseBanner = function (_a) {
|
|
|
2592
2613
|
var _b = tile.configuration, ctaLink = _b.ctaLink, ctaLinkTarget = _b.ctaLinkTarget, title = _b.title, ctaText = _b.ctaText;
|
|
2593
2614
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
2594
2615
|
var hasCTA = Boolean(ctaText);
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2616
|
+
var isInteractive = Boolean(ctaLink && !hasCTA);
|
|
2617
|
+
var commonStyles = [
|
|
2618
|
+
styles$6.container,
|
|
2619
|
+
style,
|
|
2620
|
+
{
|
|
2621
|
+
backgroundColor: theme.surface,
|
|
2622
|
+
borderRadius: theme.sizes.borderRadiusLg,
|
|
2623
|
+
},
|
|
2624
|
+
];
|
|
2625
|
+
if (isInteractive) {
|
|
2626
|
+
return (jsxRuntimeExports.jsx(BannerContext.Provider, { value: tile, children: jsxRuntimeExports.jsx(reactNative.Pressable, { testID: testID || 'banner-tile', style: function (_a) {
|
|
2627
|
+
var pressed = _a.pressed;
|
|
2628
|
+
return __spreadArray(__spreadArray([], commonStyles, true), [
|
|
2629
|
+
{ opacity: pressed ? 0.7 : 1 },
|
|
2630
|
+
], false);
|
|
2631
|
+
}, onPress: handlePress, accessible: true, role: "button", accessibilityLabel: accessibilityLabel || "".concat(title, " - Click to open"), children: children }) }));
|
|
2632
|
+
}
|
|
2633
|
+
else {
|
|
2634
|
+
return (jsxRuntimeExports.jsx(BannerContext.Provider, { value: tile, children: jsxRuntimeExports.jsx(reactNative.View, { testID: testID || 'banner-tile', style: commonStyles, accessible: true, role: "article", accessibilityLabel: accessibilityLabel || title || 'Banner', children: children }) }));
|
|
2635
|
+
}
|
|
2608
2636
|
};
|
|
2609
2637
|
var styles$6 = reactNative.StyleSheet.create({
|
|
2610
2638
|
container: {
|
|
@@ -2649,7 +2677,7 @@ var BaseTileBody = function (props) {
|
|
|
2649
2677
|
return undefined;
|
|
2650
2678
|
return isDesktop ? 3 : isTablet ? 4 : 3;
|
|
2651
2679
|
};
|
|
2652
|
-
return (jsxRuntimeExports.jsx(Text, __assign({ variant: "body" }, props, {
|
|
2680
|
+
return (jsxRuntimeExports.jsx(Text, __assign({ variant: "body" }, props, { role: "article", accessibilityLabel: body, numberOfLines: getNumberOfLines(), testID: "tile-body", children: body })));
|
|
2653
2681
|
};
|
|
2654
2682
|
|
|
2655
2683
|
/**
|
|
@@ -2761,7 +2789,7 @@ var BaseTileContent = function (_a) {
|
|
|
2761
2789
|
justifyContent: 'center',
|
|
2762
2790
|
height: !artworkUrl ? '100%' : undefined,
|
|
2763
2791
|
},
|
|
2764
|
-
],
|
|
2792
|
+
], role: "none", children: children }));
|
|
2765
2793
|
};
|
|
2766
2794
|
|
|
2767
2795
|
/**
|
|
@@ -2784,7 +2812,7 @@ var BaseTileHeader = function (_a) {
|
|
|
2784
2812
|
return null;
|
|
2785
2813
|
var dynamicStyles = useBaseTileStyles();
|
|
2786
2814
|
var combinedStyle = __assign(__assign(__assign({}, dynamicStyles.header), { marginTop: sizeInfo.isHalfSize ? 0 : dynamicStyles.header.marginTop }), (sizeInfo.isHalfSize ? { alignItems: 'center' } : {}));
|
|
2787
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { style: combinedStyle, testID: "tile-header",
|
|
2815
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: combinedStyle, testID: "tile-header", role: "heading", children: children }));
|
|
2788
2816
|
};
|
|
2789
2817
|
|
|
2790
2818
|
/**
|
|
@@ -2801,7 +2829,7 @@ var BaseTileMedia = function (props) {
|
|
|
2801
2829
|
var styles = useBaseTileStyles();
|
|
2802
2830
|
if (!artworkUrl)
|
|
2803
2831
|
return null;
|
|
2804
|
-
return (jsxRuntimeExports.jsx(ProgressiveImage, __assign({}, props, { source: { uri: artworkUrl }, testID: "tile-media", style: [props.style, baseStyles.media, styles.media], alt: "Content image".concat(title ? " for ".concat(title) : ''),
|
|
2832
|
+
return (jsxRuntimeExports.jsx(ProgressiveImage, __assign({}, props, { source: { uri: artworkUrl }, testID: "tile-media", style: [props.style, baseStyles.media, styles.media], alt: "Content image".concat(title ? " for ".concat(title) : ''), role: "img" })));
|
|
2805
2833
|
};
|
|
2806
2834
|
|
|
2807
2835
|
/**
|
|
@@ -2824,7 +2852,7 @@ var BaseTileTitle = function () {
|
|
|
2824
2852
|
// Don't show title for half tiles with image
|
|
2825
2853
|
if ((isHalfSize && artworkUrl) || !title)
|
|
2826
2854
|
return null;
|
|
2827
|
-
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Text, { variant: "title",
|
|
2855
|
+
return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Text, { variant: "title", role: "heading", accessibilityLabel: title, numberOfLines: 1, testID: "tile-title", children: title }), ctaLink && (jsxRuntimeExports.jsx(Icon, { name: "ChevronRight", color: (_b = (_a = sdk.theme) === null || _a === void 0 ? void 0 : _a.derivedSurfaceText) === null || _b === void 0 ? void 0 : _b[20], accessibilityLabel: "View details" }))] }));
|
|
2828
2856
|
};
|
|
2829
2857
|
|
|
2830
2858
|
/**
|
|
@@ -2845,10 +2873,7 @@ var useTileContext = function () {
|
|
|
2845
2873
|
return context;
|
|
2846
2874
|
};
|
|
2847
2875
|
/**
|
|
2848
|
-
* BaseTileContainer component
|
|
2849
|
-
*
|
|
2850
|
-
* @param {BaseTileRootProps} props - Component props
|
|
2851
|
-
* @returns {JSX.Element} The rendered BaseTileContainer
|
|
2876
|
+
* BaseTileContainer component with dynamic accessibility role based on CTA link
|
|
2852
2877
|
*/
|
|
2853
2878
|
var BaseTileContainer = function (_a) {
|
|
2854
2879
|
var children = _a.children, style = _a.style;
|
|
@@ -2859,25 +2884,39 @@ var BaseTileContainer = function (_a) {
|
|
|
2859
2884
|
var _b = tile.configuration, _c = _b.ctaLink, ctaLink = _c === void 0 ? '' : _c, ctaLinkTarget = _b.ctaLinkTarget, _d = _b.title, title = _d === void 0 ? 'Tile' : _d;
|
|
2860
2885
|
var theme = (sdk === null || sdk === void 0 ? void 0 : sdk.theme) || { surface: '#ffffff' };
|
|
2861
2886
|
var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
|
|
2887
|
+
var isInteractive = Boolean(ctaLink || tile.type === 'REWARD' || tile.type === 'REWARD_CATEGORY');
|
|
2862
2888
|
var layout = {
|
|
2863
2889
|
flexDirection: 'column',
|
|
2864
2890
|
justifyContent: isHalfSize ? 'center' : 'flex-start',
|
|
2865
2891
|
alignItems: 'stretch',
|
|
2866
2892
|
};
|
|
2867
2893
|
var dynamicStyles = useBaseTileStyles();
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2894
|
+
if (isInteractive) {
|
|
2895
|
+
return (jsxRuntimeExports.jsx(reactNative.Pressable, { style: function (_a) {
|
|
2896
|
+
var pressed = _a.pressed;
|
|
2897
|
+
return [
|
|
2898
|
+
baseStyles.container,
|
|
2899
|
+
dynamicStyles.container,
|
|
2900
|
+
{
|
|
2901
|
+
backgroundColor: theme.surface,
|
|
2902
|
+
opacity: pressed ? 0.7 : 1,
|
|
2903
|
+
},
|
|
2904
|
+
layout,
|
|
2905
|
+
style,
|
|
2906
|
+
];
|
|
2907
|
+
}, onPress: handlePress, accessible: true, role: "button", accessibilityLabel: "".concat(title, " - Click to open"), accessibilityState: { disabled: !ctaLink }, children: children }));
|
|
2908
|
+
}
|
|
2909
|
+
else {
|
|
2910
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: [
|
|
2871
2911
|
baseStyles.container,
|
|
2872
2912
|
dynamicStyles.container,
|
|
2873
2913
|
{
|
|
2874
2914
|
backgroundColor: theme.surface,
|
|
2875
|
-
opacity: pressed ? 0.7 : 1,
|
|
2876
2915
|
},
|
|
2877
2916
|
layout,
|
|
2878
2917
|
style,
|
|
2879
|
-
];
|
|
2880
|
-
|
|
2918
|
+
], accessible: true, role: "article", accessibilityLabel: title || 'Tile', children: children }));
|
|
2919
|
+
}
|
|
2881
2920
|
};
|
|
2882
2921
|
/**
|
|
2883
2922
|
* BaseTileRoot component to provide context and render children.
|
|
@@ -3102,6 +3141,63 @@ function withTileFetching(WrappedComponent) {
|
|
|
3102
3141
|
};
|
|
3103
3142
|
}
|
|
3104
3143
|
|
|
3144
|
+
/**
|
|
3145
|
+
* Sorts tiles by priority (higher priority first) and maintains original order for equal priorities
|
|
3146
|
+
* @param tiles Array of tiles to sort
|
|
3147
|
+
* @returns Sorted array of tiles
|
|
3148
|
+
*/
|
|
3149
|
+
var sortByPriority = function (tiles) {
|
|
3150
|
+
return __spreadArray([], tiles, true).sort(function (a, b) {
|
|
3151
|
+
// Sort by priority (higher priority first)
|
|
3152
|
+
if (a.priority !== b.priority) {
|
|
3153
|
+
return b.priority - a.priority;
|
|
3154
|
+
}
|
|
3155
|
+
// If priorities are equal, maintain original order
|
|
3156
|
+
return tiles.indexOf(a) - tiles.indexOf(b);
|
|
3157
|
+
});
|
|
3158
|
+
};
|
|
3159
|
+
/**
|
|
3160
|
+
* Transforms locale to a locale that is supported by the browser
|
|
3161
|
+
* @param locale Two-letter locale code to transform (en, fr, etc.)
|
|
3162
|
+
* @returns Full locale string (e.g., en-GB, fr-FR)
|
|
3163
|
+
*/
|
|
3164
|
+
var transformLocale = function (locale) {
|
|
3165
|
+
var localeMapping = {
|
|
3166
|
+
en: 'en-GB',
|
|
3167
|
+
fr: 'fr-FR',
|
|
3168
|
+
es: 'es-ES',
|
|
3169
|
+
de: 'de-DE',
|
|
3170
|
+
it: 'it-IT',
|
|
3171
|
+
pt: 'pt-PT',
|
|
3172
|
+
us: 'en-US',
|
|
3173
|
+
};
|
|
3174
|
+
var languageCode = (locale !== null && locale !== void 0 ? locale : 'en').toLowerCase();
|
|
3175
|
+
return localeMapping[languageCode] || 'en-GB';
|
|
3176
|
+
};
|
|
3177
|
+
/**
|
|
3178
|
+
* Formats a date string to a localized date string based on user locale
|
|
3179
|
+
* @param date Date string to format
|
|
3180
|
+
* @param userLocale User's locale (defaults to 'en')
|
|
3181
|
+
* @returns Formatted date string or fallback message
|
|
3182
|
+
*/
|
|
3183
|
+
var handleLastEarnedDate = function (date, userLocale) {
|
|
3184
|
+
if (userLocale === void 0) { userLocale = 'en'; }
|
|
3185
|
+
if (!date)
|
|
3186
|
+
return 'Date not available';
|
|
3187
|
+
try {
|
|
3188
|
+
var formattedLocale = transformLocale(userLocale);
|
|
3189
|
+
var dateObj = new Date(date);
|
|
3190
|
+
if (isNaN(dateObj.getTime())) {
|
|
3191
|
+
return 'Invalid Date';
|
|
3192
|
+
}
|
|
3193
|
+
return dateObj.toLocaleDateString(formattedLocale);
|
|
3194
|
+
}
|
|
3195
|
+
catch (error) {
|
|
3196
|
+
console.error('Error formatting date:', error);
|
|
3197
|
+
return 'Invalid Date';
|
|
3198
|
+
}
|
|
3199
|
+
};
|
|
3200
|
+
|
|
3105
3201
|
/**
|
|
3106
3202
|
* Custom hook that returns the styles for the BadgeTile component.
|
|
3107
3203
|
* Applies responsive styling based on the current device.
|
|
@@ -3165,7 +3261,7 @@ var BadgeTileDateEarned = function () {
|
|
|
3165
3261
|
var theme = useWllSdk().theme;
|
|
3166
3262
|
if (!isContextValid(tileContext))
|
|
3167
3263
|
return null;
|
|
3168
|
-
var _a = tileContext.configuration, count = _a.count, awardedDatePrefix = _a.awardedDatePrefix,
|
|
3264
|
+
var _a = tileContext.configuration, count = _a.count, awardedDatePrefix = _a.awardedDatePrefix, lastEarnedAt = _a.lastEarnedAt, badgeNotEarnedMessage = _a.badgeNotEarnedMessage, type = _a.type, locale = _a.locale;
|
|
3169
3265
|
// Don't show for Latest type with count=0
|
|
3170
3266
|
if (type === exports.BadgeTileType.Latest && count === 0) {
|
|
3171
3267
|
return null;
|
|
@@ -3181,10 +3277,10 @@ var BadgeTileDateEarned = function () {
|
|
|
3181
3277
|
var textColor = getReadableTextColor(backgroundColor);
|
|
3182
3278
|
var displayText = count === 0
|
|
3183
3279
|
? badgeNotEarnedMessage
|
|
3184
|
-
: "".concat(awardedDatePrefix, " ").concat(
|
|
3280
|
+
: "".concat(awardedDatePrefix, " ").concat(handleLastEarnedDate(lastEarnedAt, locale));
|
|
3185
3281
|
var accessibilityLabel = count === 0
|
|
3186
3282
|
? 'Badge not yet earned'
|
|
3187
|
-
: "Badge earned on ".concat(
|
|
3283
|
+
: "Badge earned on ".concat(handleLastEarnedDate(lastEarnedAt, locale));
|
|
3188
3284
|
return (jsxRuntimeExports.jsx(reactNative.View, { style: containerStyle, accessible: true, accessibilityLabel: accessibilityLabel, testID: "badge-tile-date-earned", children: jsxRuntimeExports.jsx(Text, { variant: "label", style: [styles.dateEarnedText, { color: textColor }], numberOfLines: 1, ellipsizeMode: "tail", accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: displayText }) }));
|
|
3189
3285
|
};
|
|
3190
3286
|
|
|
@@ -3366,7 +3462,7 @@ var BannerTileDescription = function () {
|
|
|
3366
3462
|
var description = bannerContext.configuration.description;
|
|
3367
3463
|
if (!description)
|
|
3368
3464
|
return null;
|
|
3369
|
-
return (jsxRuntimeExports.jsx(Text, { style: styles.description,
|
|
3465
|
+
return (jsxRuntimeExports.jsx(Text, { style: styles.description, role: "article", accessibilityLabel: description, testID: "banner-tile-description", children: description }));
|
|
3370
3466
|
};
|
|
3371
3467
|
|
|
3372
3468
|
/**
|
|
@@ -3386,7 +3482,7 @@ var BannerTileMedia = function (_a) {
|
|
|
3386
3482
|
var containerStyle = {
|
|
3387
3483
|
width: isArtworkOnly ? '100%' : '30%',
|
|
3388
3484
|
};
|
|
3389
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.mediaContainer, containerStyle],
|
|
3485
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.mediaContainer, containerStyle], role: "img", accessibilityLabel: "Banner image".concat(title ? " for ".concat(title) : ''), testID: "banner-tile-media", children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.media, alt: "Banner image".concat(title ? " for ".concat(title) : '') }) }));
|
|
3390
3486
|
};
|
|
3391
3487
|
|
|
3392
3488
|
/**
|
|
@@ -3402,7 +3498,7 @@ var BannerTileTitle = function () {
|
|
|
3402
3498
|
var title = bannerContext.configuration.title;
|
|
3403
3499
|
if (!title)
|
|
3404
3500
|
return null;
|
|
3405
|
-
return (jsxRuntimeExports.jsx(Text, { variant: "title", testID: "banner-tile-title", style: styles.title,
|
|
3501
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "title", testID: "banner-tile-title", style: styles.title, role: "heading", accessibilityLabel: title, children: title }));
|
|
3406
3502
|
};
|
|
3407
3503
|
|
|
3408
3504
|
/**
|
|
@@ -3508,7 +3604,7 @@ var ContentTileMedia = function (_a) {
|
|
|
3508
3604
|
var containerStyle = {
|
|
3509
3605
|
flexBasis: isArtworkOnly ? '100%' : '50%',
|
|
3510
3606
|
};
|
|
3511
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "content-tile-media",
|
|
3607
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "content-tile-media", role: "img", accessibilityLabel: "Image for ".concat(title), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Image for ".concat(title) }) }));
|
|
3512
3608
|
};
|
|
3513
3609
|
|
|
3514
3610
|
var ContentTileSummary = function () {
|
|
@@ -3525,7 +3621,7 @@ var ContentTileSummary = function () {
|
|
|
3525
3621
|
var getNumberOfLines = function () {
|
|
3526
3622
|
return isFullSize ? 3 : isHalfSize ? 4 : 3;
|
|
3527
3623
|
};
|
|
3528
|
-
return (jsxRuntimeExports.jsx(Text, { variant: "body",
|
|
3624
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "body", role: "article", accessibilityLabel: body, numberOfLines: getNumberOfLines(), testID: "content-tile-summary", children: body }));
|
|
3529
3625
|
};
|
|
3530
3626
|
|
|
3531
3627
|
var ContentTileTitle = function () {
|
|
@@ -3541,7 +3637,7 @@ var ContentTileTitle = function () {
|
|
|
3541
3637
|
return styles.titleWithLink;
|
|
3542
3638
|
}
|
|
3543
3639
|
};
|
|
3544
|
-
return (jsxRuntimeExports.jsx(Text, { variant: "title",
|
|
3640
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "title", role: "heading", accessibilityLabel: title, numberOfLines: 1, style: handleTitleWidth(), testID: "content-tile-title", children: title }));
|
|
3545
3641
|
};
|
|
3546
3642
|
|
|
3547
3643
|
/**
|
|
@@ -3583,22 +3679,6 @@ var ContentTile = Object.assign(ContentTileRoot, {
|
|
|
3583
3679
|
});
|
|
3584
3680
|
var ContentTile$1 = withTileFetching(ContentTile);
|
|
3585
3681
|
|
|
3586
|
-
/**
|
|
3587
|
-
* Sorts tiles by priority (higher priority first) and maintains original order for equal priorities
|
|
3588
|
-
* @param tiles Array of tiles to sort
|
|
3589
|
-
* @returns Sorted array of tiles
|
|
3590
|
-
*/
|
|
3591
|
-
var sortByPriority = function (tiles) {
|
|
3592
|
-
return __spreadArray([], tiles, true).sort(function (a, b) {
|
|
3593
|
-
// Sort by priority (higher priority first)
|
|
3594
|
-
if (a.priority !== b.priority) {
|
|
3595
|
-
return b.priority - a.priority;
|
|
3596
|
-
}
|
|
3597
|
-
// If priorities are equal, maintain original order
|
|
3598
|
-
return tiles.indexOf(a) - tiles.indexOf(b);
|
|
3599
|
-
});
|
|
3600
|
-
};
|
|
3601
|
-
|
|
3602
3682
|
exports.SectionType = void 0;
|
|
3603
3683
|
(function (SectionType) {
|
|
3604
3684
|
SectionType["Grid"] = "GRID";
|
|
@@ -4073,7 +4153,7 @@ var useSectionData = function (section, sectionId) {
|
|
|
4073
4153
|
*/
|
|
4074
4154
|
var EmptyState = function (_a) {
|
|
4075
4155
|
var message = _a.message;
|
|
4076
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { style: commonStyles.emptyContainer,
|
|
4156
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: commonStyles.emptyContainer, role: "article", accessibilityLabel: "Empty state: ".concat(message), children: jsxRuntimeExports.jsx(reactNative.Text, { children: message }) }));
|
|
4077
4157
|
};
|
|
4078
4158
|
/**
|
|
4079
4159
|
* The Section component renders a section based on its type (e.g., Banner, Grid).
|
|
@@ -4119,7 +4199,7 @@ var Section = function (_a) {
|
|
|
4119
4199
|
return jsxRuntimeExports.jsx(EmptyState, { message: "Unknown section type." });
|
|
4120
4200
|
}
|
|
4121
4201
|
};
|
|
4122
|
-
return sectionData ? (jsxRuntimeExports.jsx(SectionContext.Provider, { value: { sectionData: sectionData }, children: jsxRuntimeExports.jsx(reactNative.View, { style: styles.section, accessible: true, accessibilityLabel: "Section: ".concat(sectionData.title || 'Untitled section'), accessibilityHint: sectionData.description || undefined, children: renderSectionContent() }) })) : null;
|
|
4202
|
+
return sectionData ? (jsxRuntimeExports.jsx(SectionContext.Provider, { value: { sectionData: sectionData }, children: jsxRuntimeExports.jsx(reactNative.View, { style: styles.section, accessible: true, accessibilityLabel: "Section: ".concat(sectionData.title || 'Untitled section'), accessibilityHint: sectionData.description || undefined, role: "region", children: renderSectionContent() }) })) : null;
|
|
4123
4203
|
};
|
|
4124
4204
|
|
|
4125
4205
|
/**
|
|
@@ -4268,7 +4348,7 @@ var GroupSections = function () {
|
|
|
4268
4348
|
}
|
|
4269
4349
|
var sortedSections = sortByPriority(activeSections);
|
|
4270
4350
|
var Container = IS_WEB ? reactNative.View : reactNative.ScrollView;
|
|
4271
|
-
return (jsxRuntimeExports.jsx(Container, { accessible: true, accessibilityLabel: "Group: ".concat(groupData.name || 'Unnamed group'), children: sortedSections.map(function (section) { return (jsxRuntimeExports.jsx(Section, { section: section }, section.id)); }) }));
|
|
4351
|
+
return (jsxRuntimeExports.jsx(Container, { accessible: true, accessibilityLabel: "Group: ".concat(groupData.name || 'Unnamed group'), role: "region", children: sortedSections.map(function (section) { return (jsxRuntimeExports.jsx(Section, { section: section }, section.id)); }) }));
|
|
4272
4352
|
};
|
|
4273
4353
|
/**
|
|
4274
4354
|
* A page-level component that represents a Group view in the application.
|
|
@@ -4508,7 +4588,7 @@ var PointsTileFormattedPoints = function () {
|
|
|
4508
4588
|
return null;
|
|
4509
4589
|
var calculatedPoints = applyMultiplier(points, pointsMultiplier);
|
|
4510
4590
|
var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix).trim();
|
|
4511
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { testID: "points-tile-points",
|
|
4591
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { testID: "points-tile-points", role: "article", accessibilityLabel: "Points value: ".concat(fullPointsText), children: jsxRuntimeExports.jsxs(Row, { align: "center", justify: "start", children: [pointsPrefix ? (jsxRuntimeExports.jsx(Text, { variant: "caption", testID: "points-tile-prefix", children: pointsPrefix })) : null, jsxRuntimeExports.jsx(Text, { variant: "caption", testID: "points-tile-value", children: calculatedPoints }), pointsSuffix ? (jsxRuntimeExports.jsx(Text, { variant: "caption", style: styles.suffix, testID: "points-tile-suffix", children: pointsSuffix })) : null] }) }));
|
|
4512
4592
|
};
|
|
4513
4593
|
|
|
4514
4594
|
/**
|
|
@@ -4525,7 +4605,7 @@ var PointsTileMedia = function (_a) {
|
|
|
4525
4605
|
var styles = usePointsTileStyles(isFullSize);
|
|
4526
4606
|
if (!artworkUrl)
|
|
4527
4607
|
return null;
|
|
4528
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { testID: "points-tile-media", style: styles.imageContainer,
|
|
4608
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { testID: "points-tile-media", style: styles.imageContainer, role: "img", accessibilityLabel: "Points tile image for ".concat(title), children: jsxRuntimeExports.jsx(reactNative.Image, { source: { uri: artworkUrl }, style: styles.image, resizeMode: isFullSize ? 'cover' : 'contain' }) }));
|
|
4529
4609
|
};
|
|
4530
4610
|
|
|
4531
4611
|
/**
|
|
@@ -4540,7 +4620,7 @@ var PointsTileTitle = function () {
|
|
|
4540
4620
|
var title = tileContext.configuration.title;
|
|
4541
4621
|
if (!title)
|
|
4542
4622
|
return null;
|
|
4543
|
-
return (jsxRuntimeExports.jsx(Text, { variant: "eyebrow", testID: "points-tile-title",
|
|
4623
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "eyebrow", testID: "points-tile-title", role: "heading", accessibilityLabel: title, children: title }));
|
|
4544
4624
|
};
|
|
4545
4625
|
|
|
4546
4626
|
/**
|
|
@@ -4619,7 +4699,7 @@ var RewardCategoryHeader = function () {
|
|
|
4619
4699
|
var _a = tileContext.configuration, _b = _a.showName, showName = _b === void 0 ? true : _b, _c = _a.name, name = _c === void 0 ? '' : _c;
|
|
4620
4700
|
if (!showName || !name)
|
|
4621
4701
|
return null;
|
|
4622
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.header, { backgroundColor: theme.primary }], testID: "reward-category-header",
|
|
4702
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.header, { backgroundColor: theme.primary }], testID: "reward-category-header", role: "heading", accessibilityLabel: "Reward category: ".concat(name), children: jsxRuntimeExports.jsx(Text, { style: [styles.headerText, { color: theme.primaryText }], ellipsizeMode: "tail", numberOfLines: 1, children: name }) }));
|
|
4623
4703
|
};
|
|
4624
4704
|
|
|
4625
4705
|
/**
|
|
@@ -4635,7 +4715,7 @@ var RewardCategoryMedia = function () {
|
|
|
4635
4715
|
var _a = tileContext.configuration, artworkUrl = _a.artworkUrl, _b = _a.name, name = _b === void 0 ? 'Reward' : _b;
|
|
4636
4716
|
if (!artworkUrl)
|
|
4637
4717
|
return null;
|
|
4638
|
-
return (jsxRuntimeExports.jsx(ProgressiveImage, { testID: "reward-category-media", source: { uri: artworkUrl }, style: styles.background, alt: "Reward category image for ".concat(name),
|
|
4718
|
+
return (jsxRuntimeExports.jsx(ProgressiveImage, { testID: "reward-category-media", source: { uri: artworkUrl }, style: styles.background, alt: "Reward category image for ".concat(name), role: "img" }));
|
|
4639
4719
|
};
|
|
4640
4720
|
|
|
4641
4721
|
/**
|
|
@@ -4668,7 +4748,7 @@ var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
|
|
|
4668
4748
|
var RewardTileChevron = function () {
|
|
4669
4749
|
var _a;
|
|
4670
4750
|
var theme = useWllSdk().theme;
|
|
4671
|
-
return (jsxRuntimeExports.jsx(Icon, { name: "ChevronRight", size: IS_MOBILE ? 16 : undefined, color: ((_a = theme === null || theme === void 0 ? void 0 : theme.derivedSurfaceText) === null || _a === void 0 ? void 0 : _a[20]) || '#000000',
|
|
4751
|
+
return (jsxRuntimeExports.jsx(Icon, { name: "ChevronRight", size: IS_MOBILE ? 16 : undefined, color: ((_a = theme === null || theme === void 0 ? void 0 : theme.derivedSurfaceText) === null || _a === void 0 ? void 0 : _a[20]) || '#000000', role: "img", accessibilityLabel: "View reward details" }));
|
|
4672
4752
|
};
|
|
4673
4753
|
|
|
4674
4754
|
/**
|
|
@@ -4742,7 +4822,7 @@ var RewardTileMedia = function (_a) {
|
|
|
4742
4822
|
var containerStyle = {
|
|
4743
4823
|
flexBasis: isArtworkOnly ? '100%' : '50%',
|
|
4744
4824
|
};
|
|
4745
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "reward-tile-media",
|
|
4825
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { style: [styles.imageContainer, containerStyle], testID: "reward-tile-media", role: "img", accessibilityLabel: "Reward image for ".concat(name), children: jsxRuntimeExports.jsx(ProgressiveImage, { source: { uri: artworkUrl }, style: styles.image, alt: "Reward image for ".concat(name) }) }));
|
|
4746
4826
|
};
|
|
4747
4827
|
|
|
4748
4828
|
/**
|
|
@@ -4760,7 +4840,7 @@ var RewardTilePoints = function () {
|
|
|
4760
4840
|
return null;
|
|
4761
4841
|
var calculatedPoints = applyMultiplier(price, pointsMultiplier);
|
|
4762
4842
|
var accessibilityLabel = getPointsLabel('Reward points:', calculatedPoints, pointsPrefix, pointsSuffix);
|
|
4763
|
-
return (jsxRuntimeExports.jsx(reactNative.View, { testID: "reward-tile-points",
|
|
4843
|
+
return (jsxRuntimeExports.jsx(reactNative.View, { testID: "reward-tile-points", role: "article", accessibilityLabel: accessibilityLabel, children: jsxRuntimeExports.jsxs(Row, { align: "center", justify: "start", style: { marginTop: 8 }, children: [pointsPrefix ? jsxRuntimeExports.jsx(Text, { variant: "caption", children: pointsPrefix }) : null, jsxRuntimeExports.jsx(Text, { variant: "caption", testID: "reward-tile-points-value", children: calculatedPoints }), pointsSuffix ? (jsxRuntimeExports.jsx(Text, { variant: "caption", style: styles.suffix, children: pointsSuffix })) : null] }) }));
|
|
4764
4844
|
};
|
|
4765
4845
|
|
|
4766
4846
|
/**
|
|
@@ -4775,7 +4855,7 @@ var RewardTileSummary = function () {
|
|
|
4775
4855
|
var summary = tileContext.configuration.summary;
|
|
4776
4856
|
if (!summary)
|
|
4777
4857
|
return null;
|
|
4778
|
-
return (jsxRuntimeExports.jsx(Text, { variant: "body",
|
|
4858
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "body", role: "article", accessibilityLabel: summary, testID: "reward-tile-summary", children: summary }));
|
|
4779
4859
|
};
|
|
4780
4860
|
|
|
4781
4861
|
/**
|
|
@@ -4796,7 +4876,7 @@ var RewardTileTitle = function () {
|
|
|
4796
4876
|
return styles.titleWithLink;
|
|
4797
4877
|
}
|
|
4798
4878
|
};
|
|
4799
|
-
return (jsxRuntimeExports.jsx(Text, { variant: "title", ellipsizeMode: "tail", numberOfLines: 1,
|
|
4879
|
+
return (jsxRuntimeExports.jsx(Text, { variant: "title", ellipsizeMode: "tail", numberOfLines: 1, role: "heading", accessibilityLabel: "Reward title: ".concat(name), testID: "reward-tile-title", style: handleTitleWidth(), children: name }));
|
|
4800
4880
|
};
|
|
4801
4881
|
|
|
4802
4882
|
/**
|