@codebit-programando-solucoes/codebit-web-antd 1.1.44 → 1.1.45
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.
|
@@ -49,4 +49,6 @@ type CodebitThemeProviderProps = {
|
|
|
49
49
|
forcedTheme?: 'dark' | 'light' | null;
|
|
50
50
|
/** Optional color overrides. Any color/shade not provided falls back to Codebit's current default palette. */
|
|
51
51
|
colors?: CodebitThemeColors;
|
|
52
|
+
/** Optional font-family override applied to antd's `token.fontFamily`. When unset, antd's default font stack is used (unchanged from current behavior). */
|
|
53
|
+
fontFamily?: string;
|
|
52
54
|
} & ConfigProviderProps;
|
package/dist/index.cjs
CHANGED
|
@@ -720,7 +720,7 @@ var __webpack_exports__ = {};
|
|
|
720
720
|
dark: '#1a1a1a'
|
|
721
721
|
}
|
|
722
722
|
};
|
|
723
|
-
const CodebitThemeProvider = ({ children, storeThemeInLocalStorage = true, containerId = 'root', forcedTheme = null, colors = {}, ...props })=>{
|
|
723
|
+
const CodebitThemeProvider = ({ children, storeThemeInLocalStorage = true, containerId = 'root', forcedTheme = null, colors = {}, fontFamily, ...props })=>{
|
|
724
724
|
const hasLoaded = (0, external_react_.useRef)(false);
|
|
725
725
|
const [isDarkMode, setIsDarkMode] = (0, external_react_.useState)(()=>{
|
|
726
726
|
if (forcedTheme) return 'dark' === forcedTheme;
|
|
@@ -808,7 +808,10 @@ var __webpack_exports__ = {};
|
|
|
808
808
|
token: {
|
|
809
809
|
colorPrimary: resolvedColors.primary[isDarkMode ? 'dark' : 'light'],
|
|
810
810
|
colorInfo: resolvedColors.primary[isDarkMode ? 'dark' : 'light'],
|
|
811
|
-
colorLink: resolvedColors.primary[isDarkMode ? 'dark' : 'light']
|
|
811
|
+
colorLink: resolvedColors.primary[isDarkMode ? 'dark' : 'light'],
|
|
812
|
+
...fontFamily ? {
|
|
813
|
+
fontFamily
|
|
814
|
+
} : {}
|
|
812
815
|
},
|
|
813
816
|
components: {
|
|
814
817
|
Menu: {
|
|
@@ -872,7 +875,8 @@ var __webpack_exports__ = {};
|
|
|
872
875
|
light: external_prop_types_default().string,
|
|
873
876
|
dark: external_prop_types_default().string
|
|
874
877
|
})
|
|
875
|
-
})
|
|
878
|
+
}),
|
|
879
|
+
fontFamily: external_prop_types_default().string
|
|
876
880
|
};
|
|
877
881
|
const ThemeToggle = ()=>{
|
|
878
882
|
const config = (0, external_react_.useContext)(CodebitThemeContext);
|