@cruk/cruk-react-components 1.0.10 → 1.0.11
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/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js +1 -1
- package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -1
- package/lib/cjs/src/components/GlobalStyle.js +1 -1
- package/lib/cjs/src/components/Heading/styles.js +1 -1
- package/lib/cjs/src/components/Link/styles.js +1 -1
- package/lib/cjs/src/components/Text/styles.js +1 -1
- package/lib/cjs/src/themes/cruk.js +1 -1
- package/lib/components/Heading/index.d.ts +7 -1
- package/lib/components/Heading/styles.d.ts +6 -0
- package/lib/components/Link/styles.d.ts +1 -0
- package/lib/components/Text/index.d.ts +4 -2
- package/lib/components/Text/styles.d.ts +3 -1
- package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js +1 -1
- package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -1
- package/lib/es/src/components/GlobalStyle.js +1 -1
- package/lib/es/src/components/Heading/styles.js +1 -1
- package/lib/es/src/components/Link/styles.js +1 -1
- package/lib/es/src/components/Text/styles.js +1 -1
- package/lib/es/src/themes/cruk.js +1 -1
- package/lib/types.d.ts +1 -2
- package/package.json +12 -12
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(this,arguments)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var i=new Map,o=new WeakMap,s=0;function a(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(r=e.root)?(o.has(r)||(s+=1,o.set(r,s.toString())),o.get(r)):"0":e[t]);var r})).toString()}function u(e,t,r,n){if(void 0===r&&(r={}),void 0===n&&(n=undefined),void 0===window.IntersectionObserver&&void 0!==n){var o=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),function(){}}var s=function(e){var t=a(e),r=i.get(t);if(!r){var n,o=new Map,s=new IntersectionObserver((function(t){t.forEach((function(t){var r,i=t.isIntersecting&&n.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(r=o.get(t.target))||r.forEach((function(e){e(i,t)}))}))}),e);n=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:s,elements:o},i.set(t,r)}return r}(r),u=s.id,c=s.observer,l=s.elements,p=l.get(e)||[];return l.has(e)||l.set(e,p),p.push(t),c.observe(e),function(){p.splice(p.indexOf(t),1),0===p.length&&(l.delete(e),c.unobserve(e)),0===l.size&&(c.disconnect(),i.delete(u))}}var c=["children","as","
|
|
1
|
+
"use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r.apply(this,arguments)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var i=new Map,o=new WeakMap,s=0;function a(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(r=e.root)?(o.has(r)||(s+=1,o.set(r,s.toString())),o.get(r)):"0":e[t]);var r})).toString()}function u(e,t,r,n){if(void 0===r&&(r={}),void 0===n&&(n=undefined),void 0===window.IntersectionObserver&&void 0!==n){var o=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),function(){}}var s=function(e){var t=a(e),r=i.get(t);if(!r){var n,o=new Map,s=new IntersectionObserver((function(t){t.forEach((function(t){var r,i=t.isIntersecting&&n.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=i),null==(r=o.get(t.target))||r.forEach((function(e){e(i,t)}))}))}),e);n=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:s,elements:o},i.set(t,r)}return r}(r),u=s.id,c=s.observer,l=s.elements,p=l.get(e)||[];return l.has(e)||l.set(e,p),p.push(t),c.observe(e),function(){p.splice(p.indexOf(t),1),0===p.length&&(l.delete(e),c.unobserve(e)),0===l.size&&(c.disconnect(),i.delete(u))}}var c=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function l(e){return"function"!=typeof e.children}var p=function(e){var i,o;function s(t){var r;return(r=e.call(this,t)||this).node=null,r._unobserveCb=null,r.handleNode=function(e){r.node&&(r.unobserve(),e||r.props.triggerOnce||r.props.skip||r.setState({inView:!!r.props.initialInView,entry:void 0})),r.node=e||null,r.observeNode()},r.handleChange=function(e,t){e&&r.props.triggerOnce&&r.unobserve(),l(r.props)||r.setState({inView:e,entry:t}),r.props.onChange&&r.props.onChange(e,t)},r.state={inView:!!t.initialInView,entry:void 0},r}o=e,(i=s).prototype=Object.create(o.prototype),i.prototype.constructor=i,n(i,o);var a=s.prototype;return a.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},a.componentWillUnmount=function(){this.unobserve(),this.node=null},a.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,r=e.root,n=e.rootMargin,i=e.trackVisibility,o=e.delay,s=e.fallbackInView;this._unobserveCb=u(this.node,this.handleChange,{threshold:t,root:r,rootMargin:n,trackVisibility:i,delay:o},s)}},a.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},a.render=function(){if(!l(this.props)){var e=this.state,n=e.inView,i=e.entry;return this.props.children({inView:n,entry:i,ref:this.handleNode})}var o=this.props,s=o.children,a=o.as,u=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(o,c);return t.createElement(a||"div",r({ref:this.handleNode},u),s)},s}(t.Component);exports.InView=p,exports.observe=u;
|
|
2
2
|
//# sourceMappingURL=react-intersection-observer.m.js.map
|
package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-intersection-observer.m.js","sources":["../../../../node_modules/react-intersection-observer/react-intersection-observer.m.js"],"sourcesContent":["import * as React from 'react';\nimport { useEffect } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar observerMap = new Map();\nvar RootIds = new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(function (key) {\n return options[key] !== undefined;\n }).map(function (key) {\n return key + \"_\" + (key === 'root' ? getRootId(options.root) : options[key]);\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n var id = optionsToId(options);\n var instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n var elements = new Map();\n var thresholds;\n var observer = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n var inView = entry.isIntersecting && thresholds.some(function (threshold) {\n return entry.intersectionRatio >= threshold;\n }); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(function (callback) {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id: id,\n observer: observer,\n elements: elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options, fallbackInView) {\n if (options === void 0) {\n options = {};\n }\n\n if (fallbackInView === void 0) {\n fallbackInView = unsupportedValue;\n }\n\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n var bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return function () {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n var _createObserver = createObserver(options),\n id = _createObserver.id,\n observer = _createObserver.observer,\n elements = _createObserver.elements; // Register the callback listener for this element\n\n\n var callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements[\"delete\"](element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap[\"delete\"](id);\n }\n };\n}\n\nvar _excluded = [\"children\", \"as\", \"tag\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `<InView>` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView>\r\n {({ inView, ref, entry }) => (\r\n <div ref={ref}>\r\n <h2>{`Header inside viewport ${inView}.`}</h2>\r\n </div>\r\n )}\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the `<InView />`, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `<InView>` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\r\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nvar InView = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(InView, _React$Component);\n\n function InView(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.node = null;\n _this._unobserveCb = null;\n\n _this.handleNode = function (node) {\n if (_this.node) {\n // Clear the old observer, before we start observing a new element\n _this.unobserve();\n\n if (!node && !_this.props.triggerOnce && !_this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n _this.setState({\n inView: !!_this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n _this.node = node ? node : null;\n\n _this.observeNode();\n };\n\n _this.handleChange = function (inView, entry) {\n if (inView && _this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n _this.unobserve();\n }\n\n if (!isPlainChildren(_this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n _this.setState({\n inView: inView,\n entry: entry\n });\n }\n\n if (_this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n _this.props.onChange(inView, entry);\n }\n };\n\n _this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n return _this;\n }\n\n var _proto = InView.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unobserve();\n this.node = null;\n };\n\n _proto.observeNode = function observeNode() {\n if (!this.node || this.props.skip) return;\n var _this$props = this.props,\n threshold = _this$props.threshold,\n root = _this$props.root,\n rootMargin = _this$props.rootMargin,\n trackVisibility = _this$props.trackVisibility,\n delay = _this$props.delay,\n fallbackInView = _this$props.fallbackInView;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold: threshold,\n root: root,\n rootMargin: rootMargin,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n };\n\n _proto.unobserve = function unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n };\n\n _proto.render = function render() {\n if (!isPlainChildren(this.props)) {\n var _this$state = this.state,\n inView = _this$state.inView,\n entry = _this$state.entry;\n return this.props.children({\n inView: inView,\n entry: entry,\n ref: this.handleNode\n });\n }\n\n var _this$props2 = this.props,\n children = _this$props2.children,\n as = _this$props2.as,\n tag = _this$props2.tag,\n props = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n\n return /*#__PURE__*/React.createElement(as || tag || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n };\n\n return InView;\n}(React.Component);\nInView.displayName = 'InView';\nInView.defaultProps = {\n threshold: 0,\n triggerOnce: false,\n initialInView: false\n};\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n * <div ref={ref}>\r\n * <h2>{`Header inside viewport ${inView}.`}</h2>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n threshold = _ref.threshold,\n delay = _ref.delay,\n trackVisibility = _ref.trackVisibility,\n rootMargin = _ref.rootMargin,\n root = _ref.root,\n triggerOnce = _ref.triggerOnce,\n skip = _ref.skip,\n initialInView = _ref.initialInView,\n fallbackInView = _ref.fallbackInView;\n\n var unobserve = React.useRef();\n\n var _React$useState = React.useState({\n inView: !!initialInView\n }),\n state = _React$useState[0],\n setState = _React$useState[1];\n\n var setRef = React.useCallback(function (node) {\n if (unobserve.current !== undefined) {\n unobserve.current();\n unobserve.current = undefined;\n } // Skip creating the observer\n\n\n if (skip) return;\n\n if (node) {\n unobserve.current = observe(node, function (inView, entry) {\n setState({\n inView: inView,\n entry: entry\n });\n\n if (entry.isIntersecting && triggerOnce && unobserve.current) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve.current();\n unobserve.current = undefined;\n }\n }, {\n root: root,\n rootMargin: rootMargin,\n threshold: threshold,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n }\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n /* eslint-disable-next-line */\n\n useEffect(function () {\n if (!unobserve.current && state.entry && !triggerOnce && !skip) {\n // If we don't have a ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n setState({\n inView: !!initialInView\n });\n }\n });\n var result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, InView as default, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.m.js.map\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","_createObserver","id","instance","thresholds","elements","observer","entries","forEach","entry","_elements$get","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","unobserve","size","disconnect","_excluded","isPlainChildren","props","children","InView","_React$Component","subClass","superClass","_this","node","_unobserveCb","handleNode","triggerOnce","skip","setState","initialInView","observeNode","handleChange","onChange","state","create","constructor","_proto","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_this$props","render","_this$state","ref","_this$props2","as","tag","excluded","sourceKeys","_objectWithoutPropertiesLoose","React","createElement","Component","displayName","defaultProps"],"mappings":"6XAGA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IAAK,IAAII,KAAOD,EACVN,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAQC,KAC/CL,EAAOK,GAAOD,EAAOC,IAK3B,OAAOL,GAGFH,EAASY,MAAMC,KAAMR,WAU9B,SAASS,EAAgBC,EAAGC,GAM1B,OALAF,EAAkBb,OAAOgB,gBAAkB,SAAyBF,EAAGC,GAErE,OADAD,EAAEG,UAAYF,EACPD,GAGFD,EAAgBC,EAAGC,GAkB5B,IAAIG,EAAc,IAAIC,IAClBC,EAAU,IAAIC,QACdC,EAAS,EA+Bb,SAASC,EAAYC,GACnB,OAAOxB,OAAOyB,KAAKD,GAASE,OAAOC,QAAO,SAAUpB,GAClD,YAAwBqB,IAAjBJ,EAAQjB,MACdsB,KAAI,SAAUtB,GACf,OAAOA,EAAM,KAAe,SAARA,GAlBLuB,EAkBgCN,EAAQM,OAhBrDV,EAAQW,IAAID,KAChBR,GAAU,EACVF,EAAQY,IAAIF,EAAMR,EAAOW,aAFKb,EAAQc,IAAIJ,IADxB,IAiB+CN,EAAQjB,IAlB3E,IAAmBuB,KAmBdG,WAsDL,SAASE,EAAQC,EAASC,EAAUb,EAASc,GAS3C,QARgB,IAAZd,IACFA,EAAU,SA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T4G,EAAa9G,OAAOyB,KAAKnB,GAG7B,IAAKH,EAAI,EAAGA,EAAI2G,EAAWzG,OAAQF,IACjCI,EAAMuG,EAAW3G,GACb0G,EAASvC,QAAQ/D,IAAQ,IAC7BL,EAAOK,GAAOD,EAAOC,IAGvB,OAAOL,EAoUO6G,CAA8BL,EAAchC,GAExD,OAAoBsC,EAAMC,cAAcN,GAAMC,GAAO,MAAO7G,EAAS,CACnE0G,IAAK7F,KAAKyE,YACTT,GAAQC,IAGNC,EA3HiB,CA4HxBkC,EAAME,WACRpC,EAAOqC,YAAc,SACrBrC,EAAOsC,aAAe,CACpBvE,UAAW,EACXyC,aAAa,EACbG,eAAe"}
|
|
1
|
+
{"version":3,"file":"react-intersection-observer.m.js","sources":["../../../../node_modules/react-intersection-observer/react-intersection-observer.m.js"],"sourcesContent":["import * as React from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar observerMap = new Map();\nvar RootIds = new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(function (key) {\n return options[key] !== undefined;\n }).map(function (key) {\n return key + \"_\" + (key === 'root' ? getRootId(options.root) : options[key]);\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n var id = optionsToId(options);\n var instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n var elements = new Map();\n var thresholds;\n var observer = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n var inView = entry.isIntersecting && thresholds.some(function (threshold) {\n return entry.intersectionRatio >= threshold;\n }); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(function (callback) {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id: id,\n observer: observer,\n elements: elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options, fallbackInView) {\n if (options === void 0) {\n options = {};\n }\n\n if (fallbackInView === void 0) {\n fallbackInView = unsupportedValue;\n }\n\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n var bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return function () {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n var _createObserver = createObserver(options),\n id = _createObserver.id,\n observer = _createObserver.observer,\n elements = _createObserver.elements; // Register the callback listener for this element\n\n\n var callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements[\"delete\"](element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap[\"delete\"](id);\n }\n };\n}\n\nvar _excluded = [\"children\", \"as\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `<InView>` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView>\r\n {({ inView, ref, entry }) => (\r\n <div ref={ref}>\r\n <h2>{`Header inside viewport ${inView}.`}</h2>\r\n </div>\r\n )}\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the `<InView />`, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `<InView>` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\r\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nvar InView = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(InView, _React$Component);\n\n function InView(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.node = null;\n _this._unobserveCb = null;\n\n _this.handleNode = function (node) {\n if (_this.node) {\n // Clear the old observer, before we start observing a new element\n _this.unobserve();\n\n if (!node && !_this.props.triggerOnce && !_this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n _this.setState({\n inView: !!_this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n _this.node = node ? node : null;\n\n _this.observeNode();\n };\n\n _this.handleChange = function (inView, entry) {\n if (inView && _this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n _this.unobserve();\n }\n\n if (!isPlainChildren(_this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n _this.setState({\n inView: inView,\n entry: entry\n });\n }\n\n if (_this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n _this.props.onChange(inView, entry);\n }\n };\n\n _this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n return _this;\n }\n\n var _proto = InView.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unobserve();\n this.node = null;\n };\n\n _proto.observeNode = function observeNode() {\n if (!this.node || this.props.skip) return;\n var _this$props = this.props,\n threshold = _this$props.threshold,\n root = _this$props.root,\n rootMargin = _this$props.rootMargin,\n trackVisibility = _this$props.trackVisibility,\n delay = _this$props.delay,\n fallbackInView = _this$props.fallbackInView;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold: threshold,\n root: root,\n rootMargin: rootMargin,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n };\n\n _proto.unobserve = function unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n };\n\n _proto.render = function render() {\n if (!isPlainChildren(this.props)) {\n var _this$state = this.state,\n inView = _this$state.inView,\n entry = _this$state.entry;\n return this.props.children({\n inView: inView,\n entry: entry,\n ref: this.handleNode\n });\n }\n\n var _this$props2 = this.props,\n children = _this$props2.children,\n as = _this$props2.as,\n props = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n\n return /*#__PURE__*/React.createElement(as || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n };\n\n return InView;\n}(React.Component);\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n * <div ref={ref}>\r\n * <h2>{`Header inside viewport ${inView}.`}</h2>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n threshold = _ref.threshold,\n delay = _ref.delay,\n trackVisibility = _ref.trackVisibility,\n rootMargin = _ref.rootMargin,\n root = _ref.root,\n triggerOnce = _ref.triggerOnce,\n skip = _ref.skip,\n initialInView = _ref.initialInView,\n fallbackInView = _ref.fallbackInView,\n onChange = _ref.onChange;\n\n var unobserve = React.useRef();\n var callback = React.useRef();\n\n var _React$useState = React.useState({\n inView: !!initialInView\n }),\n state = _React$useState[0],\n setState = _React$useState[1]; // Store the onChange callback in a `ref`, so we can access the latest instance inside the `useCallback`.\n\n\n callback.current = onChange;\n var setRef = React.useCallback(function (node) {\n if (unobserve.current !== undefined) {\n unobserve.current();\n unobserve.current = undefined;\n } // Skip creating the observer\n\n\n if (skip) return;\n\n if (node) {\n unobserve.current = observe(node, function (inView, entry) {\n setState({\n inView: inView,\n entry: entry\n });\n if (callback.current) callback.current(inView, entry);\n\n if (entry.isIntersecting && triggerOnce && unobserve.current) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve.current();\n unobserve.current = undefined;\n }\n }, {\n root: root,\n rootMargin: rootMargin,\n threshold: threshold,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n }\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n /* eslint-disable-next-line */\n\n React.useEffect(function () {\n if (!unobserve.current && state.entry && !triggerOnce && !skip) {\n // If we don't have a ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n setState({\n inView: !!initialInView\n });\n }\n });\n var result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.m.js.map\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","_createObserver","id","instance","thresholds","elements","observer","entries","forEach","entry","_elements$get","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","unobserve","size","disconnect","_excluded","isPlainChildren","props","children","InView","_React$Component","subClass","superClass","_this","node","_unobserveCb","handleNode","triggerOnce","skip","setState","initialInView","observeNode","handleChange","onChange","state","create","constructor","_proto","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_this$props","render","_this$state","ref","_this$props2","as","excluded","sourceKeys","_objectWithoutPropertiesLoose","React","createElement","Component"],"mappings":"6XAEA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IA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.js"),o=require("styled-components"),t=require("../themes/cruk.js"),e=o.createGlobalStyle(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../node_modules/tslib/tslib.es6.js"),o=require("styled-components"),t=require("../themes/cruk.js"),e=o.createGlobalStyle(i||(i=n.__makeTemplateObject(["\n ","\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n"],["\n ","\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n"])),(function(o){var e,i=n.__assign(n.__assign({},t.default),o.theme);return"\n ".concat((e=i.typography.customFonts,e.map((function(n){return"\n @font-face {\n font-family: ".concat(n.family,';\n src: url("').concat(n.url,".woff2\") format('woff2'),\n url(\"").concat(n.url,".woff\") format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n ")})).join("")),"\n html {\n font-size: ").concat(i.typography.fontSizeBase,";\n font-family: ").concat(i.typography.fontFamilyBase,";\n line-height: ").concat(i.typography.lineHeight,";\n }\n body {\n background-color: ").concat(i.colors.backgroundMid,";\n color: ").concat(i.colors.textDark,";\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n ")}));e.defaultProps={theme:t.default};var i,r=o.withTheme(e);exports.default=r;
|
|
2
2
|
//# sourceMappingURL=GlobalStyle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components"),t=require("../Spacing/index.js");function i(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var r,o,u,f,a,m,s
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components"),t=require("../Spacing/index.js");function i(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var r,o,u,f,a,m,l,s=i(e),x=function(i){return e.css(r||(r=n.__makeTemplateObject(["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n font-weight: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"],["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n font-weight: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(){return i.wordBreak||"normal"}),(function(){return i.overflowWrap||"break-word"}),(function(n){return n.theme.typography.fontWeightMedium}),(function(n){var e=n.theme.colors,t=n.textColor;return t&&void 0!==e[t]?e[t]:t||e.textDark}),(function(n){return n.theme.typography.headerLineHeight}),(function(n){return n.theme.typography.headerTextTransform}),(function(n){return n.theme.spacing.m}),(function(n){return n.theme.spacing.s}),(function(n){return n.textAlign||"left"}),(function(){i.theme;var e=n.__rest(i,["theme"]);return t.Spacing(e,i.theme)}))},c=function(n,e,t){switch(n){case"m":return t.fontSizes.m;case"l":return t.fontSizes.l;case"xl":return t.fontSizes.xl;case"xxl":return t.fontSizes.xxl;case"xxxl":return t.fontSizes.xxxl;case"xxxxl":return t.fontSizes.xxxxl;default:return e}},h=function(n,e,t){switch(n){case"m":return t.fontSizes.m;case"l":case"xl":return t.fontSizes.l;case"xxl":return t.fontSizes.xl;case"xxxl":return t.fontSizes.xxl;case"xxxxl":return t.fontSizes.xxxl;default:return e}},z=function(n,e,t){switch(n){case"m":return t.fontSizes.m;case"l":case"xl":case"xxl":return t.fontSizes.l;case"xxxl":return t.fontSizes.xl;case"xxxxl":return t.fontSizes.xxl;default:return e}},d=s.default.h1(o||(o=n.__makeTemplateObject(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n } ;\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n } ;\n"])),(function(n){return x(n)}),(function(n){var e=n.theme,t=n.textSize;return z(t||null,e.fontSizes.xxl,e)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var e=n.theme,t=n.textSize;return h(t||null,e.fontSizes.xxxl,e)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.theme,t=n.textSize;return c(t||null,e.fontSizes.xxxxl,e)})),p=s.default.h2(u||(u=n.__makeTemplateObject(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var e=n.theme,t=n.textSize;return z(t||null,e.fontSizes.xl,e)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var e=n.theme,t=n.textSize;return h(t||null,e.fontSizes.xxl,e)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.theme,t=n.textSize;return c(t||null,e.fontSizes.xxxl,e)})),S=s.default.h3(f||(f=n.__makeTemplateObject(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var e=n.theme,t=n.textSize;return z(t||null,e.fontSizes.l,e)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var e=n.theme,t=n.textSize;return h(t||null,e.fontSizes.xl,e)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.theme,t=n.textSize;return c(t||null,e.fontSizes.xxl,e)})),w=s.default.h4(a||(a=n.__makeTemplateObject(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var e=n.theme,t=n.textSize;return z(t||null,e.fontSizes.l,e)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var e=n.theme,t=n.textSize;return h(t||null,e.fontSizes.l,e)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.theme,t=n.textSize;return c(t||null,e.fontSizes.xl,e)})),b=s.default.h5(m||(m=n.__makeTemplateObject(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var e=n.theme,t=n.textSize;return z(t||null,e.fontSizes.l,e)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var e=n.theme,t=n.textSize;return h(t||null,e.fontSizes.l,e)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.theme,t=n.textSize;return c(t||null,e.fontSizes.l,e)})),k=s.default.h6(l||(l=n.__makeTemplateObject(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var e=n.theme,t=n.textSize;return z(t||null,e.fontSizes.m,e)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var e=n.theme,t=n.textSize;return h(t||null,e.fontSizes.m,e)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var e=n.theme,t=n.textSize;return c(t||null,e.fontSizes.m,e)}));exports.H1=d,exports.H2=p,exports.H3=S,exports.H4=w,exports.H5=b,exports.H6=k;
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),n=require("styled-components"),r=require("../Text/index.js"),o=require("../Icon/index.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,i,c,u=t(n),s=u.default(o.default)(a||(a=e.__makeTemplateObject(["\n margin-right: ",";\n"],["\n margin-right: ",";\n"])),(function(e){return e.theme.spacing.xxs})),l=u.default(r.Text)(c||(c=e.__makeTemplateObject(["\n transition: color 0.2s ease, background-size 0.3s ease;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n padding: 0;\n color: ",";\n text-decoration: ",";\n font-weight: ",";\n background: ",";\n background-repeat: no-repeat;\n background-position-y: calc(100%);\n background-size: 100% 2px;\n\n ","\n\n &:focus-visible {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"],["\n transition: color 0.2s ease, background-size 0.3s ease;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n padding: 0;\n color: ",";\n text-decoration: ",";\n font-weight: ",";\n background: ",";\n background-repeat: no-repeat;\n background-position-y: calc(100%);\n background-size: 100% 2px;\n\n ","\n\n &:focus-visible {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"])),(function(e){var n=e.theme,r=n.colors,o=n.utilities.useBackgroundStyleLinks,t=e.textColor,a=e.appearance;return t&&void 0!==r[t]?r[t]:t||(!a&&o?"currentColor":a&&"primary"===a?r.secondary:r.linkColor)}),(function(e){var n=e.appearance,r=e.theme.typography.linkTextDecoration;return"primary"===n||"secondary"===n?"none":r}),(function(e){var n=e.theme;return n.utilities.useBackgroundStyleLinks?n.typography.fontWeightHeavy:n.typography.fontWeightNormal}),(function(e){var n=e.appearance,r=e.theme;return e.theme.utilities.useBackgroundStyleLinks&&!n?"linear-gradient(180deg, rgba(255, 255, 255, 0) 0px, ".concat(r.colors.primary," -4px);"):void 0}),(function(r){var o=r.appearance,t=r.theme.typography.fontWeightHeavy;return("primary"===o||"secondary"===o)&&n.css(i||(i=e.__makeTemplateObject(["\n font-weight: ",";\n "],["\n font-weight: ",";\n "])),t)}),(function(e){var n=e.theme,r=n.colors,o=n.utilities.useBackgroundStyleLinks,t=e.textHoverColor;return!t&&o?r.textDark:t&&void 0!==r[t]?r[t]:t||r.linkColorHover}));exports.ChevyWithLevee=s,exports.StyledLink=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),n=require("styled-components"),r=require("../Text/index.js"),o=require("../Icon/index.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a,i,c,u=t(n),s=u.default(o.default)(a||(a=e.__makeTemplateObject(["\n margin-right: ",";\n"],["\n margin-right: ",";\n"])),(function(e){return e.theme.spacing.xxs})),l=u.default(r.Text)(c||(c=e.__makeTemplateObject(["\n transition: color 0.2s ease, background-size 0.3s ease;\n overflow-wrap: break-word;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n padding: 0;\n color: ",";\n text-decoration: ",";\n font-weight: ",";\n background: ",";\n background-repeat: no-repeat;\n background-position-y: calc(100%);\n background-size: 100% 2px;\n\n ","\n\n &:focus-visible {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"],["\n transition: color 0.2s ease, background-size 0.3s ease;\n overflow-wrap: break-word;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n padding: 0;\n color: ",";\n text-decoration: ",";\n font-weight: ",";\n background: ",";\n background-repeat: no-repeat;\n background-position-y: calc(100%);\n background-size: 100% 2px;\n\n ","\n\n &:focus-visible {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"])),(function(e){var n=e.theme,r=n.colors,o=n.utilities.useBackgroundStyleLinks,t=e.textColor,a=e.appearance;return t&&void 0!==r[t]?r[t]:t||(!a&&o?"currentColor":a&&"primary"===a?r.secondary:r.linkColor)}),(function(e){var n=e.appearance,r=e.theme.typography.linkTextDecoration;return"primary"===n||"secondary"===n?"none":r}),(function(e){var n=e.theme;return n.utilities.useBackgroundStyleLinks?n.typography.fontWeightHeavy:n.typography.fontWeightNormal}),(function(e){var n=e.appearance,r=e.theme;return e.theme.utilities.useBackgroundStyleLinks&&!n?"linear-gradient(180deg, rgba(255, 255, 255, 0) 0px, ".concat(r.colors.primary," -4px);"):void 0}),(function(r){var o=r.appearance,t=r.theme.typography.fontWeightHeavy;return("primary"===o||"secondary"===o)&&n.css(i||(i=e.__makeTemplateObject(["\n font-weight: ",";\n "],["\n font-weight: ",";\n "])),t)}),(function(e){var n=e.theme,r=n.colors,o=n.utilities.useBackgroundStyleLinks,t=e.textHoverColor;return!t&&o?r.textDark:t&&void 0!==r[t]?r[t]:t||r.linkColorHover}));exports.ChevyWithLevee=s,exports.StyledLink=l;
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),t=require("styled-components"),e=require("../Spacing/index.js");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var o,i=r(t).default.p(o||(o=n.__makeTemplateObject(["\n font-family: ",";\n word-break: ",";\n color: ",";\n text-align: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n padding: 0;\n margin: 0;\n margin-bottom: ",";\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ","\n"],["\n font-family: ",";\n word-break: ",";\n color: ",";\n text-align: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n padding: 0;\n margin: 0;\n margin-bottom: ",";\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyBase}),(function(n){return n.wordBreak||"normal"}),(function(n){var t=n.theme.colors,e=n.textColor;return e&&void 0!==t[e]?t[e]:e||t.textDark}),(function(n){return n.textAlign||"left"}),(function(n){var t=n.theme,e=t.fontSizes,r=t.fontSizes.m,o=n.textSize;return o?e[o]:r}),(function(n){return n.theme.typography.lineHeight}),(function(n){var t=n.textWeight,e=n.theme;return t||e.typography.fontWeightNormal}),(function(n){var t=n.as,e=n.theme.spacing.xs;return void 0===t||"p"===t?"".concat(e):0}),(function(n){return e.Spacing(n,n.theme)}));exports.TextStyled=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),t=require("styled-components"),e=require("../Spacing/index.js");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var o,i=r(t).default.p(o||(o=n.__makeTemplateObject(["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n text-align: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n padding: 0;\n margin: 0;\n margin-bottom: ",";\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ","\n"],["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n text-align: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n padding: 0;\n margin: 0;\n margin-bottom: ",";\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyBase}),(function(n){return n.wordBreak||"normal"}),(function(n){return n.overflowWrap||"break-word"}),(function(n){var t=n.theme.colors,e=n.textColor;return e&&void 0!==t[e]?t[e]:e||t.textDark}),(function(n){return n.textAlign||"left"}),(function(n){var t=n.theme,e=t.fontSizes,r=t.fontSizes.m,o=n.textSize;return o?e[o]:r}),(function(n){return n.theme.typography.lineHeight}),(function(n){var t=n.textWeight,e=n.theme;return t||e.typography.fontWeightNormal}),(function(n){var t=n.as,e=n.theme.spacing.xs;return void 0===t||"p"===t?"".concat(e):0}),(function(n){return e.Spacing(n,n.theme)}));exports.TextStyled=i;
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={contentMaxWidth:"1020px",useDefaultFocusRect:!0,useDefaultFromControls:!1,useBackgroundStyleLinks:!1,inputBorderWidth:"1px"},r={
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={contentMaxWidth:"1020px",useDefaultFocusRect:!0,useDefaultFromControls:!1,useBackgroundStyleLinks:!1,inputBorderWidth:"1px"},r={assetPath:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/",logoUrl:"/",logoAlt:"Cancer Research UK Giving Page",logoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/logo.png",footerCopyText:"Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales(4325234) and the Isle of Man (5713F).",footerLogoAlt:"Registered with Fundraising Regulator",footerLogoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/fundreg.png"},t={s:"35px",m:"50px",l:"60px",xl:"90px",path:"".concat(r.assetPath,"images/icon-avatars/")},a={borderRadius:"4px",borderRadiusLarge:"4px",buttonBorderThickness:"2px",textDecoration:"none",textTransform:"none"},o={mobile:"576px",tablet:"768px",desktop:"992px",desktopLarge:"1200px"},n={darkBlue_100:"#edeaf5",darkBlue_200:"#dad2ea",darkBlue_300:"#a896cf",darkBlue_500:"#2e008b",magenta_100:"#fdeaf5",magenta_500:"#e40087",magenta_800:"#BB0071",magenta_900:"#710044",cyan_500:"#00b6ed",cyan_900:"#005870",grey_100:"#f5f5f5",grey_200:"#ededed",grey_300:"#c6c6c6",grey_500:"#9A9A9A",grey_800:"#575757",grey_900:"#2e2d2c",white:"#fff",black:"#000",red:"#D51311",yellow:"#fdc02f",green:"#3d854d"},s={primary:n.darkBlue_500,secondary:n.magenta_500,tertiary:n.cyan_500,textOnPrimary:n.white,textOnSecondary:n.white,textOnTertiary:n.white,disabled:n.grey_300,danger:n.red,warning:n.yellow,success:n.green,info:n.cyan_500,textError:n.red,linkColor:n.darkBlue_500,linkColorHover:n.magenta_800,textDark:n.grey_900,textLight:n.white,progressBar:n.darkBlue_500,progressBarSecondary:n.magenta_500,progressBarBackground:n.grey_200,circularProgress:n.cyan_500,circularProgressSecondary:n.magenta_500,circularProgressBackground:n.grey_300,buttonPrimaryBackground:n.magenta_500,buttonPrimaryText:n.white,buttonPrimaryBorder:n.magenta_500,buttonPrimaryBackgroundHover:n.magenta_800,buttonPrimaryTextHover:n.white,buttonPrimaryBorderHover:n.magenta_800,buttonPrimaryDisabledBackground:n.grey_100,buttonPrimaryDisabledText:n.grey_500,buttonPrimaryDisabledBorder:n.grey_100,buttonSecondaryBackground:n.white,buttonSecondaryText:n.magenta_500,buttonSecondaryBorder:n.magenta_500,buttonSecondaryBackgroundHover:n.magenta_100,buttonSecondaryTextHover:n.magenta_800,buttonSecondaryBorderHover:n.magenta_800,buttonSecondaryDisabledBackground:n.grey_100,buttonSecondaryDisabledText:n.grey_500,buttonSecondaryDisabledBorder:n.grey_100,buttonTertiaryText:n.magenta_500,buttonTertiaryTextHover:n.magenta_800,buttonTertiaryDisabledText:n.grey_500,selectionBorder:n.grey_500,textInputBorder:n.grey_900,inputBorder:n.grey_900,headerBackground:n.white,backgroundLight:n.white,backgroundLightColor:n.darkBlue_200,backgroundMid:n.grey_100,loaderColor1:n.darkBlue_500,loaderColor2:n.magenta_500,loaderColor3:n.cyan_500,paginationText:n.darkBlue_500,paginationActive:n.grey_300,paginationBackground:n.darkBlue_500,footerBackground:n.grey_200,headerBorder:n.grey_300,stepBorder:n.grey_300,stepBackground:n.white,popoverBackground:n.white,textInputExtraInfo:n.grey_200,totaliserBubbleColor:n.grey_200,totaliserBubbleTextColor:n.grey_900,totaliserBubbleTotalColor:n.darkBlue_500,selectBackground:n.grey_900,modalBackdrop:n.grey_900,userBlockExtraText:n.grey_800},i={none:"0",auto:"auto",xxs:"0.5rem",xs:"1rem",s:"1.5rem",m:"2rem",l:"2.5rem",xl:"3rem",xxl:"3.5rem"},g={xs:"0.75rem",s:"0.875rem",m:"1rem",l:"1.25rem",xl:"1.5625rem",xxl:"2rem",xxxl:"2.5rem",xxxxl:"3.125rem"},d={customFonts:[{family:"MuseoSans-500",url:"https://ccp-s3.int.cruk.org/fonts/MuseoSansRounded-500"}],fontFamilyBase:"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif",fontFamilyHeadings:"MuseoSans-500,Calibri,Arial,sans-serif",fontSizeBase:"16px",fontWeightHeavy:"700",fontWeightMedium:"500",fontWeightNormal:"400",fontWeightLight:"300",fontWeightVLight:"100",linkTextDecoration:"underline",lineHeight:"1.5em",headerLineHeight:"1.25em",headerTextTransform:"none"},u={name:"cruk",avatar:t,breakpoint:o,button:a,tokenColors:n,colors:s,spacing:i,fontSizes:g,siteConfig:r,typography:d,utilities:e};exports.AVATAR=t,exports.BREAKPOINT=o,exports.BUTTON=a,exports.COLORS=s,exports.FONT_SIZES=g,exports.SITE_CONFIG=r,exports.SPACING=i,exports.TOKEN_COLORS=n,exports.TYPOGRAPHY=d,exports.UTILITIES=e,exports.default=u;
|
|
2
2
|
//# sourceMappingURL=cruk.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, HTMLAttributes } from "react";
|
|
2
2
|
import { SpacingProps } from "../Spacing";
|
|
3
|
-
import { FontSizeType, WordBreakType } from "../../types";
|
|
3
|
+
import { FontSizeType, WordBreakType, OverflowWrapType } from "../../types";
|
|
4
4
|
export declare type HeadingProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
5
5
|
h1?: boolean;
|
|
6
6
|
h2?: boolean;
|
|
@@ -8,12 +8,18 @@ export declare type HeadingProps = SpacingProps & HTMLAttributes<HTMLElement> &
|
|
|
8
8
|
h4?: boolean;
|
|
9
9
|
h5?: boolean;
|
|
10
10
|
h6?: boolean;
|
|
11
|
+
/** font size FontSizeType t-shirt sizes */
|
|
11
12
|
textSize?: FontSizeType;
|
|
13
|
+
/** horizontal alignment of text */
|
|
12
14
|
textAlign?: "left" | "right" | "center";
|
|
15
|
+
/** color of text */
|
|
13
16
|
textColor?: string;
|
|
14
17
|
/** styled-component polymorphic feature so you take the styling of a header and cast the component to be a "span" for example */
|
|
15
18
|
as?: any;
|
|
19
|
+
/** word-break behavior */
|
|
16
20
|
wordBreak?: WordBreakType;
|
|
21
|
+
/** overflow-wrap behavior */
|
|
22
|
+
overflowWrap?: OverflowWrapType;
|
|
17
23
|
};
|
|
18
24
|
/**
|
|
19
25
|
*
|
|
@@ -6,6 +6,7 @@ export declare const H1: import("styled-components").StyledComponent<"h1", any,
|
|
|
6
6
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
7
7
|
textColor?: string | undefined;
|
|
8
8
|
wordBreak?: WordBreakType | undefined;
|
|
9
|
+
overflowWrap?: WordBreakType | undefined;
|
|
9
10
|
}, never>;
|
|
10
11
|
export declare const H2: import("styled-components").StyledComponent<"h2", any, SpacingProps & {
|
|
11
12
|
theme: ThemeType;
|
|
@@ -13,6 +14,7 @@ export declare const H2: import("styled-components").StyledComponent<"h2", any,
|
|
|
13
14
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
14
15
|
textColor?: string | undefined;
|
|
15
16
|
wordBreak?: WordBreakType | undefined;
|
|
17
|
+
overflowWrap?: WordBreakType | undefined;
|
|
16
18
|
}, never>;
|
|
17
19
|
export declare const H3: import("styled-components").StyledComponent<"h3", any, SpacingProps & {
|
|
18
20
|
theme: ThemeType;
|
|
@@ -20,6 +22,7 @@ export declare const H3: import("styled-components").StyledComponent<"h3", any,
|
|
|
20
22
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
21
23
|
textColor?: string | undefined;
|
|
22
24
|
wordBreak?: WordBreakType | undefined;
|
|
25
|
+
overflowWrap?: WordBreakType | undefined;
|
|
23
26
|
}, never>;
|
|
24
27
|
export declare const H4: import("styled-components").StyledComponent<"h4", any, SpacingProps & {
|
|
25
28
|
theme: ThemeType;
|
|
@@ -27,6 +30,7 @@ export declare const H4: import("styled-components").StyledComponent<"h4", any,
|
|
|
27
30
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
28
31
|
textColor?: string | undefined;
|
|
29
32
|
wordBreak?: WordBreakType | undefined;
|
|
33
|
+
overflowWrap?: WordBreakType | undefined;
|
|
30
34
|
}, never>;
|
|
31
35
|
export declare const H5: import("styled-components").StyledComponent<"h5", any, SpacingProps & {
|
|
32
36
|
theme: ThemeType;
|
|
@@ -34,6 +38,7 @@ export declare const H5: import("styled-components").StyledComponent<"h5", any,
|
|
|
34
38
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
35
39
|
textColor?: string | undefined;
|
|
36
40
|
wordBreak?: WordBreakType | undefined;
|
|
41
|
+
overflowWrap?: WordBreakType | undefined;
|
|
37
42
|
}, never>;
|
|
38
43
|
export declare const H6: import("styled-components").StyledComponent<"h6", any, SpacingProps & {
|
|
39
44
|
theme: ThemeType;
|
|
@@ -41,4 +46,5 @@ export declare const H6: import("styled-components").StyledComponent<"h6", any,
|
|
|
41
46
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
42
47
|
textColor?: string | undefined;
|
|
43
48
|
wordBreak?: WordBreakType | undefined;
|
|
49
|
+
overflowWrap?: WordBreakType | undefined;
|
|
44
50
|
}, never>;
|
|
@@ -9,6 +9,7 @@ export declare const StyledLink: import("styled-components").StyledComponent<imp
|
|
|
9
9
|
textWeight?: number | undefined;
|
|
10
10
|
as?: any;
|
|
11
11
|
wordBreak?: import("../../types").WordBreakType | undefined;
|
|
12
|
+
overflowWrap?: import("../../types").OverflowWrapType | undefined;
|
|
12
13
|
ref?: import("react").Ref<HTMLElement> | undefined;
|
|
13
14
|
} & {
|
|
14
15
|
theme: ThemeType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, HTMLAttributes, Ref } from "react";
|
|
2
2
|
import { SpacingProps } from "../Spacing";
|
|
3
|
-
import { WordBreakType, FontSizeType, ColorKeyType } from "../../types";
|
|
3
|
+
import { WordBreakType, FontSizeType, ColorKeyType, OverflowWrapType } from "../../types";
|
|
4
4
|
/**
|
|
5
5
|
* Text is to be used as the main paragraph component (or span using as="span"). Using the Text component is preferred to simply adding text to a div and styling that div, this will guarantee we are always using the correct font and default text colour.
|
|
6
6
|
*/
|
|
@@ -15,8 +15,10 @@ export declare type TextProps = SpacingProps & HTMLAttributes<HTMLElement> & {
|
|
|
15
15
|
textWeight?: number;
|
|
16
16
|
/** styled-components polymorphism where you can set this to "span", "p" or "h2" it default to "p" */
|
|
17
17
|
as?: any;
|
|
18
|
-
/** word
|
|
18
|
+
/** word-break behaviour */
|
|
19
19
|
wordBreak?: WordBreakType;
|
|
20
|
+
/** overflow-wrap behaviour */
|
|
21
|
+
overflowWrap?: OverflowWrapType;
|
|
20
22
|
/** react reference to the DOM element sometime used to scroll to or set focus after an error */
|
|
21
23
|
ref?: Ref<HTMLElement>;
|
|
22
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpacingProps } from "../Spacing";
|
|
2
|
-
import { WordBreakType, FontSizeType, ThemeType, ColorKeyType } from "../../types";
|
|
2
|
+
import { WordBreakType, FontSizeType, ThemeType, ColorKeyType, OverflowWrapType } from "../../types";
|
|
3
3
|
export declare type TextStyledProps = SpacingProps & {
|
|
4
4
|
textColor?: ColorKeyType;
|
|
5
5
|
textAlign?: "left" | "right" | "center" | "justify";
|
|
@@ -7,6 +7,7 @@ export declare type TextStyledProps = SpacingProps & {
|
|
|
7
7
|
textWeight?: number;
|
|
8
8
|
as?: any;
|
|
9
9
|
wordBreak?: WordBreakType;
|
|
10
|
+
overflowWrap?: OverflowWrapType;
|
|
10
11
|
theme: ThemeType;
|
|
11
12
|
};
|
|
12
13
|
export declare const TextStyled: import("styled-components").StyledComponent<"p", any, SpacingProps & {
|
|
@@ -16,5 +17,6 @@ export declare const TextStyled: import("styled-components").StyledComponent<"p"
|
|
|
16
17
|
textWeight?: number | undefined;
|
|
17
18
|
as?: any;
|
|
18
19
|
wordBreak?: WordBreakType | undefined;
|
|
20
|
+
overflowWrap?: OverflowWrapType | undefined;
|
|
19
21
|
theme: ThemeType;
|
|
20
22
|
}, never>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var r=new Map,i=new WeakMap,o=0;function s(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(i.has(n)||(o+=1,i.set(n,o.toString())),i.get(n)):"0":e[t]);var n})).toString()}function a(e,t,n,i){if(void 0===n&&(n={}),void 0===i&&(i=undefined),void 0===window.IntersectionObserver&&void 0!==i){var o=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),function(){}}var a=function(e){var t=s(e),n=r.get(t);if(!n){var i,o=new Map,a=new IntersectionObserver((function(t){t.forEach((function(t){var n,r=t.isIntersecting&&i.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null==(n=o.get(t.target))||n.forEach((function(e){e(r,t)}))}))}),e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:o},r.set(t,n)}return n}(n),
|
|
1
|
+
import*as e from"react";function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var r=new Map,i=new WeakMap,o=0;function s(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(i.has(n)||(o+=1,i.set(n,o.toString())),i.get(n)):"0":e[t]);var n})).toString()}function a(e,t,n,i){if(void 0===n&&(n={}),void 0===i&&(i=undefined),void 0===window.IntersectionObserver&&void 0!==i){var o=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),function(){}}var a=function(e){var t=s(e),n=r.get(t);if(!n){var i,o=new Map,a=new IntersectionObserver((function(t){t.forEach((function(t){var n,r=t.isIntersecting&&i.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null==(n=o.get(t.target))||n.forEach((function(e){e(r,t)}))}))}),e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:o},r.set(t,n)}return n}(n),h=a.id,l=a.observer,c=a.elements,u=c.get(e)||[];return c.has(e)||c.set(e,u),u.push(t),l.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(c.delete(e),l.unobserve(e)),0===c.size&&(l.disconnect(),r.delete(h))}}var h=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function l(e){return"function"!=typeof e.children}var c=function(r){var i,o;function s(e){var t;return(t=r.call(this,e)||this).node=null,t._unobserveCb=null,t.handleNode=function(e){t.node&&(t.unobserve(),e||t.props.triggerOnce||t.props.skip||t.setState({inView:!!t.props.initialInView,entry:void 0})),t.node=e||null,t.observeNode()},t.handleChange=function(e,n){e&&t.props.triggerOnce&&t.unobserve(),l(t.props)||t.setState({inView:e,entry:n}),t.props.onChange&&t.props.onChange(e,n)},t.state={inView:!!e.initialInView,entry:void 0},t}o=r,(i=s).prototype=Object.create(o.prototype),i.prototype.constructor=i,n(i,o);var c=s.prototype;return c.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},c.componentWillUnmount=function(){this.unobserve(),this.node=null},c.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,i=e.trackVisibility,o=e.delay,s=e.fallbackInView;this._unobserveCb=a(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:i,delay:o},s)}},c.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},c.render=function(){if(!l(this.props)){var n=this.state,r=n.inView,i=n.entry;return this.props.children({inView:r,entry:i,ref:this.handleNode})}var o=this.props,s=o.children,a=o.as,c=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(o,h);return e.createElement(a||"div",t({ref:this.handleNode},c),s)},s}(e.Component);export{c as InView,a as observe};
|
|
2
2
|
//# sourceMappingURL=react-intersection-observer.m.js.map
|
package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-intersection-observer.m.js","sources":["../../../../node_modules/react-intersection-observer/react-intersection-observer.m.js"],"sourcesContent":["import * as React from 'react';\nimport { useEffect } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar observerMap = new Map();\nvar RootIds = new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(function (key) {\n return options[key] !== undefined;\n }).map(function (key) {\n return key + \"_\" + (key === 'root' ? getRootId(options.root) : options[key]);\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n var id = optionsToId(options);\n var instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n var elements = new Map();\n var thresholds;\n var observer = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n var inView = entry.isIntersecting && thresholds.some(function (threshold) {\n return entry.intersectionRatio >= threshold;\n }); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(function (callback) {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id: id,\n observer: observer,\n elements: elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options, fallbackInView) {\n if (options === void 0) {\n options = {};\n }\n\n if (fallbackInView === void 0) {\n fallbackInView = unsupportedValue;\n }\n\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n var bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return function () {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n var _createObserver = createObserver(options),\n id = _createObserver.id,\n observer = _createObserver.observer,\n elements = _createObserver.elements; // Register the callback listener for this element\n\n\n var callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements[\"delete\"](element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap[\"delete\"](id);\n }\n };\n}\n\nvar _excluded = [\"children\", \"as\", \"tag\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `<InView>` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView>\r\n {({ inView, ref, entry }) => (\r\n <div ref={ref}>\r\n <h2>{`Header inside viewport ${inView}.`}</h2>\r\n </div>\r\n )}\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the `<InView />`, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `<InView>` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\r\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nvar InView = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(InView, _React$Component);\n\n function InView(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.node = null;\n _this._unobserveCb = null;\n\n _this.handleNode = function (node) {\n if (_this.node) {\n // Clear the old observer, before we start observing a new element\n _this.unobserve();\n\n if (!node && !_this.props.triggerOnce && !_this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n _this.setState({\n inView: !!_this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n _this.node = node ? node : null;\n\n _this.observeNode();\n };\n\n _this.handleChange = function (inView, entry) {\n if (inView && _this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n _this.unobserve();\n }\n\n if (!isPlainChildren(_this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n _this.setState({\n inView: inView,\n entry: entry\n });\n }\n\n if (_this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n _this.props.onChange(inView, entry);\n }\n };\n\n _this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n return _this;\n }\n\n var _proto = InView.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unobserve();\n this.node = null;\n };\n\n _proto.observeNode = function observeNode() {\n if (!this.node || this.props.skip) return;\n var _this$props = this.props,\n threshold = _this$props.threshold,\n root = _this$props.root,\n rootMargin = _this$props.rootMargin,\n trackVisibility = _this$props.trackVisibility,\n delay = _this$props.delay,\n fallbackInView = _this$props.fallbackInView;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold: threshold,\n root: root,\n rootMargin: rootMargin,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n };\n\n _proto.unobserve = function unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n };\n\n _proto.render = function render() {\n if (!isPlainChildren(this.props)) {\n var _this$state = this.state,\n inView = _this$state.inView,\n entry = _this$state.entry;\n return this.props.children({\n inView: inView,\n entry: entry,\n ref: this.handleNode\n });\n }\n\n var _this$props2 = this.props,\n children = _this$props2.children,\n as = _this$props2.as,\n tag = _this$props2.tag,\n props = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n\n return /*#__PURE__*/React.createElement(as || tag || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n };\n\n return InView;\n}(React.Component);\nInView.displayName = 'InView';\nInView.defaultProps = {\n threshold: 0,\n triggerOnce: false,\n initialInView: false\n};\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n * <div ref={ref}>\r\n * <h2>{`Header inside viewport ${inView}.`}</h2>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n threshold = _ref.threshold,\n delay = _ref.delay,\n trackVisibility = _ref.trackVisibility,\n rootMargin = _ref.rootMargin,\n root = _ref.root,\n triggerOnce = _ref.triggerOnce,\n skip = _ref.skip,\n initialInView = _ref.initialInView,\n fallbackInView = _ref.fallbackInView;\n\n var unobserve = React.useRef();\n\n var _React$useState = React.useState({\n inView: !!initialInView\n }),\n state = _React$useState[0],\n setState = _React$useState[1];\n\n var setRef = React.useCallback(function (node) {\n if (unobserve.current !== undefined) {\n unobserve.current();\n unobserve.current = undefined;\n } // Skip creating the observer\n\n\n if (skip) return;\n\n if (node) {\n unobserve.current = observe(node, function (inView, entry) {\n setState({\n inView: inView,\n entry: entry\n });\n\n if (entry.isIntersecting && triggerOnce && unobserve.current) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve.current();\n unobserve.current = undefined;\n }\n }, {\n root: root,\n rootMargin: rootMargin,\n threshold: threshold,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n }\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n /* eslint-disable-next-line */\n\n useEffect(function () {\n if (!unobserve.current && state.entry && !triggerOnce && !skip) {\n // If we don't have a ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n setState({\n inView: !!initialInView\n });\n }\n });\n var result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, InView as default, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.m.js.map\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","_createObserver","id","instance","thresholds","elements","observer","entries","forEach","entry","_elements$get","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","unobserve","size","disconnect","_excluded","isPlainChildren","props","children","InView","_React$Component","subClass","superClass","_this","node","_unobserveCb","handleNode","triggerOnce","skip","setState","initialInView","observeNode","handleChange","onChange","state","create","constructor","_proto","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_this$props","render","_this$state","ref","_this$props2","as","tag","excluded","sourceKeys","_objectWithoutPropertiesLoose","React","createElement","Component","displayName","defaultProps"],"mappings":"wBAGA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IA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YH,WACzBrC,EAAkBwC,EAAYxC,gBAC9BsC,EAAQE,EAAYF,MACpB9D,EAAiBgE,EAAYhE,eACjC1B,KAAKwE,aAAejD,EAAQvB,KAAKuE,KAAMvE,KAAK+E,aAAc,CACxD9C,UAAWA,EACXf,KAAMA,EACNqE,WAAYA,EAEZrC,gBAAiBA,EAEjBsC,MAAOA,GACN9D,KAGL0D,EAAOzB,UAAY,WACb3D,KAAKwE,eACPxE,KAAKwE,eAELxE,KAAKwE,aAAe,OAIxBY,EAAOO,OAAS,WACd,IAAK5B,EAAgB/D,KAAKgE,OAAQ,CAChC,IAAI4B,EAAc5F,KAAKiF,MACnBjC,EAAS4C,EAAY5C,OACrBF,EAAQ8C,EAAY9C,MACxB,OAAO9C,KAAKgE,MAAMC,SAAS,CACzBjB,OAAQA,EACRF,MAAOA,EACP+C,IAAK7F,KAAKyE,aAId,IAAIqB,EAAe9F,KAAKgE,MACpBC,EAAW6B,EAAa7B,SACxB8B,EAAKD,EAAaC,GAClBC,EAAMF,EAAaE,IACnBhC,EAhVR,SAAuCtE,EAAQuG,GAC7C,GAAc,MAAVvG,EAAgB,MAAO,GAC3B,IAEIC,EAAKJ,EAFLD,EAAS,GACT4G,EAAa9G,OAAOyB,KAAKnB,GAG7B,IAAKH,EAAI,EAAGA,EAAI2G,EAAWzG,OAAQF,IACjCI,EAAMuG,EAAW3G,GACb0G,EAASvC,QAAQ/D,IAAQ,IAC7BL,EAAOK,GAAOD,EAAOC,IAGvB,OAAOL,EAoUO6G,CAA8BL,EAAchC,GAExD,OAAoBsC,EAAMC,cAAcN,GAAMC,GAAO,MAAO7G,EAAS,CACnE0G,IAAK7F,KAAKyE,YACTT,GAAQC,IAGNC,EA3HiB,CA4HxBkC,EAAME,WACRpC,EAAOqC,YAAc,SACrBrC,EAAOsC,aAAe,CACpBvE,UAAW,EACXyC,aAAa,EACbG,eAAe"}
|
|
1
|
+
{"version":3,"file":"react-intersection-observer.m.js","sources":["../../../../node_modules/react-intersection-observer/react-intersection-observer.m.js"],"sourcesContent":["import * as React from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar observerMap = new Map();\nvar RootIds = new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(function (key) {\n return options[key] !== undefined;\n }).map(function (key) {\n return key + \"_\" + (key === 'root' ? getRootId(options.root) : options[key]);\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n var id = optionsToId(options);\n var instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n var elements = new Map();\n var thresholds;\n var observer = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n var inView = entry.isIntersecting && thresholds.some(function (threshold) {\n return entry.intersectionRatio >= threshold;\n }); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(function (callback) {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id: id,\n observer: observer,\n elements: elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options, fallbackInView) {\n if (options === void 0) {\n options = {};\n }\n\n if (fallbackInView === void 0) {\n fallbackInView = unsupportedValue;\n }\n\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n var bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return function () {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n var _createObserver = createObserver(options),\n id = _createObserver.id,\n observer = _createObserver.observer,\n elements = _createObserver.elements; // Register the callback listener for this element\n\n\n var callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements[\"delete\"](element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap[\"delete\"](id);\n }\n };\n}\n\nvar _excluded = [\"children\", \"as\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `<InView>` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView>\r\n {({ inView, ref, entry }) => (\r\n <div ref={ref}>\r\n <h2>{`Header inside viewport ${inView}.`}</h2>\r\n </div>\r\n )}\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the `<InView />`, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `<InView>` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\r\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nvar InView = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(InView, _React$Component);\n\n function InView(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.node = null;\n _this._unobserveCb = null;\n\n _this.handleNode = function (node) {\n if (_this.node) {\n // Clear the old observer, before we start observing a new element\n _this.unobserve();\n\n if (!node && !_this.props.triggerOnce && !_this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n _this.setState({\n inView: !!_this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n _this.node = node ? node : null;\n\n _this.observeNode();\n };\n\n _this.handleChange = function (inView, entry) {\n if (inView && _this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n _this.unobserve();\n }\n\n if (!isPlainChildren(_this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n _this.setState({\n inView: inView,\n entry: entry\n });\n }\n\n if (_this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n _this.props.onChange(inView, entry);\n }\n };\n\n _this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n return _this;\n }\n\n var _proto = InView.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unobserve();\n this.node = null;\n };\n\n _proto.observeNode = function observeNode() {\n if (!this.node || this.props.skip) return;\n var _this$props = this.props,\n threshold = _this$props.threshold,\n root = _this$props.root,\n rootMargin = _this$props.rootMargin,\n trackVisibility = _this$props.trackVisibility,\n delay = _this$props.delay,\n fallbackInView = _this$props.fallbackInView;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold: threshold,\n root: root,\n rootMargin: rootMargin,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n };\n\n _proto.unobserve = function unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n };\n\n _proto.render = function render() {\n if (!isPlainChildren(this.props)) {\n var _this$state = this.state,\n inView = _this$state.inView,\n entry = _this$state.entry;\n return this.props.children({\n inView: inView,\n entry: entry,\n ref: this.handleNode\n });\n }\n\n var _this$props2 = this.props,\n children = _this$props2.children,\n as = _this$props2.as,\n props = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n\n return /*#__PURE__*/React.createElement(as || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n };\n\n return InView;\n}(React.Component);\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n * <div ref={ref}>\r\n * <h2>{`Header inside viewport ${inView}.`}</h2>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n threshold = _ref.threshold,\n delay = _ref.delay,\n trackVisibility = _ref.trackVisibility,\n rootMargin = _ref.rootMargin,\n root = _ref.root,\n triggerOnce = _ref.triggerOnce,\n skip = _ref.skip,\n initialInView = _ref.initialInView,\n fallbackInView = _ref.fallbackInView,\n onChange = _ref.onChange;\n\n var unobserve = React.useRef();\n var callback = React.useRef();\n\n var _React$useState = React.useState({\n inView: !!initialInView\n }),\n state = _React$useState[0],\n setState = _React$useState[1]; // Store the onChange callback in a `ref`, so we can access the latest instance inside the `useCallback`.\n\n\n callback.current = onChange;\n var setRef = React.useCallback(function (node) {\n if (unobserve.current !== undefined) {\n unobserve.current();\n unobserve.current = undefined;\n } // Skip creating the observer\n\n\n if (skip) return;\n\n if (node) {\n unobserve.current = observe(node, function (inView, entry) {\n setState({\n inView: inView,\n entry: entry\n });\n if (callback.current) callback.current(inView, entry);\n\n if (entry.isIntersecting && triggerOnce && unobserve.current) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve.current();\n unobserve.current = undefined;\n }\n }, {\n root: root,\n rootMargin: rootMargin,\n threshold: threshold,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n }\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n /* eslint-disable-next-line */\n\n React.useEffect(function () {\n if (!unobserve.current && state.entry && !triggerOnce && !skip) {\n // If we don't have a ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n setState({\n inView: !!initialInView\n });\n }\n });\n var result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.m.js.map\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","_createObserver","id","instance","thresholds","elements","observer","entries","forEach","entry","_elements$get","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","unobserve","size","disconnect","_excluded","isPlainChildren","props","children","InView","_React$Component","subClass","superClass","_this","node","_unobserveCb","handleNode","triggerOnce","skip","setState","initialInView","observeNode","handleChange","onChange","state","create","constructor","_proto","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_this$props","render","_this$state","ref","_this$props2","as","excluded","sourceKeys","_objectWithoutPropertiesLoose","React","createElement","Component"],"mappings":"wBAEA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CACzC,IAAIG,EAASF,UAAUD,GAEvB,IAAK,IAAII,KAAOD,EACVN,OAAOQ,UAAUC,eAAeC,KAAKJ,EAAQC,KAC/CL,EAAOK,GAAOD,EAAOC,IAK3B,OAAOL,GAGFH,EAASY,MAAMC,KAAMR,WAU9B,SAASS,EAAgBC,EAAGC,GAM1B,OALAF,EAAkBb,OAAOgB,gBAAkB,SAAyBF,EAAGC,GAErE,OADAD,EAAEG,UAAYF,EACPD,GAGFD,EAAgBC,EAAGC,GAkB5B,IAAIG,EAAc,IAAIC,IAClBC,EAAU,IAAIC,QACdC,EAAS,EA+Bb,SAASC,EAAYC,GACnB,OAAOxB,OAAOyB,KAAKD,GAASE,OAAOC,QAAO,SA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4C,EAAY5C,OACrBF,EAAQ8C,EAAY9C,MACxB,OAAO9C,KAAKgE,MAAMC,SAAS,CACzBjB,OAAQA,EACRF,MAAOA,EACP+C,IAAK7F,KAAKyE,aAId,IAAIqB,EAAe9F,KAAKgE,MACpBC,EAAW6B,EAAa7B,SACxB8B,EAAKD,EAAaC,GAClB/B,EA/UR,SAAuCtE,EAAQsG,GAC7C,GAAc,MAAVtG,EAAgB,MAAO,GAC3B,IAEIC,EAAKJ,EAFLD,EAAS,GACT2G,EAAa7G,OAAOyB,KAAKnB,GAG7B,IAAKH,EAAI,EAAGA,EAAI0G,EAAWxG,OAAQF,IACjCI,EAAMsG,EAAW1G,GACbyG,EAAStC,QAAQ/D,IAAQ,IAC7BL,EAAOK,GAAOD,EAAOC,IAGvB,OAAOL,EAmUO4G,CAA8BJ,EAAchC,GAExD,OAAoBqC,EAAMC,cAAcL,GAAM,MAAO5G,EAAS,CAC5D0G,IAAK7F,KAAKyE,YACTT,GAAQC,IAGNC,EA1HiB,CA2HxBiC,EAAME"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as o}from"../../node_modules/tslib/tslib.es6.js";import{createGlobalStyle as t,withTheme as e}from"styled-components";import
|
|
1
|
+
import{__makeTemplateObject as n,__assign as o}from"../../node_modules/tslib/tslib.es6.js";import{createGlobalStyle as t,withTheme as e}from"styled-components";import i from"../themes/cruk.js";var r=t(a||(a=n(["\n ","\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n"],["\n ","\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n"])),(function(n){var t,e=o(o({},i),n.theme);return"\n ".concat((t=e.typography.customFonts,t.map((function(n){return"\n @font-face {\n font-family: ".concat(n.family,';\n src: url("').concat(n.url,".woff2\") format('woff2'),\n url(\"").concat(n.url,".woff\") format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: fallback;\n }\n ")})).join("")),"\n html {\n font-size: ").concat(e.typography.fontSizeBase,";\n font-family: ").concat(e.typography.fontFamilyBase,";\n line-height: ").concat(e.typography.lineHeight,";\n }\n body {\n background-color: ").concat(e.colors.backgroundMid,";\n color: ").concat(e.colors.textDark,";\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n ")}));r.defaultProps={theme:i};var a,s=e(r);export{s as default};
|
|
2
2
|
//# sourceMappingURL=GlobalStyle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__rest as t}from"../../../node_modules/tslib/tslib.es6.js";import e,{css as i}from"styled-components";import{Spacing as r}from"../Spacing/index.js";var o,f,u,m,a,s,l,x=function(e){return i(o||(o=n(["\n font-family: ",";\n word-break: ",";\n font-weight: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"],["\n font-family: ",";\n word-break: ",";\n font-weight: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(){return e.wordBreak||"normal"}),(function(n){return n.theme.typography.fontWeightMedium}),(function(n){var t=n.theme.colors,e=n.textColor;return e&&void 0!==t[e]?t[e]:e||t.textDark}),(function(n){return n.theme.typography.headerLineHeight}),(function(n){return n.theme.typography.headerTextTransform}),(function(n){return n.theme.spacing.m}),(function(n){return n.theme.spacing.s}),(function(n){return n.textAlign||"left"}),(function(){e.theme;var n=t(e,["theme"]);return r(n,e.theme)}))},h=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":return e.fontSizes.l;case"xl":return e.fontSizes.xl;case"xxl":return e.fontSizes.xxl;case"xxxl":return e.fontSizes.xxxl;case"xxxxl":return e.fontSizes.xxxxl;default:return t}},z=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":return e.fontSizes.l;case"xxl":return e.fontSizes.xl;case"xxxl":return e.fontSizes.xxl;case"xxxxl":return e.fontSizes.xxxl;default:return t}},c=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":case"xxl":return e.fontSizes.l;case"xxxl":return e.fontSizes.xl;case"xxxxl":return e.fontSizes.xxl;default:return t}},d=e.h1(f||(f=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n } ;\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n } ;\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.xxxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xxxxl,t)})),S=e.h2(u||(u=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xxxl,t)})),p=e.h3(m||(m=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xxl,t)})),w=e.h4(a||(a=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xl,t)})),b=e.h5(s||(s=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.l,t)})),
|
|
1
|
+
import{__makeTemplateObject as n,__rest as t}from"../../../node_modules/tslib/tslib.es6.js";import e,{css as i}from"styled-components";import{Spacing as r}from"../Spacing/index.js";var o,f,u,m,a,s,l,x=function(e){return i(o||(o=n(["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n font-weight: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"],["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n font-weight: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(){return e.wordBreak||"normal"}),(function(){return e.overflowWrap||"break-word"}),(function(n){return n.theme.typography.fontWeightMedium}),(function(n){var t=n.theme.colors,e=n.textColor;return e&&void 0!==t[e]?t[e]:e||t.textDark}),(function(n){return n.theme.typography.headerLineHeight}),(function(n){return n.theme.typography.headerTextTransform}),(function(n){return n.theme.spacing.m}),(function(n){return n.theme.spacing.s}),(function(n){return n.textAlign||"left"}),(function(){e.theme;var n=t(e,["theme"]);return r(n,e.theme)}))},h=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":return e.fontSizes.l;case"xl":return e.fontSizes.xl;case"xxl":return e.fontSizes.xxl;case"xxxl":return e.fontSizes.xxxl;case"xxxxl":return e.fontSizes.xxxxl;default:return t}},z=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":return e.fontSizes.l;case"xxl":return e.fontSizes.xl;case"xxxl":return e.fontSizes.xxl;case"xxxxl":return e.fontSizes.xxxl;default:return t}},c=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":case"xxl":return e.fontSizes.l;case"xxxl":return e.fontSizes.xl;case"xxxxl":return e.fontSizes.xxl;default:return t}},d=e.h1(f||(f=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n } ;\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n } ;\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.xxxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xxxxl,t)})),S=e.h2(u||(u=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xxxl,t)})),p=e.h3(m||(m=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xxl,t)})),w=e.h4(a||(a=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.xl,t)})),b=e.h5(s||(s=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.l,t)})),v=e.h6(l||(l=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.textSize;return c(e||null,t.fontSizes.m,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.textSize;return z(e||null,t.fontSizes.m,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.textSize;return h(e||null,t.fontSizes.m,t)}));export{d as H1,S as H2,p as H3,w as H4,b as H5,v as H6};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{css as r}from"styled-components";import{Text as e}from"../Text/index.js";import t from"../Icon/index.js";var i,
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{css as r}from"styled-components";import{Text as e}from"../Text/index.js";import t from"../Icon/index.js";var a,i,c,s=o(t)(a||(a=n(["\n margin-right: ",";\n"],["\n margin-right: ",";\n"])),(function(n){return n.theme.spacing.xxs})),u=o(e)(c||(c=n(["\n transition: color 0.2s ease, background-size 0.3s ease;\n overflow-wrap: break-word;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n padding: 0;\n color: ",";\n text-decoration: ",";\n font-weight: ",";\n background: ",";\n background-repeat: no-repeat;\n background-position-y: calc(100%);\n background-size: 100% 2px;\n\n ","\n\n &:focus-visible {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"],["\n transition: color 0.2s ease, background-size 0.3s ease;\n overflow-wrap: break-word;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n padding: 0;\n color: ",";\n text-decoration: ",";\n font-weight: ",";\n background: ",";\n background-repeat: no-repeat;\n background-position-y: calc(100%);\n background-size: 100% 2px;\n\n ","\n\n &:focus-visible {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"])),(function(n){var o=n.theme,r=o.colors,e=o.utilities.useBackgroundStyleLinks,t=n.textColor,a=n.appearance;return t&&void 0!==r[t]?r[t]:t||(!a&&e?"currentColor":a&&"primary"===a?r.secondary:r.linkColor)}),(function(n){var o=n.appearance,r=n.theme.typography.linkTextDecoration;return"primary"===o||"secondary"===o?"none":r}),(function(n){var o=n.theme;return o.utilities.useBackgroundStyleLinks?o.typography.fontWeightHeavy:o.typography.fontWeightNormal}),(function(n){var o=n.appearance,r=n.theme;return n.theme.utilities.useBackgroundStyleLinks&&!o?"linear-gradient(180deg, rgba(255, 255, 255, 0) 0px, ".concat(r.colors.primary," -4px);"):void 0}),(function(o){var e=o.appearance,t=o.theme.typography.fontWeightHeavy;return("primary"===e||"secondary"===e)&&r(i||(i=n(["\n font-weight: ",";\n "],["\n font-weight: ",";\n "])),t)}),(function(n){var o=n.theme,r=o.colors,e=o.utilities.useBackgroundStyleLinks,t=n.textHoverColor;return!t&&e?r.textDark:t&&void 0!==r[t]?r[t]:t||r.linkColorHover}));export{s as ChevyWithLevee,u as StyledLink};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";import{Spacing as
|
|
1
|
+
import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import t from"styled-components";import{Spacing as o}from"../Spacing/index.js";var e,r=t.p(e||(e=n(["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n text-align: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n padding: 0;\n margin: 0;\n margin-bottom: ",";\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ","\n"],["\n font-family: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n text-align: ",";\n font-size: ",";\n line-height: ",";\n font-weight: ",";\n padding: 0;\n margin: 0;\n margin-bottom: ",";\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyBase}),(function(n){return n.wordBreak||"normal"}),(function(n){return n.overflowWrap||"break-word"}),(function(n){var t=n.theme.colors,o=n.textColor;return o&&void 0!==t[o]?t[o]:o||t.textDark}),(function(n){return n.textAlign||"left"}),(function(n){var t=n.theme,o=t.fontSizes,e=t.fontSizes.m,r=n.textSize;return r?o[r]:e}),(function(n){return n.theme.typography.lineHeight}),(function(n){var t=n.textWeight,o=n.theme;return t||o.typography.fontWeightNormal}),(function(n){var t=n.as,o=n.theme.spacing.xs;return void 0===t||"p"===t?"".concat(o):0}),(function(n){return o(n,n.theme)}));export{r as TextStyled};
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e={contentMaxWidth:"1020px",useDefaultFocusRect:!0,useDefaultFromControls:!1,useBackgroundStyleLinks:!1,inputBorderWidth:"1px"},r={
|
|
1
|
+
var e={contentMaxWidth:"1020px",useDefaultFocusRect:!0,useDefaultFromControls:!1,useBackgroundStyleLinks:!1,inputBorderWidth:"1px"},r={assetPath:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/",logoUrl:"/",logoAlt:"Cancer Research UK Giving Page",logoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/logo.png",footerCopyText:"Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales(4325234) and the Isle of Man (5713F).",footerLogoAlt:"Registered with Fundraising Regulator",footerLogoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/fundreg.png"},a={s:"35px",m:"50px",l:"60px",xl:"90px",path:"".concat(r.assetPath,"images/icon-avatars/")},t={borderRadius:"4px",borderRadiusLarge:"4px",buttonBorderThickness:"2px",textDecoration:"none",textTransform:"none"},o={mobile:"576px",tablet:"768px",desktop:"992px",desktopLarge:"1200px"},n={darkBlue_100:"#edeaf5",darkBlue_200:"#dad2ea",darkBlue_300:"#a896cf",darkBlue_500:"#2e008b",magenta_100:"#fdeaf5",magenta_500:"#e40087",magenta_800:"#BB0071",magenta_900:"#710044",cyan_500:"#00b6ed",cyan_900:"#005870",grey_100:"#f5f5f5",grey_200:"#ededed",grey_300:"#c6c6c6",grey_500:"#9A9A9A",grey_800:"#575757",grey_900:"#2e2d2c",white:"#fff",black:"#000",red:"#D51311",yellow:"#fdc02f",green:"#3d854d"},i={primary:n.darkBlue_500,secondary:n.magenta_500,tertiary:n.cyan_500,textOnPrimary:n.white,textOnSecondary:n.white,textOnTertiary:n.white,disabled:n.grey_300,danger:n.red,warning:n.yellow,success:n.green,info:n.cyan_500,textError:n.red,linkColor:n.darkBlue_500,linkColorHover:n.magenta_800,textDark:n.grey_900,textLight:n.white,progressBar:n.darkBlue_500,progressBarSecondary:n.magenta_500,progressBarBackground:n.grey_200,circularProgress:n.cyan_500,circularProgressSecondary:n.magenta_500,circularProgressBackground:n.grey_300,buttonPrimaryBackground:n.magenta_500,buttonPrimaryText:n.white,buttonPrimaryBorder:n.magenta_500,buttonPrimaryBackgroundHover:n.magenta_800,buttonPrimaryTextHover:n.white,buttonPrimaryBorderHover:n.magenta_800,buttonPrimaryDisabledBackground:n.grey_100,buttonPrimaryDisabledText:n.grey_500,buttonPrimaryDisabledBorder:n.grey_100,buttonSecondaryBackground:n.white,buttonSecondaryText:n.magenta_500,buttonSecondaryBorder:n.magenta_500,buttonSecondaryBackgroundHover:n.magenta_100,buttonSecondaryTextHover:n.magenta_800,buttonSecondaryBorderHover:n.magenta_800,buttonSecondaryDisabledBackground:n.grey_100,buttonSecondaryDisabledText:n.grey_500,buttonSecondaryDisabledBorder:n.grey_100,buttonTertiaryText:n.magenta_500,buttonTertiaryTextHover:n.magenta_800,buttonTertiaryDisabledText:n.grey_500,selectionBorder:n.grey_500,textInputBorder:n.grey_900,inputBorder:n.grey_900,headerBackground:n.white,backgroundLight:n.white,backgroundLightColor:n.darkBlue_200,backgroundMid:n.grey_100,loaderColor1:n.darkBlue_500,loaderColor2:n.magenta_500,loaderColor3:n.cyan_500,paginationText:n.darkBlue_500,paginationActive:n.grey_300,paginationBackground:n.darkBlue_500,footerBackground:n.grey_200,headerBorder:n.grey_300,stepBorder:n.grey_300,stepBackground:n.white,popoverBackground:n.white,textInputExtraInfo:n.grey_200,totaliserBubbleColor:n.grey_200,totaliserBubbleTextColor:n.grey_900,totaliserBubbleTotalColor:n.darkBlue_500,selectBackground:n.grey_900,modalBackdrop:n.grey_900,userBlockExtraText:n.grey_800},g={none:"0",auto:"auto",xxs:"0.5rem",xs:"1rem",s:"1.5rem",m:"2rem",l:"2.5rem",xl:"3rem",xxl:"3.5rem"},s={xs:"0.75rem",s:"0.875rem",m:"1rem",l:"1.25rem",xl:"1.5625rem",xxl:"2rem",xxxl:"2.5rem",xxxxl:"3.125rem"},d={customFonts:[{family:"MuseoSans-500",url:"https://ccp-s3.int.cruk.org/fonts/MuseoSansRounded-500"}],fontFamilyBase:"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif",fontFamilyHeadings:"MuseoSans-500,Calibri,Arial,sans-serif",fontSizeBase:"16px",fontWeightHeavy:"700",fontWeightMedium:"500",fontWeightNormal:"400",fontWeightLight:"300",fontWeightVLight:"100",linkTextDecoration:"underline",lineHeight:"1.5em",headerLineHeight:"1.25em",headerTextTransform:"none"},l={name:"cruk",avatar:a,breakpoint:o,button:t,tokenColors:n,colors:i,spacing:g,fontSizes:s,siteConfig:r,typography:d,utilities:e};export{a as AVATAR,o as BREAKPOINT,t as BUTTON,i as COLORS,s as FONT_SIZES,r as SITE_CONFIG,g as SPACING,n as TOKEN_COLORS,d as TYPOGRAPHY,e as UTILITIES,l as default};
|
|
2
2
|
//# sourceMappingURL=cruk.js.map
|
package/lib/types.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare type UtilitiesType = {
|
|
|
10
10
|
inputBorderWidth: string;
|
|
11
11
|
};
|
|
12
12
|
export declare type SiteConfigType = {
|
|
13
|
-
cdnPath: string;
|
|
14
13
|
assetPath: string;
|
|
15
14
|
logoUrl: string;
|
|
16
15
|
logoAlt: string;
|
|
@@ -133,7 +132,6 @@ export declare type CustomFontType = {
|
|
|
133
132
|
};
|
|
134
133
|
export declare type TypographyType = {
|
|
135
134
|
customFonts: [CustomFontType];
|
|
136
|
-
fontUrl: string;
|
|
137
135
|
fontFamilyBase: string;
|
|
138
136
|
fontFamilyHeadings: string;
|
|
139
137
|
fontSizeBase: string;
|
|
@@ -226,3 +224,4 @@ export declare type AddressOptionsType = {
|
|
|
226
224
|
Error?: Error;
|
|
227
225
|
};
|
|
228
226
|
export declare type WordBreakType = "normal" | "break-all" | "keep-all" | "break-word" | "inherit" | "initial" | "unset";
|
|
227
|
+
export declare type OverflowWrapType = "normal" | "anywhere" | "revert" | "revert-layer" | "break-word" | "inherit" | "initial" | "unset";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cruk/cruk-react-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "React components implementing CRUK and SU2C designs",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@babel/preset-typescript": "^7.9.0",
|
|
76
76
|
"@cruk/eslint-config": "^1.0.4",
|
|
77
77
|
"@cypress/react": "^5.10.0",
|
|
78
|
-
"@cypress/webpack-dev-server": "1.8.
|
|
78
|
+
"@cypress/webpack-dev-server": "1.8.4",
|
|
79
79
|
"@cypress/webpack-preprocessor": "^5.9.1",
|
|
80
80
|
"@mdx-js/loader": "^2.0.0",
|
|
81
81
|
"@mdx-js/mdx": "^2.0.0",
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
"@rollup/plugin-babel": "^5.0.0",
|
|
88
88
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
89
89
|
"@rollup/plugin-node-resolve": "^13.0.5",
|
|
90
|
-
"@storybook/addon-a11y": "6.4.
|
|
91
|
-
"@storybook/addon-actions": "^6.4.
|
|
92
|
-
"@storybook/addon-docs": "^6.4.
|
|
93
|
-
"@storybook/addon-essentials": "^6.4.
|
|
94
|
-
"@storybook/addon-links": "^6.4.
|
|
95
|
-
"@storybook/builder-webpack5": "^6.4.
|
|
96
|
-
"@storybook/manager-webpack5": "^6.4.
|
|
97
|
-
"@storybook/react": "^6.4.
|
|
90
|
+
"@storybook/addon-a11y": "6.4.22",
|
|
91
|
+
"@storybook/addon-actions": "^6.4.22",
|
|
92
|
+
"@storybook/addon-docs": "^6.4.22",
|
|
93
|
+
"@storybook/addon-essentials": "^6.4.22",
|
|
94
|
+
"@storybook/addon-links": "^6.4.22",
|
|
95
|
+
"@storybook/builder-webpack5": "^6.4.22",
|
|
96
|
+
"@storybook/manager-webpack5": "^6.4.22",
|
|
97
|
+
"@storybook/react": "^6.4.22",
|
|
98
98
|
"@types/assert": "^1.5.1",
|
|
99
99
|
"@types/cypress-image-snapshot": "^3.1.6",
|
|
100
100
|
"@types/jest": "^27.4.0",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"ts-loader": "9.2.8",
|
|
144
144
|
"typescript": "^4.4.4",
|
|
145
145
|
"webpack": "^5.53.0",
|
|
146
|
-
"webpack-cli": "4.9.
|
|
146
|
+
"webpack-cli": "4.9.2",
|
|
147
147
|
"webpack-dev-server": "^4.7.3"
|
|
148
148
|
},
|
|
149
149
|
"peerDependencies": {
|
|
@@ -153,6 +153,6 @@
|
|
|
153
153
|
},
|
|
154
154
|
"dependencies": {
|
|
155
155
|
"react-focus-lock": "^2.5.2",
|
|
156
|
-
"react-intersection-observer": "^
|
|
156
|
+
"react-intersection-observer": "^9.1.0"
|
|
157
157
|
}
|
|
158
158
|
}
|