@cruk/cruk-react-components 7.1.5 → 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.
Files changed (147) hide show
  1. package/lib/index.css +152 -398
  2. package/lib/src/components/AddressLookup/index.js +1 -1
  3. package/lib/src/components/AddressLookup/index.js.map +1 -1
  4. package/lib/src/components/Avatar/index.js +1 -1
  5. package/lib/src/components/Badge/index.js +1 -1
  6. package/lib/src/components/Box/index.js +1 -1
  7. package/lib/src/components/Carousel/index.js +1 -1
  8. package/lib/src/components/Carousel/index.js.map +1 -1
  9. package/lib/src/components/Checkbox/index.js +1 -1
  10. package/lib/src/components/Collapse/index.js +1 -1
  11. package/lib/src/components/DateField/index.js +1 -1
  12. package/lib/src/components/DateField/index.js.map +1 -1
  13. package/lib/src/components/ErrorText/index.js +1 -1
  14. package/lib/src/components/Footer/index.js +1 -1
  15. package/lib/src/components/Header/index.js +1 -1
  16. package/lib/src/components/Header/index.js.map +1 -1
  17. package/lib/src/components/Heading/index.js +1 -1
  18. package/lib/src/components/IconFa/index.js +1 -1
  19. package/lib/src/components/InfoBox/index.js +1 -1
  20. package/lib/src/components/LabelWrapper/index.js +1 -1
  21. package/lib/src/components/LegendWrapper/index.js +1 -1
  22. package/lib/src/components/Link/index.js +1 -1
  23. package/lib/src/components/Loader/index.js +1 -1
  24. package/lib/src/components/Modal/TestModalWithContent.d.ts +1 -3
  25. package/lib/src/components/Modal/TestModalWithOpenButton.d.ts +3 -0
  26. package/lib/src/components/Modal/index.d.ts +6 -3
  27. package/lib/src/components/Modal/index.js +1 -1
  28. package/lib/src/components/Modal/index.js.map +1 -1
  29. package/lib/src/components/Pagination/index.js +1 -1
  30. package/lib/src/components/PopOver/index.d.ts +4 -8
  31. package/lib/src/components/PopOver/index.js +1 -1
  32. package/lib/src/components/PopOver/index.js.map +1 -1
  33. package/lib/src/components/ProgressBar/index.js +1 -1
  34. package/lib/src/components/RadioConsent/index.js +1 -1
  35. package/lib/src/components/Select/index.js +1 -1
  36. package/lib/src/components/Step/index.js +1 -1
  37. package/lib/src/components/Text/index.js +1 -1
  38. package/lib/src/components/TextAreaField/index.js +1 -1
  39. package/lib/src/components/TextField/index.js +1 -1
  40. package/lib/src/components/Totaliser/index.js +1 -1
  41. package/lib/src/components/UserBlock/index.js +1 -1
  42. package/lib/src/hooks/useKey.js +1 -1
  43. package/lib/src/hooks/useLayoutEffectBrowser.js +1 -1
  44. package/lib/src/hooks/useScrollPosition.js +1 -1
  45. package/lib/src/hooks/useScrollPosition.js.map +1 -1
  46. package/lib/src/types.d.ts +1 -1
  47. package/lib/src/types.js.map +1 -1
  48. package/lib/src/utils/debounce.js +1 -1
  49. package/package.json +4 -15
  50. package/lib/index.css.map +0 -1
  51. package/lib/node_modules/@babel/runtime/helpers/esm/defineProperty.js +0 -2
  52. package/lib/node_modules/@babel/runtime/helpers/esm/defineProperty.js.map +0 -1
  53. package/lib/node_modules/@babel/runtime/helpers/esm/extends.js +0 -2
  54. package/lib/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
  55. package/lib/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -2
  56. package/lib/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +0 -1
  57. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -2
  58. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
  59. package/lib/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -2
  60. package/lib/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
  61. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +0 -2
  62. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +0 -1
  63. package/lib/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +0 -2
  64. package/lib/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js.map +0 -1
  65. package/lib/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -2
  66. package/lib/node_modules/@babel/runtime/helpers/esm/typeof.js.map +0 -1
  67. package/lib/node_modules/focus-lock/dist/es2015/commands.js +0 -2
  68. package/lib/node_modules/focus-lock/dist/es2015/commands.js.map +0 -1
  69. package/lib/node_modules/focus-lock/dist/es2015/constants.js +0 -2
  70. package/lib/node_modules/focus-lock/dist/es2015/constants.js.map +0 -1
  71. package/lib/node_modules/focus-lock/dist/es2015/focusInside.js +0 -2
  72. package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +0 -1
  73. package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js +0 -2
  74. package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +0 -1
  75. package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js +0 -2
  76. package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js.map +0 -1
  77. package/lib/node_modules/focus-lock/dist/es2015/focusables.js +0 -2
  78. package/lib/node_modules/focus-lock/dist/es2015/focusables.js.map +0 -1
  79. package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js +0 -2
  80. package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +0 -1
  81. package/lib/node_modules/focus-lock/dist/es2015/return-focus.js +0 -2
  82. package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +0 -1
  83. package/lib/node_modules/focus-lock/dist/es2015/sibling.js +0 -2
  84. package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +0 -1
  85. package/lib/node_modules/focus-lock/dist/es2015/solver.js +0 -2
  86. package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +0 -1
  87. package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js +0 -2
  88. package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +0 -1
  89. package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js +0 -2
  90. package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js.map +0 -1
  91. package/lib/node_modules/focus-lock/dist/es2015/utils/array.js +0 -2
  92. package/lib/node_modules/focus-lock/dist/es2015/utils/array.js.map +0 -1
  93. package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js +0 -2
  94. package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +0 -1
  95. package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js +0 -2
  96. package/lib/node_modules/focus-lock/dist/es2015/utils/correctFocus.js.map +0 -1
  97. package/lib/node_modules/focus-lock/dist/es2015/utils/firstFocus.js +0 -2
  98. package/lib/node_modules/focus-lock/dist/es2015/utils/firstFocus.js.map +0 -1
  99. package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js +0 -2
  100. package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +0 -1
  101. package/lib/node_modules/focus-lock/dist/es2015/utils/is.js +0 -2
  102. package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +0 -1
  103. package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js +0 -2
  104. package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +0 -1
  105. package/lib/node_modules/focus-lock/dist/es2015/utils/safe.js +0 -2
  106. package/lib/node_modules/focus-lock/dist/es2015/utils/safe.js.map +0 -1
  107. package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js +0 -2
  108. package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +0 -1
  109. package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js +0 -2
  110. package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +0 -1
  111. package/lib/node_modules/focus-lock/dist/es2015/utils/tabbables.js +0 -2
  112. package/lib/node_modules/focus-lock/dist/es2015/utils/tabbables.js.map +0 -1
  113. package/lib/node_modules/react-clientside-effect/lib/index.es.js +0 -2
  114. package/lib/node_modules/react-clientside-effect/lib/index.es.js.map +0 -1
  115. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js +0 -2
  116. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +0 -1
  117. package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js +0 -2
  118. package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js.map +0 -1
  119. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js +0 -2
  120. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +0 -1
  121. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js +0 -2
  122. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +0 -1
  123. package/lib/node_modules/react-focus-lock/dist/es2015/index.js +0 -2
  124. package/lib/node_modules/react-focus-lock/dist/es2015/index.js.map +0 -1
  125. package/lib/node_modules/react-focus-lock/dist/es2015/medium.js +0 -2
  126. package/lib/node_modules/react-focus-lock/dist/es2015/medium.js.map +0 -1
  127. package/lib/node_modules/react-focus-lock/dist/es2015/scope.js +0 -2
  128. package/lib/node_modules/react-focus-lock/dist/es2015/scope.js.map +0 -1
  129. package/lib/node_modules/react-focus-lock/dist/es2015/util.js +0 -2
  130. package/lib/node_modules/react-focus-lock/dist/es2015/util.js.map +0 -1
  131. package/lib/node_modules/react-intersection-observer/dist/index.js +0 -2
  132. package/lib/node_modules/react-intersection-observer/dist/index.js.map +0 -1
  133. package/lib/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -2
  134. package/lib/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +0 -1
  135. package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -2
  136. package/lib/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +0 -1
  137. package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -2
  138. package/lib/node_modules/use-callback-ref/dist/es2015/useRef.js.map +0 -1
  139. package/lib/node_modules/use-sidecar/dist/es2015/medium.js +0 -2
  140. package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +0 -1
  141. package/lib/src/components/Carousel/Dots.d.ts +0 -9
  142. package/lib/src/components/Carousel/Dots.js +0 -2
  143. package/lib/src/components/Carousel/Dots.js.map +0 -1
  144. package/lib/src/components/Modal/TestModalWithState.d.ts +0 -4
  145. package/lib/src/hooks/useEffectBrowser.d.ts +0 -3
  146. package/lib/src/hooks/useEffectBrowser.js +0 -2
  147. package/lib/src/hooks/useEffectBrowser.js.map +0 -1
@@ -1,2 +0,0 @@
1
- function n(n){setTimeout(n,1)}var r=function(n){return n&&"current"in n?n.current:n};export{n as deferAction,r as extractRef};
2
- //# sourceMappingURL=util.js.map
@@ -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":"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","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
1
- function n(n,t){return"function"==typeof n?n(t):n&&(n.current=t),n}export{n as assignRef};
2
- //# sourceMappingURL=assignRef.js.map
@@ -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"],"mappings":"uDACA,SAASA,EAAKC,GACV,OAAOA,CACX,CACA,SAASC,EAAkBC,EAAUC,QACd,IAAfA,IAAyBA,EAAaJ,GAC1C,IAAIK,EAAS,GACTC,GAAW,EA0Df,MAzDa,CACTC,KAAM,WACF,GAAID,EACA,MAAM,IAAIE,MAAM,oGAEpB,OAAIH,EAAOI,OACAJ,EAAOA,EAAOI,OAAS,GAE3BN,CACX,EACAO,UAAW,SAAUC,GACjB,IAAIC,EAAOR,EAAWO,EAAML,GAE5B,OADAD,EAAOQ,KAAKD,GACL,WACHP,EAASA,EAAOS,OAAO,SAAUC,GAAK,OAAOA,IAAMH,CAAM,EAC7D,CACJ,EACAI,iBAAkB,SAAUC,GAExB,IADAX,GAAW,EACJD,EAAOI,QAAQ,CAClB,IAAIS,EAAMb,EACVA,EAAS,GACTa,EAAIC,QAAQF,EAChB,CACAZ,EAAS,CACLQ,KAAM,SAAUE,GAAK,OAAOE,EAAGF,EAAI,EACnCD,OAAQ,WAAc,OAAOT,CAAQ,EAE7C,EACAe,aAAc,SAAUH,GACpBX,GAAW,EACX,IAAIe,EAAe,GACnB,GAAIhB,EAAOI,OAAQ,CACf,IAAIS,EAAMb,EACVA,EAAS,GACTa,EAAIC,QAAQF,GACZI,EAAehB,CACnB,CACA,IAAIiB,EAAe,WACf,IAAIJ,EAAMG,EACVA,EAAe,GACfH,EAAIC,QAAQF,EAChB,EACIM,EAAQ,WAAc,OAAOC,QAAQC,UAAUC,KAAKJ,EAAe,EACvEC,IACAlB,EAAS,CACLQ,KAAM,SAAUE,GACZM,EAAaR,KAAKE,GAClBQ,GACJ,EACAT,OAAQ,SAAUA,GAEd,OADAO,EAAeA,EAAaP,OAAOA,GAC5BT,CACX,EAER,EAGR,CACO,SAASsB,EAAaxB,EAAUC,GAEnC,YADmB,IAAfA,IAAyBA,EAAaJ,GACnCE,EAAkBC,EAAUC,EACvC,CAEO,SAASwB,EAAoBC,QAChB,IAAZA,IAAsBA,EAAU,CAAA,GACpC,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,4 +0,0 @@
1
- import React from "react";
2
- export declare function TestModalWithState({ themeName }: {
3
- themeName: string;
4
- }): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import { type EffectCallback, type DependencyList } from "react";
2
- export declare function useEffectBrowser(action: EffectCallback, deps: DependencyList): void;
3
- export default useEffectBrowser;
@@ -1,2 +0,0 @@
1
- import{useEffect as n}from"react";function t(t,e){n(function(){if("undefined"!=typeof window)return t()},[e])}export{t as default,t as useEffectBrowser};
2
- //# sourceMappingURL=useEffectBrowser.js.map
@@ -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"}