@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/web.js CHANGED
@@ -8229,10 +8229,19 @@ var isValidColor = function (color) {
8229
8229
  */
8230
8230
  var validateTheme = function (theme) {
8231
8231
  var requiredColors = ['accent', 'background', 'primary', 'surface', 'surfaceText', 'text'];
8232
- // fontFamily is optional - it has a default value in defaultTheme
8233
8232
  var missingOrInvalidColors = requiredColors.filter(function (color) {
8234
8233
  return !theme[color] || !isValidColor(theme[color]);
8235
8234
  });
8235
+ if (missingOrInvalidColors.length > 0) {
8236
+ console.warn('Theme validation failed. Missing or invalid colors:', missingOrInvalidColors.map(function (color) {
8237
+ return {
8238
+ color: color,
8239
+ value: theme[color],
8240
+ exists: !!theme[color],
8241
+ isValid: theme[color] ? isValidColor(theme[color]) : false
8242
+ };
8243
+ }));
8244
+ }
8236
8245
  return missingOrInvalidColors.length === 0;
8237
8246
  };
8238
8247
  /**
@@ -8242,7 +8251,11 @@ var validateTheme = function (theme) {
8242
8251
  */
8243
8252
  var createSafeColor = function (color) {
8244
8253
  try {
8245
- return Color(color);
8254
+ var colorInstance = Color(color);
8255
+ console.log('Original color:', color);
8256
+ console.log('Color instance toString:', colorInstance.toString());
8257
+ console.log('Color instance hex:', colorInstance.hex());
8258
+ return colorInstance;
8246
8259
  } catch (error) {
8247
8260
  console.error("Invalid color value: ".concat(color), error);
8248
8261
  return null;
@@ -18902,12 +18915,27 @@ var Text = function (_a) {
18902
18915
  }
18903
18916
  };
18904
18917
  var variantStyle = getVariantStyle(variant);
18905
- var baseTextStyle = {
18906
- fontFamily: theme.fontFamily
18907
- };
18908
- // NOTE: We must apply fontFamily as base style to ensure it's always applied
18918
+ // NOTE: React Native Web has different style resolution rules compared to CSS.
18919
+ // 1. We create styles using StyleSheet.create for better performance
18920
+ // 2. Base styles set the initial fontFamily
18921
+ // 3. variantStyle contains responsive fontSize and other variant-specific styles
18922
+ // 4. webOverrides ensures fontFamily is correctly applied on web platform
18923
+ // (prevents system font stack from being incorrectly applied)
18924
+ // 5. custom style prop has highest precedence
18925
+ // The order matters because RN Web resolves styles by specific properties
18926
+ // rather than last-declaration-wins like in CSS
18927
+ // https://necolas.github.io/react-native-web/docs/styling/#how-it-works
18928
+ var styles = StyleSheet$1.create({
18929
+ base: {
18930
+ fontFamily: theme.fontFamily
18931
+ },
18932
+ webOverrides: IS_WEB ? {
18933
+ fontFamily: theme.fontFamily
18934
+ } : {}
18935
+ });
18936
+ var combinedStyles = [styles.base, variantStyle, styles.webOverrides, style];
18909
18937
  return /*#__PURE__*/React__namespace.createElement(Text$3, __assign({
18910
- style: [baseTextStyle, variantStyle, style]
18938
+ style: combinedStyles
18911
18939
  }, props));
18912
18940
  };
18913
18941