@spothero/ui 15.4.0 → 15.5.0
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/package.json
CHANGED
|
@@ -7,9 +7,18 @@ import {Fonts, LegacyOverrides} from 'v2/theme/global';
|
|
|
7
7
|
import merge from 'lodash/merge';
|
|
8
8
|
|
|
9
9
|
const ThemeProvider = forwardRef(
|
|
10
|
-
(
|
|
10
|
+
(
|
|
11
|
+
{
|
|
12
|
+
theme,
|
|
13
|
+
useLegacyOverrides,
|
|
14
|
+
disableExternalFonts = false,
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
},
|
|
18
|
+
ref
|
|
19
|
+
) => (
|
|
11
20
|
<ChakraProvider {...props} ref={ref} theme={merge(THEME, theme)}>
|
|
12
|
-
<Fonts />
|
|
21
|
+
{disableExternalFonts ? null : <Fonts />}
|
|
13
22
|
<LegacyOverrides useLegacyOverrides={useLegacyOverrides} />
|
|
14
23
|
{children}
|
|
15
24
|
</ChakraProvider>
|
|
@@ -19,6 +28,8 @@ const ThemeProvider = forwardRef(
|
|
|
19
28
|
ThemeProvider.propTypes = {
|
|
20
29
|
/** If true, this will use the old `spothero-html` base styles */
|
|
21
30
|
useLegacyOverrides: PropTypes.bool,
|
|
31
|
+
/** If true, this will not load the `Fonts` global styles */
|
|
32
|
+
disableExternalFonts: PropTypes.bool,
|
|
22
33
|
/** The React node (generally your entire App) that will be provided the theme */
|
|
23
34
|
children: PropTypes.node,
|
|
24
35
|
/** Adds additional themeing on top of SpotHero's default configuration */
|
|
@@ -64,6 +64,12 @@ const Template = (props, {hasDarkBackground}) => {
|
|
|
64
64
|
a boolean. If true, the ThemeProvider will insert the typography
|
|
65
65
|
styling from .spothero-html
|
|
66
66
|
</Text>{' '}
|
|
67
|
+
<Text mb={8} color={contentTextColor}>
|
|
68
|
+
ThemeProvider also has a <Code>disableExternalFonts</Code> prop
|
|
69
|
+
that is a boolean. If true, the ThemeProvider will not load the
|
|
70
|
+
font files from Google's CDN, and you will be able to handle
|
|
71
|
+
fonts on a project-level.
|
|
72
|
+
</Text>{' '}
|
|
67
73
|
</Box>
|
|
68
74
|
);
|
|
69
75
|
};
|