@wlloyalty/wll-react-sdk 1.0.98 → 1.0.100

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/native.js CHANGED
@@ -1680,8 +1680,15 @@ var validateTheme = function (theme) {
1680
1680
  'surfaceText',
1681
1681
  'text',
1682
1682
  ];
1683
- // fontFamily is optional - it has a default value in defaultTheme
1684
1683
  var missingOrInvalidColors = requiredColors.filter(function (color) { return !theme[color] || !isValidColor(theme[color]); });
1684
+ if (missingOrInvalidColors.length > 0) {
1685
+ console.warn('Theme validation failed. Missing or invalid colors:', missingOrInvalidColors.map(function (color) { return ({
1686
+ color: color,
1687
+ value: theme[color],
1688
+ exists: !!theme[color],
1689
+ isValid: theme[color] ? isValidColor(theme[color]) : false,
1690
+ }); }));
1691
+ }
1685
1692
  return missingOrInvalidColors.length === 0;
1686
1693
  };
1687
1694
  /**
@@ -1691,7 +1698,11 @@ var validateTheme = function (theme) {
1691
1698
  */
1692
1699
  var createSafeColor = function (color) {
1693
1700
  try {
1694
- return Color(color);
1701
+ var colorInstance = Color(color);
1702
+ console.log('Original color:', color);
1703
+ console.log('Color instance toString:', colorInstance.toString());
1704
+ console.log('Color instance hex:', colorInstance.hex());
1705
+ return colorInstance;
1695
1706
  }
1696
1707
  catch (error) {
1697
1708
  console.error("Invalid color value: ".concat(color), error);
@@ -2300,11 +2311,33 @@ var Text = function (_a) {
2300
2311
  }
2301
2312
  };
2302
2313
  var variantStyle = getVariantStyle(variant);
2303
- var baseTextStyle = {
2304
- fontFamily: theme.fontFamily,
2305
- };
2306
- // NOTE: We must apply fontFamily as base style to ensure it's always applied
2307
- return jsxRuntimeExports.jsx(reactNative.Text, __assign({ style: [baseTextStyle, variantStyle, style] }, props));
2314
+ // NOTE: React Native Web has different style resolution rules compared to CSS.
2315
+ // 1. We create styles using StyleSheet.create for better performance
2316
+ // 2. Base styles set the initial fontFamily
2317
+ // 3. variantStyle contains responsive fontSize and other variant-specific styles
2318
+ // 4. webOverrides ensures fontFamily is correctly applied on web platform
2319
+ // (prevents system font stack from being incorrectly applied)
2320
+ // 5. custom style prop has highest precedence
2321
+ // The order matters because RN Web resolves styles by specific properties
2322
+ // rather than last-declaration-wins like in CSS
2323
+ // https://necolas.github.io/react-native-web/docs/styling/#how-it-works
2324
+ var styles = reactNative.StyleSheet.create({
2325
+ base: {
2326
+ fontFamily: theme.fontFamily,
2327
+ },
2328
+ webOverrides: IS_WEB
2329
+ ? {
2330
+ fontFamily: theme.fontFamily,
2331
+ }
2332
+ : {},
2333
+ });
2334
+ var combinedStyles = [
2335
+ styles.base,
2336
+ variantStyle,
2337
+ styles.webOverrides,
2338
+ style,
2339
+ ];
2340
+ return jsxRuntimeExports.jsx(reactNative.Text, __assign({ style: combinedStyles }, props));
2308
2341
  };
2309
2342
 
2310
2343
  var MAX_WIDTH = 1080;