@cruk/cruk-react-components 7.1.4 → 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.css +158 -398
- package/lib/src/components/AddressLookup/index.js +1 -1
- package/lib/src/components/AddressLookup/index.js.map +1 -1
- package/lib/src/components/Avatar/index.js +1 -1
- package/lib/src/components/Badge/index.js +1 -1
- package/lib/src/components/Box/index.js +1 -1
- package/lib/src/components/Carousel/index.js +1 -1
- package/lib/src/components/Carousel/index.js.map +1 -1
- package/lib/src/components/Checkbox/index.js +1 -1
- package/lib/src/components/Collapse/index.js +1 -1
- package/lib/src/components/DateField/index.js +1 -1
- package/lib/src/components/DateField/index.js.map +1 -1
- package/lib/src/components/ErrorText/index.js +1 -1
- package/lib/src/components/Footer/index.js +1 -1
- package/lib/src/components/Header/index.js +1 -1
- package/lib/src/components/Header/index.js.map +1 -1
- package/lib/src/components/Heading/index.js +1 -1
- package/lib/src/components/IconFa/index.js +1 -1
- package/lib/src/components/InfoBox/index.js +1 -1
- package/lib/src/components/LabelWrapper/index.js +1 -1
- package/lib/src/components/LegendWrapper/index.js +1 -1
- package/lib/src/components/Link/index.js +1 -1
- package/lib/src/components/Loader/index.js +1 -1
- package/lib/src/components/Modal/TestModalWithContent.d.ts +1 -3
- package/lib/src/components/Modal/TestModalWithOpenButton.d.ts +3 -0
- package/lib/src/components/Modal/index.d.ts +6 -3
- package/lib/src/components/Modal/index.js +1 -1
- package/lib/src/components/Modal/index.js.map +1 -1
- package/lib/src/components/Pagination/index.js +1 -1
- package/lib/src/components/PopOver/index.d.ts +4 -8
- package/lib/src/components/PopOver/index.js +1 -1
- package/lib/src/components/PopOver/index.js.map +1 -1
- package/lib/src/components/ProgressBar/index.js +1 -1
- package/lib/src/components/RadioConsent/index.js +1 -1
- package/lib/src/components/Select/index.js +1 -1
- package/lib/src/components/Step/index.js +1 -1
- package/lib/src/components/Text/index.js +1 -1
- package/lib/src/components/TextAreaField/index.js +1 -1
- package/lib/src/components/TextField/index.js +1 -1
- package/lib/src/components/TextField/index.js.map +1 -1
- package/lib/src/components/Totaliser/index.js +1 -1
- package/lib/src/components/UserBlock/index.js +1 -1
- package/lib/src/hooks/useKey.js +1 -1
- package/lib/src/hooks/useLayoutEffectBrowser.js +1 -1
- package/lib/src/hooks/useScrollPosition.js +1 -1
- package/lib/src/hooks/useScrollPosition.js.map +1 -1
- package/lib/src/types.d.ts +1 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/debounce.js +1 -1
- package/package.json +4 -15
- package/lib/index.css.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/extends.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +0 -1
- package/lib/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -2
- package/lib/node_modules/@babel/runtime/helpers/esm/typeof.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/commands.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/commands.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/constants.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/constants.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusInside.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/focusables.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/focusables.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/return-focus.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/solver.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/array.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/array.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/firstFocus.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/firstFocus.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/is.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/safe.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/safe.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +0 -1
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabbables.js +0 -2
- package/lib/node_modules/focus-lock/dist/es2015/utils/tabbables.js.map +0 -1
- package/lib/node_modules/react-clientside-effect/lib/index.es.js +0 -2
- package/lib/node_modules/react-clientside-effect/lib/index.es.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/index.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/index.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/medium.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/medium.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/scope.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/scope.js.map +0 -1
- package/lib/node_modules/react-focus-lock/dist/es2015/util.js +0 -2
- package/lib/node_modules/react-focus-lock/dist/es2015/util.js.map +0 -1
- package/lib/node_modules/react-intersection-observer/dist/index.js +0 -2
- package/lib/node_modules/react-intersection-observer/dist/index.js.map +0 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -2
- package/lib/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +0 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -2
- package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +0 -1
- package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -2
- package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js.map +0 -1
- package/lib/node_modules/use-sidecar/dist/es2015/medium.js +0 -2
- package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +0 -1
- package/lib/src/components/Carousel/Dots.d.ts +0 -9
- package/lib/src/components/Carousel/Dots.js +0 -2
- package/lib/src/components/Carousel/Dots.js.map +0 -1
- package/lib/src/components/Modal/TestModalWithState.d.ts +0 -4
- package/lib/src/hooks/useEffectBrowser.d.ts +0 -3
- package/lib/src/hooks/useEffectBrowser.js +0 -2
- package/lib/src/hooks/useEffectBrowser.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Trap.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport { moveFocusInside, focusInside, focusIsHidden, expandFocusableNodes, getFocusableNodes, focusNextElement, focusPrevElement, focusFirstElement, focusLastElement, captureFocusRestore } from 'focus-lock';\nimport { deferAction, extractRef } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar tryRestoreFocus = function tryRestoreFocus() {\n return null;\n};\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\nvar windowFocused = false;\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n do {\n var item = allNodes[i];\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n return;\n }\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n return Boolean(focusWasOutsideWindow);\n }\n return focusWasOutsideWindow === 'meanwhile';\n};\nvar checkInHost = function checkInHost(check, el, boundary) {\n return el && (el.host === check && (!el.activeElement || boundary.contains(el.activeElement)) || el.parentNode && checkInHost(check, el.parentNode, boundary));\n};\nvar withinHost = function withinHost(activeElement, workingArea) {\n return workingArea.some(function (area) {\n return checkInHost(activeElement, area, area);\n });\n};\nvar getNodeFocusables = function getNodeFocusables(nodes) {\n return getFocusableNodes(nodes, new Map());\n};\nvar isNotFocusable = function isNotFocusable(node) {\n return !getNodeFocusables([node.parentNode]).some(function (el) {\n return el.node === node;\n });\n};\nvar activateTrap = function activateTrap() {\n var result = false;\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 noFocusGuards = _lastActiveTrap.noFocusGuards;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n if (focusOnBody() && lastActiveFocus && lastActiveFocus !== document.body) {\n if (!document.body.contains(lastActiveFocus) || isNotFocusable(lastActiveFocus)) {\n var newTarget = tryRestoreFocus();\n if (newTarget) {\n newTarget.focus();\n }\n }\n }\n var activeElement = document && document.activeElement;\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n var shouldForceRestoreFocus = function shouldForceRestoreFocus() {\n if (!focusWasOutside(crossFrame) || !noFocusGuards || !lastActiveFocus || windowFocused) {\n return false;\n }\n var nodes = getNodeFocusables(workingArea);\n var lastIndex = nodes.findIndex(function (_ref) {\n var node = _ref.node;\n return node === lastActiveFocus;\n });\n return lastIndex === 0 || lastIndex === nodes.length - 1;\n };\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || shouldForceRestoreFocus() || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !(focusInside(workingArea) || activeElement && withinHost(activeElement, workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n if (activeElement.blur) {\n activeElement.blur();\n }\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus, {\n focusOptions: focusOptions\n });\n lastPortaledElement = {};\n }\n }\n lastActiveFocus = document && document.activeElement;\n if (lastActiveFocus !== document.body) {\n tryRestoreFocus = captureFocusRestore(lastActiveFocus);\n }\n focusWasOutsideWindow = false;\n }\n }\n if (document && activeElement !== document.activeElement && document.querySelector('[data-focus-auto-guard]')) {\n var newActiveElement = document && document.activeElement;\n var allNodes = expandFocusableNodes(workingArea);\n var focusedIndex = allNodes.map(function (_ref2) {\n var node = _ref2.node;\n return node;\n }).indexOf(newActiveElement);\n if (focusedIndex > -1) {\n allNodes.filter(function (_ref3) {\n var guard = _ref3.guard,\n node = _ref3.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref4) {\n var node = _ref4.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 return result;\n};\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n event.stopPropagation();\n event.preventDefault();\n }\n};\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\nvar onFocus = function onFocus(event) {\n var source = event.target;\n var currentNode = event.currentTarget;\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\nvar FocusTrap = function FocusTrap(_ref5) {\n var children = _ref5.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\nvar onWindowFocus = function onWindowFocus() {\n windowFocused = true;\n};\nvar onWindowBlur = function onWindowBlur() {\n windowFocused = false;\n focusWasOutsideWindow = 'just';\n deferAction(function () {\n focusWasOutsideWindow = 'meanwhile';\n });\n};\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('focus', onWindowFocus);\n window.addEventListener('blur', onWindowBlur);\n};\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('focus', onWindowFocus);\n window.removeEventListener('blur', onWindowBlur);\n};\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref6) {\n var disabled = _ref6.disabled;\n return !disabled;\n });\n}\nvar focusLockAPI = {\n moveFocusInside: moveFocusInside,\n focusInside: focusInside,\n focusNextElement: focusNextElement,\n focusPrevElement: focusPrevElement,\n focusFirstElement: focusFirstElement,\n focusLastElement: focusLastElement,\n captureFocusRestore: captureFocusRestore\n};\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation();\n if (!traps.filter(function (_ref7) {\n var id = _ref7.id;\n return id === lastTrap.id;\n }).length) {\n lastTrap.returnFocus(!trap);\n }\n }\n if (trap) {\n lastActiveFocus = null;\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation(focusLockAPI);\n }\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n}\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb(focusLockAPI);\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["focusOnBody","document","activeElement","body","lastActiveTrap","lastActiveFocus","tryRestoreFocus","lastPortaledElement","focusWasOutsideWindow","windowFocused","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","checkInHost","check","el","boundary","host","contains","parentNode","getNodeFocusables","nodes","getFocusableNodes","Map","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","focusOptions","noFocusGuards","workingNode","portaledElement","some","newTarget","focus","workingArea","concat","map","extractRef","filter","Boolean","whiteList","focusWhitelisted","lastIndex","findIndex","_ref","length","shouldForceRestoreFocus","focusIsHidden","focusInside","area","withinHost","blur","moveFocusInside","captureFocusRestore","querySelector","newActiveElement","expandFocusableNodes","focusedIndex","_ref2","indexOf","_ref3","forEach","_ref4","removeAttribute","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowFocus","onWindowBlur","focusLockAPI","focusNextElement","focusPrevElement","focusFirstElement","focusLastElement","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","observerNode","mediumBlur","assignMedium","mediumEffect","cb","FocusTrap","withSideEffect","propsList","_ref6","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref7","returnFocus","onActivation","removeEventListener"],"mappings":"i3BAMA,IAAIA,EAAc,WAChB,OAAOC,UAAYA,SAASC,gBAAkBD,SAASE,IACzD,EAIIC,EAAiB,KACjBC,EAAkB,KAClBC,EAAkB,WACpB,OAAO,IACT,EACIC,EAAsB,KACtBC,GAAwB,EACxBC,GAAgB,EAChBC,EAAmB,WACrB,OAAO,CACT,EAaA,SAASC,EAAUC,EAAYC,EAAKC,EAAMC,GACxC,IAAIC,EAAY,KACZC,EAAIL,EACR,EAAG,CACD,IAAIM,EAAOH,EAASE,GACpB,GAAIC,EAAKC,MACHD,EAAKE,KAAKC,QAAQC,iBACpBN,EAAYE,OAET,KAAIA,EAAKK,SAMd,MALA,GAAIN,IAAML,EACR,OAEFI,EAAY,IAGd,CACF,QAAUC,GAAKH,KAAUD,GACrBG,IACFA,EAAUI,KAAKI,SAAW,EAE9B,CACA,IAMIC,EAAc,SAASA,EAAYC,EAAOC,EAAIC,GAChD,OAAOD,IAAOA,EAAGE,OAASH,KAAWC,EAAGzB,eAAiB0B,EAASE,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CjCzF,EAAkB,KAEtB,EAMe2G,CApFI,WACjB,OAAO,IACT","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createMedium as e,createSidecarMedium as r}from"../../../use-sidecar/dist/es2015/medium.js";var t=e({},function(e){return{target:e.target,currentTarget:e.currentTarget}}),n=e(),s=e(),u=r({async:!0,ssr:"undefined"!=typeof document});export{n as mediumBlur,s as mediumEffect,t as mediumFocus,u as mediumSidecar};
|
|
2
|
-
//# sourceMappingURL=medium.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"medium.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/medium.js"],"sourcesContent":["import { createMedium, createSidecarMedium } from 'use-sidecar';\nexport var mediumFocus = createMedium({}, function (_ref) {\n var target = _ref.target,\n currentTarget = _ref.currentTarget;\n return {\n target: target,\n currentTarget: currentTarget\n };\n});\nexport var mediumBlur = createMedium();\nexport var mediumEffect = createMedium();\nexport var mediumSidecar = createSidecarMedium({\n async: true,\n ssr: typeof document !== 'undefined'\n});"],"names":["mediumFocus","createMedium","_ref","target","currentTarget","mediumBlur","mediumEffect","mediumSidecar","createSidecarMedium","async","ssr","document"],"mappings":"mGACU,IAACA,EAAcC,EAAa,GAAI,SAAUC,GAGlD,MAAO,CACLC,OAHWD,EAAKC,OAIhBC,cAHgBF,EAAKE,cAKzB,GACWC,EAAaJ,IACbK,EAAeL,IACfM,EAAgBC,EAAoB,CAC7CC,OAAO,EACPC,IAAyB,oBAAbC","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/scope.js"],"sourcesContent":["import { createContext } from 'react';\nexport var focusScope = /*#__PURE__*/createContext(undefined);"],"names":["focusScope","createContext","undefined"],"mappings":"sCACU,IAACA,EAA0BC,OAAcC","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/util.js"],"sourcesContent":["export function deferAction(action) {\n setTimeout(action, 1);\n}\nexport var inlineProp = function inlineProp(name, value) {\n var obj = {};\n obj[name] = value;\n return obj;\n};\nexport var extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};"],"names":["deferAction","action","setTimeout","extractRef","ref","current"],"mappings":"AAAO,SAASA,EAAYC,GAC1BC,WAAWD,EAAQ,EACrB,CAMU,IAACE,EAAa,SAAoBC,GAC1C,OAAOA,GAAO,YAAaA,EAAMA,EAAIC,QAAUD,CACjD","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as e from"react";var t=Object.defineProperty,i=(e,i,s)=>((e,i,s)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s)(e,"symbol"!=typeof i?i+"":i,s),s=new Map,n=new WeakMap,o=0;function r(e){return Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{return`${t}_${"root"===t?(i=e.root,i?(n.has(i)||(o+=1,n.set(i,o.toString())),n.get(i)):"0"):e[t]}`;var i}).toString()}function h(e,t,i={},n=undefined){if(void 0===window.IntersectionObserver&&void 0!==n){const s=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof i.threshold?i.threshold:0,time:0,boundingClientRect:s,intersectionRect:s,rootBounds:s}),()=>{}}const{id:o,observer:h,elements:l}=function(e){const t=r(e);let i=s.get(t);if(!i){const n=new Map;let o;const r=new IntersectionObserver(t=>{t.forEach(t=>{var i;const s=t.isIntersecting&&o.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=s),null==(i=n.get(t.target))||i.forEach(e=>{e(s,t)})})},e);o=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),i={id:t,observer:r,elements:n},s.set(t,i)}return i}(i),a=l.get(e)||[];return l.has(e)||l.set(e,a),a.push(t),h.observe(e),function(){a.splice(a.indexOf(t),1),0===a.length&&(l.delete(e),h.unobserve(e)),0===l.size&&(h.disconnect(),s.delete(o))}}var l=class extends e.Component{constructor(e){super(e),i(this,"node",null),i(this,"_unobserveCb",null),i(this,"lastInView"),i(this,"handleNode",e=>{this.node&&(this.unobserve(),e||this.props.triggerOnce||this.props.skip||(this.setState({inView:!!this.props.initialInView,entry:void 0}),this.lastInView=this.props.initialInView)),this.node=e||null,this.observeNode()}),i(this,"handleChange",(e,t)=>{const i=this.lastInView;this.lastInView=e,(void 0!==i||e)&&(e&&this.props.triggerOnce&&this.unobserve(),function(e){return"function"!=typeof e.children}(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t))}),this.state={inView:!!e.initialInView,entry:void 0},this.lastInView=e.initialInView}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(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())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:i,trackVisibility:s,delay:n,fallbackInView:o}=this.props;void 0===this.lastInView&&(this.lastInView=this.props.initialInView),this._unobserveCb=h(this.node,this.handleChange,{threshold:e,root:t,rootMargin:i,trackVisibility:s,delay:n},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:t}=this.props;if("function"==typeof t){const{inView:e,entry:i}=this.state;return t({inView:e,entry:i,ref:this.handleNode})}const{as:i,triggerOnce:s,threshold:n,root:o,rootMargin:r,onChange:h,skip:l,trackVisibility:a,delay:d,initialInView:p,fallbackInView:c,...u}=this.props;return e.createElement(i||"div",{ref:this.handleNode,...u},t)}};export{l as InView,h as observe};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../node_modules/react-intersection-observer/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\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}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a2;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a2 = elements.get(entry.target)) == null ? void 0 : _a2.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const 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 () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"lastInView\");\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n this.lastInView = this.props.initialInView;\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n const previousInView = this.lastInView;\n this.lastInView = inView;\n if (previousInView === void 0 && !inView) {\n return;\n }\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n this.lastInView = props.initialInView;\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\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 componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n if (this.lastInView === void 0) {\n this.lastInView = this.props.initialInView;\n }\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-expect-error\n trackVisibility,\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a2;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const lastInViewRef = React2.useRef(initialInView);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (lastInViewRef.current === void 0) {\n lastInViewRef.current = initialInView;\n }\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n const previousInView = lastInViewRef.current;\n lastInViewRef.current = inView;\n if (previousInView === void 0 && !inView) {\n return;\n }\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-expect-error\n trackVisibility,\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\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 [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a2 = state.entry) == null ? void 0 : _a2.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n lastInViewRef.current = initialInView;\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\n// src/useOnInView.tsx\nimport * as React3 from \"react\";\nvar _a, _b;\nvar useSyncEffect = (_b = (_a = React3.useInsertionEffect) != null ? _a : React3.useLayoutEffect) != null ? _b : React3.useEffect;\nvar useOnInView = (onIntersectionChange, {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n triggerOnce,\n skip\n} = {}) => {\n const onIntersectionChangeRef = React3.useRef(onIntersectionChange);\n const observedElementRef = React3.useRef(null);\n const observerCleanupRef = React3.useRef(void 0);\n const lastInViewRef = React3.useRef(void 0);\n useSyncEffect(() => {\n onIntersectionChangeRef.current = onIntersectionChange;\n }, [onIntersectionChange]);\n return React3.useCallback(\n (element) => {\n const cleanupExisting = () => {\n if (observerCleanupRef.current) {\n const cleanup = observerCleanupRef.current;\n observerCleanupRef.current = void 0;\n cleanup();\n }\n };\n if (element === observedElementRef.current) {\n return observerCleanupRef.current;\n }\n if (!element || skip) {\n cleanupExisting();\n observedElementRef.current = null;\n lastInViewRef.current = void 0;\n return;\n }\n cleanupExisting();\n observedElementRef.current = element;\n let destroyed = false;\n const destroyObserver = observe(\n element,\n (inView, entry) => {\n const previousInView = lastInViewRef.current;\n lastInViewRef.current = inView;\n if (previousInView === void 0 && !inView) {\n return;\n }\n onIntersectionChangeRef.current(\n inView,\n entry\n );\n if (triggerOnce && inView) {\n stopObserving();\n }\n },\n {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay\n }\n );\n function stopObserving() {\n if (destroyed) return;\n destroyed = true;\n destroyObserver();\n observedElementRef.current = null;\n observerCleanupRef.current = void 0;\n lastInViewRef.current = void 0;\n }\n observerCleanupRef.current = stopObserving;\n return observerCleanupRef.current;\n },\n [\n Array.isArray(threshold) ? threshold.toString() : threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n triggerOnce,\n skip\n ]\n );\n};\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView,\n useOnInView\n};\n//# sourceMappingURL=index.mjs.map"],"names":["__defProp","Object","defineProperty","__publicField","obj","key","value","enumerable","configurable","writable","__defNormalProp","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","map","root","has","set","toString","get","observe","element","callback","fallbackInView","unsupportedValue","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","target","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","id","observer","elements","instance","thresholds","entries","forEach","entry","_a2","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","length","delete","unobserve","size","disconnect","InView","React","Component","constructor","props","super","this","node","triggerOnce","skip","setState","initialInView","lastInView","observeNode","previousInView","children","isPlainChildren","onChange","state","componentDidMount","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_unobserveCb","handleChange","render","ref","handleNode","as","createElement"],"mappings":"wBACA,IAAIA,EAAYC,OAAOC,eAEnBC,EAAgB,CAACC,EAAKC,EAAKC,IADT,EAACF,EAAKC,EAAKC,IAAUD,KAAOD,EAAMJ,EAAUI,EAA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AC7C,CACA,MAAMC,GACJA,EAAEtB,YACFA,EAAWtC,UACXA,EAASjB,KACTA,EAAIqE,WACJA,EAAUL,SACVA,EAAQR,KACRA,EAAIvB,gBACJA,EAAeqC,MACfA,EAAKZ,cACLA,EAAalD,eACbA,KACG2C,GACDE,KAAKF,MACT,OAAOH,EAAM8B,cACXD,GAAM,MACN,CAAEF,IAAKtB,KAAKuB,cAAezB,GAC3BW,EAEJ","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assignRef.js","sources":["../../../../../node_modules/use-callback-ref/dist/es2015/assignRef.js"],"sourcesContent":["/**\n * Assigns a value for a given ref, no matter of the ref format\n * @param {RefObject} ref - a callback function or ref object\n * @param value - a new value\n *\n * @see https://github.com/theKashey/use-callback-ref#assignref\n * @example\n * const refObject = useRef();\n * const refFn = (ref) => {....}\n *\n * assignRef(refObject, \"refValue\");\n * assignRef(refFn, \"refValue\");\n */\nexport function assignRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n }\n else if (ref) {\n ref.current = value;\n }\n return ref;\n}\n"],"names":["assignRef","ref","value","current"],"mappings":"AAaO,SAASA,EAAUC,EAAKC,GAO3B,MANmB,mBAARD,EACPA,EAAIC,GAECD,IACLA,EAAIE,QAAUD,GAEXD,CACX","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import*as n from"react";import{assignRef as e}from"./assignRef.js";import{useCallbackRef as r}from"./useRef.js";var t="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,f=new WeakMap;function o(n,o){var u=r(null,function(r){return n.forEach(function(n){return e(n,r)})});return t(function(){var r=f.get(u);if(r){var t=new Set(r),o=new Set(n),a=u.current;t.forEach(function(n){o.has(n)||e(n,null)}),o.forEach(function(n){t.has(n)||e(n,a)})}f.set(u,n)},[n]),u}export{o as useMergeRefs};
|
|
2
|
-
//# sourceMappingURL=useMergeRef.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useMergeRef.js","sources":["../../../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js"],"sourcesContent":["import * as React from 'react';\nimport { assignRef } from './assignRef';\nimport { useCallbackRef } from './useRef';\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar currentValues = new WeakMap();\n/**\n * Merges two or more refs together providing a single interface to set their value\n * @param {RefObject|Ref} refs\n * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}\n *\n * @see {@link mergeRefs} a version without buit-in memoization\n * @see https://github.com/theKashey/use-callback-ref#usemergerefs\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const ownRef = useRef();\n * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together\n * return <div ref={domRef}>...</div>\n * }\n */\nexport function useMergeRefs(refs, defaultValue) {\n var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {\n return refs.forEach(function (ref) { return assignRef(ref, newValue); });\n });\n // handle refs changes - added or removed\n useIsomorphicLayoutEffect(function () {\n var oldValue = currentValues.get(callbackRef);\n if (oldValue) {\n var prevRefs_1 = new Set(oldValue);\n var nextRefs_1 = new Set(refs);\n var current_1 = callbackRef.current;\n prevRefs_1.forEach(function (ref) {\n if (!nextRefs_1.has(ref)) {\n assignRef(ref, null);\n }\n });\n nextRefs_1.forEach(function (ref) {\n if (!prevRefs_1.has(ref)) {\n assignRef(ref, current_1);\n }\n });\n }\n currentValues.set(callbackRef, refs);\n }, [refs]);\n return callbackRef;\n}\n"],"names":["useIsomorphicLayoutEffect","window","React","useLayoutEffect","useEffect","currentValues","WeakMap","useMergeRefs","refs","defaultValue","callbackRef","useCallbackRef","newValue","forEach","ref","assignRef","oldValue","get","prevRefs_1","Set","nextRefs_1","current_1","current","has","set"],"mappings":"gHAGA,IAAIA,EAA8C,oBAAXC,OAAyBC,EAAMC,gBAAkBD,EAAME,UAC1FC,EAAgB,IAAIC,QAejB,SAASC,EAAaC,EAAMC,GAC/B,IAAIC,EAAcC,EAA+B,KAAM,SAAUC,GAC7D,OAAOJ,EAAKK,QAAQ,SAAUC,GAAO,OAAOC,EAAUD,EAAKF,EAAW,EAC1E,GAqBA,OAnBAZ,EAA0B,WACtB,IAAIgB,EAAWX,EAAcY,IAAIP,GACjC,GAAIM,EAAU,CACV,IAAIE,EAAa,IAAIC,IAAIH,GACrBI,EAAa,IAAID,IAAIX,GACrBa,EAAYX,EAAYY,QAC5BJ,EAAWL,QAAQ,SAAUC,GACpBM,EAAWG,IAAIT,IAChBC,EAAUD,EAAK,KAEvB,GACAM,EAAWP,QAAQ,SAAUC,GACpBI,EAAWK,IAAIT,IAChBC,EAAUD,EAAKO,EAEvB,EACJ,CACAhB,EAAcmB,IAAId,EAAaF,EACnC,EAAG,CAACA,IACGE,CACX","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useState as a}from"react";function r(r,e){var c=a(function(){return{value:r,callback:e,facade:{get current(){return c.value},set current(a){var r=c.value;r!==a&&(c.value=a,c.callback(a,r))}}}})[0];return c.callback=e,c.facade}export{r as useCallbackRef};
|
|
2
|
-
//# sourceMappingURL=useRef.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRef.js","sources":["../../../../../node_modules/use-callback-ref/dist/es2015/useRef.js"],"sourcesContent":["import { useState } from 'react';\n/**\n * creates a MutableRef with ref change callback\n * @param initialValue - initial ref value\n * @param {Function} callback - a callback to run when value changes\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n *\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n * @returns {MutableRefObject}\n */\nexport function useCallbackRef(initialValue, callback) {\n var ref = useState(function () { return ({\n // value\n value: initialValue,\n // last callback\n callback: callback,\n // \"memoized\" public interface\n facade: {\n get current() {\n return ref.value;\n },\n set current(value) {\n var last = ref.value;\n if (last !== value) {\n ref.value = value;\n ref.callback(value, last);\n }\n },\n },\n }); })[0];\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n"],"names":["useCallbackRef","initialValue","callback","ref","useState","value","facade","current","last"],"mappings":"iCAeO,SAASA,EAAeC,EAAcC,GACzC,IAAIC,EAAMC,EAAS,WAAc,MAAA,CAE7BC,MAAOJ,EAEPC,SAAUA,EAEVI,OAAQ,CACJ,WAAIC,GACA,OAAOJ,EAAIE,KACf,EACA,WAAIE,CAAQF,GACR,IAAIG,EAAOL,EAAIE,MACXG,IAASH,IACTF,EAAIE,MAAQA,EACZF,EAAID,SAASG,EAAOG,GAE5B,GAEJ,GAAG,GAGP,OADAL,EAAID,SAAWA,EACRC,EAAIG,MACf","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{__assign as n}from"../../../tslib/tslib.es6.js";function r(n){return n}function t(n,t){void 0===t&&(t=r);var u=[],e=!1;return{read:function(){if(e)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return u.length?u[u.length-1]:n},useMedium:function(n){var r=t(n,e);return u.push(r),function(){u=u.filter(function(n){return n!==r})}},assignSyncMedium:function(n){for(e=!0;u.length;){var r=u;u=[],r.forEach(n)}u={push:function(r){return n(r)},filter:function(){return u}}},assignMedium:function(n){e=!0;var r=[];if(u.length){var t=u;u=[],t.forEach(n),r=u}var i=function(){var t=r;r=[],t.forEach(n)},o=function(){return Promise.resolve().then(i)};o(),u={push:function(n){r.push(n),o()},filter:function(n){return r=r.filter(n),u}}}}}function u(n,u){return void 0===u&&(u=r),t(n,u)}function e(r){void 0===r&&(r={});var u=t(null);return u.options=n({async:!0,ssr:!1},r),u}export{u as createMedium,e as createSidecarMedium};
|
|
2
|
-
//# sourceMappingURL=medium.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"medium.js","sources":["../../../../../node_modules/use-sidecar/dist/es2015/medium.js"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","buffer","assigned","read","Error","length","useMedium","data","item","push","filter","x","assignSyncMedium","cb","cbs","forEach","assignMedium","pendingQueue","executeQueue","cycle","Promise","resolve","then","createMedium","createSidecarMedium","options","medium","__assign","async","ssr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IAAIC,EAAS5B,EAAkB,MAE/B,OADA4B,EAAOD,QAAUE,EAAS,CAAEC,OAAO,EAAMC,KAAK,GAASJ,GAChDC,CACX","x_google_ignoreList":[0]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare const Dots: ({ count, currentPosition, scrollToPosition, next, previous, }: {
|
|
3
|
-
count: number;
|
|
4
|
-
currentPosition: number;
|
|
5
|
-
scrollToPosition: (to: number) => void;
|
|
6
|
-
next: () => void;
|
|
7
|
-
previous: () => void;
|
|
8
|
-
}) => React.JSX.Element;
|
|
9
|
-
export default Dots;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"react";import{faCaretLeft as a,faCaretRight as n}from"../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";import{IconFa as t}from"../IconFa/index.js";var r=function(r){var o=r.count,c=r.currentPosition,l=void 0===c?0:c,s=r.scrollToPosition,i=r.next,m=r.previous,u=l!==o-1,d=0!==l,f=Array.from({length:o},function(e,a){return"arrayIndex".concat(a)});return e.createElement("div",{className:"button-wrapper"},e.createElement("button",{className:"carousel-button",disabled:!d,"aria-label":"previous",onClick:function(){m()}},e.createElement("span",{className:"vertical-align"},e.createElement(t,{faIcon:a,size:"1.25em"}),e.createElement("span",{className:"screen-reader-only"},"Scroll carousel to previous index"))),e.createElement("div",{className:"dot-container","data-count":o},f.map(function(a,n){var t=n===l;return e.createElement("button",{className:"dot",key:a,role:"switch","aria-checked":t,onClick:function(){s(n)}},e.createElement("span",{className:"screen-reader-only"},"Scroll carousel to index ".concat(n)))})),e.createElement("button",{className:"carousel-button",disabled:!u,"aria-label":"next",onClick:function(){i()}},e.createElement("span",{className:"vertical-align"},e.createElement(t,{faIcon:n,size:"1.25em"}),e.createElement("span",{className:"screen-reader-only"},"Scroll carousel to next index"))))};export{r as Dots,r as default};
|
|
2
|
-
//# sourceMappingURL=Dots.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dots.js","sources":["../../../../src/components/Carousel/Dots.tsx"],"sourcesContent":["import React from \"react\";\nimport { faCaretLeft, faCaretRight } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { IconFa } from \"../IconFa\";\n\nexport const Dots = ({\n count,\n currentPosition = 0,\n scrollToPosition,\n next,\n previous,\n}: {\n count: number;\n currentPosition: number;\n scrollToPosition: (to: number) => void;\n next: () => void;\n previous: () => void;\n}) => {\n const moreOnRight = currentPosition !== count - 1;\n const moreOnLeft = currentPosition !== 0;\n const countArray = Array.from({ length: count }, (e, i) => `arrayIndex${i}`);\n\n return (\n <div className=\"button-wrapper\">\n <button\n className=\"carousel-button\"\n disabled={!moreOnLeft}\n aria-label=\"previous\"\n onClick={() => {\n previous();\n }}\n >\n <span className=\"vertical-align\">\n <IconFa faIcon={faCaretLeft} size=\"1.25em\" />\n <span className=\"screen-reader-only\">\n Scroll carousel to previous index\n </span>\n </span>\n </button>\n\n <div className=\"dot-container\" data-count={count}>\n {countArray.map((item, index) => {\n const isChecked = index === currentPosition;\n const scrollTo = () => {\n scrollToPosition(index);\n };\n return (\n <button\n className=\"dot\"\n key={item}\n role=\"switch\"\n aria-checked={isChecked}\n onClick={scrollTo}\n >\n <span className=\"screen-reader-only\">{`Scroll carousel to index ${index}`}</span>\n </button>\n );\n })}\n </div>\n\n <button\n className=\"carousel-button\"\n disabled={!moreOnRight}\n aria-label=\"next\"\n onClick={() => {\n next();\n }}\n >\n <span className=\"vertical-align\">\n <IconFa faIcon={faCaretRight} size=\"1.25em\" />\n <span className=\"screen-reader-only\">\n Scroll carousel to next index\n </span>\n </span>\n </button>\n </div>\n );\n};\n\nexport default Dots;\n"],"names":["Dots","_a","count","_b","currentPosition","scrollToPosition","next","previous","moreOnRight","moreOnLeft","countArray","Array","from","length","e","i","concat","React","createElement","className","disabled","onClick","IconFa","faIcon","faCaretLeft","size","map","item","index","isChecked","key","role","faCaretRight"],"mappings":"kLAKO,IAAMA,EAAO,SAACC,GACnB,IAAAC,UACAC,EAAAF,EAAAG,gBAAAA,aAAkB,EAACD,EACnBE,qBACAC,EAAIL,EAAAK,KACJC,EAAQN,EAAAM,SAQFC,EAAcJ,IAAoBF,EAAQ,EAC1CO,EAAiC,IAApBL,EACbM,EAAaC,MAAMC,KAAK,CAAEC,OAAQX,GAAS,SAACY,EAAGC,GAAM,MAAA,aAAAC,OAAaD,EAAb,GAE3D,OACEE,EAAAC,cAAA,MAAA,CAAKC,UAAU,kBACbF,EAAAC,cAAA,SAAA,CACEC,UAAU,kBACVC,UAAWX,EAAU,aACV,WACXY,QAAS,WACPd,GACF,GAEAU,EAAAC,cAAA,OAAA,CAAMC,UAAU,kBACdF,EAAAC,cAACI,GAAOC,OAAQC,EAAaC,KAAK,WAClCR,EAAAC,cAAA,OAAA,CAAMC,UAAU,sBAAoB,uCAMxCF,EAAAC,cAAA,MAAA,CAAKC,UAAU,gBAAe,aAAajB,GACxCQ,EAAWgB,IAAI,SAACC,EAAMC,GACrB,IAAMC,EAAYD,IAAUxB,EAI5B,OACEa,EAAAC,cAAA,SAAA,CACEC,UAAU,MACVW,IAAKH,EACLI,KAAK,SAAQ,eACCF,EACdR,QATa,WACfhB,EAAiBuB,EACnB,GASIX,EAAAC,cAAA,OAAA,CAAMC,UAAU,sBAAsB,4BAAAH,OAA4BY,IAGxE,IAGFX,EAAAC,cAAA,SAAA,CACEC,UAAU,kBACVC,UAAWZ,EAAW,aACX,OACXa,QAAS,WACPf,GACF,GAEAW,EAAAC,cAAA,OAAA,CAAMC,UAAU,kBACdF,EAAAC,cAACI,GAAOC,OAAQS,EAAcP,KAAK,WACnCR,EAAAC,cAAA,OAAA,CAAMC,UAAU,sBAAoB,mCAO9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEffectBrowser.js","sources":["../../../src/hooks/useEffectBrowser.ts"],"sourcesContent":["import { useEffect, type EffectCallback, type DependencyList } from \"react\";\n\n// this is a useEffect hook which automatically checks if the code is running\n// in the browser before executing the action\nexport function useEffectBrowser(action: EffectCallback, deps: DependencyList) {\n useEffect(() => {\n if (typeof window === `undefined`) return;\n return action();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [deps]);\n}\n\nexport default useEffectBrowser;\n"],"names":["useEffectBrowser","action","deps","useEffect","window"],"mappings":"kCAIM,SAAUA,EAAiBC,EAAwBC,GACvDC,EAAU,WACR,GAAsB,oBAAXC,OACX,OAAOH,GAET,EAAG,CAACC,GACN"}
|