@wlloyalty/wll-react-sdk 1.0.105 → 1.0.107

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.
@@ -24,3 +24,23 @@ export declare const commonStyles: {
24
24
  };
25
25
  };
26
26
  export declare const defaultTheme: BaseThemeObject;
27
+ /**
28
+ * Creates appropriate directional margin styles for both web and native platforms.
29
+ * Handles RTL layouts correctly across platforms by using the I18nManager.
30
+ *
31
+ * @param value - The margin value to apply
32
+ * @returns An object with the appropriate margin style property
33
+ */
34
+ export declare const getDirectionalMargin: (value: number) => {
35
+ marginLeft: number;
36
+ marginRight?: undefined;
37
+ marginEnd?: undefined;
38
+ } | {
39
+ marginRight: number;
40
+ marginLeft?: undefined;
41
+ marginEnd?: undefined;
42
+ } | {
43
+ marginEnd: number;
44
+ marginLeft?: undefined;
45
+ marginRight?: undefined;
46
+ };
package/dist/web.js CHANGED
@@ -7986,45 +7986,6 @@ var EventEmitter$1 = /** @class */function () {
7986
7986
  */
7987
7987
  var sdkEventEmitter = new EventEmitter$1();
7988
7988
 
7989
- var sizes = {
7990
- borderRadiusSm: 15,
7991
- borderRadiusLg: 20,
7992
- borderRadiusButton: 9,
7993
- borderRadiusRounded: 9999,
7994
- xxxs: 4,
7995
- xxs: 8,
7996
- xs: 10,
7997
- sm: 12,
7998
- md: 14,
7999
- lg: 16,
8000
- xl: 18,
8001
- xxl: 24,
8002
- xxxl: 32,
8003
- xxxxl: 40,
8004
- xxxxxl: 60
8005
- };
8006
- var commonStyles = StyleSheet$1.create({
8007
- emptyContainer: {
8008
- flex: 1,
8009
- justifyContent: 'center',
8010
- alignItems: 'center'
8011
- }
8012
- });
8013
- var defaultTheme = {
8014
- fontFamily: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif',
8015
- background: '#F0F0F0',
8016
- text: '#000000',
8017
- primary: '#392ed7',
8018
- accent: '#ff6a3d',
8019
- surface: '#f8f7fc',
8020
- surfaceText: '#000000',
8021
- pageButtonBackground: '#392ed7',
8022
- pageButtonText: '#ffffff',
8023
- errorPrimary: '#000000',
8024
- positive: '#008000',
8025
- negative: '#ff0000'
8026
- };
8027
-
8028
7989
  /**
8029
7990
  * Copyright (c) 2013-present, Facebook, Inc.
8030
7991
  *
@@ -8229,6 +8190,69 @@ var _a$1 = Dimensions.get("window"),
8229
8190
  _a$1.height;
8230
8191
  var SCREEN_WIDTH = width;
8231
8192
 
8193
+ var sizes = {
8194
+ borderRadiusSm: 15,
8195
+ borderRadiusLg: 20,
8196
+ borderRadiusButton: 9,
8197
+ borderRadiusRounded: 9999,
8198
+ xxxs: 4,
8199
+ xxs: 8,
8200
+ xs: 10,
8201
+ sm: 12,
8202
+ md: 14,
8203
+ lg: 16,
8204
+ xl: 18,
8205
+ xxl: 24,
8206
+ xxxl: 32,
8207
+ xxxxl: 40,
8208
+ xxxxxl: 60
8209
+ };
8210
+ var commonStyles = StyleSheet$1.create({
8211
+ emptyContainer: {
8212
+ flex: 1,
8213
+ justifyContent: 'center',
8214
+ alignItems: 'center'
8215
+ }
8216
+ });
8217
+ var defaultTheme = {
8218
+ fontFamily: '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif',
8219
+ background: '#F0F0F0',
8220
+ text: '#000000',
8221
+ primary: '#392ed7',
8222
+ accent: '#ff6a3d',
8223
+ surface: '#f8f7fc',
8224
+ surfaceText: '#000000',
8225
+ pageButtonBackground: '#392ed7',
8226
+ pageButtonText: '#ffffff',
8227
+ errorPrimary: '#000000',
8228
+ positive: '#008000',
8229
+ negative: '#ff0000'
8230
+ };
8231
+ /**
8232
+ * Creates appropriate directional margin styles for both web and native platforms.
8233
+ * Handles RTL layouts correctly across platforms by using the I18nManager.
8234
+ *
8235
+ * @param value - The margin value to apply
8236
+ * @returns An object with the appropriate margin style property
8237
+ */
8238
+ var getDirectionalMargin = function (value) {
8239
+ if (IS_WEB) {
8240
+ // Check document direction for web
8241
+ // We need to use this because React Native Web does not support I18nManager
8242
+ // and marginStart/marginEnd resolves to margin-left/margin-right and not margin-inline-start/end
8243
+ var isRTL = typeof document !== 'undefined' && document.documentElement.dir === 'rtl';
8244
+ return isRTL ? {
8245
+ marginLeft: value
8246
+ } : {
8247
+ marginRight: value
8248
+ };
8249
+ }
8250
+ // For native platforms, use marginEnd which automatically handles RTL
8251
+ return {
8252
+ marginEnd: value
8253
+ };
8254
+ };
8255
+
8232
8256
  var COLOR_CONSTANTS = {
8233
8257
  MINIMUM_CONTRAST_RATIO: 2,
8234
8258
  DEFAULT_LIGHTNESS_ADJUSTMENT: 0.2,
@@ -20202,14 +20226,14 @@ var useBannerTileStyles = function () {
20202
20226
  slideContent: {
20203
20227
  flex: 1
20204
20228
  },
20205
- mediaContainer: {
20229
+ mediaContainer: __assign(__assign({
20206
20230
  aspectRatio: 1,
20207
20231
  position: 'relative',
20208
- overflow: 'hidden',
20209
- marginRight: useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet),
20232
+ overflow: 'hidden'
20233
+ }, getDirectionalMargin(useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet))), {
20210
20234
  maxHeight: useResponsiveValue(253, 120, isDesktop, isTablet),
20211
20235
  minHeight: 120
20212
- },
20236
+ }),
20213
20237
  media: {
20214
20238
  position: 'absolute',
20215
20239
  width: '100%',
@@ -20396,11 +20420,10 @@ var useContentTileStyles = function (hasArtwork) {
20396
20420
  flex: 1
20397
20421
  },
20398
20422
  header: getHeaderStyle(hasArtwork),
20399
- tileTitle: {
20423
+ tileTitle: __assign({
20400
20424
  maxWidth: '90%',
20401
- flex: 1,
20402
- marginRight: 8
20403
- }
20425
+ flex: 1
20426
+ }, getDirectionalMargin(8))
20404
20427
  });
20405
20428
  };
20406
20429
 
@@ -20979,9 +21002,7 @@ var Grid = function (_a) {
20979
21002
  key: "container-".concat(index),
20980
21003
  style: [
20981
21004
  // @ts-ignore Web uses CSS calc strings for responsive layouts, while ViewStyle expects numbers
20982
- getTileWidth(columnsPerRow), !isLastInRow && {
20983
- marginRight: GRID_GAP
20984
- }]
21005
+ getTileWidth(columnsPerRow), !isLastInRow && getDirectionalMargin(GRID_GAP)]
20985
21006
  }, /*#__PURE__*/React.createElement(TileContainer, {
20986
21007
  tiles: currentTiles
20987
21008
  })));
@@ -22036,11 +22057,10 @@ var useRewardTileStyles = function () {
22036
22057
  width: '100%',
22037
22058
  marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
22038
22059
  },
22039
- tileTitle: {
22060
+ tileTitle: __assign({
22040
22061
  maxWidth: '90%',
22041
- flex: 1,
22042
- marginRight: 8
22043
- }
22062
+ flex: 1
22063
+ }, getDirectionalMargin(8))
22044
22064
  });
22045
22065
  };
22046
22066