@wlloyalty/wll-react-sdk 1.0.97 → 1.0.99

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,13 +8229,18 @@ 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
- // Log missing or invalid colors for debugging
8234
8232
  var missingOrInvalidColors = requiredColors.filter(function (color) {
8235
8233
  return !theme[color] || !isValidColor(theme[color]);
8236
8234
  });
8237
8235
  if (missingOrInvalidColors.length > 0) {
8238
- console.warn('[WLL SDK] Missing or invalid required colors:', missingOrInvalidColors);
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
+ }));
8239
8244
  }
8240
8245
  return missingOrInvalidColors.length === 0;
8241
8246
  };
@@ -8246,7 +8251,11 @@ var validateTheme = function (theme) {
8246
8251
  */
8247
8252
  var createSafeColor = function (color) {
8248
8253
  try {
8249
- 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;
8250
8259
  } catch (error) {
8251
8260
  console.error("Invalid color value: ".concat(color), error);
8252
8261
  return null;
@@ -8463,12 +8472,6 @@ var createTheme = function (baseTheme) {
8463
8472
  baseTheme = {};
8464
8473
  }
8465
8474
  var mergedTheme = __assign(__assign({}, defaultTheme), baseTheme);
8466
- // Always log theme information to help with debugging
8467
- console.debug('[WLL SDK] Theme created:', {
8468
- fontFamily: mergedTheme.fontFamily,
8469
- baseTheme: baseTheme === null || baseTheme === void 0 ? void 0 : baseTheme.fontFamily,
8470
- defaultTheme: defaultTheme.fontFamily
8471
- });
8472
8475
  return __assign(__assign({}, mergedTheme), {
8473
8476
  sizes: sizes,
8474
8477
  derivedBackground: getDerivedColor(mergedTheme.background),
@@ -8504,14 +8507,6 @@ var WllSdkProvider = function (_a) {
8504
8507
  if (!validateTheme(themeToUse)) {
8505
8508
  console.warn('Invalid theme provided. Some required colors are missing or invalid.');
8506
8509
  }
8507
- // Always log theme updates to help with debugging
8508
- console.debug('[WLL SDK] Theme update details:', {
8509
- 'providedTheme (full)': providedTheme,
8510
- 'themeToUse.fontFamily': themeToUse.fontFamily,
8511
- 'providedTheme.fontFamily': providedTheme === null || providedTheme === void 0 ? void 0 : providedTheme.fontFamily,
8512
- 'defaultTheme.fontFamily': defaultTheme.fontFamily,
8513
- 'providedTheme keys': providedTheme ? Object.keys(providedTheme) : 'none'
8514
- });
8515
8510
  setThemeState(createTheme(themeToUse));
8516
8511
  }, [providedTheme]);
8517
8512
  var setTheme = React.useCallback(function (newTheme) {
@@ -18923,6 +18918,7 @@ var Text = function (_a) {
18923
18918
  var baseTextStyle = {
18924
18919
  fontFamily: theme.fontFamily
18925
18920
  };
18921
+ // NOTE: We must apply fontFamily as base style to ensure it's always applied
18926
18922
  return /*#__PURE__*/React__namespace.createElement(Text$3, __assign({
18927
18923
  style: [baseTextStyle, variantStyle, style]
18928
18924
  }, props));