@spark-web/core
Version:
--- title: Core isExperimentalPackage: true ---
40 lines (36 loc) • 2.14 kB
JavaScript
import { Global } from '@emotion/react';
import { jsx, jsxs } from 'react/jsx-runtime';
import { useFocusVisible, IdProvider } from '@spark-web/a11y';
import { LinkComponentContext, DefaultLinkComponent } from '@spark-web/link';
import { ThemeProvider, defaultTheme } from '@spark-web/theme';
var AESTETICO_REGULAR_URL = 'https://static-assets.prod.cloud.brighte.com.au/fonts/Aestetico-Regular.woff2';
var AESTETICO_SEMIBOLD_URL = 'https://static-assets.prod.cloud.brighte.com.au/fonts/Aestetico-SemiBold.woff2';
var styles = "\n@import \"//hello.myfonts.net/count/46e60e\";\n\n@font-face {\n font-family: Aestetico;\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(".concat(AESTETICO_REGULAR_URL, ") format(\"woff2\");\n}\n\n@font-face {\n font-family: Aestetico;\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(").concat(AESTETICO_SEMIBOLD_URL, ") format(\"woff2\");\n}\n").trim();
function AesteticoStylesheet() {
return /*#__PURE__*/jsx(Global, {
styles: styles
});
}
/** Consolidates core functionality and dependencies of Spark Web. */
var SparkProvider = function SparkProvider(_ref) {
var children = _ref.children,
_ref$linkComponent = _ref.linkComponent,
linkComponent = _ref$linkComponent === void 0 ? DefaultLinkComponent : _ref$linkComponent,
_ref$loadCustomFonts = _ref.loadCustomFonts,
loadCustomFonts = _ref$loadCustomFonts === void 0 ? true : _ref$loadCustomFonts,
_ref$theme = _ref.theme,
theme = _ref$theme === void 0 ? defaultTheme : _ref$theme;
useFocusVisible();
return /*#__PURE__*/jsxs(ThemeProvider, {
value: theme,
children: [/*#__PURE__*/jsx(LinkComponentContext.Provider, {
value: linkComponent,
children: /*#__PURE__*/jsx(IdProvider, {
children: children
})
}), loadCustomFonts && /*#__PURE__*/jsx(AesteticoStylesheet, {}), /*#__PURE__*/jsx(Global, {
styles: "body{margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}"
})]
});
};
export { AESTETICO_REGULAR_URL, AESTETICO_SEMIBOLD_URL, AesteticoStylesheet, SparkProvider };