@wlloyalty/wll-react-sdk 1.0.45 → 1.0.47

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.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));
@@ -18994,7 +19010,7 @@ var BannerContext = /*#__PURE__*/React.createContext(null);
18994
19010
  var useBannerContext = function () {
18995
19011
  var context = React.useContext(BannerContext);
18996
19012
  if (!context) {
18997
- throw new Error('Tile components must be used within a BaseTile');
19013
+ throw new Error('Banner components must be used within a BaseBanner');
18998
19014
  }
18999
19015
  return context;
19000
19016
  };
@@ -19158,11 +19174,7 @@ var BaseTileHeader = function (_a) {
19158
19174
 
19159
19175
  var BaseTileMedia = function (props) {
19160
19176
  var tile = useTileContext();
19161
- var _a = tile.configuration,
19162
- artworkUrl = _a.artworkUrl;
19163
- _a.title;
19164
- _a.body;
19165
- useTileSize(tile).isHalfSize;
19177
+ var artworkUrl = tile.configuration.artworkUrl;
19166
19178
  var styles = useBaseTileStyles();
19167
19179
  if (!artworkUrl) return null;
19168
19180
  return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
@@ -19208,9 +19220,9 @@ var useTileContext = function () {
19208
19220
  return context;
19209
19221
  };
19210
19222
  /**
19211
- * BaseTileRoot component to handle layout and pressable behavior.
19223
+ * BaseTileContainer component to handle layout and pressable behavior.
19212
19224
  */
19213
- var BaseTileRoot = function (_a) {
19225
+ var BaseTileContainer = function (_a) {
19214
19226
  var children = _a.children,
19215
19227
  style = _a.style;
19216
19228
  var tile = useTileContext();
@@ -19244,20 +19256,20 @@ var BaseTileRoot = function (_a) {
19244
19256
  }, children);
19245
19257
  };
19246
19258
  /**
19247
- * BaseTileInner component to provide context and render children.
19259
+ * BaseTileRoot component to provide context and render children.
19248
19260
  */
19249
- var BaseTileInner = function (_a) {
19261
+ var BaseTileRoot = function (_a) {
19250
19262
  var tile = _a.tile,
19251
19263
  children = _a.children;
19252
19264
  return /*#__PURE__*/React.createElement(TileContext.Provider, {
19253
19265
  value: tile
19254
- }, /*#__PURE__*/React.createElement(BaseTile.Root, null, children));
19266
+ }, /*#__PURE__*/React.createElement(BaseTile.Container, null, children));
19255
19267
  };
19256
19268
  /**
19257
19269
  * BaseTile component with subcomponents attached.
19258
19270
  */
19259
- var BaseTile = Object.assign(BaseTileInner, {
19260
- Root: BaseTileRoot,
19271
+ var BaseTile = Object.assign(BaseTileRoot, {
19272
+ Container: BaseTileContainer,
19261
19273
  Media: BaseTileMedia,
19262
19274
  Content: BaseTileContent,
19263
19275
  Header: BaseTileHeader,
@@ -19556,25 +19568,22 @@ var BadgeTileDateEarned = function () {
19556
19568
  if (type === exports.BadgeTileType.Latest && count === 0) {
19557
19569
  return null;
19558
19570
  }
19559
- if (count === 0) {
19560
- return /*#__PURE__*/React.createElement(View$2, {
19561
- style: containerStyle
19562
- }, /*#__PURE__*/React.createElement(Text, {
19563
- variant: "label",
19564
- style: {
19565
- color: textColor
19566
- }
19567
- }, badgeNotEarnedMessage));
19568
- }
19569
- 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;
19570
19574
  return /*#__PURE__*/React.createElement(View$2, {
19571
- style: containerStyle
19575
+ style: containerStyle,
19576
+ accessible: true,
19577
+ accessibilityRole: "text",
19578
+ accessibilityLabel: accessibilityLabel
19572
19579
  }, /*#__PURE__*/React.createElement(Text, {
19573
19580
  variant: "label",
19574
19581
  style: {
19575
19582
  color: textColor
19576
- }
19577
- }, "".concat(awardedDatePrefix, " ").concat(formattedDate)));
19583
+ },
19584
+ accessibilityElementsHidden: true,
19585
+ importantForAccessibility: "no-hide-descendants"
19586
+ }, displayText));
19578
19587
  };
19579
19588
 
19580
19589
  var BadgeTileDescription = function () {
@@ -19583,11 +19592,17 @@ var BadgeTileDescription = function () {
19583
19592
  var count = configuration.count,
19584
19593
  description = configuration.description;
19585
19594
  if (count === 0 || !description) return null;
19586
- return /*#__PURE__*/React.createElement(Text, {
19595
+ return /*#__PURE__*/React.createElement(View$2, {
19596
+ accessible: true,
19597
+ accessibilityRole: "text",
19598
+ accessibilityLabel: "Badge description: ".concat(description)
19599
+ }, /*#__PURE__*/React.createElement(Text, {
19587
19600
  variant: "body",
19588
19601
  numberOfLines: 2,
19589
- ellipsizeMode: "tail"
19590
- }, description);
19602
+ ellipsizeMode: "tail",
19603
+ accessibilityElementsHidden: true,
19604
+ importantForAccessibility: "no-hide-descendants"
19605
+ }, description));
19591
19606
  };
19592
19607
 
19593
19608
  var BadgeTileMedia = function (_a) {
@@ -19623,13 +19638,22 @@ var BadgeTileStatus = function () {
19623
19638
  if (type !== exports.BadgeTileType.Specific || count === 1) {
19624
19639
  return null;
19625
19640
  }
19641
+ var isLocked = count === 0;
19642
+ var statusLabel = isLocked ? 'Badge locked' : "Earned ".concat(count, " times");
19626
19643
  return /*#__PURE__*/React.createElement(View$2, {
19627
- style: styles.indicatorContainer
19628
- }, count === 0 ? /*#__PURE__*/React.createElement(LucideIcons.LockKeyholeIcon, {
19644
+ style: styles.indicatorContainer,
19645
+ accessible: true,
19646
+ accessibilityRole: "text",
19647
+ accessibilityLabel: statusLabel
19648
+ }, isLocked ? /*#__PURE__*/React.createElement(Icon, {
19649
+ name: "LockKeyhole",
19629
19650
  color: "#FFF",
19630
- size: 20
19651
+ size: 20,
19652
+ accessibilityElementsHidden: true
19631
19653
  }) : /*#__PURE__*/React.createElement(Text, {
19632
- style: styles.countText
19654
+ style: styles.countText,
19655
+ accessibilityElementsHidden: true,
19656
+ importantForAccessibility: "no-hide-descendants"
19633
19657
  }, count, "x"));
19634
19658
  };
19635
19659
 
@@ -19642,11 +19666,17 @@ var BadgeTileTitle = function () {
19642
19666
  emptyBadgeMessage = configuration.emptyBadgeMessage;
19643
19667
  var displayText = count === 0 ? emptyBadgeMessage : name;
19644
19668
  if (!displayText) return null;
19645
- return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(Text, {
19669
+ return /*#__PURE__*/React.createElement(View$2, {
19670
+ accessible: true,
19671
+ accessibilityRole: "header",
19672
+ accessibilityLabel: "Badge title: ".concat(displayText)
19673
+ }, /*#__PURE__*/React.createElement(Text, {
19646
19674
  variant: "title",
19647
19675
  style: styles.titleText,
19648
19676
  numberOfLines: count === 0 ? 2 : 1,
19649
- ellipsizeMode: "tail"
19677
+ ellipsizeMode: "tail",
19678
+ accessibilityElementsHidden: true,
19679
+ importantForAccessibility: "no-hide-descendants"
19650
19680
  }, displayText));
19651
19681
  };
19652
19682
 
@@ -19685,10 +19715,12 @@ var BannerTileCTA = function () {
19685
19715
  ctaLinkTarget = _a.ctaLinkTarget;
19686
19716
  var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19687
19717
  if (!ctaText) return null;
19718
+ var hint = ctaLinkTarget === 'NEW_WINDOW' ? "Opens ".concat(ctaLink, " in a new window") : "Takes you to ".concat(ctaLink);
19688
19719
  return /*#__PURE__*/React.createElement(Button, {
19689
19720
  title: ctaText,
19690
19721
  variant: "accent",
19691
- onPress: handlePress
19722
+ onPress: handlePress,
19723
+ accessibilityHint: hint
19692
19724
  });
19693
19725
  };
19694
19726
 
@@ -19734,34 +19766,45 @@ var BannerTileDescription = function () {
19734
19766
  var description = configuration.description;
19735
19767
  var theme = useWllSdk().theme;
19736
19768
  if (!description) return null;
19737
- return /*#__PURE__*/React.createElement(Text, {
19769
+ return /*#__PURE__*/React.createElement(View$2, {
19770
+ accessible: true,
19771
+ accessibilityRole: "text",
19772
+ accessibilityLabel: description
19773
+ }, /*#__PURE__*/React.createElement(Text, {
19738
19774
  style: [styles.description, {
19739
19775
  color: theme.derivedSurfaceText[20]
19740
- }]
19741
- }, description);
19776
+ }],
19777
+ accessibilityElementsHidden: true,
19778
+ importantForAccessibility: "no-hide-descendants"
19779
+ }, description));
19742
19780
  };
19743
19781
 
19744
19782
  var BannerTileMedia = function (_a) {
19745
19783
  var isArtworkOnly = _a.isArtworkOnly;
19746
19784
  var styles = useBannerTileStyles();
19747
19785
  var configuration = useBannerContext().configuration;
19748
- var artworkUrl = configuration.artworkUrl;
19786
+ var _b = configuration,
19787
+ artworkUrl = _b.artworkUrl,
19788
+ title = _b.title;
19749
19789
  if (!artworkUrl) return null;
19750
19790
  var containerStyle = {
19751
19791
  width: isArtworkOnly ? '100%' : '30%'
19752
19792
  };
19753
- return (
19754
- /*#__PURE__*/
19755
- // @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
19756
- React.createElement(View$2, {
19757
- style: [styles.mediaContainer, containerStyle]
19758
- }, /*#__PURE__*/React.createElement(ProgressiveImage, {
19759
- source: {
19760
- uri: artworkUrl
19761
- },
19762
- style: styles.media
19763
- }))
19764
- );
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
+ }));
19765
19808
  };
19766
19809
 
19767
19810
  var BannerTileTitle = function () {
@@ -19769,10 +19812,16 @@ var BannerTileTitle = function () {
19769
19812
  var configuration = useBannerContext().configuration;
19770
19813
  var title = configuration.title;
19771
19814
  if (!title) return null;
19772
- return /*#__PURE__*/React.createElement(Text, {
19815
+ return /*#__PURE__*/React.createElement(View$2, {
19816
+ accessible: true,
19817
+ accessibilityRole: "header",
19818
+ accessibilityLabel: title
19819
+ }, /*#__PURE__*/React.createElement(Text, {
19773
19820
  variant: "title",
19774
- style: styles.title
19775
- }, title);
19821
+ style: styles.title,
19822
+ accessibilityElementsHidden: true,
19823
+ importantForAccessibility: "no-hide-descendants"
19824
+ }, title));
19776
19825
  };
19777
19826
 
19778
19827
  /**
@@ -19792,13 +19841,12 @@ var isArtworkOnly$1 = function (configuration) {
19792
19841
  var BannerTileRoot = function (_a) {
19793
19842
  var tile = _a.tile;
19794
19843
  if (!tile) return null;
19795
- useBannerTileStyles();
19796
19844
  var configuration = tile.configuration;
19797
19845
  return /*#__PURE__*/React.createElement(BaseBanner, {
19798
19846
  tile: tile
19799
19847
  }, /*#__PURE__*/React.createElement(BannerTile.Media, {
19800
19848
  isArtworkOnly: isArtworkOnly$1(configuration)
19801
- }), /*#__PURE__*/React.createElement(FlexBox, null, /*#__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)));
19802
19850
  };
19803
19851
  /**
19804
19852
  * The BannerTile component with subcomponents attached.
@@ -19815,6 +19863,11 @@ var ContentTileBody = function () {
19815
19863
  return /*#__PURE__*/React.createElement(BaseTile.Body, null);
19816
19864
  };
19817
19865
 
19866
+ var ContentTileContainer = function (_a) {
19867
+ var children = _a.children;
19868
+ return /*#__PURE__*/React.createElement(BaseTile.Container, null, children);
19869
+ };
19870
+
19818
19871
  var useContentTileStyles = function () {
19819
19872
  var theme = useWllSdk().theme;
19820
19873
  var _a = useResponsive$1(),
@@ -19854,28 +19907,23 @@ var ContentTileMedia = function () {
19854
19907
  });
19855
19908
  };
19856
19909
 
19857
- var ContentTileRoot = function (_a) {
19858
- var children = _a.children;
19859
- return /*#__PURE__*/React.createElement(BaseTile.Root, null, children);
19860
- };
19861
-
19862
19910
  /**
19863
- * The ContentTile component renders a tile with a root, media, content, header, and body.
19911
+ * The ContentTile component renders a tile with a container, media, content, header, and body.
19864
19912
  *
19865
19913
  * @param tile - The tile data to render.
19866
19914
  */
19867
- var ContentTileMain = function (_a) {
19915
+ var ContentTileRoot = function (_a) {
19868
19916
  var tile = _a.tile;
19869
19917
  if (!tile) return null;
19870
19918
  return /*#__PURE__*/React.createElement(BaseTile, {
19871
19919
  tile: tile
19872
- }, /*#__PURE__*/React.createElement(ContentTile.Root, 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))));
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))));
19873
19921
  };
19874
19922
  /**
19875
19923
  * The ContentTile component with subcomponents attached.
19876
19924
  */
19877
- var ContentTile = Object.assign(ContentTileMain, {
19878
- Root: ContentTileRoot,
19925
+ var ContentTile = Object.assign(ContentTileRoot, {
19926
+ Container: ContentTileContainer,
19879
19927
  Media: ContentTileMedia,
19880
19928
  Content: ContentTileContent,
19881
19929
  Header: ContentTileHeader,
@@ -20105,10 +20153,9 @@ var Carousel = function (_a) {
20105
20153
  dispatch = _c[1];
20106
20154
  var currentIndex = state.currentIndex,
20107
20155
  containerWidth = state.containerWidth;
20108
- var bannerTiles = section.tiles.filter(function (tile) {
20156
+ var sortedTiles = sortByPriority(section.tiles.filter(function (tile) {
20109
20157
  return tile.type === exports.TileType.Banner;
20110
- });
20111
- var sortedTiles = sortByPriority(bannerTiles);
20158
+ }));
20112
20159
  var handleScroll = React.useCallback(function (event) {
20113
20160
  var contentOffsetX = event.nativeEvent.contentOffset.x;
20114
20161
  var newIndex = contentOffsetX / containerWidth;
@@ -20450,8 +20497,14 @@ var useSectionData = function (section, sectionId) {
20450
20497
  var EmptyState = function (_a) {
20451
20498
  var message = _a.message;
20452
20499
  return /*#__PURE__*/React.createElement(View$2, {
20453
- style: commonStyles.emptyContainer
20454
- }, /*#__PURE__*/React.createElement(Text$3, null, message));
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));
20455
20508
  };
20456
20509
  /**
20457
20510
  * The Section component renders a section based on its type (e.g., Banner, Grid).
@@ -20471,7 +20524,13 @@ var Section = function (_a) {
20471
20524
  var renderSectionContent = function () {
20472
20525
  if (isLoading) {
20473
20526
  return /*#__PURE__*/React.createElement(View$2, {
20474
- style: commonStyles.emptyContainer
20527
+ style: commonStyles.emptyContainer,
20528
+ accessible: true,
20529
+ accessibilityRole: "none",
20530
+ accessibilityLabel: "Loading section content",
20531
+ accessibilityState: {
20532
+ busy: true
20533
+ }
20475
20534
  }, /*#__PURE__*/React.createElement(Skeleton, null));
20476
20535
  }
20477
20536
  if (error || !sectionData) {
@@ -20500,48 +20559,62 @@ var Section = function (_a) {
20500
20559
  sectionData: sectionData
20501
20560
  }
20502
20561
  }, /*#__PURE__*/React.createElement(View$2, {
20503
- 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
20504
20567
  }, renderSectionContent())) : null;
20505
20568
  };
20506
20569
 
20507
- /**
20508
- * A page-level component that represents a Group view in the application.
20509
- *
20510
- * This component serves as a container page that manages the fetching and display
20511
- * of a group's data and its associated sections. It handles various states including
20512
- * loading, errors, and empty states, providing a complete page experience for
20513
- * viewing group content.
20514
- *
20515
- * @param id - The unique identifier of the group to fetch and display.
20516
- */
20517
- var Group = function (_a) {
20518
- var id = _a.id;
20519
- 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) {
20520
20580
  var getGroupByID = useWllSdk().getGroupByID;
20581
+ var _a = React.useState(null),
20582
+ groupData = _a[0],
20583
+ setGroupData = _a[1];
20521
20584
  var _b = React.useState(null),
20522
- groupData = _b[0],
20523
- setGroupData = _b[1];
20524
- var _c = React.useState(null),
20525
- error = _c[0],
20526
- setError = _c[1];
20585
+ error = _b[0],
20586
+ setError = _b[1];
20587
+ var _c = React.useState(true),
20588
+ isLoading = _c[0],
20589
+ setIsLoading = _c[1];
20527
20590
  var fetchGroup = React.useCallback(function () {
20528
20591
  return __awaiter(void 0, void 0, void 0, function () {
20529
20592
  var response;
20530
20593
  return __generator(this, function (_a) {
20531
20594
  switch (_a.label) {
20532
20595
  case 0:
20533
- _a.trys.push([0, 2,, 3]);
20596
+ setIsLoading(true);
20534
20597
  setError(null);
20535
- return [4 /*yield*/, getGroupByID(id)];
20598
+ _a.label = 1;
20536
20599
  case 1:
20537
- response = _a.sent();
20538
- setGroupData(response.data);
20539
- return [3 /*break*/, 3];
20600
+ _a.trys.push([1, 3, 4, 5]);
20601
+ return [4 /*yield*/, getGroupByID(id)];
20540
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:
20541
20611
  _a.sent();
20542
20612
  setError('Failed to fetch group data. Please try again later.');
20543
- return [3 /*break*/, 3];
20544
- case 3:
20613
+ return [3 /*break*/, 5];
20614
+ case 4:
20615
+ setIsLoading(false);
20616
+ return [7 /*endfinally*/];
20617
+ case 5:
20545
20618
  return [2 /*return*/];
20546
20619
  }
20547
20620
  });
@@ -20550,35 +20623,51 @@ var Group = function (_a) {
20550
20623
  React.useEffect(function () {
20551
20624
  fetchGroup();
20552
20625
  }, [fetchGroup]);
20553
- // Handle loading state
20554
- if (!groupData && !error) {
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) {
20555
20650
  return /*#__PURE__*/React.createElement(View$2, {
20556
20651
  style: commonStyles.emptyContainer
20557
20652
  }, /*#__PURE__*/React.createElement(Skeleton, null));
20558
20653
  }
20559
- // Handle error state
20560
- if (error) {
20561
- return /*#__PURE__*/React.createElement(View$2, {
20562
- style: commonStyles.emptyContainer
20563
- }, /*#__PURE__*/React.createElement(Text, {
20564
- variant: "body"
20565
- }, error));
20566
- }
20567
- // Handle empty group data
20568
- if (!groupData) {
20569
- return /*#__PURE__*/React.createElement(View$2, {
20570
- style: commonStyles.emptyContainer
20571
- }, /*#__PURE__*/React.createElement(Text, {
20572
- variant: "body"
20573
- }, "No group data available"));
20654
+ if (error || !groupData) {
20655
+ return /*#__PURE__*/React.createElement(GroupEmptyState, {
20656
+ message: error || 'No group data available'
20657
+ });
20574
20658
  }
20575
- // Handle empty sections
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;
20576
20667
  if (!groupData.sections || groupData.sections.length === 0) {
20577
- return /*#__PURE__*/React.createElement(View$2, {
20578
- style: commonStyles.emptyContainer
20579
- }, /*#__PURE__*/React.createElement(Text, {
20580
- variant: "body"
20581
- }, "No sections available"));
20668
+ return /*#__PURE__*/React.createElement(GroupEmptyState, {
20669
+ message: "This group doesn't have any sections"
20670
+ });
20582
20671
  }
20583
20672
  var sortedSections = sortByPriority(groupData.sections);
20584
20673
  return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
@@ -20588,6 +20677,170 @@ var Group = function (_a) {
20588
20677
  });
20589
20678
  }));
20590
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
+ };
20591
20844
 
20592
20845
  var usePointsTileStyles = function (isFullSize) {
20593
20846
  var _a = useResponsive$1(),
@@ -20632,6 +20885,11 @@ var usePointsTileStyles = function (isFullSize) {
20632
20885
  });
20633
20886
  };
20634
20887
 
20888
+ var TextProps = {
20889
+ variant: 'caption',
20890
+ accessibilityElementsHidden: true,
20891
+ importantForAccessibility: 'no-hide-descendants'
20892
+ };
20635
20893
  var PointsTileFormattedPoints = function () {
20636
20894
  var styles = usePointsTileStyles();
20637
20895
  var configuration = useTileContext().configuration;
@@ -20645,38 +20903,56 @@ var PointsTileFormattedPoints = function () {
20645
20903
  points = _a.points;
20646
20904
  if (points === undefined) return null;
20647
20905
  var calculatedPoints = points * multiplier;
20648
- return /*#__PURE__*/React.createElement(Text, {
20649
- variant: "caption"
20650
- }, pointsPrefix, /*#__PURE__*/React.createElement(Layout, {
20651
- direction: "row"
20652
- }, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
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, {
20653
20915
  style: styles.suffix
20654
- }, pointsSuffix)));
20916
+ }), pointsSuffix)));
20655
20917
  };
20656
20918
 
20657
20919
  var PointsTileMedia = function (_a) {
20658
20920
  var isFullSize = _a.isFullSize;
20659
20921
  var configuration = useTileContext().configuration;
20660
- var artworkUrl = configuration.artworkUrl;
20922
+ var _b = configuration,
20923
+ artworkUrl = _b.artworkUrl,
20924
+ title = _b.title;
20661
20925
  var styles = usePointsTileStyles(isFullSize);
20662
20926
  if (!artworkUrl) return null;
20663
20927
  return /*#__PURE__*/React.createElement(View$2, {
20664
- style: styles.imageContainer
20928
+ style: styles.imageContainer,
20929
+ accessible: true,
20930
+ accessibilityRole: "image",
20931
+ accessibilityLabel: "Points tile image".concat(title ? " for ".concat(title) : '')
20665
20932
  }, /*#__PURE__*/React.createElement(Image$2, {
20666
20933
  source: {
20667
20934
  uri: artworkUrl
20668
20935
  },
20669
20936
  style: styles.image,
20670
- resizeMode: "contain"
20937
+ resizeMode: "contain",
20938
+ accessibilityElementsHidden: true,
20939
+ importantForAccessibility: "no-hide-descendants"
20671
20940
  }));
20672
20941
  };
20673
20942
 
20674
20943
  var PointsTileTitle = function () {
20675
20944
  var configuration = useTileContext().configuration;
20676
20945
  var title = configuration.title;
20677
- return title ? /*#__PURE__*/React.createElement(Text, {
20678
- variant: "eyebrow"
20679
- }, title) : null;
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));
20680
20956
  };
20681
20957
 
20682
20958
  /**
@@ -20697,7 +20973,7 @@ var PointsTileRoot = function (_a) {
20697
20973
  style: styles.container
20698
20974
  }, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
20699
20975
  isFullSize: false
20700
- }), /*#__PURE__*/React.createElement(Layout, {
20976
+ }), /*#__PURE__*/React.createElement(Column, {
20701
20977
  style: styles.contentContainer
20702
20978
  }, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
20703
20979
  };
@@ -20753,26 +21029,34 @@ var RewardCategoryHeader = function () {
20753
21029
  return /*#__PURE__*/React.createElement(View$2, {
20754
21030
  style: [styles.header, {
20755
21031
  backgroundColor: theme.primary
20756
- }]
21032
+ }],
21033
+ accessible: true,
21034
+ accessibilityRole: "header",
21035
+ accessibilityLabel: "Reward category: ".concat(name)
20757
21036
  }, /*#__PURE__*/React.createElement(Text, {
20758
21037
  style: [styles.headerText, {
20759
21038
  color: theme.primaryText
20760
21039
  }],
20761
21040
  ellipsizeMode: "tail",
20762
- numberOfLines: 1
21041
+ numberOfLines: 1,
21042
+ accessibilityElementsHidden: true,
21043
+ importantForAccessibility: "no-hide-descendants"
20763
21044
  }, name));
20764
21045
  };
20765
21046
 
20766
21047
  var RewardCategoryMedia = function () {
20767
21048
  var styles = useRewardCategoryTileStyles();
20768
21049
  var configuration = useTileContext().configuration;
20769
- var artworkUrl = configuration.artworkUrl;
21050
+ var _a = configuration,
21051
+ artworkUrl = _a.artworkUrl,
21052
+ name = _a.name;
20770
21053
  if (!artworkUrl) return null;
20771
21054
  return /*#__PURE__*/React.createElement(ProgressiveImage, {
20772
21055
  source: {
20773
21056
  uri: artworkUrl
20774
21057
  },
20775
- style: styles.background
21058
+ style: styles.background,
21059
+ alt: name
20776
21060
  });
20777
21061
  };
20778
21062
 
@@ -20842,6 +21126,7 @@ var useRewardTileStyles = function () {
20842
21126
  fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
20843
21127
  },
20844
21128
  header: {
21129
+ width: '100%',
20845
21130
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
20846
21131
  }
20847
21132
  });
@@ -20889,23 +21174,36 @@ var RewardTilePoints = function () {
20889
21174
  if (!showPrice || price === undefined) return null;
20890
21175
  // Calculate points
20891
21176
  var calculatedPoints = price * Number(pointsMultiplier);
20892
- return /*#__PURE__*/React.createElement(Text, {
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, {
20893
21183
  variant: "caption",
20894
- style: styles.footer
21184
+ style: styles.footer,
21185
+ accessibilityElementsHidden: true,
21186
+ importantForAccessibility: "no-hide-descendants"
20895
21187
  }, pointsPrefix, /*#__PURE__*/React.createElement(View$2, {
20896
21188
  style: styles.pointsContainer
20897
21189
  }, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
20898
21190
  style: styles.suffix
20899
- }, pointsSuffix)));
21191
+ }, pointsSuffix))));
20900
21192
  };
20901
21193
 
20902
21194
  var RewardTileSummary = function () {
20903
21195
  var configuration = useTileContext().configuration;
20904
21196
  var summary = configuration.summary;
20905
21197
  if (!summary) return null;
20906
- return /*#__PURE__*/React.createElement(Text, {
20907
- variant: "body"
20908
- }, summary);
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));
20909
21207
  };
20910
21208
 
20911
21209
  var RewardTileTitle = function () {
@@ -20942,8 +21240,7 @@ var RewardTileRoot = function (_a) {
20942
21240
  tile: tile
20943
21241
  }, /*#__PURE__*/React.createElement(RewardTile.Media, {
20944
21242
  isArtworkOnly: isArtworkOnly(configuration)
20945
- }), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Layout, {
20946
- direction: "row",
21243
+ }), /*#__PURE__*/React.createElement(Layout, null, /*#__PURE__*/React.createElement(Row, {
20947
21244
  justify: "between",
20948
21245
  align: "center",
20949
21246
  style: styles.header
@@ -21114,7 +21411,7 @@ var TierTileEmpty = function (_a) {
21114
21411
  style: {
21115
21412
  paddingTop: 16
21116
21413
  }
21117
- }, /*#__PURE__*/React__namespace.createElement(FlexBox, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
21414
+ }, /*#__PURE__*/React__namespace.createElement(FullFlex, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
21118
21415
  variant: "title",
21119
21416
  style: styles.title
21120
21417
  }, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
@@ -21192,82 +21489,6 @@ var styles = StyleSheet$1.create({
21192
21489
  }
21193
21490
  });
21194
21491
 
21195
- /**
21196
- * A FlexBox component that provides a flexible container with `flex: 1`.
21197
- *
21198
- * This component is commonly used to create a full-flex container that expands
21199
- * to fill available space in a layout.
21200
- */
21201
- var FlexBox = function (_a) {
21202
- var children = _a.children,
21203
- style = _a.style;
21204
- return /*#__PURE__*/React.createElement(View$2, {
21205
- style: [{
21206
- flex: 1
21207
- }, style]
21208
- }, children);
21209
- };
21210
-
21211
- var justifyMap = {
21212
- start: 'flex-start',
21213
- end: 'flex-end',
21214
- center: 'center',
21215
- between: 'space-between',
21216
- around: 'space-around',
21217
- evenly: 'space-evenly'
21218
- };
21219
- var alignMap = {
21220
- start: 'flex-start',
21221
- end: 'flex-end',
21222
- center: 'center',
21223
- stretch: 'stretch',
21224
- baseline: 'baseline'
21225
- };
21226
-
21227
- var Layout = function (_a) {
21228
- var children = _a.children,
21229
- _b = _a.justify,
21230
- justify = _b === void 0 ? 'start' : _b,
21231
- _c = _a.align,
21232
- align = _c === void 0 ? 'stretch' : _c,
21233
- _d = _a.direction,
21234
- direction = _d === void 0 ? 'column' : _d,
21235
- _e = _a.style,
21236
- style = _e === void 0 ? {} : _e;
21237
- var theme = useWllSdk().theme;
21238
- var _f = useResponsive$1(),
21239
- isDesktop = _f.isDesktop,
21240
- isTablet = _f.isTablet;
21241
- var dynamicStyles = StyleSheet$1.create({
21242
- column: {
21243
- flex: 1,
21244
- paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
21245
- paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
21246
- justifyContent: justifyMap[justify],
21247
- alignItems: alignMap[align],
21248
- flexDirection: direction
21249
- }
21250
- });
21251
- return /*#__PURE__*/React__namespace.createElement(View$2, {
21252
- style: [dynamicStyles.column, style]
21253
- }, children);
21254
- };
21255
-
21256
- /**
21257
- * A simple Spacer component that creates flexible space in layouts.
21258
- *
21259
- * The Spacer is commonly used in flexbox layouts to create adjustable empty space
21260
- * between child elements, avoiding the need for explicit margins or padding.
21261
- */
21262
- var Spacer = function (_a) {
21263
- var style = _a.style;
21264
- return /*#__PURE__*/React.createElement(View$2, {
21265
- style: [{
21266
- flex: 1
21267
- }, style]
21268
- });
21269
- };
21270
-
21271
21492
  var Reward = /** @class */function () {
21272
21493
  function Reward() {}
21273
21494
  return Reward;
@@ -21281,9 +21502,10 @@ exports.BaseBanner = BaseBanner;
21281
21502
  exports.BaseTile = BaseTile;
21282
21503
  exports.Button = Button;
21283
21504
  exports.Carousel = Carousel;
21505
+ exports.Column = Column;
21284
21506
  exports.ContentTile = ContentTile$1;
21285
21507
  exports.ContentTileConfig = ContentTileConfig;
21286
- exports.FlexBox = FlexBox;
21508
+ exports.FullFlex = FullFlex;
21287
21509
  exports.Grid = Grid;
21288
21510
  exports.Group = Group;
21289
21511
  exports.Icon = Icon;
@@ -21300,6 +21522,7 @@ exports.RewardCategoryTile = RewardCategoryTile$1;
21300
21522
  exports.RewardCategoryTileConfig = RewardCategoryTileConfig;
21301
21523
  exports.RewardTile = RewardTile$1;
21302
21524
  exports.RewardTileConfig = RewardTileConfig;
21525
+ exports.Row = Row;
21303
21526
  exports.Section = Section;
21304
21527
  exports.SectionHeader = SectionHeader;
21305
21528
  exports.Skeleton = Skeleton;