@cruk/cruk-react-components 1.0.3 → 1.0.6
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/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js +1 -1
- package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
- package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js +2 -0
- package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -0
- package/lib/cjs/src/components/Button/index.js +1 -1
- package/lib/cjs/src/components/Button/styles.js +1 -1
- package/lib/cjs/src/components/Carousel/Dots.js +2 -0
- package/lib/cjs/src/components/Carousel/Dots.js.map +1 -0
- package/lib/cjs/src/components/Carousel/index.js +2 -0
- package/lib/cjs/src/components/Carousel/index.js.map +1 -0
- package/lib/cjs/src/components/Carousel/styles.js +2 -0
- package/lib/cjs/src/components/Carousel/styles.js.map +1 -0
- package/lib/cjs/src/components/Collapse/styles.js +1 -1
- package/lib/cjs/src/components/Link/styles.js +1 -1
- package/lib/cjs/src/components/Pagination/styles.js +1 -1
- package/lib/cjs/src/components/ProgressBar/index.js +1 -1
- package/lib/cjs/src/components/ProgressBar/styles.js +1 -1
- package/lib/cjs/src/components/Totaliser/index.js +1 -1
- package/lib/cjs/src/components/Totaliser/styles.js +1 -1
- package/lib/cjs/src/components/index.js +1 -1
- package/lib/cjs/src/themes/cruk.js +1 -1
- package/lib/cjs/src/themes/su2c.js +1 -1
- package/lib/components/Carousel/Carousel.stories.d.ts +6 -0
- package/lib/components/Carousel/Dots.d.ts +12 -0
- package/lib/components/Carousel/index.d.ts +13 -0
- package/lib/components/Carousel/styles.d.ts +30 -0
- package/lib/components/Carousel/test.cypress.d.ts +1 -0
- package/lib/components/ProgressBar/index.d.ts +5 -1
- package/lib/components/ProgressBar/styles.d.ts +20 -10
- package/lib/components/Totaliser/index.d.ts +2 -0
- package/lib/components/Totaliser/styles.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js +1 -1
- package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
- package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
- package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js +2 -0
- package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -0
- package/lib/es/src/components/Button/index.js +1 -1
- package/lib/es/src/components/Button/styles.js +1 -1
- package/lib/es/src/components/Carousel/Dots.js +2 -0
- package/lib/es/src/components/Carousel/Dots.js.map +1 -0
- package/lib/es/src/components/Carousel/index.js +2 -0
- package/lib/es/src/components/Carousel/index.js.map +1 -0
- package/lib/es/src/components/Carousel/styles.js +2 -0
- package/lib/es/src/components/Carousel/styles.js.map +1 -0
- package/lib/es/src/components/Collapse/styles.js +1 -1
- package/lib/es/src/components/Link/styles.js +1 -1
- package/lib/es/src/components/Pagination/styles.js +1 -1
- package/lib/es/src/components/ProgressBar/index.js +1 -1
- package/lib/es/src/components/ProgressBar/styles.js +1 -1
- package/lib/es/src/components/Totaliser/index.js +1 -1
- package/lib/es/src/components/Totaliser/styles.js +1 -1
- package/lib/es/src/components/index.js +1 -1
- package/lib/es/src/themes/cruk.js +1 -1
- package/lib/es/src/themes/su2c.js +1 -1
- package/lib/types.d.ts +2 -0
- package/package.json +25 -25
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.6] - 2021-03-23
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Links, Pagination button/links and Buttons that have been cast as an anchor tag all show default focus outline on focus. This wasn't happening in Firefox. [#428](https://github.com/CRUKorg/cruk-react-components/issues/428)
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Carousel component
|
|
17
|
+
- secondaryPercentage prop for Progress Bar and Totaliser
|
|
18
|
+
|
|
19
|
+
## [1.0.5] - 2021-02-09
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Using node 16 and cypress 9.4.1
|
|
24
|
+
|
|
25
|
+
## [1.0.4] - 2021-02-02
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Collapse focus rect SU2C needs reduced border radius [#403](https://github.com/CRUKorg/cruk-react-components/issues/403)
|
|
30
|
+
- Totaliser with custom summary has a speech bubble arrow artifact [#404](https://github.com/CRUKorg/cruk-react-components/issues/404)
|
|
31
|
+
|
|
8
32
|
## [1.0.3] - 2021-01-21
|
|
9
33
|
|
|
10
34
|
### Changed
|
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./focusMerge.js"),o=function(e){e.focus(),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},t=0,n=!1;exports.focusOn=o,exports.setFocus=function(c,s){
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./focusMerge.js"),o=function(e,o){e.focus(o),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},t=0,n=!1;exports.focusOn=o,exports.setFocus=function(c,s,u){void 0===u&&(u={});var i=e.getFocusMerge(c,s);if(!n&&i){if(t>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),n=!0,void setTimeout((function(){n=!1}),1);t++,o(i.node,u.focusOptions),t--}};
|
|
2
2
|
//# sourceMappingURL=setFocus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target) {\n target.focus();\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode) {\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focus","contentWindow","guardCount","lockDisabled","topNode","lastNode","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"qGACWA,EAAU,SAAUC,
|
|
1
|
+
{"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n target.focus(focusOptions);\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focusOptions","focus","contentWindow","guardCount","lockDisabled","topNode","lastNode","options","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"qGACWA,EAAU,SAAUC,EAAQC,GACnCD,EAAOE,MAAMD,GACT,kBAAmBD,GAAUA,EAAOG,eACpCH,EAAOG,cAAcD,SAGzBE,EAAa,EACbC,GAAe,qCACG,SAAUC,EAASC,EAAUC,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAIC,EAAYC,gBAAcJ,EAASC,GACvC,IAAIF,GAGAI,EAAW,CACX,GAAIL,EAAa,EAOb,OANAO,QAAQC,MAAM,qJAEdP,GAAe,OACfQ,YAAW,WACPR,GAAe,IAChB,GAGPD,IACAL,EAAQU,EAAUK,KAAMN,EAAQP,cAChCG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../@babel/runtime/helpers/esm/extends.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../@babel/runtime/helpers/esm/extends.js"),o=require("react"),t=require("prop-types"),r=require("../../../focus-lock/dist/es2015/constants.js"),s=require("./FocusGuard.js"),u=require("./medium.js"),n=require("../../../use-callback-ref/dist/es2015/useMergeRef.js");function c(e){if(e&&e.__esModule)return e;var o=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),o.default=e,Object.freeze(o)}var a=c(o),i=[],d=a.forwardRef((function(t,c){var d,l=a.useState(),f=l[0],v=l[1],b=a.useRef(),p=a.useRef(!1),m=a.useRef(null),F=t.children,y=t.disabled,O=t.noFocusGuards,g=t.persistentFocus,h=t.crossFrame,j=t.autoFocus,k=t.allowTextSelection,E=t.group,w=t.className,x=t.whiteList,C=t.shards,S=void 0===C?i:C,D=t.as,P=void 0===D?"div":D,R=t.lockProps,q=void 0===R?{}:R,G=t.sideCar,N=t.returnFocus,_=t.focusOptions,L=t.onActivation,T=t.onDeactivation,M=a.useState({})[0],A=a.useCallback((function(){m.current=m.current||document&&document.activeElement,b.current&&L&&L(b.current),p.current=!0}),[L]),B=a.useCallback((function(){p.current=!1,T&&T(b.current)}),[T]);o.useEffect((function(){y||(m.current=null)}),[]);var I=a.useCallback((function(e){var o=m.current;if(o&&o.focus){var t="function"==typeof N?N(o):N;if(Boolean(t)){var r="object"==typeof t?t:void 0;m.current=null,e?Promise.resolve().then((function(){return o.focus(r)})):o.focus(r)}}}),[N]),U=a.useCallback((function(e){p.current&&u.mediumFocus.useMedium(e)}),[]),V=u.mediumBlur.useMedium,z=a.useCallback((function(e){b.current!==e&&(b.current=e,v(e))}),[]);"production"!==process.env.NODE_ENV&&(void 0!==k&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),a.useEffect((function(){b.current||console.error("FocusLock: could not obtain ref to internal node")}),[]));var H=e.default(((d={})[r.FOCUS_DISABLED]=y&&"disabled",d[r.FOCUS_GROUP]=E,d),q),J=!0!==O,K=J&&"tail"!==O,Q=n.useMergeRefs([c,z]);return a.createElement(a.Fragment,null,J&&[a.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:y?-1:0,style:s.hiddenGuard}),a.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:y?-1:1,style:s.hiddenGuard})],!y&&a.createElement(G,{id:M,sideCar:u.mediumSidecar,observed:f,disabled:y,persistentFocus:g,crossFrame:h,autoFocus:j,whiteList:x,shards:S,onActivation:A,onDeactivation:B,returnFocus:I,focusOptions:_}),a.createElement(P,e.default({ref:Q},H,{className:w,onBlur:V,onFocus:U}),F),K&&a.createElement("div",{"data-focus-guard":!0,tabIndex:y?-1:0,style:s.hiddenGuard}))}));d.propTypes="production"!==process.env.NODE_ENV?{children:t.node,disabled:t.bool,returnFocus:t.oneOfType([t.bool,t.object,t.func]),focusOptions:t.object,noFocusGuards:t.bool,allowTextSelection:t.bool,autoFocus:t.bool,persistentFocus:t.bool,crossFrame:t.bool,group:t.string,className:t.string,whiteList:t.func,shards:t.arrayOf(t.any),as:t.oneOfType([t.string,t.func,t.object]),lockProps:t.object,onActivation:t.func,onDeactivation:t.func,sideCar:t.any.isRequired}:{},d.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var l=d;exports.default=l;
|
|
2
2
|
//# sourceMappingURL=Lock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lock.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { useEffect } from \"react\";\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var children = props.children,\n disabled = props.disabled,\n noFocusGuards = props.noFocusGuards,\n persistentFocus = props.persistentFocus,\n crossFrame = props.crossFrame,\n autoFocus = props.autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n shouldReturnFocus = props.returnFocus,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n\n var _React$useState2 = React.useState({}),\n id = _React$useState2[0]; // SIDE EFFECT CALLBACKS\n\n\n var onActivation = React.useCallback(function () {\n originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement;\n\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n\n isActive.current = true;\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n }, [onDeactivationCallback]);\n useEffect(function () {\n if (!disabled) {\n // cleanup return focus on trap deactivation\n // sideEffect/returnFocus should happen by this time\n originalFocusedElement.current = null;\n }\n }, []);\n var returnFocus = React.useCallback(function (allowDefer) {\n var returnFocusTo = originalFocusedElement.current;\n\n if (returnFocusTo && returnFocusTo.focus) {\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n\n if (Boolean(howToReturnFocus)) {\n var focusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n\n if (allowDefer) {\n // React might return focus after update\n // it's safer to defer the action\n Promise.resolve().then(function () {\n return returnFocusTo.focus(focusOptions);\n });\n } else {\n returnFocusTo.focus(focusOptions);\n }\n }\n }\n }, [shouldReturnFocus]); // MEDIUM CALLBACKS\n\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium; // REF PROPAGATION\n // not using real refs due to race conditions\n\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n\n React.useEffect(function () {\n if (!observed.current) {\n // eslint-disable-next-line no-console\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }),\n /*#__PURE__*/\n // nearest focus guard\n React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) // first tabbed element guard\n ], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), children), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object]),\n noFocusGuards: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nFocusLock.defaultProps = {\n children: undefined,\n disabled: false,\n returnFocus: false,\n noFocusGuards: false,\n autoFocus: true,\n persistentFocus: false,\n crossFrame: true,\n allowTextSelection: undefined,\n group: undefined,\n className: undefined,\n whiteList: undefined,\n shards: undefined,\n as: 'div',\n lockProps: {},\n onActivation: undefined,\n onDeactivation: undefined\n};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","children","disabled","noFocusGuards","persistentFocus","crossFrame","autoFocus","allowTextSelection","group","className","whiteList","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","shouldReturnFocus","returnFocus","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","current","document","activeElement","useEffect","allowDefer","returnFocusTo","focus","howToReturnFocus","Boolean","focusOptions","undefined","Promise","resolve","then","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","propTypes","node","bool","oneOfType","object","string","func","arrayOf","any","isRequired","defaultProps"],"mappings":"2oBAQIA,EAAa,GACbC,EAAyBC,EAAMC,YAAW,SAAqBC,EAAOC,GACxE,IAAIC,EAEAC,EAAk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GACJ7C,EAAW,CACZR,UAAWA,EACXsC,OAAQA,EACRJ,QAASA,IACP1C,GAAW4D,GAAiCzE,EAAM4E,cAAc,MAAO,CACzE,oBAAoB,EACpBG,SAAUjE,GAAY,EAAI,EAC1BkE,MAAOC,oBAGXlF,EAAUqF,UAAqC,eAAzBrB,QAAQC,IAAIC,SAA4B,CAC5DpD,SAAUwE,OACVvE,SAAUwE,OACVpD,YAAaqD,YAAU,CAACD,OAAME,WAC9BzE,cAAeuE,OACfnE,mBAAoBmE,OACpBpE,UAAWoE,OACXtE,gBAAiBsE,OACjBrE,WAAYqE,OACZlE,MAAOqE,SACPpE,UAAWoE,SACXnE,UAAWoE,OACXlE,OAAQmE,UAAQC,OAChBlE,GAAI6D,YAAU,CAACE,SAAQC,OAAMF,WAC7B3D,UAAW2D,SACXpD,aAAcsD,OACdpD,eAAgBoD,OAChB1D,QAAS4D,MAAIC,YACX,GACJ9F,EAAU+F,aAAe,CACvBjF,cAAUsC,EACVrC,UAAU,EACVoB,aAAa,EACbnB,eAAe,EACfG,WAAW,EACXF,iBAAiB,EACjBC,YAAY,EACZE,wBAAoBgC,EACpB/B,WAAO+B,EACP9B,eAAW8B,EACX7B,eAAW6B,EACX3B,YAAQ2B,EACRzB,GAAI,MACJG,UAAW,GACXO,kBAAce,EACdb,oBAAgBa,GAElB,MAAepD"}
|
|
1
|
+
{"version":3,"file":"Lock.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { useEffect } from \"react\";\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var children = props.children,\n disabled = props.disabled,\n noFocusGuards = props.noFocusGuards,\n persistentFocus = props.persistentFocus,\n crossFrame = props.crossFrame,\n autoFocus = props.autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n shouldReturnFocus = props.returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n\n var _React$useState2 = React.useState({}),\n id = _React$useState2[0]; // SIDE EFFECT CALLBACKS\n\n\n var onActivation = React.useCallback(function () {\n originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement;\n\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n\n isActive.current = true;\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n }, [onDeactivationCallback]);\n useEffect(function () {\n if (!disabled) {\n // cleanup return focus on trap deactivation\n // sideEffect/returnFocus should happen by this time\n originalFocusedElement.current = null;\n }\n }, []);\n var returnFocus = React.useCallback(function (allowDefer) {\n var returnFocusTo = originalFocusedElement.current;\n\n if (returnFocusTo && returnFocusTo.focus) {\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n\n if (Boolean(howToReturnFocus)) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n\n if (allowDefer) {\n // React might return focus after update\n // it's safer to defer the action\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]); // MEDIUM CALLBACKS\n\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium; // REF PROPAGATION\n // not using real refs due to race conditions\n\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n\n React.useEffect(function () {\n if (!observed.current) {\n // eslint-disable-next-line no-console\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }),\n /*#__PURE__*/\n // nearest focus guard\n React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) // first tabbed element guard\n ], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), children), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nFocusLock.defaultProps = {\n children: undefined,\n disabled: false,\n returnFocus: false,\n focusOptions: undefined,\n noFocusGuards: false,\n autoFocus: true,\n persistentFocus: false,\n crossFrame: true,\n allowTextSelection: undefined,\n group: undefined,\n className: undefined,\n whiteList: undefined,\n shards: undefined,\n as: 'div',\n lockProps: {},\n onActivation: undefined,\n onDeactivation: undefined\n};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","children","disabled","noFocusGuards","persistentFocus","crossFrame","autoFocus","allowTextSelection","group","className","whiteList","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","shouldReturnFocus","returnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","current","document","activeElement","useEffect","allowDefer","returnFocusTo","focus","howToReturnFocus","Boolean","returnFocusOptions","undefined","Promise","resolve","then","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired","defaultProps"],"mappings":"2oBAQIA,EAAa,GACbC,EAAyBC,EAAMC,YAAW,SAAqBC,EAAOC,GACxE,IAAIC,EAEAC,EAAkBL,EAAMM,WACxBC,EAAeF,EAAgB,GAC/BG,EAAcH,EAAgB,GAE9BI,EAAWT,EAAMU,SACjBC,EAAWX,EAAMU,QAAO,GACxBE,EAAyBZ,EAAMU,OAAO,MACtCG,EAAWX,EAAMW,SACjBC,EAAWZ,EAAMY,SACjBC,EAAgBb,EAAMa,cACtBC,EAAkBd,EAAMc,gBACxBC,EAAaf,EAAMe,WACnBC,EAAYhB,EAAMgB,UAClBC,EAAqBjB,EAAMiB,mBAC3BC,EAAQlB,EAAMkB,MACdC,EAAYnB,EAAMmB,UAClBC,EAAYpB,EAAMoB,UAClBC,EAAgBrB,EAAMsB,OACtBA,OAA2B,IAAlBD,EAA2BzB,EAAayB,EACjDE,EAAYvB,EAAMwB,GAClBC,OAA0B,IAAdF,EAAuB,MAAQA,EAC3CG,EAAmB1B,EAAM2B,UACzBC,OAAsC,IAArBF,EAA8B,GAAKA,EACpDG,EAAU7B,EAAM8B,QAChBC,EAAoB/B,EAAMgC,YAC1BC,EAAejC,EAAMiC,aACrBC,EAAuBlC,EAAMmC,aAC7BC,EAAyBpC,EAAMqC,eAG/BC,EADmBxC,EAAMM,SAAS,IACZ,GAGtB+B,EAAerC,EAAMyC,aAAY,WACnC7B,EAAuB8B,QAAU9B,EAAuB8B,SAAWC,UAAYA,SAASC,cAEpFnC,EAASiC,SAAWN,GACtBA,EAAqB3B,EAASiC,SAGhC/B,EAAS+B,SAAU,IAClB,CAACN,IACAG,EAAiBvC,EAAMyC,aAAY,WACrC9B,EAAS+B,SAAU,EAEfJ,GACFA,EAAuB7B,EA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:!0}),require("react");var e=require("prop-types"),n=require("../../../react-clientside-effect/lib/index.es.js"),t=require("../../../focus-lock/dist/es2015/index.js"),u=require("./util.js"),r=require("./medium.js"),o=require("../../../focus-lock/dist/es2015/focusInside.js"),i=require("../../../focus-lock/dist/es2015/focusIsHidden.js"),c=require("../../../focus-lock/dist/es2015/focusables.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react");var e=require("prop-types"),n=require("../../../react-clientside-effect/lib/index.es.js"),t=require("../../../focus-lock/dist/es2015/index.js"),u=require("./util.js"),r=require("./medium.js"),o=require("../../../focus-lock/dist/es2015/focusInside.js"),i=require("../../../focus-lock/dist/es2015/focusIsHidden.js"),c=require("../../../focus-lock/dist/es2015/focusables.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=s(e),a=function(){return document&&document.activeElement===document.body||i.focusIsHidden()},f=null,l=null,m=null,v=!1,b=function(){return!0};function p(e,n,t,u){var r=null,o=e;do{var i=u[o];if(i.guard)i.node.dataset.focusAutoGuard&&(r=i);else{if(!i.lockItem)break;if(o!==e)return;r=null}}while((o+=t)!==n);r&&(r.node.tabIndex=0)}var E=function(e){return e&&"current"in e?e.current:e},g=function(){var e,n=!1;if(f){var u=f,r=u.observed,i=u.persistentFocus,s=u.autoFocus,d=u.shards,g=u.crossFrame,I=u.focusOptions,j=r||m&&m.portaledElement,q=document&&document.activeElement;if(j){var h=[j].concat(d.map(E).filter(Boolean));if(q&&!function(e){return(f.whiteList||b)(e)}(q)||(i||(g?Boolean(v):"meanwhile"===v)||!a()||!l&&s)&&(!j||o.focusInside(h)||(e=q,m&&m.portaledElement===e)||(document&&!l&&q&&!s?(q.blur&&q.blur(),document.body.focus()):(n=t.default(h,l,{focusOptions:I}),m={})),v=!1,l=document&&document.activeElement),document){var w=document&&document.activeElement,x=c.getFocusabledIn(h),F=x.map((function(e){return e.node})).indexOf(w);F>-1&&(x.filter((function(e){var n=e.guard,t=e.node;return n&&t.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),p(F,x.length,1,x),p(F,-1,-1,x))}}}return n},I=function(e){g()&&e&&(e.stopPropagation(),e.preventDefault())},j=function(){return u.deferAction(g)};"production"===process.env.NODE_ENV||d.default.node.isRequired;var q=function(){v="just",setTimeout((function(){v="meanwhile"}),0)};r.mediumFocus.assignSyncMedium((function(e){var n=e.target,t=e.currentTarget;t.contains(n)||(m={observerNode:t,portaledElement:n})})),r.mediumBlur.assignMedium(j),r.mediumEffect.assignMedium((function(e){return e({moveFocusInside:t.default,focusInside:o.focusInside})}));var h=n.default((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var n=e.slice(-1)[0];n&&!f&&(document.addEventListener("focusin",I),document.addEventListener("focusout",j),window.addEventListener("blur",q));var t=f,r=t&&n&&n.id===t.id;f=n,t&&!r&&(t.onDeactivation(),e.filter((function(e){return e.id===t.id})).length||t.returnFocus(!n)),n?(l=null,r&&t.observed===n.observed||n.onActivation(),g(),u.deferAction(g)):(document.removeEventListener("focusin",I),document.removeEventListener("focusout",j),window.removeEventListener("blur",q),l=null)}))((function(){return null}));exports.default=h;
|
|
2
2
|
//# sourceMappingURL=Trap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trap.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport moveFocusInside, { focusInside, focusIsHidden, getFocusabledIn } from 'focus-lock';\nimport { deferAction } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\n\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\n\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\n\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\n\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\n\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\n\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\n\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\n\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n\n do {\n var item = allNodes[i];\n\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n // we will tab to the next element\n return;\n }\n\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\n\nvar extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\n\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n // with cross frame return true for any value\n return Boolean(focusWasOutsideWindow);\n } // in other case return only of focus went a while aho\n\n\n return focusWasOutsideWindow === 'meanwhile';\n};\n\nvar activateTrap = function activateTrap() {\n var result = false;\n\n if (lastActiveTrap) {\n var _lastActiveTrap = lastActiveTrap,\n observed = _lastActiveTrap.observed,\n persistentFocus = _lastActiveTrap.persistentFocus,\n autoFocus = _lastActiveTrap.autoFocus,\n shards = _lastActiveTrap.shards,\n crossFrame = _lastActiveTrap.crossFrame;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n var activeElement = document && document.activeElement;\n\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !(focusInside(workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n // Check if blur() exists, which is missing on certain elements on IE\n if (activeElement.blur) {\n activeElement.blur();\n }\n\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus);\n lastPortaledElement = {};\n }\n }\n\n focusWasOutsideWindow = false;\n lastActiveFocus = document && document.activeElement;\n }\n }\n\n if (document) {\n var newActiveElement = document && document.activeElement;\n var allNodes = getFocusabledIn(workingArea);\n var focusedIndex = allNodes.map(function (_ref) {\n var node = _ref.node;\n return node;\n }).indexOf(newActiveElement);\n\n if (focusedIndex > -1) {\n // remove old focus\n allNodes.filter(function (_ref2) {\n var guard = _ref2.guard,\n node = _ref2.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref3) {\n var node = _ref3.node;\n return node.removeAttribute('tabIndex');\n });\n autoGuard(focusedIndex, allNodes.length, +1, allNodes);\n autoGuard(focusedIndex, -1, -1, allNodes);\n }\n }\n }\n }\n\n return result;\n};\n\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n // prevent scroll jump\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\n\nvar onFocus = function onFocus(event) {\n // detect portal\n var source = event.target;\n var currentNode = event.currentTarget;\n\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\n\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\n\nvar FocusTrap = function FocusTrap(_ref4) {\n var children = _ref4.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\n\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\n\nvar onWindowBlur = function onWindowBlur() {\n focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction\n\n setTimeout(function () {\n focusWasOutsideWindow = 'meanwhile';\n }, 0);\n};\n\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('blur', onWindowBlur);\n};\n\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('blur', onWindowBlur);\n};\n\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref5) {\n var disabled = _ref5.disabled;\n return !disabled;\n });\n}\n\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation(); // return focus only of last trap was removed\n\n if (!traps.filter(function (_ref6) {\n var id = _ref6.id;\n return id === lastTrap.id;\n }).length) {\n // allow defer is no other trap is awaiting restore\n lastTrap.returnFocus(!trap);\n }\n }\n\n if (trap) {\n lastActiveFocus = null;\n\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation();\n }\n\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n} // bind medium\n\n\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb({\n moveFocusInside: moveFocusInside,\n focusInside: focusInside\n });\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["isFreeFocus","document","activeElement","body","focusIsHidden","lastActiveTrap","lastActiveFocus","lastPortaledElement","focusWasOutsideWindow","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","extractRef","ref","current","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","workingNode","portaledElement","workingArea","concat","map","filter","Boolean","whiteList","focusWhitelisted","focusInside","blur","focus","moveFocusInside","newActiveElement","getFocusabledIn","focusedIndex","_ref","indexOf","_ref2","forEach","_ref3","removeAttribute","length","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowBlur","setTimeout","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","contains","observerNode","mediumBlur","assignMedium","mediumEffect","cb","withSideEffect","propsList","_ref5","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref6","returnFocus","onActivation","removeEventListener"],"mappings":"6hBAWIA,EAAc,WAChB,OAJOC,UAAYA,SAASC,gBAAkBD,SAASE,MAI/BC,mBAGtBC,EAAiB,KACjBC,EAAkB,KAClBC,EAAsB,KACtBC,GAAwB,EAExBC,EAAmB,WACrB,OAAO,GAkBT,SAASC,EAAUC,EAAYC,EAAKC,EAAMC,GACxC,IAAIC,EAAY,KACZC,EAAIL,EAER,EAAG,CACD,IAAIM,EAAOH,EAASE,GAEpB,GAAIC,EAAKC,MACHD,EAAKE,KAAKC,QAAQC,iBACpBN,EAAYE,OAET,CAAA,IAAIA,EAAKK,SAQd,MAPA,GAAIN,IAAML,EAER,OAGFI,EAAY,aAINC,GAAKH,KAAUD,GAErBG,IACFA,EAAUI,KAAKI,SAAW,GAI9B,IAAIC,EAAa,SAAoBC,GACnC,OAAOA,GAAO,YAAaA,EAAMA,EAAIC,QAAUD,GAa7CE,EAAe,WACjB,IA/CqDC,EA+CjDC,GAAS,EAEb,GAAIxB,EAAgB,CAClB,IAAIyB,EAAkBzB,EAClB0B,EAAWD,EAAgBC,SAC3BC,EAAkBF,EAAgBE,gBAClCC,EAAYH,EAAgBG,UAC5BC,EAASJ,EAAgBI,OACzBC,EAAaL,EAAgBK,WAC7BC,EAAcL,GAAYxB,GAAuBA,EAAoB8B,gBACrEnC,EAAgBD,UAAYA,SAASC,cAEzC,GAAIkC,EAAa,CACf,IAAIE,EAAc,CAACF,GAAaG,OAAOL,EAAOM,IAAIhB,GAAYiB,OAAO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E,EAAsB,CACpBwE,aAsIaH,EArIbvC,gBAqI0BqC,OAuF9BM,aAAWC,aAAalB,GACxBmB,eAAaD,cAAa,SAAUE,GAClC,OAAOA,EAAG,CACRnC,gBAAiBA,UACjBH,YAAaA,mBAGjB,MAAeuC,WAtDf,SAA4BC,GAC1B,OAAOA,EAAU5C,QAAO,SAAU6C,GAEhC,OADeA,EAAMC,eAKzB,SAAmCC,GACjC,IAAIC,EAAOD,EAAME,OAAO,GAAG,GAEvBD,IAASpF,IArBbJ,SAAS0F,iBAAiB,UAAWhC,GACrC1D,SAAS0F,iBAAiB,WAAY5B,GACtC6B,OAAOD,iBAAiB,OAAQrB,IAuBhC,IAAIuB,EAAWxF,EACXyF,EAAWD,GAAYJ,GAAQA,EAAKM,KAAOF,EAASE,GACxD1F,EAAiBoF,EAEbI,IAAaC,IACfD,EAASG,iBAEJR,EAAM/C,QAAO,SAAUwD,GAE1B,OADSA,EAAMF,KACDF,EAASE,MACtBrC,QAEDmC,EAASK,aAAaT,IAItBA,GACFnF,EAAkB,KAEbwF,GAAYD,EAAS9D,WAAa0D,EAAK1D,UAC1C0D,EAAKU,eAGPxE,IACAqC,cAAYrC,KA3Cd1B,SAASmG,oBAAoB,UAAWzC,GACxC1D,SAASmG,oBAAoB,WAAYrC,GACzC6B,OAAOQ,oBAAoB,OAAQ9B,GA4CjChE,EAAkB,QAaP8E,EA1FI,WACjB,OAAO"}
|
|
1
|
+
{"version":3,"file":"Trap.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport moveFocusInside, { focusInside, focusIsHidden, getFocusabledIn } from 'focus-lock';\nimport { deferAction } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\n\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\n\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\n\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\n\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\n\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\n\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\n\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\n\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n\n do {\n var item = allNodes[i];\n\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n // we will tab to the next element\n return;\n }\n\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\n\nvar extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\n\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n // with cross frame return true for any value\n return Boolean(focusWasOutsideWindow);\n } // in other case return only of focus went a while aho\n\n\n return focusWasOutsideWindow === 'meanwhile';\n};\n\nvar activateTrap = function activateTrap() {\n var result = false;\n\n if (lastActiveTrap) {\n var _lastActiveTrap = lastActiveTrap,\n observed = _lastActiveTrap.observed,\n persistentFocus = _lastActiveTrap.persistentFocus,\n autoFocus = _lastActiveTrap.autoFocus,\n shards = _lastActiveTrap.shards,\n crossFrame = _lastActiveTrap.crossFrame,\n focusOptions = _lastActiveTrap.focusOptions;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n var activeElement = document && document.activeElement;\n\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !(focusInside(workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n // Check if blur() exists, which is missing on certain elements on IE\n if (activeElement.blur) {\n activeElement.blur();\n }\n\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus, {\n focusOptions: focusOptions\n });\n lastPortaledElement = {};\n }\n }\n\n focusWasOutsideWindow = false;\n lastActiveFocus = document && document.activeElement;\n }\n }\n\n if (document) {\n var newActiveElement = document && document.activeElement;\n var allNodes = getFocusabledIn(workingArea);\n var focusedIndex = allNodes.map(function (_ref) {\n var node = _ref.node;\n return node;\n }).indexOf(newActiveElement);\n\n if (focusedIndex > -1) {\n // remove old focus\n allNodes.filter(function (_ref2) {\n var guard = _ref2.guard,\n node = _ref2.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref3) {\n var node = _ref3.node;\n return node.removeAttribute('tabIndex');\n });\n autoGuard(focusedIndex, allNodes.length, +1, allNodes);\n autoGuard(focusedIndex, -1, -1, allNodes);\n }\n }\n }\n }\n\n return result;\n};\n\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n // prevent scroll jump\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\n\nvar onFocus = function onFocus(event) {\n // detect portal\n var source = event.target;\n var currentNode = event.currentTarget;\n\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\n\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\n\nvar FocusTrap = function FocusTrap(_ref4) {\n var children = _ref4.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\n\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\n\nvar onWindowBlur = function onWindowBlur() {\n focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction\n\n setTimeout(function () {\n focusWasOutsideWindow = 'meanwhile';\n }, 0);\n};\n\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('blur', onWindowBlur);\n};\n\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('blur', onWindowBlur);\n};\n\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref5) {\n var disabled = _ref5.disabled;\n return !disabled;\n });\n}\n\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation(); // return focus only of last trap was removed\n\n if (!traps.filter(function (_ref6) {\n var id = _ref6.id;\n return id === lastTrap.id;\n }).length) {\n // allow defer is no other trap is awaiting restore\n lastTrap.returnFocus(!trap);\n }\n }\n\n if (trap) {\n lastActiveFocus = null;\n\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation();\n }\n\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n} // bind medium\n\n\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb({\n moveFocusInside: moveFocusInside,\n focusInside: focusInside\n });\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["isFreeFocus","document","activeElement","body","focusIsHidden","lastActiveTrap","lastActiveFocus","lastPortaledElement","focusWasOutsideWindow","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","extractRef","ref","current","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","focusOptions","workingNode","portaledElement","workingArea","concat","map","filter","Boolean","whiteList","focusWhitelisted","focusInside","blur","focus","moveFocusInside","newActiveElement","getFocusabledIn","focusedIndex","_ref","indexOf","_ref2","forEach","_ref3","removeAttribute","length","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowBlur","setTimeout","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","contains","observerNode","mediumBlur","assignMedium","mediumEffect","cb","withSideEffect","propsList","_ref5","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref6","returnFocus","onActivation","removeEventListener"],"mappings":"6hBAWIA,EAAc,WAChB,OAJOC,UAAYA,SAASC,gBAAkBD,SAASE,MAI/BC,mBAGtBC,EAAiB,KACjBC,EAAkB,KAClBC,EAAsB,KACtBC,GAAwB,EAExBC,EAAmB,WACrB,OAAO,GAkBT,SAASC,EAAUC,EAAYC,EAAKC,EAAMC,GACxC,IAAIC,EAAY,KACZC,EAAIL,EAER,EAAG,CACD,IAAIM,EAAOH,EAASE,GAEpB,GAAIC,EAAKC,MACHD,EAAKE,KAAKC,QAAQC,iBACpBN,EAAYE,OAET,CAAA,IAAIA,EAAKK,SAQd,MAPA,GAAIN,IAAML,EAER,OAGFI,EAAY,aAINC,GAAKH,KAAUD,GAErBG,IACFA,EAAUI,KAAKI,SAAW,GAI9B,IAAIC,EAAa,SAAoBC,GACnC,OAAOA,GAAO,YAAaA,EAAMA,EAAIC,QAAUD,GAa7CE,EAAe,WACjB,IA/CqDC,EA+CjDC,GAAS,EAEb,GAAIxB,EAAgB,CAClB,IAAIyB,EAAkBzB,EAClB0B,EAAWD,EAAgBC,SAC3BC,EAAkBF,EAAgBE,gBAClCC,EAAYH,EAAgBG,UAC5BC,EAASJ,EAAgBI,OACzBC,EAAaL,EAAgBK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C,UACtBC,UAAUlD,KAAKmD,WAG3B,IAAIC,EAAe,WACjB/D,EAAwB,OAExBgE,YAAW,WACThE,EAAwB,cACvB,IA6DLiE,cAAYC,kBA5FE,SAAiBb,GAE7B,IAAIc,EAASd,EAAMe,OACfC,EAAchB,EAAMiB,cAEnBD,EAAYE,SAASJ,KAzI1BpE,EAAsB,CACpByE,aAyIaH,EAxIbvC,gBAwI0BqC,OAuF9BM,aAAWC,aAAalB,GACxBmB,eAAaD,cAAa,SAAUE,GAClC,OAAOA,EAAG,CACRnC,gBAAiBA,UACjBH,YAAaA,mBAGjB,MAAeuC,WAtDf,SAA4BC,GAC1B,OAAOA,EAAU5C,QAAO,SAAU6C,GAEhC,OADeA,EAAMC,eAKzB,SAAmCC,GACjC,IAAIC,EAAOD,EAAME,OAAO,GAAG,GAEvBD,IAASrF,IArBbJ,SAAS2F,iBAAiB,UAAWhC,GACrC3D,SAAS2F,iBAAiB,WAAY5B,GACtC6B,OAAOD,iBAAiB,OAAQrB,IAuBhC,IAAIuB,EAAWzF,EACX0F,EAAWD,GAAYJ,GAAQA,EAAKM,KAAOF,EAASE,GACxD3F,EAAiBqF,EAEbI,IAAaC,IACfD,EAASG,iBAEJR,EAAM/C,QAAO,SAAUwD,GAE1B,OADSA,EAAMF,KACDF,EAASE,MACtBrC,QAEDmC,EAASK,aAAaT,IAItBA,GACFpF,EAAkB,KAEbyF,GAAYD,EAAS/D,WAAa2D,EAAK3D,UAC1C2D,EAAKU,eAGPzE,IACAsC,cAAYtC,KA3Cd1B,SAASoG,oBAAoB,UAAWzC,GACxC3D,SAASoG,oBAAoB,WAAYrC,GACzC6B,OAAOQ,oBAAoB,OAAQ9B,GA4CjCjE,EAAkB,QAaP+E,EA1FI,WACjB,OAAO"}
|
|
@@ -0,0 +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","tag","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=o.tag,p=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||u||"div",r({ref:this.handleNode},p),s)},s}(t.Component);p.displayName="InView",p.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1},exports.InView=p,exports.default=p,exports.observe=u;
|
|
2
|
+
//# sourceMappingURL=react-intersection-observer.m.js.map
|
|
@@ -0,0 +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,IA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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,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("react"),r=require("styled-components"),n=require("../../themes/cruk.js"),a=require("../Icon/index.js"),u=require("./styles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=l(t),s=t.forwardRef((function(t,l){var s=r.useTheme(),o=e.__assign(e.__assign({},n.default),s),d=t.appearance,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("react"),r=require("styled-components"),n=require("../../themes/cruk.js"),a=require("../Icon/index.js"),u=require("./styles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=l(t),s=t.forwardRef((function(t,l){var s=r.useTheme(),o=e.__assign(e.__assign({},n.default),s),d=t.appearance,f=void 0===d?"primary":d,c=t.isIconButton,p=void 0!==c&&c,h=i.default.Children.toArray(t.children),m="string"==typeof h[0],y=h[0],_=!(!p&&(1===h.length&&!m&&(null==y?void 0:y.type))!==a.default);return i.default.createElement(u.StyledButton,e.__assign({as:t.href?"a":"button"},t.href?{role:"button"}:{},t,{appearance:f,isIconButton:_,theme:o,ref:l}),t.children&&h.length?i.default.Children.map(t.children,(function(e,t){return i.default.createElement(u.Spacer,{theme:o,key:t},e)})):null)}));s.defaultProps={appearance:"primary",full:!1,size:"m"},exports.Button=s,exports.default=s;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),o=require("styled-components");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t,e,c,a,i,l,d,s
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),o=require("styled-components");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t,e,c,a,i,l,d,u,s=r(o),b=s.default.span(t||(t=n.__makeTemplateObject(["\n margin-left: ",";\n &:first-of-type {\n margin-left: 0;\n }\n"],["\n margin-left: ",";\n &:first-of-type {\n margin-left: 0;\n }\n"])),(function(n){return n.theme.spacing.xxs})),m=s.default.button(u||(u=n.__makeTemplateObject(["\n box-sizing: border-box;\n min-height: ",";\n display: inline-block;\n vertical-align: middle;\n padding: ",";\n width: ",";\n min-width: ",";\n\n border-radius: ",";\n border-style: solid;\n border-width: ",";\n\n transition: color 0.2s ease, background-color 0.2s ease,\n border-color 0.2s ease;\n\n cursor: pointer;\n font-size: ",";\n font-family: ",";\n font-weight: ",";\n text-align: center;\n text-transform: ",";\n text-decoration: ",";\n\n &:focus {\n outline: auto;\n }\n\n ","\n\n ","\n\n ","\n \n ","\n\n ","\n\n ","\n"],["\n box-sizing: border-box;\n min-height: ",";\n display: inline-block;\n vertical-align: middle;\n padding: ",";\n width: ",";\n min-width: ",";\n\n border-radius: ",";\n border-style: solid;\n border-width: ",";\n\n transition: color 0.2s ease, background-color 0.2s ease,\n border-color 0.2s ease;\n\n cursor: pointer;\n font-size: ",";\n font-family: ",";\n font-weight: ",";\n text-align: center;\n text-transform: ",";\n text-decoration: ",";\n\n &:focus {\n outline: auto;\n }\n\n ","\n\n ","\n\n ","\n \n ","\n\n ","\n\n ","\n"])),"3rem",(function(n){var o=n.theme;return n.isIconButton?"0":"calc( (".concat("3rem"," - ( ").concat(o.button.buttonBorderThickness," * 2) - ").concat(o.typography.lineHeight," ) / 2) ").concat(o.spacing.m)}),(function(n){return n.isIconButton?"".concat("3rem"):"auto"}),(function(n){return n.isIconButton?"".concat("3rem"):"auto"}),(function(n){return n.theme.button.borderRadius}),(function(n){return n.theme.button.buttonBorderThickness}),(function(n){return n.theme.fontSizes.m}),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightMedium}),(function(n){return n.theme.button.textTransform}),(function(n){return n.theme.button.textDecoration}),(function(r){return"primary"===r.appearance&&o.css(e||(e=n.__makeTemplateObject(["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "],["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "])),r.theme.colors.buttonPrimaryBackground,r.theme.colors.buttonPrimaryBorder,r.theme.colors.buttonPrimaryText,r.theme.colors.buttonPrimaryBackgroundHover,r.theme.colors.buttonPrimaryBorderHover,r.theme.colors.buttonPrimaryTextHover,r.theme.colors.buttonPrimaryDisabledBackground,r.theme.colors.buttonPrimaryDisabledText,r.theme.colors.buttonPrimaryDisabledBorder)}),(function(r){return"secondary"===r.appearance&&o.css(c||(c=n.__makeTemplateObject(["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "],["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "])),r.theme.colors.buttonSecondaryBackground,r.theme.colors.buttonSecondaryBorder,r.theme.colors.buttonSecondaryText,r.theme.colors.buttonSecondaryBackgroundHover,r.theme.colors.buttonSecondaryBorderHover,r.theme.colors.buttonSecondaryTextHover,r.theme.colors.buttonSecondaryDisabledBackground,r.theme.colors.buttonSecondaryDisabledText,r.theme.colors.buttonSecondaryDisabledBorder)}),(function(r){return"tertiary"===r.appearance&&o.css(a||(a=n.__makeTemplateObject(["\n display: inline-block;\n padding: 0;\n border: 0px;\n background-color: rgba(255, 255, 255, 0);\n transition: color 0.2s ease;\n color: ",";\n :focus,\n :hover {\n color: ",";\n }\n :disabled {\n cursor: not-allowed;\n background-color: transparent;\n color: "," !important;\n border-color: transparent;\n }\n "],["\n display: inline-block;\n padding: 0;\n border: 0px;\n background-color: rgba(255, 255, 255, 0);\n transition: color 0.2s ease;\n color: ",";\n :focus,\n :hover {\n color: ",";\n }\n :disabled {\n cursor: not-allowed;\n background-color: transparent;\n color: "," !important;\n border-color: transparent;\n }\n "])),r.theme.colors.buttonTertiaryText,r.theme.colors.buttonTertiaryTextHover,r.theme.colors.buttonTertiaryDisabledText)}),(function(r){return"l"===r.size&&o.css(i||(i=n.__makeTemplateObject(["\n min-height: ",";\n border-radius: ",";\n padding: ",";\n min-width: ",";\n height: ",";\n "],["\n min-height: ",";\n border-radius: ",";\n padding: ",";\n min-width: ",";\n height: ",";\n "])),"4rem",(function(n){return n.theme.button.borderRadiusLarge}),(function(n){var o=n.theme;return n.isIconButton?"0":"calc( (".concat("4rem"," - ( ").concat(o.button.buttonBorderThickness," * 2) - ").concat(o.typography.lineHeight," ) / 2) ").concat(o.spacing.m)}),(function(n){return n.isIconButton?"".concat("4rem"):"auto"}),(function(n){return n.isIconButton?"".concat("4rem"):"auto"}))}),(function(r){return r.full&&o.css(l||(l=n.__makeTemplateObject(["\n width: 100%;\n "],["\n width: 100%;\n "])))}),(function(r){return r.css&&o.css(d||(d=n.__makeTemplateObject(["\n ","\n "],["\n ","\n "])),r.css)}));exports.Spacer=b,exports.StyledButton=m;
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("react"),l=require("./styles.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(t),a=function(t){return n.default.createElement("div",null,n.default.createElement(l.CarouselButton,e.__assign({},t,{"aria-label":"previous"}),n.default.createElement(l.VerticalAlign,null,"◄",n.default.createElement(l.ScreenReaderOnly,null,"Scroll carousel to previous index"))))},u=function(t){return n.default.createElement("div",null,n.default.createElement(l.CarouselButton,e.__assign({},t,{"aria-label":"next"}),n.default.createElement(l.VerticalAlign,null,"►",n.default.createElement(l.ScreenReaderOnly,null,"Scroll carousel to previous index"))))},o=function(e){var t=e.count,r=e.currentPosition,o=void 0===r?0:r,c=e.scrollToPosition,i=e.next,s=e.previous,d=o!==t-1,f=0!==o,m=Array.from({length:t},(function(e,t){return"arrayIndex".concat(t)}));return n.default.createElement(l.ButtonWrapper,null,n.default.createElement(a,{disabled:!f,onClick:s}),n.default.createElement(l.DotContainer,{count:t},m.map((function(e,t){var r=t===o;return n.default.createElement(l.Dot,{key:e,selected:r,role:"switch","aria-checked":r,onClick:function(){c(t)}},n.default.createElement(l.ScreenReaderOnly,null,"Scroll carousel to index ".concat(t)))}))),n.default.createElement(u,{disabled:!d,onClick:i}))};exports.CarouselLeftButton=a,exports.CarouselRightButton=u,exports.Dots=o,exports.default=o;
|
|
2
|
+
//# sourceMappingURL=Dots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dots.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../node_modules/react-intersection-observer/react-intersection-observer.m.js"),r=require("../Box/index.js"),n=require("./Dots.js"),l=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(e),a=function(o){var a=o.startPosition,s=void 0===a?0:a,i=o.children,c=o.onPositionChanged,d=o.shrinkUnselectedPages,f=void 0!==d&&d,h=e.useState(s),v=h[0],m=h[1],C=e.useState(!0),E=C[0],g=C[1],p=e.useRef(null),x=u.default.Children.toArray(i).filter(Boolean),y=function(e){if(p&&p.current){var t=p.current.scrollWidth,r=0===e,n=e===p.current.children.length-1,l=p.current.children[e];if(!l)return;var o=l.offsetLeft;r?p.current.scrollTo(0,0):n?p.current.scrollTo(t,0):p.current.scrollTo(o,0),E||g(!0)}};e.useEffect((function(){0!==s&&g(!1)}),[s]),e.useEffect((function(){!1===E&&y(s)}),[E]);var P=1===x.length;return u.default.createElement(u.default.Fragment,null,u.default.createElement(r.default,null,u.default.createElement(l.CarouselWrapper,null,u.default.createElement(l.CarouselScrollArea,{ref:p,"aria-live":"assertive",smoothScrolling:E,tabIndex:0},x.map((function(e,r){var n=r===v;return u.default.createElement(l.CarouselCard,{key:r,onlyChild:P},u.default.createElement(t.InView,{threshold:.5,as:"div",onChange:function(e){var t;e&&v!==(t=r)&&(m(t),c&&c(t))}},u.default.createElement(l.CarouselCardInner,{onlyChild:P,isSelected:n,shrinkUnselectedPages:f},e)))}))))),x.length>1?u.default.createElement(r.default,null,u.default.createElement(n.Dots,{count:x.length,currentPosition:v,scrollToPosition:y,next:function(){y(v+1)},previous:function(){y(v-1)}})):null)},s=e.memo(a);exports.Carousel=a,exports.default=s;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js");function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t,o,r,i,a,l,s,c,d,p,u=e(require("styled-components")),m=u.default.div(t||(t=n.__makeTemplateObject(["\n position: relative;\n width: 100%;\n overflow-y: hidden;\n"],["\n position: relative;\n width: 100%;\n overflow-y: hidden;\n"]))),h=u.default.ul(o||(o=n.__makeTemplateObject(["\n position: relative;\n overflow-x: scroll;\n scroll-snap-type: x mandatory;\n scroll-behavior: ",";\n -webkit-overflow-scrolling: touch;\n white-space: nowrap;\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 20px;\n margin-bottom: -20px;\n height: 100%;\n"],["\n position: relative;\n overflow-x: scroll;\n scroll-snap-type: x mandatory;\n scroll-behavior: ",";\n -webkit-overflow-scrolling: touch;\n white-space: nowrap;\n padding-left: 0;\n padding-right: 0;\n padding-bottom: 20px;\n margin-bottom: -20px;\n height: 100%;\n"])),(function(n){return n.smoothScrolling?"smooth":"auto"})),f=u.default.li(r||(r=n.__makeTemplateObject(["\n scroll-snap-align: center;\n display: inline-block;\n width: ",";\n"],["\n scroll-snap-align: center;\n display: inline-block;\n width: ",";\n"])),(function(n){return n.onlyChild?"100%":"80%"})),b=u.default.div(i||(i=n.__makeTemplateObject(["\n transition: transform 0.2s linear;\n transform: ",";\n"],["\n transition: transform 0.2s linear;\n transform: ",";\n"])),(function(n){var e=n.isSelected,t=n.shrinkUnselectedPages;return n.onlyChild||e&&t?"scale(1)":"scale(0.9)"})),g=u.default.div(a||(a=n.__makeTemplateObject(["\n display: flex;\n justify-content: center;\n"],["\n display: flex;\n justify-content: center;\n"]))),x=u.default.span(l||(l=n.__makeTemplateObject(["\n display: block;\n margin: auto;\n height: 2rem;\n line-height: 1.75rem;\n"],["\n display: block;\n margin: auto;\n height: 2rem;\n line-height: 1.75rem;\n"]))),y=u.default.button(s||(s=n.__makeTemplateObject(["\n height: 100%;\n cursor: pointer;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n color: ",";\n font-size: ",";\n font-weight: 600;\n transition: color 0.3s ease, transform 0.3s ease;\n max-width: 3rem;\n padding: 0;\n vertical-align: middle;\n user-select: none;\n\n transform: scale(0.8);\n &:hover {\n transform: ",";\n }\n"],["\n height: 100%;\n cursor: pointer;\n background-color: rgba(255, 255, 255, 0);\n border: none;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n color: ",";\n font-size: ",";\n font-weight: 600;\n transition: color 0.3s ease, transform 0.3s ease;\n max-width: 3rem;\n padding: 0;\n vertical-align: middle;\n user-select: none;\n\n transform: scale(0.8);\n &:hover {\n transform: ",";\n }\n"])),(function(n){var e=n.disabled,t=n.theme;return e?t.colors.disabled:"su2c"===t.name?t.colors.textDark:t.colors.primary}),(function(n){return n.theme.fontSizes.xxxl}),(function(n){return n.disabled?"scale(0.8)":"scale(1)"})),w=u.default.div(c||(c=n.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n display: ",";\n\n @media (min-width: ",") {\n display: ",";\n }\n\n @media (min-width: ",") {\n display: ",";\n }\n"],["\n display: flex;\n flex-direction: row;\n justify-content: center;\n display: ",";\n\n @media (min-width: ",") {\n display: ",";\n }\n\n @media (min-width: ",") {\n display: ",";\n }\n"])),(function(n){return n.count>6?"none":"flex"}),(function(n){return n.theme.breakpoint.tablet}),(function(n){return n.count>10?"none":"flex"}),(function(n){return n.theme.breakpoint.desktop}),(function(n){return n.count>20?"none":"flex"})),k=u.default.button(d||(d=n.__makeTemplateObject(["\n border: none;\n outline-offset: ",";\n padding: 0;\n margin: ",";\n width: ",";\n height: ",";\n border-radius: 50%;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n border: ",";\n background-color: ",";\n user-select: none;\n transition: background-color 0.3s ease, transform 0.3s ease;\n transform: scale(0.8);\n &:hover {\n transform: scale(1);\n }\n"],["\n border: none;\n outline-offset: ",";\n padding: 0;\n margin: ",";\n width: ",";\n height: ",";\n border-radius: 50%;\n /* TODO if this makes it into the component library carouselButtonColor should be a theme prop */\n border: ",";\n background-color: ",";\n user-select: none;\n transition: background-color 0.3s ease, transform 0.3s ease;\n transform: scale(0.8);\n &:hover {\n transform: scale(1);\n }\n"])),(function(n){return n.theme.spacing.xxs}),(function(n){var e=n.theme;return"auto ".concat(e.spacing.xxs)}),(function(n){return n.theme.fontSizes.l}),(function(n){return n.theme.fontSizes.l}),(function(n){var e=n.theme;return"solid 1px ".concat("su2c"===e.name?e.colors.textDark:e.colors.primary)}),(function(n){var e=n.theme;return n.selected?"".concat("su2c"===e.name?e.colors.textDark:e.colors.primary):e.colors.backgroundLight})),v=u.default.span(p||(p=n.__makeTemplateObject(["\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n"],["\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n margin-bottom: -1px;\n margin-right: -1px;\n overflow: hidden;\n padding: 0px;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n"])));exports.ButtonWrapper=g,exports.CarouselButton=y,exports.CarouselCard=f,exports.CarouselCardInner=b,exports.CarouselScrollArea=h,exports.CarouselWrapper=m,exports.Dot=k,exports.DotContainer=w,exports.ScreenReaderOnly=v,exports.VerticalAlign=x;
|
|
2
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components"),t=require("../Button/index.js"),o=require("../Icon/index.js");function r(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var i,a,s,l,u=r(e),d=u.default(o.default)(i||(i=n.__makeTemplateObject(["\n transform: ",";\n transition-duration: ","s;\n"],["\n transform: ",";\n transition-duration: ","s;\n"])),(function(n){return n.open?"rotate(90deg) translateX(0.1em) scaleX(-1) ":"rotate(90deg)"}),.5),f=u.default(t.Button)(a||(a=n.__makeTemplateObject(["\n display: flex;\n color: ",";\n font-size: ",";\n font-family: ",";\n font-weight: normal;\n margin-bottom: 0;\n height: initial;\n text-decoration: none;\n text-align: left;\n border-radius: 0;\n :hover,\n :focus {\n color: ",";\n }\n"],["\n display: flex;\n color: ",";\n font-size: ",";\n font-family: ",";\n font-weight: normal;\n margin-bottom: 0;\n height: initial;\n text-decoration: none;\n text-align: left;\n border-radius: 0;\n :hover,\n :focus {\n color: ",";\n }\n"])),(function(n){var e=n.theme.colors,t=n.textColor;return t&&void 0!==e[t]?e[t]:t||e.secondary}),(function(n){var e=n.theme,t=e.fontSizes,o=e.fontSizes.m,r=n.textSize;return r?t[r]:o}),(function(n){var e=n.theme;return n.textFontFamily||e.typography.fontFamilyBase}),(function(n){var e=n.theme.colors,t=n.textColor;return t&&void 0!==e[t]?e[t]:t||e.secondary})),c=u.default.div(s||(s=n.__makeTemplateObject(["\n margin: 0;\n transition: ","s ease;\n height: ",";\n visibility: ",";\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n"],["\n margin: 0;\n transition: ","s ease;\n height: ",";\n visibility: ",";\n overflow: hidden;\n & > p {\n margin-top: 0;\n }\n"])),.5,(function(n){return n.contentHeight}),(function(n){return n.openStatus?"visible":"hidden"})),m=u.default.div(l||(l=n.__makeTemplateObject(["\n cursor: pointer;\n"],["\n cursor: pointer;\n"])));exports.CollapseContent=c,exports.CustomHeader=m,exports.DefaultHeader=f,exports.FlippingIcon=d,exports.transitionDurationSeconds=.5;
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components"),r=require("../Text/index.js"),o=require("../Icon/index.js");function t(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var a,i,c,u=t(e),s=u.default(o.default)(a||(a=n.__makeTemplateObject(["\n margin-right: ",";\n"],["\n margin-right: ",";\n"])),(function(n){return n.theme.spacing.xxs})),d=u.default(r.Text)(c||(c=n.__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 {\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 {\n outline: auto;\n }\n\n &:hover {\n cursor: pointer;\n background-size: 100% 100%;\n color: ",";\n }\n"])),(function(n){var e=n.theme,r=e.colors,o=e.utilities.useBackgroundStyleLinks,t=n.textColor,a=n.appearance;return t&&void 0!==r[t]?r[t]:t||(!a&&o?"currentColor":a&&"primary"===a?r.secondary:r.linkColor)}),(function(n){var e=n.appearance,r=n.theme.typography.linkTextDecoration;return"primary"===e||"secondary"===e?"none":r}),(function(n){var e=n.theme;return e.utilities.useBackgroundStyleLinks?e.typography.fontWeightHeavy:e.typography.fontWeightMedium}),(function(n){var e=n.appearance,r=n.theme;return n.theme.utilities.useBackgroundStyleLinks&&!e?"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)&&e.css(i||(i=n.__makeTemplateObject(["\n font-weight: ",";\n "],["\n font-weight: ",";\n "])),t)}),(function(n){var e=n.theme,r=e.colors,o=e.utilities.useBackgroundStyleLinks,t=n.textHoverColor;return!t&&o?r.textDark:t&&void 0!==r[t]?r[t]:t||r.linkColorHover}));exports.ChevyWithLevee=s,exports.StyledLink=d;
|
|
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"),e=require("styled-components");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components");function o(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t,r,i,a,c,d,l,s=o(e),u=s.default.div(t||(t=n.__makeTemplateObject(["\n display: table;\n width: 100%;\n clear: both;\n text-align: center;\n"],["\n display: table;\n width: 100%;\n clear: both;\n text-align: center;\n"]))),p=s.default.ul(r||(r=n.__makeTemplateObject(["\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n"],["\n display: inline-block;\n padding-left: 0;\n margin: 20px 0;\n"]))),f=s.default.a(d||(d=n.__makeTemplateObject(["\n font-weight: normal;\n font-family: ",";\n font-size: ",";\n color: ",";\n background-color: ",";\n cursor: pointer;\n border-radius: 0;\n margin: ",";\n padding: 7px 11px;\n text-decoration: none;\n &:hover {\n opacity: 0.88;\n text-decoration: underline;\n }\n &:focus,\n &:active,\n &:visited {\n text-decoration: none;\n }\n\n &:focus {\n outline: auto;\n }\n\n ","\n\n ","\n\n ","\n"],["\n font-weight: normal;\n font-family: ",";\n font-size: ",";\n color: ",";\n background-color: ",";\n cursor: pointer;\n border-radius: 0;\n margin: ",";\n padding: 7px 11px;\n text-decoration: none;\n &:hover {\n opacity: 0.88;\n text-decoration: underline;\n }\n &:focus,\n &:active,\n &:visited {\n text-decoration: none;\n }\n\n &:focus {\n outline: auto;\n }\n\n ","\n\n ","\n\n ","\n"])),(function(n){return n.theme.typography.fontFamilyBase}),(function(n){return n.theme.fontSizes.s}),(function(n){return n.theme.colors.textLight}),(function(n){return n.theme.colors.paginationBackground}),(function(n){return n.theme.spacing.xxs}),(function(o){return o.active&&e.css(i||(i=n.__makeTemplateObject(["\n color: ",";\n background-color: ",";\n cursor: default;\n &:hover {\n background-color: ",";\n text-decoration: none;\n }\n "],["\n color: ",";\n background-color: ",";\n cursor: default;\n &:hover {\n background-color: ",";\n text-decoration: none;\n }\n "])),(function(n){return n.theme.colors.textDark}),(function(n){return n.theme.colors.paginationActive}),(function(n){return n.theme.colors.paginationActive}))}),(function(o){return("Prev"===o.name||"Next"===o.name)&&e.css(a||(a=n.__makeTemplateObject(["\n color: ",";\n background-color: transparent;\n font-weight: bold;\n padding: 8px 6px;\n background-color: transparent;\n &:hover {\n background-color: transparent;\n text-decoration: underline;\n }\n &:focus,\n &:active,\n &:visited {\n text-decoration: none;\n }\n "],["\n color: ",";\n background-color: transparent;\n font-weight: bold;\n padding: 8px 6px;\n background-color: transparent;\n &:hover {\n background-color: transparent;\n text-decoration: underline;\n }\n &:focus,\n &:active,\n &:visited {\n text-decoration: none;\n }\n "])),(function(n){var e=n.theme;return n.disabled?e.colors.disabled:e.colors.paginationText}))}),(function(o){return o.disabled&&e.css(c||(c=n.__makeTemplateObject(["\n color: $ ",";\n cursor: not-allowed;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active,\n &:visited {\n color: ",";\n text-decoration: none;\n }\n "],["\n color: $ ",";\n cursor: not-allowed;\n text-decoration: none;\n &:hover,\n &:focus,\n &:active,\n &:visited {\n color: ",";\n text-decoration: none;\n }\n "])),(function(n){return n.theme.colors.disabled}),(function(n){return n.theme.colors.disabled}))})),m=s.default.li(l||(l=n.__makeTemplateObject(["\n display: none;\n &:first-child,\n &:last-child {\n display: inline;\n }\n @media (min-width: ",") {\n display: inline;\n }\n span {\n border: none;\n min-width: 30px;\n padding: 5px;\n margin: 1px;\n border-radius: 0;\n }\n"],["\n display: none;\n &:first-child,\n &:last-child {\n display: inline;\n }\n @media (min-width: ",") {\n display: inline;\n }\n span {\n border: none;\n min-width: 30px;\n padding: 5px;\n margin: 1px;\n border-radius: 0;\n }\n"])),(function(n){return n.theme.breakpoint.mobile}));exports.PagerItem=m,exports.PagerLink=f,exports.PagerList=p,exports.PagerWrapper=u;
|
|
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"),r=require("react"),t=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),r=require("react"),t=require("styled-components"),a=require("../../themes/cruk.js"),l=require("./styles.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=c(r);exports.default=function(r){var c=r.percentage,o=void 0===c?0:c,n=r.isCircular,i=r.circleContents,u=r.circleSize,d=r.barColor,f=r.secondaryBarColor,m=r.secondaryPercentage,p=r.children,y=t.useTheme(),h=e.__assign(e.__assign({},a.default),y),C=Number.isNaN(o)?0:o,g=C>100?100:C,E="".concat(C,"%"),b=m&&!Number.isNaN(m)?m:0,k=b>100?100:b,P="".concat("string"==typeof i?i:""," ").concat(E,"% Complete"),v=i||E,x=58,_=2*Math.PI*x;return s.default.createElement(t.ThemeProvider,{theme:h},s.default.createElement(l.ProgressBarWrapper,null,n?s.default.createElement(l.CircularWrapper,{circleSize:u||"90px"},s.default.createElement(l.CircleSvg,{viewBox:"0 0 ".concat(128," ").concat(128)},s.default.createElement(l.EmptyCircle,{cx:64,cy:64,r:x,strokeWidth:6}),s.default.createElement(l.FullCircle,{isSecondary:!0,barColor:f,cx:64,cy:64,r:x,strokeWidth:6,strokeDasharray:_,strokeDashoffset:_*(1-k/100),strokeDashoffsetInit:_}),s.default.createElement(l.FullCircle,{barColor:d,cx:64,cy:64,r:x,strokeWidth:6,strokeDasharray:_,strokeDashoffset:_*(1-g/100),strokeDashoffsetInit:_})),s.default.createElement(l.CircularValue,null,v)):s.default.createElement(l.LineProgressBarWrapper,{percentage:g,secondaryPercentage:k},s.default.createElement(l.LineProgressBar,{isSecondary:!0,percentage:k,barColor:f}),s.default.createElement(l.LineProgressBar,{percentage:g,barColor:d}),s.default.createElement(l.ScreenReaderOnly,null,P)),p))};
|
|
2
2
|
//# sourceMappingURL=index.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");function t(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var r,o,i,a,s,l,d,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../../../node_modules/tslib/tslib.es6.js"),e=require("styled-components");function t(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var r,o,i,a,s,c,l,p,d,u,h,f,m,g,b,x=t(e),k=function(t){var o=t.strokeDashoffsetInit,i=t.strokeDashoffset;return e.keyframes(r||(r=n.__makeTemplateObject(["\n 0% {\n stroke-dashoffset: "," ;\n }\n 50% {\n stroke-dashoffset: "," ;\n }\n 100% {\n stroke-dashoffset: "," ;\n }\n"],["\n 0% {\n stroke-dashoffset: "," ;\n }\n 50% {\n stroke-dashoffset: "," ;\n }\n 100% {\n stroke-dashoffset: "," ;\n }\n"])),o,i,i)},_=function(t){var r=t.strokeDashoffsetInit,i=t.strokeDashoffset;return e.keyframes(o||(o=n.__makeTemplateObject(["\n 0% {\n stroke-dashoffset: "," ;\n }\n 100% {\n stroke-dashoffset: "," ;\n }\n"],["\n 0% {\n stroke-dashoffset: "," ;\n }\n 100% {\n stroke-dashoffset: "," ;\n }\n"])),r,i)},y=function(){return e.keyframes(i||(i=n.__makeTemplateObject(["\n 0% {\n width: 0px;\n height: 0px;\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n width: 64px;\n height: 64px;\n right: -32px;\n }\n"],["\n 0% {\n width: 0px;\n height: 0px;\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n width: 64px;\n height: 64px;\n right: -32px;\n }\n"])))},w=function(){return e.keyframes(a||(a=n.__makeTemplateObject(["\n 0% {\n transform: scale(1);\n border-radius: 0px;\n\n }\n 50% {\n transform:scale(1.025);\n }\n 100% {\n transform: scale(1);\n border-radius: 0px;\n }\n"],["\n 0% {\n transform: scale(1);\n border-radius: 0px;\n\n }\n 50% {\n transform:scale(1.025);\n }\n 100% {\n transform: scale(1);\n border-radius: 0px;\n }\n"])))},v=x.default.div(s||(s=n.__makeTemplateObject(["\n margin-top: ",";\n"],["\n margin-top: ",";\n"])),"16px"),j=x.default.div(l||(l=n.__makeTemplateObject(["\n position: relative;\n height: ",";\n margin-bottom: 0;\n background-color: ",";\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n\n ","\n"],["\n position: relative;\n height: ",";\n margin-bottom: 0;\n background-color: ",";\n box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);\n\n ","\n"])),"16px",(function(n){return n.theme.colors.progressBarBackground}),(function(t){var r=t.percentage,o=t.secondaryPercentage;return(100===r||100===o)&&e.css(c||(c=n.__makeTemplateObject(["\n animation: "," 0.3s 0.5s 1 ease-out;\n "],["\n animation: "," 0.3s 0.5s 1 ease-out;\n "])),w)})),O=x.default.div(d||(d=n.__makeTemplateObject(["\n position: absolute;\n left: 0;\n height: ",";\n background-color: ",";\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n transition: width 0.6s ease;\n width: ",'%;\n\n &::before {\n content: "";\n display: inline-block;\n position: absolute;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 0px;\n height: 0px;\n border-radius: 50%;\n opacity: 0;\n filter: blur(2px);\n background-color: ',";\n\n ","\n }\n"],["\n position: absolute;\n left: 0;\n height: ",";\n background-color: ",";\n box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);\n transition: width 0.6s ease;\n width: ",'%;\n\n &::before {\n content: "";\n display: inline-block;\n position: absolute;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n width: 0px;\n height: 0px;\n border-radius: 50%;\n opacity: 0;\n filter: blur(2px);\n background-color: ',";\n\n ","\n }\n"])),"16px",(function(n){var e=n.barColor,t=n.isSecondary,r=n.theme.colors,o=r.progressBar,i=r.progressBarSecondary;return e||t?i:o}),(function(n){return n.percentage}),(function(n){var e=n.barColor,t=n.isSecondary,r=n.theme.colors,o=r.progressBar,i=r.progressBarSecondary;return e||t?i:o}),(function(t){return 100===t.percentage&&e.css(p||(p=n.__makeTemplateObject(["\n animation: "," 0.33s 0.75s 3 ease-in;\n "],["\n animation: "," 0.33s 0.75s 3 ease-in;\n "])),y)})),T=x.default.span(u||(u=n.__makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n"],["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n border: 0;\n"]))),S=x.default.div(h||(h=n.__makeTemplateObject(["\n position: relative;\n width: ",";\n height: ",";\n background: none;\n margin: 0 auto;\n box-shadow: none;\n"],["\n position: relative;\n width: ",";\n height: ",";\n background: none;\n margin: 0 auto;\n box-shadow: none;\n"])),(function(n){return n.circleSize}),(function(n){return n.circleSize})),B=x.default.svg(f||(f=n.__makeTemplateObject(["\n position: absolute;\n transform: rotate(-90deg);\n fill: none;\n stroke-linecap: round;\n width: 100%;\n height: 100%;\n"],["\n position: absolute;\n transform: rotate(-90deg);\n fill: none;\n stroke-linecap: round;\n width: 100%;\n height: 100%;\n"]))),C=x.default.circle(m||(m=n.__makeTemplateObject(["\n stroke: ",";\n"],["\n stroke: ",";\n"])),(function(n){return n.theme.tokenColors.grey_200})),z=x.default.circle(g||(g=n.__makeTemplateObject(["\n stroke: ",";\n animation: ","\n 1s linear;\n"],["\n stroke: ",";\n animation: ","\n 1s linear;\n"])),(function(n){var e=n.isSecondary,t=n.barColor,r=n.theme.colors,o=r.circularProgress,i=r.circularProgressSecondary;return t||e?i:o}),(function(n){return n.isSecondary?_:k})),P=x.default.div(b||(b=n.__makeTemplateObject(["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n z-index: 2;\n font-size: ",";\n line-height: ",";\n text-align: center;\n height: 100%;\n color: ",";\n"],["\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n z-index: 2;\n font-size: ",";\n line-height: ",";\n text-align: center;\n height: 100%;\n color: ",";\n"])),(function(n){return n.theme.fontSizes.l}),(function(n){return n.theme.fontSizes.l}),(function(n){return n.theme.colors.textDark}));exports.CircleSvg=B,exports.CircularValue=P,exports.CircularWrapper=S,exports.EmptyCircle=C,exports.FullCircle=z,exports.LineProgressBar=O,exports.LineProgressBarWrapper=j,exports.ProgressBarWrapper=v,exports.ScreenReaderOnly=T;
|
|
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"),t=require("react"),a=require("styled-components"),r=require("../../utils/Helper.js"),l=require("../../themes/cruk.js"),n=require("../Text/index.js"),u=require("../Badge/index.js"),m=require("../Box/index.js"),o=require("./styles.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=s(t);exports.default=function(t){var s=t.total,d=t.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../node_modules/tslib/tslib.es6.js"),t=require("react"),a=require("styled-components"),r=require("../../utils/Helper.js"),l=require("../../themes/cruk.js"),n=require("../Text/index.js"),u=require("../Badge/index.js"),m=require("../Box/index.js"),o=require("./styles.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=s(t);exports.default=function(t){var s=t.total,d=t.additionalAmount,c=t.giftAid,f=t.target,p=void 0===f?null:f,g=t.isCompact,E=t.summaryMessage,h=void 0===E?void 0:E,y=t.children,x=a.useTheme(),j=e.__assign(e.__assign({},l.default),x),q=r.calculatePercentRounded(+s,p||0),b=r.calculatePercentRounded(d?+s+(d||0):0,p||0),C="".concat(q,"% of the £").concat(r.formatMoneyWithCommas(p||0)," target");return i.default.createElement(o.TotaliserWrapper,{isCompact:g||!1,theme:j},g?i.default.createElement(o.CompactWrapper,{theme:j},i.default.createElement(m.default,{marginHorizontal:"none",marginRight:"xxs",marginBottom:"none"},i.default.createElement(u.default,null,"£".concat(r.formatMoneyWithCommas(s)))),null!==p&&i.default.createElement(o.Summary,null,i.default.createElement(n.Text,{as:"span"},C))):i.default.createElement(o.BubbleWrapper,{theme:j},i.default.createElement(o.BubbleText,null,"Total raised"),i.default.createElement(o.Total,null,"£",r.formatMoneyWithCommas(s)),i.default.createElement(o.GiftAid,null,"+ £",r.formatMoneyWithCommas(c||0)," Gift Aid")),(!!p||!!h)&&i.default.createElement(o.ProgressBarWrapper,{isCompact:g||!1,theme:j},i.default.createElement(o.StyledProgressBar,{theme:j,percentage:q,secondaryPercentage:b}),!g&&(h?i.default.createElement(o.Summary,null,h):i.default.createElement(o.Summary,null,i.default.createElement(n.Text,{as:"span"},C)))),y)};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|