@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/web.js CHANGED
@@ -18891,7 +18891,6 @@ var ProgressiveImage = function (_a) {
18891
18891
  var baseColor = theme.alphaDerivedPrimary[20];
18892
18892
  var desaturatedColor = desaturateColor(baseColor);
18893
18893
  var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
18894
- // Create base animated image
18895
18894
  var baseImage = /*#__PURE__*/React.createElement(Animated$1.Image, __assign({}, props, {
18896
18895
  source: source,
18897
18896
  style: [styles$7.imageOverlay, __assign({
@@ -18900,7 +18899,9 @@ var ProgressiveImage = function (_a) {
18900
18899
  filter: isDesaturated ? 'grayscale(100%)' : undefined
18901
18900
  })],
18902
18901
  onLoad: onImageLoad,
18903
- accessibilityLabel: alt
18902
+ accessibilityLabel: alt,
18903
+ accessible: true,
18904
+ role: "img"
18904
18905
  }));
18905
18906
  return /*#__PURE__*/React.createElement(View$2, {
18906
18907
  style: [styles$7.container, style, {
@@ -19008,10 +19009,35 @@ var Text = function (_a) {
19008
19009
  fontFamily: theme.fontFamily
19009
19010
  } : {}
19010
19011
  });
19012
+ // Determine appropriate accessibility role based on variant
19013
+ // This helps screen readers understand the semantic meaning
19014
+ var accessibilityRole;
19015
+ switch (variant) {
19016
+ case 'title':
19017
+ accessibilityRole = 'header';
19018
+ break;
19019
+ case 'caption':
19020
+ accessibilityRole = 'text';
19021
+ break;
19022
+ case 'eyebrow':
19023
+ accessibilityRole = 'text';
19024
+ break;
19025
+ case 'description':
19026
+ accessibilityRole = 'paragraph';
19027
+ break;
19028
+ case 'label':
19029
+ accessibilityRole = 'text';
19030
+ break;
19031
+ default:
19032
+ accessibilityRole = 'text';
19033
+ }
19011
19034
  var combinedStyles = [styles.base, variantStyle, styles.webOverrides, style];
19012
19035
  return /*#__PURE__*/React__namespace.createElement(Text$3, __assign({
19013
19036
  style: combinedStyles
19014
- }, props));
19037
+ }, props, {
19038
+ accessible: true,
19039
+ role: accessibilityRole
19040
+ }));
19015
19041
  };
19016
19042
 
19017
19043
  var MAX_WIDTH = 1080;
@@ -19197,24 +19223,38 @@ var BaseBanner = function (_a) {
19197
19223
  ctaText = _b.ctaText;
19198
19224
  var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19199
19225
  var hasCTA = Boolean(ctaText);
19200
- return /*#__PURE__*/React.createElement(BannerContext.Provider, {
19201
- value: tile
19202
- }, /*#__PURE__*/React.createElement(Pressable$1, {
19203
- testID: testID || 'banner-tile',
19204
- style: function (_a) {
19205
- var pressed = _a.pressed;
19206
- return [styles$6.container, style, {
19207
- backgroundColor: theme.surface,
19208
- borderRadius: theme.sizes.borderRadiusLg,
19209
- opacity: pressed ? 0.7 : 1
19210
- }];
19211
- },
19212
- onPress: hasCTA ? undefined : handlePress,
19213
- disabled: !ctaLink || hasCTA,
19214
- accessible: true,
19215
- role: hasCTA ? 'article' : 'button',
19216
- accessibilityLabel: accessibilityLabel || "".concat(title).concat(!hasCTA && ctaLink ? ' - Click to open' : '')
19217
- }, children));
19226
+ var isInteractive = Boolean(ctaLink && !hasCTA);
19227
+ var commonStyles = [styles$6.container, style, {
19228
+ backgroundColor: theme.surface,
19229
+ borderRadius: theme.sizes.borderRadiusLg
19230
+ }];
19231
+ if (isInteractive) {
19232
+ return /*#__PURE__*/React.createElement(BannerContext.Provider, {
19233
+ value: tile
19234
+ }, /*#__PURE__*/React.createElement(Pressable$1, {
19235
+ testID: testID || 'banner-tile',
19236
+ style: function (_a) {
19237
+ var pressed = _a.pressed;
19238
+ return __spreadArray(__spreadArray([], commonStyles, true), [{
19239
+ opacity: pressed ? 0.7 : 1
19240
+ }], false);
19241
+ },
19242
+ onPress: handlePress,
19243
+ accessible: true,
19244
+ role: "button",
19245
+ accessibilityLabel: accessibilityLabel || "".concat(title, " - Click to open")
19246
+ }, children));
19247
+ } else {
19248
+ return /*#__PURE__*/React.createElement(BannerContext.Provider, {
19249
+ value: tile
19250
+ }, /*#__PURE__*/React.createElement(View$2, {
19251
+ testID: testID || 'banner-tile',
19252
+ style: commonStyles,
19253
+ accessible: true,
19254
+ role: "article",
19255
+ accessibilityLabel: accessibilityLabel || title || 'Banner'
19256
+ }, children));
19257
+ }
19218
19258
  };
19219
19259
  var styles$6 = StyleSheet$1.create({
19220
19260
  container: {
@@ -19496,10 +19536,7 @@ var useTileContext = function () {
19496
19536
  return context;
19497
19537
  };
19498
19538
  /**
19499
- * BaseTileContainer component to handle layout and pressable behavior.
19500
- *
19501
- * @param {BaseTileRootProps} props - Component props
19502
- * @returns {JSX.Element} The rendered BaseTileContainer
19539
+ * BaseTileContainer component with dynamic accessibility role based on CTA link
19503
19540
  */
19504
19541
  var BaseTileContainer = function (_a) {
19505
19542
  var children = _a.children,
@@ -19518,29 +19555,40 @@ var BaseTileContainer = function (_a) {
19518
19555
  surface: '#ffffff'
19519
19556
  };
19520
19557
  var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19558
+ var isInteractive = Boolean(ctaLink || tile.type === 'REWARD' || tile.type === 'REWARD_CATEGORY');
19521
19559
  var layout = {
19522
19560
  flexDirection: 'column',
19523
19561
  justifyContent: isHalfSize ? 'center' : 'flex-start',
19524
19562
  alignItems: 'stretch'
19525
19563
  };
19526
19564
  var dynamicStyles = useBaseTileStyles();
19527
- return /*#__PURE__*/React.createElement(Pressable$1, {
19528
- style: function (_a) {
19529
- var pressed = _a.pressed;
19530
- return [baseStyles.container, dynamicStyles.container, {
19531
- backgroundColor: theme.surface,
19532
- opacity: pressed ? 0.7 : 1
19533
- }, layout, style];
19534
- },
19535
- onPress: handlePress,
19536
- disabled: tile.type !== 'REWARD' && tile.type !== 'REWARD_CATEGORY' && !ctaLink,
19537
- accessible: true,
19538
- role: "button",
19539
- accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : ''),
19540
- accessibilityState: {
19541
- disabled: !ctaLink
19542
- }
19543
- }, children);
19565
+ if (isInteractive) {
19566
+ return /*#__PURE__*/React.createElement(Pressable$1, {
19567
+ style: function (_a) {
19568
+ var pressed = _a.pressed;
19569
+ return [baseStyles.container, dynamicStyles.container, {
19570
+ backgroundColor: theme.surface,
19571
+ opacity: pressed ? 0.7 : 1
19572
+ }, layout, style];
19573
+ },
19574
+ onPress: handlePress,
19575
+ accessible: true,
19576
+ role: "button",
19577
+ accessibilityLabel: "".concat(title, " - Click to open"),
19578
+ accessibilityState: {
19579
+ disabled: !ctaLink
19580
+ }
19581
+ }, children);
19582
+ } else {
19583
+ return /*#__PURE__*/React.createElement(View$2, {
19584
+ style: [baseStyles.container, dynamicStyles.container, {
19585
+ backgroundColor: theme.surface
19586
+ }, layout, style],
19587
+ accessible: true,
19588
+ role: "article",
19589
+ accessibilityLabel: title || 'Tile'
19590
+ }, children);
19591
+ }
19544
19592
  };
19545
19593
  /**
19546
19594
  * BaseTileRoot component to provide context and render children.
@@ -21195,7 +21243,8 @@ var Section = function (_a) {
21195
21243
  style: styles.section,
21196
21244
  accessible: true,
21197
21245
  accessibilityLabel: "Section: ".concat(sectionData.title || 'Untitled section'),
21198
- accessibilityHint: sectionData.description || undefined
21246
+ accessibilityHint: sectionData.description || undefined,
21247
+ role: "region"
21199
21248
  }, renderSectionContent()))) : null;
21200
21249
  };
21201
21250
 
@@ -21377,7 +21426,8 @@ var GroupSections = function () {
21377
21426
  var Container = IS_WEB ? View$2 : ScrollView$2;
21378
21427
  return /*#__PURE__*/React.createElement(Container, {
21379
21428
  accessible: true,
21380
- accessibilityLabel: "Group: ".concat(groupData.name || 'Unnamed group')
21429
+ accessibilityLabel: "Group: ".concat(groupData.name || 'Unnamed group'),
21430
+ role: "region"
21381
21431
  }, sortedSections.map(function (section) {
21382
21432
  return /*#__PURE__*/React.createElement(Section, {
21383
21433
  key: section.id,