@wlloyalty/wll-react-sdk 1.0.60 → 1.0.62

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.
Files changed (49) hide show
  1. package/dist/index.d.ts +24 -14
  2. package/dist/native.js +582 -250
  3. package/dist/native.js.map +1 -1
  4. package/dist/types/components/atoms/BaseTile/base-tile-body.d.ts +6 -0
  5. package/dist/types/components/atoms/BaseTile/base-tile-content.d.ts +11 -4
  6. package/dist/types/components/atoms/BaseTile/base-tile-header.d.ts +11 -4
  7. package/dist/types/components/atoms/BaseTile/base-tile-media.d.ts +6 -0
  8. package/dist/types/components/atoms/BaseTile/base-tile-title.d.ts +5 -0
  9. package/dist/types/components/atoms/BaseTile/index.d.ts +9 -8
  10. package/dist/types/components/atoms/BaseTile/styles.d.ts +27 -0
  11. package/dist/types/components/organisms/BadgeTile/badge-tile-date-earned.d.ts +5 -0
  12. package/dist/types/components/organisms/BadgeTile/badge-tile-description.d.ts +5 -0
  13. package/dist/types/components/organisms/BadgeTile/badge-tile-media.d.ts +5 -0
  14. package/dist/types/components/organisms/BadgeTile/badge-tile-status.d.ts +5 -0
  15. package/dist/types/components/organisms/BadgeTile/badge-tile-title.d.ts +5 -0
  16. package/dist/types/components/organisms/BadgeTile/styles.d.ts +6 -0
  17. package/dist/types/components/organisms/BannerTile/banner-tile-cta.d.ts +5 -0
  18. package/dist/types/components/organisms/BannerTile/banner-tile-description.d.ts +5 -0
  19. package/dist/types/components/organisms/BannerTile/banner-tile-media.d.ts +5 -0
  20. package/dist/types/components/organisms/BannerTile/banner-tile-title.d.ts +5 -0
  21. package/dist/types/components/organisms/BannerTile/styles.d.ts +6 -0
  22. package/dist/types/components/organisms/ContentTile/content-tile-container.d.ts +2 -4
  23. package/dist/types/components/organisms/ContentTile/content-tile-content.d.ts +2 -4
  24. package/dist/types/components/organisms/ContentTile/index.d.ts +2 -6
  25. package/dist/types/components/organisms/ContentTile/styles.d.ts +6 -0
  26. package/dist/types/components/organisms/Group/index.d.ts +26 -3
  27. package/dist/types/components/organisms/PointsTile/points-tile-formatted-points.d.ts +5 -0
  28. package/dist/types/components/organisms/PointsTile/points-tile-media.d.ts +5 -0
  29. package/dist/types/components/organisms/PointsTile/points-tile-title.d.ts +5 -0
  30. package/dist/types/components/organisms/PointsTile/styles.d.ts +6 -0
  31. package/dist/types/components/organisms/RewardCategoryTile/reward-category-header.d.ts +5 -0
  32. package/dist/types/components/organisms/RewardCategoryTile/reward-category-media.d.ts +5 -0
  33. package/dist/types/components/organisms/RewardCategoryTile/styles.d.ts +6 -0
  34. package/dist/types/components/organisms/RewardTile/index.d.ts +6 -1
  35. package/dist/types/components/organisms/RewardTile/reward-tile-chevron.d.ts +5 -0
  36. package/dist/types/components/organisms/RewardTile/reward-tile-media.d.ts +7 -0
  37. package/dist/types/components/organisms/RewardTile/reward-tile-points.d.ts +5 -0
  38. package/dist/types/components/organisms/RewardTile/reward-tile-summary.d.ts +5 -0
  39. package/dist/types/components/organisms/RewardTile/reward-tile-title.d.ts +5 -0
  40. package/dist/types/components/organisms/RewardTile/styles.d.ts +6 -0
  41. package/dist/types/components/organisms/Section/index.d.ts +8 -0
  42. package/dist/types/components/organisms/Section/styles.d.ts +6 -0
  43. package/dist/types/context/WllSdkContext.d.ts +2 -3
  44. package/dist/types/types/helpers.d.ts +11 -0
  45. package/dist/types/types/theme.d.ts +2 -3
  46. package/dist/types/utils/contextHelpers.d.ts +8 -0
  47. package/dist/web.js +582 -250
  48. package/dist/web.js.map +1 -1
  49. package/package.json +1 -1
package/dist/native.js CHANGED
@@ -19105,17 +19105,26 @@ var useTileSize = function (tile) {
19105
19105
  }, [tile.tileHeight]);
19106
19106
  };
19107
19107
 
19108
+ /**
19109
+ * Renders the body text of a BaseTile component.
19110
+ *
19111
+ * @param {BaseTileBodyProps} props - Component props including text styling options
19112
+ * @returns {JSX.Element|null} The rendered body text or null if conditions for display are not met
19113
+ */
19108
19114
  var BaseTileBody = function (props) {
19109
- var tile = useTileContext();
19110
- var _a = useResponsive$1(),
19111
- isDesktop = _a.isDesktop,
19112
- isTablet = _a.isTablet;
19113
- var _b = tile.configuration,
19114
- body = _b.body,
19115
- artworkUrl = _b.artworkUrl;
19116
- var isHalfSize = useTileSize(tile).isHalfSize;
19115
+ var tileContext = useTileContext();
19116
+ var responsive = useResponsive$1();
19117
+ if (!tileContext || !tileContext.configuration || !responsive) return null;
19118
+ var isDesktop = responsive.isDesktop,
19119
+ isTablet = responsive.isTablet;
19120
+ var _a = tileContext.configuration,
19121
+ body = _a.body,
19122
+ artworkUrl = _a.artworkUrl;
19123
+ var sizeInfo = useTileSize(tileContext);
19124
+ if (!sizeInfo) return null;
19125
+ var isHalfSize = sizeInfo.isHalfSize;
19126
+ // Don't show body for half tiles with image
19117
19127
  if (isHalfSize && artworkUrl || !body) return null;
19118
- // Helper function to determine the number of lines
19119
19128
  var getNumberOfLines = function () {
19120
19129
  if (!isHalfSize && !artworkUrl) return undefined;
19121
19130
  return isDesktop ? 3 : isTablet ? 4 : 3;
@@ -19123,12 +19132,24 @@ var BaseTileBody = function (props) {
19123
19132
  return /*#__PURE__*/React.createElement(Text, _extends({
19124
19133
  variant: "body"
19125
19134
  }, props, {
19135
+ accessibilityRole: "text",
19126
19136
  accessibilityLabel: body,
19127
19137
  numberOfLines: getNumberOfLines(),
19128
19138
  testID: "tile-body"
19129
19139
  }), body);
19130
19140
  };
19131
19141
 
19142
+ /**
19143
+ * Utility function that checks if a component context and its configuration exist.
19144
+ * Works for both tile contexts and banner contexts.
19145
+ *
19146
+ * @param context - The component context to validate (tileContext or bannerContext)
19147
+ * @returns `true` if both the context and its configuration exist, otherwise `false`
19148
+ */
19149
+ function isContextValid(context) {
19150
+ return context !== null && context !== undefined && context.configuration !== null && context.configuration !== undefined;
19151
+ }
19152
+
19132
19153
  var baseStyles = StyleSheet$1.create({
19133
19154
  container: {
19134
19155
  width: '100%',
@@ -19144,15 +19165,35 @@ var baseStyles = StyleSheet$1.create({
19144
19165
  objectFit: 'cover'
19145
19166
  }
19146
19167
  });
19147
- // Dynamic styles hook
19168
+ /**
19169
+ * Custom hook that returns the styles for the BaseTile component.
19170
+ * Applies responsive styling based on the current device.
19171
+ *
19172
+ * @returns StyleSheet styles for the BaseTile component
19173
+ */
19148
19174
  var useBaseTileStyles = function () {
19149
- var tile = useTileContext();
19175
+ var tileContext = useTileContext();
19150
19176
  var theme = useWllSdk().theme;
19151
19177
  var _a = useResponsive$1(),
19152
19178
  isDesktop = _a.isDesktop,
19153
19179
  isTablet = _a.isTablet;
19154
- var isHalfSize = useTileSize(tile).isHalfSize;
19155
- var _b = tile.configuration,
19180
+ if (!tileContext || !tileContext.configuration) {
19181
+ return StyleSheet$1.create({
19182
+ container: baseStyles.container,
19183
+ content: baseStyles.content,
19184
+ header: {
19185
+ marginBottom: 0,
19186
+ marginTop: 0,
19187
+ flexDirection: 'row',
19188
+ alignItems: 'center',
19189
+ justifyContent: 'space-between'
19190
+ },
19191
+ media: baseStyles.media
19192
+ });
19193
+ }
19194
+ var sizeInfo = useTileSize(tileContext);
19195
+ var isHalfSize = (sizeInfo === null || sizeInfo === void 0 ? void 0 : sizeInfo.isHalfSize) || false;
19196
+ var _b = tileContext.configuration,
19156
19197
  artworkUrl = _b.artworkUrl,
19157
19198
  title = _b.title,
19158
19199
  body = _b.body;
@@ -19183,11 +19224,21 @@ var useBaseTileStyles = function () {
19183
19224
  });
19184
19225
  };
19185
19226
 
19227
+ /**
19228
+ * Renders the content section of a BaseTile component.
19229
+ *
19230
+ * @param {BaseTileContentProps} props - Component props
19231
+ * @param {ReactNode} props.children - Child elements to render within the content area
19232
+ * @returns {JSX.Element|null} The rendered content or null if conditions for display are not met
19233
+ */
19186
19234
  var BaseTileContent = function (_a) {
19187
19235
  var children = _a.children;
19188
- var tile = useTileContext();
19189
- var artworkUrl = tile.configuration.artworkUrl;
19190
- var isHalfSize = useTileSize(tile).isHalfSize;
19236
+ var tileContext = useTileContext();
19237
+ if (!isContextValid(tileContext)) return null;
19238
+ var artworkUrl = tileContext.configuration.artworkUrl;
19239
+ var sizeInfo = useTileSize(tileContext);
19240
+ if (!sizeInfo) return null;
19241
+ var isHalfSize = sizeInfo.isHalfSize;
19191
19242
  // For half tiles with an image, don't show other content
19192
19243
  if (isHalfSize && artworkUrl) return null;
19193
19244
  return /*#__PURE__*/React.createElement(View$2, {
@@ -19195,34 +19246,54 @@ var BaseTileContent = function (_a) {
19195
19246
  style: [baseStyles.content, {
19196
19247
  justifyContent: 'center',
19197
19248
  height: !artworkUrl ? '100%' : undefined
19198
- }]
19249
+ }],
19250
+ accessibilityRole: "none"
19199
19251
  }, children);
19200
19252
  };
19201
19253
 
19254
+ /**
19255
+ * Renders the header section of a BaseTile component.
19256
+ *
19257
+ * @param {BaseTileHeaderProps} props - Component props
19258
+ * @param {ReactNode} props.children - Child elements to render within the header
19259
+ * @returns {JSX.Element|null} The rendered header or null if conditions for display are not met
19260
+ */
19202
19261
  var BaseTileHeader = function (_a) {
19203
19262
  var children = _a.children;
19204
- var tile = useTileContext();
19205
- var artworkUrl = tile.configuration.artworkUrl;
19206
- var isHalfSize = useTileSize(tile).isHalfSize;
19263
+ var tileContext = useTileContext();
19264
+ if (!isContextValid(tileContext)) return null;
19265
+ var artworkUrl = tileContext.configuration.artworkUrl;
19266
+ var sizeInfo = useTileSize(tileContext);
19267
+ if (!sizeInfo) return null;
19268
+ var isHalfSize = sizeInfo.isHalfSize;
19207
19269
  // For half tiles with an image, don't show header
19208
19270
  if (isHalfSize && artworkUrl) return null;
19209
19271
  var dynamicStyles = useBaseTileStyles();
19272
+ var combinedStyle = __assign(__assign(__assign({}, dynamicStyles.header), {
19273
+ marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop
19274
+ }), isHalfSize ? {
19275
+ alignItems: 'center'
19276
+ } : {});
19210
19277
  return /*#__PURE__*/React.createElement(View$2, {
19211
- style: [dynamicStyles.header, {
19212
- marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop,
19213
- // @ts-ignore
19214
- textAlign: isHalfSize && 'center'
19215
- }],
19216
- numberOfLines: 1,
19217
- testID: "tile-header"
19278
+ style: combinedStyle,
19279
+ testID: "tile-header",
19280
+ accessibilityRole: "header"
19218
19281
  }, children);
19219
19282
  };
19220
19283
 
19284
+ /**
19285
+ * Renders the media (image) for a BaseTile component.
19286
+ *
19287
+ * @param {ImagePropsNoSource} props - The image props excluding source
19288
+ * @returns {JSX.Element|null} The rendered image or null if no artwork URL is present
19289
+ */
19221
19290
  var BaseTileMedia = function (props) {
19222
- var tile = useTileContext();
19223
- var _a = tile.configuration,
19291
+ var tileContext = useTileContext();
19292
+ if (!isContextValid(tileContext)) return null;
19293
+ var _a = tileContext.configuration,
19224
19294
  artworkUrl = _a.artworkUrl,
19225
- title = _a.title;
19295
+ _b = _a.title,
19296
+ title = _b === void 0 ? '' : _b;
19226
19297
  var styles = useBaseTileStyles();
19227
19298
  if (!artworkUrl) return null;
19228
19299
  return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
@@ -19232,29 +19303,40 @@ var BaseTileMedia = function (props) {
19232
19303
  testID: "tile-media",
19233
19304
  style: [props.style, baseStyles.media, styles.media],
19234
19305
  alt: "Content image".concat(title ? " for ".concat(title) : ''),
19235
- accessibilityElementsHidden: true,
19236
- importantForAccessibility: "no-hide-descendants"
19306
+ accessibilityRole: "image"
19237
19307
  }));
19238
19308
  };
19239
19309
 
19310
+ /**
19311
+ * Renders the title of a BaseTile component.
19312
+ *
19313
+ * @returns {JSX.Element|null} The rendered title or null if conditions for display are not met
19314
+ */
19240
19315
  var BaseTileTitle = function () {
19241
- var tile = useTileContext();
19242
- var theme = useWllSdk().theme;
19243
- var _a = tile.configuration,
19244
- title = _a.title,
19245
- ctaLink = _a.ctaLink,
19246
- artworkUrl = _a.artworkUrl;
19247
- var isHalfSize = useTileSize(tile).isHalfSize;
19316
+ var _a, _b;
19317
+ var tileContext = useTileContext();
19318
+ var sdk = useWllSdk();
19319
+ if (!tileContext || !tileContext.configuration || !sdk) return null;
19320
+ var config = tileContext.configuration;
19321
+ var title = config.title,
19322
+ _c = config.ctaLink,
19323
+ ctaLink = _c === void 0 ? '' : _c,
19324
+ artworkUrl = config.artworkUrl;
19325
+ var sizeInfo = useTileSize(tileContext);
19326
+ if (!sizeInfo) return null;
19327
+ var isHalfSize = sizeInfo.isHalfSize;
19248
19328
  // Don't show title for half tiles with image
19249
19329
  if (isHalfSize && artworkUrl || !title) return null;
19250
19330
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
19251
19331
  variant: "title",
19332
+ accessibilityRole: "header",
19252
19333
  accessibilityLabel: title,
19253
19334
  numberOfLines: 1,
19254
19335
  testID: "tile-title"
19255
19336
  }, title), ctaLink && /*#__PURE__*/React.createElement(Icon, {
19256
19337
  name: "ChevronRight",
19257
- color: theme.derivedSurfaceText[20]
19338
+ color: (_b = (_a = sdk.theme) === null || _a === void 0 ? void 0 : _a.derivedSurfaceText) === null || _b === void 0 ? void 0 : _b[20],
19339
+ accessibilityLabel: "View details"
19258
19340
  }));
19259
19341
  };
19260
19342
 
@@ -19264,6 +19346,9 @@ var BaseTileTitle = function () {
19264
19346
  var TileContext = /*#__PURE__*/React.createContext(null);
19265
19347
  /**
19266
19348
  * Custom hook to access the TileContext.
19349
+ *
19350
+ * @returns {Tile} The current tile from context
19351
+ * @throws {Error} If used outside of a BaseTile
19267
19352
  */
19268
19353
  var useTileContext = function () {
19269
19354
  var context = React.useContext(TileContext);
@@ -19274,19 +19359,27 @@ var useTileContext = function () {
19274
19359
  };
19275
19360
  /**
19276
19361
  * BaseTileContainer component to handle layout and pressable behavior.
19362
+ *
19363
+ * @param {BaseTileRootProps} props - Component props
19364
+ * @returns {JSX.Element} The rendered BaseTileContainer
19277
19365
  */
19278
19366
  var BaseTileContainer = function (_a) {
19279
19367
  var children = _a.children,
19280
19368
  style = _a.style;
19281
19369
  var tile = useTileContext();
19282
- var theme = useWllSdk().theme;
19283
- var isHalfSize = useTileSize(tile).isHalfSize;
19370
+ var sdk = useWllSdk();
19371
+ var sizeInfo = useTileSize(tile);
19372
+ var isHalfSize = (sizeInfo === null || sizeInfo === void 0 ? void 0 : sizeInfo.isHalfSize) || false;
19284
19373
  var _b = tile.configuration,
19285
- ctaLink = _b.ctaLink,
19374
+ _c = _b.ctaLink,
19375
+ ctaLink = _c === void 0 ? '' : _c,
19286
19376
  ctaLinkTarget = _b.ctaLinkTarget,
19287
- title = _b.title;
19377
+ _d = _b.title,
19378
+ title = _d === void 0 ? 'Tile' : _d;
19379
+ var theme = (sdk === null || sdk === void 0 ? void 0 : sdk.theme) || {
19380
+ surface: '#ffffff'
19381
+ };
19288
19382
  var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19289
- // Dynamic layout and styles
19290
19383
  var layout = {
19291
19384
  flexDirection: 'column',
19292
19385
  justifyContent: isHalfSize ? 'center' : 'flex-start',
@@ -19304,19 +19397,32 @@ var BaseTileContainer = function (_a) {
19304
19397
  onPress: handlePress,
19305
19398
  disabled: tile.type !== 'REWARD' && tile.type !== 'REWARD_CATEGORY' && !ctaLink,
19306
19399
  accessible: true,
19307
- role: "button",
19308
- accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : '')
19400
+ accessibilityRole: "button",
19401
+ accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : ''),
19402
+ accessibilityState: {
19403
+ disabled: !ctaLink
19404
+ }
19309
19405
  }, children);
19310
19406
  };
19311
19407
  /**
19312
19408
  * BaseTileRoot component to provide context and render children.
19409
+ *
19410
+ * @param {BaseTileProps} props - Component props
19411
+ * @returns {JSX.Element|null} The rendered BaseTileRoot or null if no tile is provided
19313
19412
  */
19314
19413
  var BaseTileRoot = function (_a) {
19315
19414
  var tile = _a.tile,
19316
- children = _a.children;
19415
+ children = _a.children,
19416
+ style = _a.style;
19417
+ if (!tile) {
19418
+ console.warn('BaseTile: No tile provided');
19419
+ return null;
19420
+ }
19317
19421
  return /*#__PURE__*/React.createElement(TileContext.Provider, {
19318
19422
  value: tile
19319
- }, /*#__PURE__*/React.createElement(BaseTile.Container, null, children));
19423
+ }, /*#__PURE__*/React.createElement(BaseTile.Container, {
19424
+ style: style
19425
+ }, children));
19320
19426
  };
19321
19427
  /**
19322
19428
  * BaseTile component with subcomponents attached.
@@ -19555,6 +19661,12 @@ function withTileFetching(WrappedComponent) {
19555
19661
  };
19556
19662
  }
19557
19663
 
19664
+ /**
19665
+ * Custom hook that returns the styles for the BadgeTile component.
19666
+ * Applies responsive styling based on the current device.
19667
+ *
19668
+ * @returns StyleSheet styles for the BadgeTile component
19669
+ */
19558
19670
  var useBadgeTileStyles = function () {
19559
19671
  var _a = useResponsive$1(),
19560
19672
  isDesktop = _a.isDesktop,
@@ -19603,16 +19715,22 @@ var useBadgeTileStyles = function () {
19603
19715
  });
19604
19716
  };
19605
19717
 
19718
+ /**
19719
+ * Renders the date earned for a Badge Tile.
19720
+ *
19721
+ * @returns JSX.Element or null if badge is not earned or badgeNotEarnedMessage exists
19722
+ */
19606
19723
  var BadgeTileDateEarned = function () {
19607
19724
  var styles = useBadgeTileStyles();
19608
- var tile = useTileContext();
19609
- var configuration = tile.configuration;
19610
- var count = configuration.count,
19611
- awardedDatePrefix = configuration.awardedDatePrefix,
19612
- createdAt = configuration.createdAt,
19613
- badgeNotEarnedMessage = configuration.badgeNotEarnedMessage,
19614
- type = configuration.type;
19725
+ var tileContext = useTileContext();
19615
19726
  var theme = useWllSdk().theme;
19727
+ if (!isContextValid(tileContext)) return null;
19728
+ var _a = tileContext.configuration,
19729
+ count = _a.count,
19730
+ awardedDatePrefix = _a.awardedDatePrefix,
19731
+ createdAt = _a.createdAt,
19732
+ badgeNotEarnedMessage = _a.badgeNotEarnedMessage,
19733
+ type = _a.type;
19616
19734
  // Don't show for Latest type with count=0
19617
19735
  if (type === exports.BadgeTileType.Latest && count === 0) {
19618
19736
  return null;
@@ -19645,12 +19763,18 @@ var BadgeTileDateEarned = function () {
19645
19763
  }, displayText));
19646
19764
  };
19647
19765
 
19766
+ /**
19767
+ * Renders the description for a Badge Tile.
19768
+ *
19769
+ * @returns JSX.Element or null if description is not present
19770
+ */
19648
19771
  var BadgeTileDescription = function () {
19649
- var tile = useTileContext();
19650
- var configuration = tile.configuration;
19651
- var count = configuration.count,
19652
- description = configuration.description,
19653
- type = configuration.type;
19772
+ var tileContext = useTileContext();
19773
+ if (!isContextValid(tileContext)) return null;
19774
+ var _a = tileContext.configuration,
19775
+ count = _a.count,
19776
+ description = _a.description,
19777
+ type = _a.type;
19654
19778
  if (!description) return null;
19655
19779
  // For Latest type, hide description when count = 0
19656
19780
  // For Specific type, always show description
@@ -19668,18 +19792,24 @@ var BadgeTileDescription = function () {
19668
19792
  }, description));
19669
19793
  };
19670
19794
 
19795
+ /**
19796
+ * Renders the media for a Badge Tile.
19797
+ *
19798
+ * @returns JSX.Element or null if media is not present
19799
+ */
19671
19800
  var BadgeTileMedia = function (_a) {
19672
19801
  var children = _a.children,
19673
19802
  alt = _a.alt,
19674
19803
  props = __rest(_a, ["children", "alt"]);
19675
19804
  var styles = useBadgeTileStyles();
19676
- var tile = useTileContext();
19677
- var configuration = tile.configuration;
19678
- var count = configuration.count,
19679
- artworkUrl = configuration.artworkUrl,
19680
- emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl,
19681
- type = configuration.type,
19682
- name = configuration.name;
19805
+ var tileContext = useTileContext();
19806
+ if (!isContextValid(tileContext)) return null;
19807
+ var _b = tileContext.configuration,
19808
+ count = _b.count,
19809
+ artworkUrl = _b.artworkUrl,
19810
+ emptyBadgeArtworkUrl = _b.emptyBadgeArtworkUrl,
19811
+ type = _b.type,
19812
+ name = _b.name;
19683
19813
  var displayUrl = type === exports.BadgeTileType.Specific ? artworkUrl : count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
19684
19814
  if (!displayUrl) return null;
19685
19815
  return /*#__PURE__*/React.createElement(View$2, {
@@ -19696,12 +19826,18 @@ var BadgeTileMedia = function (_a) {
19696
19826
  })), children);
19697
19827
  };
19698
19828
 
19829
+ /**
19830
+ * Renders the status for a Badge Tile.
19831
+ *
19832
+ * @returns JSX.Element or null if badge is not earned or badgeNotEarnedMessage exists
19833
+ */
19699
19834
  var BadgeTileStatus = function () {
19700
19835
  var styles = useBadgeTileStyles();
19701
- var tile = useTileContext();
19702
- var configuration = tile.configuration;
19703
- var count = configuration.count,
19704
- type = configuration.type;
19836
+ var tileContext = useTileContext();
19837
+ if (!isContextValid(tileContext)) return null;
19838
+ var _a = tileContext.configuration,
19839
+ count = _a.count,
19840
+ type = _a.type;
19705
19841
  if (type !== exports.BadgeTileType.Specific || count === 1) {
19706
19842
  return null;
19707
19843
  }
@@ -19725,14 +19861,20 @@ var BadgeTileStatus = function () {
19725
19861
  }, count, "x"));
19726
19862
  };
19727
19863
 
19864
+ /**
19865
+ * Renders the title for a Badge Tile.
19866
+ *
19867
+ * @returns JSX.Element or null if name is not present
19868
+ */
19728
19869
  var BadgeTileTitle = function () {
19729
19870
  var styles = useBadgeTileStyles();
19730
- var tile = useTileContext();
19731
- var configuration = tile.configuration;
19732
- var count = configuration.count,
19733
- name = configuration.name,
19734
- emptyBadgeMessage = configuration.emptyBadgeMessage,
19735
- type = configuration.type;
19871
+ var tileContext = useTileContext();
19872
+ if (!isContextValid(tileContext)) return null;
19873
+ var _a = tileContext.configuration,
19874
+ count = _a.count,
19875
+ name = _a.name,
19876
+ emptyBadgeMessage = _a.emptyBadgeMessage,
19877
+ type = _a.type;
19736
19878
  var displayText = type === exports.BadgeTileType.Specific ? name : count === 0 ? emptyBadgeMessage : name;
19737
19879
  if (!displayText) return null;
19738
19880
  return /*#__PURE__*/React.createElement(View$2, {
@@ -19751,7 +19893,7 @@ var BadgeTileTitle = function () {
19751
19893
 
19752
19894
  /**
19753
19895
  * The main BadgeTile component.
19754
- *
19896
+ * @returns JSX.Element or null if tile is not active or tileHeight is not full.
19755
19897
  * This component renders a badge tile with optional media, status, title, description, and date earned.
19756
19898
  */
19757
19899
  var BadgeTileRoot = function (_a) {
@@ -19776,15 +19918,23 @@ var BadgeTile = Object.assign(BadgeTileRoot, {
19776
19918
  });
19777
19919
  var BadgeTile$1 = withTileFetching(BadgeTile);
19778
19920
 
19921
+ /**
19922
+ * Renders the call to action of a Banner Tile.
19923
+ *
19924
+ * @returns JSX.Element or null if no text or required props are present
19925
+ */
19779
19926
  var BannerTileCTA = function () {
19780
- var tile = useBannerContext();
19781
- var _a = tile.configuration,
19782
- ctaText = _a.ctaText,
19783
- ctaLink = _a.ctaLink,
19927
+ var bannerContext = useBannerContext();
19928
+ if (!isContextValid(bannerContext)) return null;
19929
+ var _a = bannerContext.configuration,
19930
+ _b = _a.ctaText,
19931
+ ctaText = _b === void 0 ? '' : _b,
19932
+ _c = _a.ctaLink,
19933
+ ctaLink = _c === void 0 ? '' : _c,
19784
19934
  ctaLinkTarget = _a.ctaLinkTarget;
19785
- var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19786
- if (!ctaText) return null;
19787
- var hint = ctaLinkTarget === 'NEW_WINDOW' ? "Opens ".concat(ctaLink, " in a new window") : "Takes you to ".concat(ctaLink);
19935
+ if (!ctaText || !ctaLink) return null;
19936
+ var handlePress = useHandleTilePress(bannerContext, ctaLink, ctaLinkTarget);
19937
+ var hint = ctaLink ? ctaLinkTarget === exports.CTALinkTarget.newWindow ? "Opens ".concat(ctaLink, " in a new window") : "Takes you to ".concat(ctaLink) : '';
19788
19938
  return /*#__PURE__*/React.createElement(Button, {
19789
19939
  testID: "banner-tile-cta",
19790
19940
  title: ctaText,
@@ -19794,6 +19944,12 @@ var BannerTileCTA = function () {
19794
19944
  });
19795
19945
  };
19796
19946
 
19947
+ /**
19948
+ * Custom hook that returns the styles for the BannerTile component.
19949
+ * Applies responsive styling based on the current device.
19950
+ *
19951
+ * @returns StyleSheet styles for the BannerTile component
19952
+ */
19797
19953
  var useBannerTileStyles = function () {
19798
19954
  var _a = useResponsive$1(),
19799
19955
  isDesktop = _a.isDesktop,
@@ -19830,42 +19986,45 @@ var useBannerTileStyles = function () {
19830
19986
  });
19831
19987
  };
19832
19988
 
19989
+ /**
19990
+ * Renders the description text of a Banner Tile.
19991
+ *
19992
+ * @returns JSX.Element or null if no description is present
19993
+ */
19833
19994
  var BannerTileDescription = function () {
19834
19995
  var styles = useBannerTileStyles();
19835
- var configuration = useBannerContext().configuration;
19836
- var description = configuration.description;
19837
- var theme = useWllSdk().theme;
19996
+ var bannerContext = useBannerContext();
19997
+ if (!isContextValid(bannerContext)) return null;
19998
+ var description = bannerContext.configuration.description;
19838
19999
  if (!description) return null;
19839
- return /*#__PURE__*/React.createElement(View$2, {
19840
- accessible: true,
20000
+ return /*#__PURE__*/React.createElement(Text, {
20001
+ style: styles.description,
20002
+ accessibilityRole: "text",
19841
20003
  accessibilityLabel: description,
19842
20004
  testID: "banner-tile-description"
19843
- }, /*#__PURE__*/React.createElement(Text, {
19844
- style: [styles.description, {
19845
- color: theme.derivedSurfaceText[20]
19846
- }],
19847
- accessibilityElementsHidden: true,
19848
- importantForAccessibility: "no-hide-descendants"
19849
- }, description));
20005
+ }, description);
19850
20006
  };
19851
20007
 
20008
+ /**
20009
+ * Renders the media of a Banner Tile.
20010
+ *
20011
+ * @returns JSX.Element or null if no media is present
20012
+ */
19852
20013
  var BannerTileMedia = function (_a) {
19853
20014
  var isArtworkOnly = _a.isArtworkOnly;
19854
20015
  var styles = useBannerTileStyles();
19855
- var configuration = useBannerContext().configuration;
19856
- var _b = configuration,
20016
+ var bannerContext = useBannerContext();
20017
+ if (!isContextValid(bannerContext)) return null;
20018
+ var _b = bannerContext.configuration,
19857
20019
  artworkUrl = _b.artworkUrl,
19858
20020
  title = _b.title;
19859
20021
  if (!artworkUrl) return null;
19860
20022
  var containerStyle = {
19861
20023
  width: isArtworkOnly ? '100%' : '30%'
19862
20024
  };
19863
- return /*#__PURE__*/React.createElement(View$2
19864
- // @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
19865
- , {
20025
+ return /*#__PURE__*/React.createElement(View$2, {
19866
20026
  style: [styles.mediaContainer, containerStyle],
19867
- accessible: true,
19868
- role: "img",
20027
+ accessibilityRole: "image",
19869
20028
  accessibilityLabel: "Banner image".concat(title ? " for ".concat(title) : ''),
19870
20029
  testID: "banner-tile-media"
19871
20030
  }, /*#__PURE__*/React.createElement(ProgressiveImage, {
@@ -19873,27 +20032,28 @@ var BannerTileMedia = function (_a) {
19873
20032
  uri: artworkUrl
19874
20033
  },
19875
20034
  style: styles.media,
19876
- alt: "Banner image".concat(title ? " for ".concat(title) : ''),
19877
- accessibilityElementsHidden: true,
19878
- importantForAccessibility: "no-hide-descendants"
20035
+ alt: "Banner image".concat(title ? " for ".concat(title) : '')
19879
20036
  }));
19880
20037
  };
19881
20038
 
20039
+ /**
20040
+ * Renders the title of a Banner Tile.
20041
+ *
20042
+ * @returns JSX.Element or null if no title is present
20043
+ */
19882
20044
  var BannerTileTitle = function () {
19883
20045
  var styles = useBannerTileStyles();
19884
- var configuration = useBannerContext().configuration;
19885
- var title = configuration.title;
20046
+ var bannerContext = useBannerContext();
20047
+ if (!isContextValid(bannerContext)) return null;
20048
+ var title = bannerContext.configuration.title;
19886
20049
  if (!title) return null;
19887
- return /*#__PURE__*/React.createElement(View$2, {
19888
- accessible: true,
19889
- accessibilityLabel: title
19890
- }, /*#__PURE__*/React.createElement(Text, {
20050
+ return /*#__PURE__*/React.createElement(Text, {
19891
20051
  variant: "title",
19892
20052
  testID: "banner-tile-title",
19893
20053
  style: styles.title,
19894
- accessibilityElementsHidden: true,
19895
- importantForAccessibility: "no-hide-descendants"
19896
- }, title));
20054
+ accessibilityRole: "header",
20055
+ accessibilityLabel: title
20056
+ }, title);
19897
20057
  };
19898
20058
 
19899
20059
  /**
@@ -19903,16 +20063,20 @@ var BannerTileTitle = function () {
19903
20063
  * @returns `true` if the tile has no title, description, or CTA text.
19904
20064
  */
19905
20065
  var isArtworkOnly$1 = function (configuration) {
20066
+ if (!configuration) return true;
19906
20067
  return !configuration.title && !configuration.description && !configuration.ctaText;
19907
20068
  };
19908
20069
  /**
19909
20070
  * The main BannerTile component.
19910
20071
  *
19911
20072
  * This component renders a banner tile with optional media, title, description, and CTA.
20073
+ *
20074
+ * @param {BannerTileProps} props - Component props
20075
+ * @returns {JSX.Element | null} Rendered component or null if tile is inactive
19912
20076
  */
19913
20077
  var BannerTileRoot = function (_a) {
19914
20078
  var tile = _a.tile;
19915
- if (!tile || !tile.active) return null;
20079
+ if (!tile || !tile.active || !tile.configuration) return null;
19916
20080
  var configuration = tile.configuration;
19917
20081
  return /*#__PURE__*/React.createElement(BaseBanner, {
19918
20082
  tile: tile
@@ -19940,6 +20104,12 @@ var ContentTileContainer = function (_a) {
19940
20104
  return /*#__PURE__*/React.createElement(BaseTile.Container, null, children);
19941
20105
  };
19942
20106
 
20107
+ /**
20108
+ * Custom hook that returns the styles for the ContentTile component.
20109
+ * Applies responsive styling based on the current device.
20110
+ *
20111
+ * @returns StyleSheet styles for the ContentTile component
20112
+ */
19943
20113
  var useContentTileStyles = function () {
19944
20114
  var theme = useWllSdk().theme;
19945
20115
  var _a = useResponsive$1(),
@@ -19966,8 +20136,9 @@ var ContentTileContent = function (_a) {
19966
20136
  };
19967
20137
 
19968
20138
  var ContentTileHeader = function () {
19969
- var tile = useTileContext();
19970
- var title = tile.configuration.title;
20139
+ var tileContext = useTileContext();
20140
+ if (!isContextValid(tileContext)) return null;
20141
+ var title = tileContext.configuration.title;
19971
20142
  if (!title) return null;
19972
20143
  return /*#__PURE__*/React.createElement(BaseTile.Header, null, /*#__PURE__*/React.createElement(BaseTile.Title, null));
19973
20144
  };
@@ -20494,6 +20665,12 @@ var styles$1 = StyleSheet$1.create({
20494
20665
  }
20495
20666
  });
20496
20667
 
20668
+ /**
20669
+ * Custom hook that returns the styles for the Section component.
20670
+ * Applies responsive styling based on the current device.
20671
+ *
20672
+ * @returns StyleSheet styles for the Section component
20673
+ */
20497
20674
  var useSectionStyles = function () {
20498
20675
  var _a = useResponsive$1(),
20499
20676
  isDesktop = _a.isDesktop,
@@ -20515,9 +20692,13 @@ var useSectionStyles = function () {
20515
20692
  var SectionContext = /*#__PURE__*/React.createContext(undefined);
20516
20693
  /**
20517
20694
  * Custom hook to fetch section data.
20695
+ *
20696
+ * @param {TSection} [section] - The section data if provided directly
20697
+ * @param {string} [sectionId] - The ID of the section to fetch
20698
+ * @returns {Object} Object containing section data, loading state, and any error
20518
20699
  */
20519
20700
  var useSectionData = function (section, sectionId) {
20520
- var getSectionByID = useWllSdk().getSectionByID;
20701
+ var sdk = useWllSdk();
20521
20702
  var _a = React.useState(section || null),
20522
20703
  sectionData = _a[0],
20523
20704
  setSectionData = _a[1];
@@ -20530,7 +20711,7 @@ var useSectionData = function (section, sectionId) {
20530
20711
  React.useEffect(function () {
20531
20712
  if (section) {
20532
20713
  setSectionData(section);
20533
- } else if (sectionId) {
20714
+ } else if (sectionId && sdk && sdk.getSectionByID) {
20534
20715
  var fetchSection = function () {
20535
20716
  return __awaiter(void 0, void 0, void 0, function () {
20536
20717
  var response, err_1;
@@ -20541,13 +20722,13 @@ var useSectionData = function (section, sectionId) {
20541
20722
  _a.label = 1;
20542
20723
  case 1:
20543
20724
  _a.trys.push([1, 3, 4, 5]);
20544
- return [4 /*yield*/, getSectionByID(sectionId)];
20725
+ return [4 /*yield*/, sdk.getSectionByID(sectionId)];
20545
20726
  case 2:
20546
20727
  response = _a.sent();
20547
- if (response.status === 'success' && response.data) {
20728
+ if (response && response.status === 'success' && response.data) {
20548
20729
  setSectionData(response.data);
20549
20730
  } else {
20550
- setError(response.error || 'Failed to fetch section data.');
20731
+ setError(response && response.error || 'Failed to fetch section data.');
20551
20732
  }
20552
20733
  return [3 /*break*/, 5];
20553
20734
  case 3:
@@ -20565,7 +20746,7 @@ var useSectionData = function (section, sectionId) {
20565
20746
  };
20566
20747
  fetchSection();
20567
20748
  }
20568
- }, [section, sectionId, getSectionByID]);
20749
+ }, [section, sectionId, sdk]);
20569
20750
  return {
20570
20751
  sectionData: sectionData,
20571
20752
  isLoading: isLoading,
@@ -20574,20 +20755,26 @@ var useSectionData = function (section, sectionId) {
20574
20755
  };
20575
20756
  /**
20576
20757
  * Component to display an empty state with a message.
20758
+ *
20759
+ * @param {Object} props - Component props
20760
+ * @param {string} props.message - Message to display in the empty state
20761
+ * @returns {JSX.Element} The empty state component
20577
20762
  */
20578
20763
  var EmptyState = function (_a) {
20579
20764
  var message = _a.message;
20580
20765
  return /*#__PURE__*/React.createElement(View$2, {
20581
20766
  style: commonStyles.emptyContainer,
20582
- accessible: true,
20767
+ accessibilityRole: "text",
20583
20768
  accessibilityLabel: "Empty state: ".concat(message)
20584
- }, /*#__PURE__*/React.createElement(Text$3, {
20585
- accessibilityElementsHidden: true,
20586
- importantForAccessibility: "no-hide-descendants"
20587
- }, message));
20769
+ }, /*#__PURE__*/React.createElement(Text$3, null, message));
20588
20770
  };
20589
20771
  /**
20590
20772
  * The Section component renders a section based on its type (e.g., Banner, Grid).
20773
+ *
20774
+ * @param {SectionProps} props - Component props
20775
+ * @param {TSection} [props.section] - The section data
20776
+ * @param {string} [props.sectionId] - The ID of the section to fetch
20777
+ * @returns {JSX.Element|null} The rendered section or null if invalid props
20591
20778
  */
20592
20779
  var Section = function (_a) {
20593
20780
  var section = _a.section,
@@ -20614,12 +20801,23 @@ var Section = function (_a) {
20614
20801
  });
20615
20802
  }
20616
20803
  // Filter out inactive tiles before passing to child components
20617
- var activeTiles = sortByPriority(sectionData.tiles.filter(function (tile) {
20618
- return tile.active;
20804
+ var activeTiles = sectionData.tiles && sortByPriority(sectionData.tiles.filter(function (tile) {
20805
+ return tile && tile.active;
20619
20806
  }));
20807
+ if (!activeTiles || activeTiles.length === 0) {
20808
+ return /*#__PURE__*/React.createElement(EmptyState, {
20809
+ message: "No active tiles available."
20810
+ });
20811
+ }
20620
20812
  var sectionWithActiveTiles = __assign(__assign({}, sectionData), {
20621
20813
  tiles: activeTiles
20622
20814
  });
20815
+ if (!sectionData.type) {
20816
+ console.warn('Section is missing a type');
20817
+ return /*#__PURE__*/React.createElement(EmptyState, {
20818
+ message: "Invalid section configuration."
20819
+ });
20820
+ }
20623
20821
  switch (sectionData.type) {
20624
20822
  case exports.SectionType.Banner:
20625
20823
  return /*#__PURE__*/React.createElement(Carousel, {
@@ -20643,13 +20841,21 @@ var Section = function (_a) {
20643
20841
  }, /*#__PURE__*/React.createElement(View$2, {
20644
20842
  style: styles.section,
20645
20843
  accessible: true,
20646
- role: "region",
20647
- "aria-label": "Section: ".concat(sectionData.title || 'Untitled section'),
20648
- "aria-description": sectionData.description || undefined
20844
+ accessibilityLabel: "Section: ".concat(sectionData.title || 'Untitled section'),
20845
+ accessibilityHint: sectionData.description || undefined
20649
20846
  }, renderSectionContent())) : null;
20650
20847
  };
20651
20848
 
20849
+ /**
20850
+ * Context for providing group data to child components
20851
+ */
20652
20852
  var GroupContext = /*#__PURE__*/React.createContext(undefined);
20853
+ /**
20854
+ * Custom hook to access the GroupContext
20855
+ *
20856
+ * @returns {GroupContextType} The group context data
20857
+ * @throws {Error} If used outside of a GroupProvider
20858
+ */
20653
20859
  var useGroupContext = function () {
20654
20860
  var context = React.useContext(GroupContext);
20655
20861
  if (!context) {
@@ -20657,9 +20863,14 @@ var useGroupContext = function () {
20657
20863
  }
20658
20864
  return context;
20659
20865
  };
20660
- // Custom Hook for Group Data
20866
+ /**
20867
+ * Custom hook to fetch and manage group data
20868
+ *
20869
+ * @param {string} id - The ID of the group to fetch
20870
+ * @returns {Object} Object containing group data, loading state, and any error
20871
+ */
20661
20872
  var useGroupData = function (id) {
20662
- var getGroupByID = useWllSdk().getGroupByID;
20873
+ var sdk = useWllSdk();
20663
20874
  var _a = React.useState(null),
20664
20875
  groupData = _a[0],
20665
20876
  setGroupData = _a[1];
@@ -20671,27 +20882,33 @@ var useGroupData = function (id) {
20671
20882
  setIsLoading = _c[1];
20672
20883
  var fetchGroup = React.useCallback(function () {
20673
20884
  return __awaiter(void 0, void 0, void 0, function () {
20674
- var response;
20885
+ var response, err_1;
20675
20886
  return __generator(this, function (_a) {
20676
20887
  switch (_a.label) {
20677
20888
  case 0:
20889
+ if (!id || !sdk || !sdk.getGroupByID) {
20890
+ setError('Unable to fetch group data: invalid configuration');
20891
+ setIsLoading(false);
20892
+ return [2 /*return*/];
20893
+ }
20678
20894
  setIsLoading(true);
20679
20895
  setError(null);
20680
20896
  _a.label = 1;
20681
20897
  case 1:
20682
20898
  _a.trys.push([1, 3, 4, 5]);
20683
- return [4 /*yield*/, getGroupByID(id)];
20899
+ return [4 /*yield*/, sdk.getGroupByID(id)];
20684
20900
  case 2:
20685
20901
  response = _a.sent();
20686
- if (response.status === 'success' && response.data) {
20902
+ if (response && response.status === 'success' && response.data) {
20687
20903
  setGroupData(response.data);
20688
20904
  } else {
20689
- setError(response.error || 'Failed to fetch group data.');
20905
+ setError(response && response.error || 'Failed to fetch group data.');
20690
20906
  }
20691
20907
  return [3 /*break*/, 5];
20692
20908
  case 3:
20693
- _a.sent();
20909
+ err_1 = _a.sent();
20694
20910
  setError('Failed to fetch group data. Please try again later.');
20911
+ console.error('Error fetching group:', err_1);
20695
20912
  return [3 /*break*/, 5];
20696
20913
  case 4:
20697
20914
  setIsLoading(false);
@@ -20701,7 +20918,7 @@ var useGroupData = function (id) {
20701
20918
  }
20702
20919
  });
20703
20920
  });
20704
- }, [id, getGroupByID]);
20921
+ }, [id, sdk]);
20705
20922
  React.useEffect(function () {
20706
20923
  fetchGroup();
20707
20924
  }, [fetchGroup]);
@@ -20711,6 +20928,55 @@ var useGroupData = function (id) {
20711
20928
  error: error
20712
20929
  };
20713
20930
  };
20931
+ /**
20932
+ * Component to display an empty state with a message
20933
+ *
20934
+ * @param {GroupEmptyStateProps} props - Component props
20935
+ * @param {string} props.message - Message to display
20936
+ * @returns {JSX.Element} The empty state component
20937
+ */
20938
+ var GroupEmptyState = function (_a) {
20939
+ var message = _a.message;
20940
+ return /*#__PURE__*/React.createElement(View$2, {
20941
+ style: commonStyles.emptyContainer,
20942
+ accessible: true,
20943
+ accessibilityLabel: "Empty state: ".concat(message)
20944
+ }, /*#__PURE__*/React.createElement(Text, {
20945
+ variant: "body"
20946
+ }, message));
20947
+ };
20948
+ /**
20949
+ * Component to render all sections in a group
20950
+ *
20951
+ * @returns {JSX.Element} The sections component
20952
+ */
20953
+ var GroupSections = function () {
20954
+ var groupData = useGroupContext().groupData;
20955
+ if (!groupData || !groupData.sections || groupData.sections.length === 0) {
20956
+ return /*#__PURE__*/React.createElement(GroupEmptyState, {
20957
+ message: "This group doesn't have any sections"
20958
+ });
20959
+ }
20960
+ // Filter out inactive sections and null/undefined values before sorting
20961
+ var activeSections = groupData.sections.filter(function (section) {
20962
+ return section && section.active;
20963
+ });
20964
+ if (activeSections.length === 0) {
20965
+ return /*#__PURE__*/React.createElement(GroupEmptyState, {
20966
+ message: "This group doesn't have any active sections"
20967
+ });
20968
+ }
20969
+ var sortedSections = sortByPriority(activeSections);
20970
+ return /*#__PURE__*/React.createElement(View$2, {
20971
+ accessible: true,
20972
+ accessibilityLabel: "Group: ".concat(groupData.name || 'Unnamed group')
20973
+ }, sortedSections.map(function (section) {
20974
+ return /*#__PURE__*/React.createElement(Section, {
20975
+ key: section.id,
20976
+ section: section
20977
+ });
20978
+ }));
20979
+ };
20714
20980
  /**
20715
20981
  * A page-level component that represents a Group view in the application.
20716
20982
  *
@@ -20719,18 +20985,25 @@ var useGroupData = function (id) {
20719
20985
  * loading, errors, and empty states, providing a complete page experience for
20720
20986
  * viewing group content.
20721
20987
  *
20722
- * @param id - The unique identifier of the group to fetch and display.
20988
+ * @param {GroupProps} props - Component props
20989
+ * @param {string} props.id - The unique identifier of the group to fetch and display
20990
+ * @returns {JSX.Element|null} The rendered group or null if invalid ID
20723
20991
  */
20724
20992
  var Group = function (_a) {
20725
20993
  var id = _a.id;
20726
- if (!id) return null;
20994
+ if (!id) {
20995
+ console.warn('Group component requires id prop');
20996
+ return null;
20997
+ }
20727
20998
  var _b = useGroupData(id),
20728
20999
  groupData = _b.groupData,
20729
21000
  isLoading = _b.isLoading,
20730
21001
  error = _b.error;
20731
21002
  if (isLoading) {
20732
21003
  return /*#__PURE__*/React.createElement(View$2, {
20733
- style: commonStyles.emptyContainer
21004
+ style: commonStyles.emptyContainer,
21005
+ accessible: true,
21006
+ accessibilityLabel: "Loading group data"
20734
21007
  }, /*#__PURE__*/React.createElement(Skeleton, null));
20735
21008
  }
20736
21009
  if (error || !groupData) {
@@ -20746,33 +21019,6 @@ var Group = function (_a) {
20746
21019
  "data-testid": "group-container"
20747
21020
  }, /*#__PURE__*/React.createElement(GroupSections, null)));
20748
21021
  };
20749
- var GroupSections = function () {
20750
- var groupData = useGroupContext().groupData;
20751
- if (!groupData.sections || groupData.sections.length === 0) {
20752
- return /*#__PURE__*/React.createElement(GroupEmptyState, {
20753
- message: "This group doesn't have any sections"
20754
- });
20755
- }
20756
- // Filter out inactive sections before sorting
20757
- var activeSections = groupData.sections.filter(function (section) {
20758
- return section.active;
20759
- });
20760
- var sortedSections = sortByPriority(activeSections);
20761
- return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
20762
- return /*#__PURE__*/React.createElement(Section, {
20763
- key: section.id,
20764
- section: section
20765
- });
20766
- }));
20767
- };
20768
- var GroupEmptyState = function (_a) {
20769
- var message = _a.message;
20770
- return /*#__PURE__*/React.createElement(View$2, {
20771
- style: commonStyles.emptyContainer
20772
- }, /*#__PURE__*/React.createElement(Text, {
20773
- variant: "body"
20774
- }, message));
20775
- };
20776
21022
 
20777
21023
  /**
20778
21024
  * Cleans up a number by removing any whitespace and ensuring it's a valid number
@@ -20980,6 +21226,12 @@ var Spacer = function (_a) {
20980
21226
  }, rest));
20981
21227
  };
20982
21228
 
21229
+ /**
21230
+ * Custom hook that returns the styles for the PointsTile component.
21231
+ * Applies responsive styling based on the current device.
21232
+ *
21233
+ * @returns StyleSheet styles for the PointsTile component
21234
+ */
20983
21235
  var usePointsTileStyles = function (isFullSize) {
20984
21236
  var _a = useResponsive$1(),
20985
21237
  isDesktop = _a.isDesktop,
@@ -21023,23 +21275,30 @@ var usePointsTileStyles = function (isFullSize) {
21023
21275
  });
21024
21276
  };
21025
21277
 
21278
+ /**
21279
+ * Renders formatted points value for a Points Tile.
21280
+ *
21281
+ * @returns JSX.Element or null if points are undefined or zero
21282
+ */
21026
21283
  var PointsTileFormattedPoints = function () {
21027
21284
  var styles = usePointsTileStyles();
21028
- var configuration = useTileContext().configuration;
21029
- var _a = configuration,
21285
+ var tileContext = useTileContext();
21286
+ if (!isContextValid(tileContext)) return null;
21287
+ var _a = tileContext.configuration,
21030
21288
  _b = _a.pointsMultiplier,
21031
21289
  pointsMultiplier = _b === void 0 ? 1 : _b,
21032
21290
  _c = _a.pointsPrefix,
21033
21291
  pointsPrefix = _c === void 0 ? '' : _c,
21034
21292
  _d = _a.pointsSuffix,
21035
21293
  pointsSuffix = _d === void 0 ? 'pts' : _d,
21036
- points = _a.points;
21294
+ _e = _a.points,
21295
+ points = _e === void 0 ? 0 : _e;
21037
21296
  if (points === undefined || points === 0) return null;
21038
21297
  var calculatedPoints = applyMultiplier(points, pointsMultiplier);
21039
- var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix);
21298
+ var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix).trim();
21040
21299
  return /*#__PURE__*/React.createElement(View$2, {
21041
21300
  testID: "points-tile-points",
21042
- accessible: true,
21301
+ accessibilityRole: "text",
21043
21302
  accessibilityLabel: "Points value: ".concat(fullPointsText)
21044
21303
  }, /*#__PURE__*/React.createElement(Row, {
21045
21304
  align: "center",
@@ -21057,55 +21316,64 @@ var PointsTileFormattedPoints = function () {
21057
21316
  }, pointsSuffix) : null));
21058
21317
  };
21059
21318
 
21319
+ /**
21320
+ * Renders the media of a Points Tile.
21321
+ *
21322
+ * @returns JSX.Element or null if media is not present
21323
+ */
21060
21324
  var PointsTileMedia = function (_a) {
21061
21325
  var isFullSize = _a.isFullSize;
21062
- var configuration = useTileContext().configuration;
21063
- var _b = configuration,
21326
+ var tileContext = useTileContext();
21327
+ if (!isContextValid(tileContext)) return null;
21328
+ var _b = tileContext.configuration,
21064
21329
  artworkUrl = _b.artworkUrl,
21065
- title = _b.title;
21330
+ _c = _b.title,
21331
+ title = _c === void 0 ? 'Points' : _c;
21066
21332
  var styles = usePointsTileStyles(isFullSize);
21067
21333
  if (!artworkUrl) return null;
21068
21334
  return /*#__PURE__*/React.createElement(View$2, {
21069
21335
  testID: "points-tile-media",
21070
- accessible: true,
21071
- role: "img",
21072
- accessibilityLabel: "Points tile image for ".concat(title),
21073
- style: styles.imageContainer
21336
+ style: styles.imageContainer,
21337
+ accessibilityRole: "image",
21338
+ accessibilityLabel: "Points tile image for ".concat(title)
21074
21339
  }, /*#__PURE__*/React.createElement(Image$2, {
21075
21340
  source: {
21076
21341
  uri: artworkUrl
21077
21342
  },
21078
21343
  style: styles.image,
21079
- resizeMode: isFullSize ? 'cover' : 'contain',
21080
- accessibilityElementsHidden: true,
21081
- importantForAccessibility: "no-hide-descendants"
21344
+ resizeMode: isFullSize ? 'cover' : 'contain'
21082
21345
  }));
21083
21346
  };
21084
21347
 
21348
+ /**
21349
+ * Renders the title of a Points Tile.
21350
+ *
21351
+ * @returns JSX.Element or null if no title is present
21352
+ */
21085
21353
  var PointsTileTitle = function () {
21086
- var configuration = useTileContext().configuration;
21087
- var title = configuration.title;
21354
+ var tileContext = useTileContext();
21355
+ if (!isContextValid(tileContext)) return null;
21356
+ var title = tileContext.configuration.title;
21088
21357
  if (!title) return null;
21089
- return /*#__PURE__*/React.createElement(View$2, {
21090
- testID: "points-tile-title",
21091
- accessible: true,
21092
- accessibilityLabel: title,
21093
- role: "banner"
21094
- }, /*#__PURE__*/React.createElement(Text, {
21358
+ return /*#__PURE__*/React.createElement(Text, {
21095
21359
  variant: "eyebrow",
21096
- accessibilityElementsHidden: true,
21097
- importantForAccessibility: "no-hide-descendants"
21098
- }, title));
21360
+ testID: "points-tile-title",
21361
+ accessibilityRole: "header",
21362
+ accessibilityLabel: title
21363
+ }, title);
21099
21364
  };
21100
21365
 
21101
21366
  /**
21102
21367
  * The PointsTile component renders a tile with media, title, and formatted points.
21103
21368
  *
21104
- * @param tile - The tile data to render.
21369
+ * @param props - Component props
21370
+ * @returns JSX.Element or null if tile is inactive or missing required props
21105
21371
  */
21106
21372
  var PointsTileRoot = function (_a) {
21107
21373
  var tile = _a.tile;
21108
- if (!tile || !tile.active) return null;
21374
+ if (!tile || !tile.active || !tile.configuration) return null;
21375
+ var config = tile.configuration;
21376
+ if (!config) return null;
21109
21377
  var isFullSize = useTileSize(tile).isFullSize;
21110
21378
  var styles = usePointsTileStyles(isFullSize);
21111
21379
  return /*#__PURE__*/React.createElement(BaseTile, {
@@ -21130,6 +21398,12 @@ var PointsTile = Object.assign(PointsTileRoot, {
21130
21398
  });
21131
21399
  var PointsTile$1 = withTileFetching(PointsTile);
21132
21400
 
21401
+ /**
21402
+ * Custom hook that returns the styles for the RewardCategory component.
21403
+ * Applies responsive styling based on the current device.
21404
+ *
21405
+ * @returns StyleSheet styles for the RewardCategory component
21406
+ */
21133
21407
  var useRewardCategoryTileStyles = function () {
21134
21408
  var _a = useResponsive$1(),
21135
21409
  isDesktop = _a.isDesktop,
@@ -21161,21 +21435,29 @@ var useRewardCategoryTileStyles = function () {
21161
21435
  });
21162
21436
  };
21163
21437
 
21438
+ /**
21439
+ * Renders the header for a Reward Category Tile.
21440
+ *
21441
+ * @returns JSX.Element or null if showName is false or name is not present
21442
+ */
21164
21443
  var RewardCategoryHeader = function () {
21165
21444
  var styles = useRewardCategoryTileStyles();
21166
21445
  var theme = useWllSdk().theme;
21167
- var configuration = useTileContext().configuration;
21168
- var _a = configuration,
21169
- showName = _a.showName,
21170
- name = _a.name;
21446
+ var tileContext = useTileContext();
21447
+ if (!isContextValid(tileContext)) return null;
21448
+ var _a = tileContext.configuration,
21449
+ _b = _a.showName,
21450
+ showName = _b === void 0 ? true : _b,
21451
+ _c = _a.name,
21452
+ name = _c === void 0 ? '' : _c;
21171
21453
  if (!showName || !name) return null;
21172
21454
  return /*#__PURE__*/React.createElement(View$2, {
21173
21455
  style: [styles.header, {
21174
21456
  backgroundColor: theme.primary
21175
21457
  }],
21176
- accessible: true,
21177
- accessibilityLabel: "Reward category: ".concat(name),
21178
- testID: "reward-category-header"
21458
+ testID: "reward-category-header",
21459
+ accessibilityRole: "header",
21460
+ accessibilityLabel: "Reward category: ".concat(name)
21179
21461
  }, /*#__PURE__*/React.createElement(Text, {
21180
21462
  style: [styles.headerText, {
21181
21463
  color: theme.primaryText
@@ -21185,12 +21467,19 @@ var RewardCategoryHeader = function () {
21185
21467
  }, name));
21186
21468
  };
21187
21469
 
21470
+ /**
21471
+ * Renders the background media for a Reward Category Tile.
21472
+ *
21473
+ * @returns JSX.Element or null if no artwork URL is present
21474
+ */
21188
21475
  var RewardCategoryMedia = function () {
21189
21476
  var styles = useRewardCategoryTileStyles();
21190
- var configuration = useTileContext().configuration;
21191
- var _a = configuration,
21477
+ var tileContext = useTileContext();
21478
+ if (!isContextValid(tileContext)) return null;
21479
+ var _a = tileContext.configuration,
21192
21480
  artworkUrl = _a.artworkUrl,
21193
- name = _a.name;
21481
+ _b = _a.name,
21482
+ name = _b === void 0 ? 'Reward' : _b;
21194
21483
  if (!artworkUrl) return null;
21195
21484
  return /*#__PURE__*/React.createElement(ProgressiveImage, {
21196
21485
  testID: "reward-category-media",
@@ -21199,19 +21488,20 @@ var RewardCategoryMedia = function () {
21199
21488
  },
21200
21489
  style: styles.background,
21201
21490
  alt: "Reward category image for ".concat(name),
21202
- accessibilityElementsHidden: true,
21203
- importantForAccessibility: "no-hide-descendants"
21491
+ accessibilityRole: "image"
21204
21492
  });
21205
21493
  };
21206
21494
 
21207
21495
  /**
21208
21496
  * The RewardCategoryTile component renders a tile with a header and media.
21209
21497
  *
21210
- * @param tile - The tile data to render.
21498
+ * @param {RewardCategoryTileProps} props - The component props
21499
+ * @param {Tile} props.tile - The tile data to render
21500
+ * @returns {JSX.Element|null} Rendered component or null if tile is inactive or missing configuration
21211
21501
  */
21212
21502
  var RewardCategoryTileRoot = function (_a) {
21213
21503
  var tile = _a.tile;
21214
- if (!tile || !tile.active) return null;
21504
+ if (!tile || !tile.active || !tile.configuration) return null;
21215
21505
  return /*#__PURE__*/React.createElement(BaseTile, {
21216
21506
  tile: tile
21217
21507
  }, /*#__PURE__*/React.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React.createElement(RewardCategoryTile.Media, null));
@@ -21225,14 +21515,28 @@ var RewardCategoryTile = Object.assign(RewardCategoryTileRoot, {
21225
21515
  });
21226
21516
  var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
21227
21517
 
21518
+ /**
21519
+ * Renders a chevron icon for a Reward Tile.
21520
+ *
21521
+ * @returns JSX.Element
21522
+ */
21228
21523
  var RewardTileChevron = function () {
21524
+ var _a;
21229
21525
  var theme = useWllSdk().theme;
21230
21526
  return /*#__PURE__*/React.createElement(Icon, {
21231
21527
  name: "ChevronRight",
21232
- color: theme.derivedSurfaceText[20]
21528
+ color: ((_a = theme === null || theme === void 0 ? void 0 : theme.derivedSurfaceText) === null || _a === void 0 ? void 0 : _a[20]) || '#000000',
21529
+ accessibilityRole: "image",
21530
+ accessibilityLabel: "View reward details"
21233
21531
  });
21234
21532
  };
21235
21533
 
21534
+ /**
21535
+ * Custom hook that returns the styles for the RewardTile component.
21536
+ * Applies responsive styling based on the current device.
21537
+ *
21538
+ * @returns StyleSheet styles for the RewardTile component
21539
+ */
21236
21540
  var useRewardTileStyles = function () {
21237
21541
  var _a = useResponsive$1(),
21238
21542
  isDesktop = _a.isDesktop,
@@ -21276,24 +21580,33 @@ var useRewardTileStyles = function () {
21276
21580
  });
21277
21581
  };
21278
21582
 
21583
+ /**
21584
+ * Renders the media for a Reward Tile.
21585
+ *
21586
+ * @param props {RewardTileMediaProps} - Component props
21587
+ * @param props.isArtworkOnly {boolean} - Whether the media should be rendered as an artwork only component
21588
+ * @returns JSX.Element or null if no artwork URL is present or artwork should not be shown
21589
+ */
21279
21590
  var RewardTileMedia = function (_a) {
21280
21591
  var isArtworkOnly = _a.isArtworkOnly;
21281
21592
  var styles = useRewardTileStyles();
21282
- var configuration = useTileContext().configuration;
21283
- var _b = configuration,
21593
+ var tileContext = useTileContext();
21594
+ if (!isContextValid(tileContext)) return null;
21595
+ var _b = tileContext.configuration,
21284
21596
  artworkUrl = _b.artworkUrl,
21285
21597
  _c = _b.showArtwork,
21286
21598
  showArtwork = _c === void 0 ? true : _c,
21287
- name = _b.name;
21599
+ _d = _b.name,
21600
+ name = _d === void 0 ? 'Reward' : _d;
21288
21601
  if (!artworkUrl || !showArtwork) return null;
21289
21602
  var containerStyle = {
21290
21603
  flexBasis: isArtworkOnly ? '100%' : '50%'
21291
21604
  };
21292
- return /*#__PURE__*/React.createElement(View$2
21293
- // @ts-ignore: We are using percentage values for flexBasis, which is valid in React Native but TypeScript expects a number.
21294
- , {
21605
+ return /*#__PURE__*/React.createElement(View$2, {
21295
21606
  style: [styles.imageContainer, containerStyle],
21296
- testID: "reward-tile-media"
21607
+ testID: "reward-tile-media",
21608
+ accessibilityRole: "image",
21609
+ accessibilityLabel: "Reward image for ".concat(name)
21297
21610
  }, /*#__PURE__*/React.createElement(ProgressiveImage, {
21298
21611
  source: {
21299
21612
  uri: artworkUrl
@@ -21303,26 +21616,32 @@ var RewardTileMedia = function (_a) {
21303
21616
  }));
21304
21617
  };
21305
21618
 
21619
+ /**
21620
+ * Renders the points value of a Reward Tile.
21621
+ *
21622
+ * @returns JSX.Element or null if price should not be shown or is zero/undefined
21623
+ */
21306
21624
  var RewardTilePoints = function () {
21307
21625
  var styles = useRewardTileStyles();
21308
- var configuration = useTileContext().configuration;
21309
- var _a = configuration,
21310
- showPrice = _a.showPrice,
21311
- price = _a.price,
21312
- _b = _a.pointsMultiplier,
21313
- pointsMultiplier = _b === void 0 ? 1 : _b,
21314
- _c = _a.pointsPrefix,
21315
- pointsPrefix = _c === void 0 ? '' : _c,
21316
- _d = _a.pointsSuffix,
21317
- pointsSuffix = _d === void 0 ? 'pts' : _d;
21318
- // Exit early if price is not shown or undefined
21626
+ var tileContext = useTileContext();
21627
+ if (!isContextValid(tileContext)) return null;
21628
+ var _a = tileContext.configuration,
21629
+ _b = _a.showPrice,
21630
+ showPrice = _b === void 0 ? true : _b,
21631
+ _c = _a.price,
21632
+ price = _c === void 0 ? 0 : _c,
21633
+ _d = _a.pointsMultiplier,
21634
+ pointsMultiplier = _d === void 0 ? 1 : _d,
21635
+ _e = _a.pointsPrefix,
21636
+ pointsPrefix = _e === void 0 ? '' : _e,
21637
+ _f = _a.pointsSuffix,
21638
+ pointsSuffix = _f === void 0 ? 'pts' : _f;
21319
21639
  if (!showPrice || price === undefined || price === 0) return null;
21320
- // Calculate points
21321
21640
  var calculatedPoints = applyMultiplier(price, pointsMultiplier);
21322
21641
  var accessibilityLabel = getPointsLabel('Reward points:', calculatedPoints, pointsPrefix, pointsSuffix);
21323
21642
  return /*#__PURE__*/React.createElement(View$2, {
21324
21643
  testID: "reward-tile-points",
21325
- accessible: true,
21644
+ accessibilityRole: "text",
21326
21645
  accessibilityLabel: accessibilityLabel
21327
21646
  }, /*#__PURE__*/React.createElement(Row, {
21328
21647
  align: "center",
@@ -21341,29 +21660,39 @@ var RewardTilePoints = function () {
21341
21660
  }, pointsSuffix) : null));
21342
21661
  };
21343
21662
 
21663
+ /**
21664
+ * Renders the summary of a Reward Tile.
21665
+ *
21666
+ * @returns JSX.Element or null if no summary is present
21667
+ */
21344
21668
  var RewardTileSummary = function () {
21345
- var configuration = useTileContext().configuration;
21346
- var summary = configuration.summary;
21669
+ var tileContext = useTileContext();
21670
+ if (!isContextValid(tileContext)) return null;
21671
+ var summary = tileContext.configuration.summary;
21347
21672
  if (!summary) return null;
21348
- return /*#__PURE__*/React.createElement(View$2, {
21349
- accessible: true,
21350
- accessibilityLabel: summary
21351
- }, /*#__PURE__*/React.createElement(Text, {
21673
+ return /*#__PURE__*/React.createElement(Text, {
21352
21674
  variant: "body",
21353
- accessibilityElementsHidden: true,
21354
- importantForAccessibility: "no-hide-descendants",
21675
+ accessibilityRole: "text",
21676
+ accessibilityLabel: summary,
21355
21677
  testID: "reward-tile-summary"
21356
- }, summary));
21678
+ }, summary);
21357
21679
  };
21358
21680
 
21681
+ /**
21682
+ * Renders the title of a Reward Tile.
21683
+ *
21684
+ * @returns JSX.Element or null if no name is present
21685
+ */
21359
21686
  var RewardTileTitle = function () {
21360
- var configuration = useTileContext().configuration;
21361
- var name = configuration.name;
21687
+ var tileContext = useTileContext();
21688
+ if (!isContextValid(tileContext)) return null;
21689
+ var name = tileContext.configuration.name;
21362
21690
  if (!name) return null;
21363
21691
  return /*#__PURE__*/React.createElement(Text, {
21364
21692
  variant: "title",
21365
21693
  ellipsizeMode: "tail",
21366
21694
  numberOfLines: 1,
21695
+ accessibilityRole: "header",
21367
21696
  accessibilityLabel: "Reward title: ".concat(name),
21368
21697
  testID: "reward-tile-title"
21369
21698
  }, name);
@@ -21376,17 +21705,20 @@ var RewardTileTitle = function () {
21376
21705
  * @returns `true` if the tile should display artwork only.
21377
21706
  */
21378
21707
  var isArtworkOnly = function (configuration) {
21708
+ if (!configuration) return false;
21379
21709
  return !configuration.showDetails;
21380
21710
  };
21381
21711
  /**
21382
21712
  * The RewardTile component renders a tile with media, title, summary, points, and a chevron.
21383
21713
  *
21384
- * @param tile - The tile data to render.
21714
+ * @param {RewardTileProps} props - Component props
21715
+ * @param {Tile} props.tile - The tile data to render
21716
+ * @returns JSX.Element or null if tile is inactive or not a full-height tile
21385
21717
  */
21386
21718
  var RewardTileRoot = function (_a) {
21387
21719
  var tile = _a.tile;
21388
21720
  var styles = useRewardTileStyles();
21389
- if (!tile || tile.tileHeight !== exports.TileHeight.Full || !tile.active) return null;
21721
+ if (!tile || tile.tileHeight !== exports.TileHeight.Full || !tile.active || !tile.configuration) return null;
21390
21722
  var configuration = tile.configuration;
21391
21723
  return /*#__PURE__*/React.createElement(BaseTile, {
21392
21724
  tile: tile