UNPKG

@spark-web/core

Version:

--- title: Core isExperimentalPackage: true ---

47 lines (41 loc) 2.36 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var react = require('@emotion/react'); var jsxRuntime = require('react/jsx-runtime'); var a11y = require('@spark-web/a11y'); var link = require('@spark-web/link'); var theme = require('@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__*/jsxRuntime.jsx(react.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 ? link.DefaultLinkComponent : _ref$linkComponent, _ref$loadCustomFonts = _ref.loadCustomFonts, loadCustomFonts = _ref$loadCustomFonts === void 0 ? true : _ref$loadCustomFonts, _ref$theme = _ref.theme, theme$1 = _ref$theme === void 0 ? theme.defaultTheme : _ref$theme; a11y.useFocusVisible(); return /*#__PURE__*/jsxRuntime.jsxs(theme.ThemeProvider, { value: theme$1, children: [/*#__PURE__*/jsxRuntime.jsx(link.LinkComponentContext.Provider, { value: linkComponent, children: /*#__PURE__*/jsxRuntime.jsx(a11y.IdProvider, { children: children }) }), loadCustomFonts && /*#__PURE__*/jsxRuntime.jsx(AesteticoStylesheet, {}), /*#__PURE__*/jsxRuntime.jsx(react.Global, { styles: "body{margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}" })] }); }; exports.AESTETICO_REGULAR_URL = AESTETICO_REGULAR_URL; exports.AESTETICO_SEMIBOLD_URL = AESTETICO_SEMIBOLD_URL; exports.AesteticoStylesheet = AesteticoStylesheet; exports.SparkProvider = SparkProvider;