@wlloyalty/wll-react-sdk 1.0.113 → 1.1.0

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.
@@ -2,6 +2,10 @@ import { CTALinkTarget, RoundupTileConfig, TileHeight, TileType } from '../../ty
2
2
  export type RoundupTileMockConfig = Partial<RoundupTileConfig> & {
3
3
  active?: boolean;
4
4
  tileHeight?: TileHeight;
5
+ defaultLocale?: string;
6
+ details?: any[];
7
+ locale?: string;
8
+ balance?: number;
5
9
  };
6
10
  export declare const createRoundupTileMock: (config?: RoundupTileMockConfig) => {
7
11
  id: string;
@@ -13,11 +17,14 @@ export declare const createRoundupTileMock: (config?: RoundupTileMockConfig) =>
13
17
  priority: number;
14
18
  configuration: {
15
19
  title: string | null;
16
- amount: number;
17
- amountPrefix: string | null;
18
- amountSuffix: string | null;
19
20
  artworkUrl: string | null;
20
21
  ctaLink: string | null | undefined;
21
22
  ctaLinkTarget: CTALinkTarget | undefined;
23
+ defaultLocale: string;
24
+ details: any[];
25
+ locale: string;
26
+ balance: number | undefined;
27
+ amountPrefix: string | null | undefined;
28
+ amountSuffix: string | null | undefined;
22
29
  };
23
30
  };
@@ -49,7 +49,7 @@ export declare class RoundupTileConfig {
49
49
  amountPrefix?: string | null;
50
50
  amountSuffix?: string | null;
51
51
  artworkUrl?: string | null;
52
- amount?: number;
52
+ balance?: number;
53
53
  ctaLink?: string | null;
54
54
  ctaLinkTarget?: CTALinkTarget;
55
55
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Cleans up a number by removing any whitespace and ensuring it's a valid number
3
+ * @param value The number to clean up
4
+ * @returns A cleaned up number as a number
5
+ */
6
+ export declare const cleanNumber: (value: number) => number;
1
7
  /**
2
8
  * Applies a multiplier to a base value. Handles string multipliers by converting them to numbers.
3
9
  * If the multiplier is invalid (NaN, null, undefined), defaults to 1.
package/dist/web.js CHANGED
@@ -22505,6 +22505,36 @@ TierTile.Full = TierTileFull;
22505
22505
  TierTile.Half = TierTileHalf;
22506
22506
  TierTile.Empty = TierTileEmpty;
22507
22507
 
22508
+ /**
22509
+ * Renders formatted points value for a Roundup Tile.
22510
+ *
22511
+ * @returns JSX.Element or null if points are undefined or zero
22512
+ */
22513
+ var RoundupTileFormattedPoints = function () {
22514
+ var tileContext = useTileContext();
22515
+ if (!isContextValid(tileContext)) return null;
22516
+ var _a = tileContext.configuration,
22517
+ _b = _a.balance,
22518
+ balance = _b === void 0 ? 0 : _b,
22519
+ _c = _a.amountPrefix,
22520
+ amountPrefix = _c === void 0 ? '' : _c,
22521
+ _d = _a.amountSuffix,
22522
+ amountSuffix = _d === void 0 ? '' : _d;
22523
+ if (balance === undefined) return null;
22524
+ var fullPointsText = "".concat(amountPrefix).concat(cleanNumber(balance)).concat(amountSuffix).trim();
22525
+ return /*#__PURE__*/React.createElement(View$2, {
22526
+ testID: "roundup-tile-amount",
22527
+ role: "article",
22528
+ accessibilityLabel: "Amount: ".concat(fullPointsText)
22529
+ }, /*#__PURE__*/React.createElement(Row, {
22530
+ align: "center",
22531
+ justify: "start"
22532
+ }, /*#__PURE__*/React.createElement(Text, {
22533
+ variant: "caption",
22534
+ testID: "roundup-tile-value"
22535
+ }, fullPointsText)));
22536
+ };
22537
+
22508
22538
  /**
22509
22539
  * Custom hook that returns the styles for the RoundupTile component.
22510
22540
  * Applies responsive styling based on the current device.
@@ -22564,44 +22594,6 @@ var useRoundupTileStyles = function (isFullSize) {
22564
22594
  });
22565
22595
  };
22566
22596
 
22567
- /**
22568
- * Renders formatted points value for a Roundup Tile.
22569
- *
22570
- * @returns JSX.Element or null if points are undefined or zero
22571
- */
22572
- var RoundupTileFormattedPoints = function () {
22573
- var styles = useRoundupTileStyles();
22574
- var tileContext = useTileContext();
22575
- if (!isContextValid(tileContext)) return null;
22576
- var _a = tileContext.configuration,
22577
- _b = _a.amountPrefix,
22578
- amountPrefix = _b === void 0 ? '' : _b,
22579
- _c = _a.amountSuffix,
22580
- amountSuffix = _c === void 0 ? '' : _c,
22581
- _d = _a.amount,
22582
- amount = _d === void 0 ? 0 : _d;
22583
- if (amount === undefined) return null;
22584
- var fullPointsText = "".concat(amountPrefix).concat(amount, " ").concat(amountSuffix).trim();
22585
- return /*#__PURE__*/React.createElement(View$2, {
22586
- testID: "roundup-tile-amount",
22587
- role: "article",
22588
- accessibilityLabel: "Amount: ".concat(fullPointsText)
22589
- }, /*#__PURE__*/React.createElement(Row, {
22590
- align: "center",
22591
- justify: "start"
22592
- }, amountPrefix ? (/*#__PURE__*/React.createElement(Text, {
22593
- variant: "caption",
22594
- testID: "roundup-tile-prefix"
22595
- }, amountPrefix)) : null, /*#__PURE__*/React.createElement(Text, {
22596
- variant: "caption",
22597
- testID: "roundup-tile-value"
22598
- }, amount), amountSuffix ? (/*#__PURE__*/React.createElement(Text, {
22599
- variant: "caption",
22600
- style: styles.suffix,
22601
- testID: "roundup-tile-suffix"
22602
- }, amountSuffix)) : null));
22603
- };
22604
-
22605
22597
  /**
22606
22598
  * Renders the media of a Points Tile.
22607
22599
  *