@wlloyalty/wll-react-sdk 1.0.96 → 1.0.98
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 +9 -24
- package/dist/native.js.map +1 -1
- package/dist/web.js +13 -22
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -8228,11 +8228,12 @@ var isValidColor = function (color) {
|
|
|
8228
8228
|
* @returns Boolean indicating if theme is valid
|
|
8229
8229
|
*/
|
|
8230
8230
|
var validateTheme = function (theme) {
|
|
8231
|
-
var requiredColors = ['accent', 'background', 'primary', 'surface', 'surfaceText', '
|
|
8231
|
+
var requiredColors = ['accent', 'background', 'primary', 'surface', 'surfaceText', 'text'];
|
|
8232
8232
|
// fontFamily is optional - it has a default value in defaultTheme
|
|
8233
|
-
|
|
8234
|
-
return theme[color]
|
|
8233
|
+
var missingOrInvalidColors = requiredColors.filter(function (color) {
|
|
8234
|
+
return !theme[color] || !isValidColor(theme[color]);
|
|
8235
8235
|
});
|
|
8236
|
+
return missingOrInvalidColors.length === 0;
|
|
8236
8237
|
};
|
|
8237
8238
|
/**
|
|
8238
8239
|
* Safely creates a Color instance with error handling
|
|
@@ -8458,12 +8459,6 @@ var createTheme = function (baseTheme) {
|
|
|
8458
8459
|
baseTheme = {};
|
|
8459
8460
|
}
|
|
8460
8461
|
var mergedTheme = __assign(__assign({}, defaultTheme), baseTheme);
|
|
8461
|
-
// Always log theme information to help with debugging
|
|
8462
|
-
console.debug('[WLL SDK] Theme created:', {
|
|
8463
|
-
fontFamily: mergedTheme.fontFamily,
|
|
8464
|
-
baseTheme: baseTheme === null || baseTheme === void 0 ? void 0 : baseTheme.fontFamily,
|
|
8465
|
-
defaultTheme: defaultTheme.fontFamily
|
|
8466
|
-
});
|
|
8467
8462
|
return __assign(__assign({}, mergedTheme), {
|
|
8468
8463
|
sizes: sizes,
|
|
8469
8464
|
derivedBackground: getDerivedColor(mergedTheme.background),
|
|
@@ -8499,14 +8494,6 @@ var WllSdkProvider = function (_a) {
|
|
|
8499
8494
|
if (!validateTheme(themeToUse)) {
|
|
8500
8495
|
console.warn('Invalid theme provided. Some required colors are missing or invalid.');
|
|
8501
8496
|
}
|
|
8502
|
-
// Always log theme updates to help with debugging
|
|
8503
|
-
console.debug('[WLL SDK] Theme update details:', {
|
|
8504
|
-
'providedTheme (full)': providedTheme,
|
|
8505
|
-
'themeToUse.fontFamily': themeToUse.fontFamily,
|
|
8506
|
-
'providedTheme.fontFamily': providedTheme === null || providedTheme === void 0 ? void 0 : providedTheme.fontFamily,
|
|
8507
|
-
'defaultTheme.fontFamily': defaultTheme.fontFamily,
|
|
8508
|
-
'providedTheme keys': providedTheme ? Object.keys(providedTheme) : 'none'
|
|
8509
|
-
});
|
|
8510
8497
|
setThemeState(createTheme(themeToUse));
|
|
8511
8498
|
}, [providedTheme]);
|
|
8512
8499
|
var setTheme = React.useCallback(function (newTheme) {
|
|
@@ -18915,10 +18902,12 @@ var Text = function (_a) {
|
|
|
18915
18902
|
}
|
|
18916
18903
|
};
|
|
18917
18904
|
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
18909
|
return /*#__PURE__*/React__namespace.createElement(Text$3, __assign({
|
|
18919
|
-
style: [variantStyle, style
|
|
18920
|
-
fontFamily: theme.fontFamily
|
|
18921
|
-
}]
|
|
18910
|
+
style: [baseTextStyle, variantStyle, style]
|
|
18922
18911
|
}, props));
|
|
18923
18912
|
};
|
|
18924
18913
|
|
|
@@ -20397,11 +20386,13 @@ var useSectionHeaderStyles = function () {
|
|
|
20397
20386
|
fontSize: useResponsiveValue(theme.sizes.xxxl, theme.sizes.xl, isDesktop, isTablet),
|
|
20398
20387
|
marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
|
|
20399
20388
|
fontWeight: '700',
|
|
20400
|
-
color: theme.text
|
|
20389
|
+
color: theme.text,
|
|
20390
|
+
fontFamily: theme.fontFamily
|
|
20401
20391
|
},
|
|
20402
20392
|
sectionDescription: {
|
|
20403
20393
|
fontSize: useResponsiveValue(theme.sizes.xxl, theme.sizes.md, isDesktop, isTablet),
|
|
20404
|
-
color: theme.alphaDerivedText[80]
|
|
20394
|
+
color: theme.alphaDerivedText[80],
|
|
20395
|
+
fontFamily: theme.fontFamily
|
|
20405
20396
|
}
|
|
20406
20397
|
});
|
|
20407
20398
|
};
|