@wlloyalty/wll-react-sdk 1.0.104 → 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/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
- return (jsxRuntimeExports.jsx(BannerContext.Provider, { value: tile, children: jsxRuntimeExports.jsx(reactNative.Pressable, { testID: testID || 'banner-tile', style: function (_a) {
2596
- var pressed = _a.pressed;
2597
- return [
2598
- styles$6.container,
2599
- style,
2600
- {
2601
- backgroundColor: theme.surface,
2602
- borderRadius: theme.sizes.borderRadiusLg,
2603
- opacity: pressed ? 0.7 : 1,
2604
- },
2605
- ];
2606
- }, onPress: hasCTA ? undefined : handlePress, disabled: !ctaLink || hasCTA, accessible: true, role: hasCTA ? 'article' : 'button', accessibilityLabel: accessibilityLabel ||
2607
- "".concat(title).concat(!hasCTA && ctaLink ? ' - Click to open' : ''), children: children }) }));
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: {
@@ -2845,10 +2873,7 @@ var useTileContext = function () {
2845
2873
  return context;
2846
2874
  };
2847
2875
  /**
2848
- * BaseTileContainer component to handle layout and pressable behavior.
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
- return (jsxRuntimeExports.jsx(reactNative.Pressable, { style: function (_a) {
2869
- var pressed = _a.pressed;
2870
- return [
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
- }, onPress: handlePress, disabled: tile.type !== 'REWARD' && tile.type !== 'REWARD_CATEGORY' && !ctaLink, accessible: true, role: "button", accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : ''), accessibilityState: { disabled: !ctaLink }, children: children }));
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.
@@ -4160,7 +4199,7 @@ var Section = function (_a) {
4160
4199
  return jsxRuntimeExports.jsx(EmptyState, { message: "Unknown section type." });
4161
4200
  }
4162
4201
  };
4163
- 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;
4164
4203
  };
4165
4204
 
4166
4205
  /**
@@ -4309,7 +4348,7 @@ var GroupSections = function () {
4309
4348
  }
4310
4349
  var sortedSections = sortByPriority(activeSections);
4311
4350
  var Container = IS_WEB ? reactNative.View : reactNative.ScrollView;
4312
- 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)); }) }));
4313
4352
  };
4314
4353
  /**
4315
4354
  * A page-level component that represents a Group view in the application.