@bigbinary/neetoui 8.2.51 → 8.2.53
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/dist/Pane.js +5 -3
- package/dist/Pane.js.map +1 -1
- package/dist/ProgressBar.js +1 -0
- package/dist/ProgressBar.js.map +1 -1
- package/dist/cjs/Pane.js +5 -3
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/ProgressBar.js +1 -0
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/package.json +1 -1
package/dist/Pane.js
CHANGED
|
@@ -68,11 +68,13 @@ var getHeader = function getHeader(paneWrapperRef) {
|
|
|
68
68
|
return paneWrapperRef.current.querySelector(".neeto-ui-pane__header");
|
|
69
69
|
};
|
|
70
70
|
var updateHeaderHeight = function updateHeaderHeight(header, paneWrapperRef) {
|
|
71
|
-
var headerHeight = header.offsetHeight;
|
|
71
|
+
var headerHeight = header === null || header === void 0 ? void 0 : header.offsetHeight;
|
|
72
72
|
if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {
|
|
73
|
-
|
|
73
|
+
var _paneWrapperRef$curre;
|
|
74
|
+
(_paneWrapperRef$curre = paneWrapperRef.current) === null || _paneWrapperRef$curre === void 0 || _paneWrapperRef$curre.style.setProperty("--neeto-ui-pane-header-height", "".concat(headerHeight, "px"));
|
|
74
75
|
} else {
|
|
75
|
-
|
|
76
|
+
var _paneWrapperRef$curre2;
|
|
77
|
+
(_paneWrapperRef$curre2 = paneWrapperRef.current) === null || _paneWrapperRef$curre2 === void 0 || _paneWrapperRef$curre2.style.removeProperty("--neeto-ui-pane-header-height");
|
|
76
78
|
}
|
|
77
79
|
};
|
|
78
80
|
|
package/dist/Pane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pane.js","sources":["../src/components/Pane/Body.jsx","../src/components/Pane/Footer.jsx","../src/components/Pane/Header.jsx","../src/components/Pane/constants.js","../src/components/Pane/utils.js","../src/components/Pane/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, hasFooter = true }) => (\n <div\n data-cy=\"pane-body\"\n className={classnames(\n \"neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start\",\n {\n \"neeto-ui-pane__body--has-footer\": hasFooter,\n [className]: className,\n }\n )}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify if the Pane has a footer.\n * @default true\n */\n hasFooter: PropTypes.bool,\n /**\n * To specify className to be applied to the Pane Body container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className }) => (\n <div\n className={classnames(\n \"neeto-ui-pane__footer neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Pane Footer container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Header = ({ children, className }) => (\n <div\n className={classnames(\"neeto-ui-pane__header\", className)}\n data-cy=\"pane-header\"\n >\n {children}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * To specify className to be applied to the Pane Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\n","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeader = paneWrapperRef =>\n paneWrapperRef.current.querySelector(\".neeto-ui-pane__header\");\n\nexport const updateHeaderHeight = (header, paneWrapperRef) => {\n const headerHeight = header.offsetHeight;\n\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapperRef.current.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n } else {\n paneWrapperRef.current.style.removeProperty(\n \"--neeto-ui-pane-header-height\"\n );\n }\n};\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlay, useOverlayManager } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeader, updateHeaderHeight } from \"./utils\";\n\nconst SIZES = { small: \"small\", large: \"large\" };\n\nconst Pane = ({\n size = SIZES.small,\n isOpen = false,\n onClose = () => {},\n children,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const paneWrapperRef = useRef(null);\n const backdropRef = useRef(null);\n\n const observerRef = useRef(\n new ResizeObserver(([entry]) =>\n updateHeaderHeight(entry.target, paneWrapperRef)\n )\n );\n\n useOverlayManager(paneWrapperRef, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapperRef,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return undefined;\n\n const header = getHeader(paneWrapperRef);\n if (!header) return undefined;\n\n const observer = observerRef.current;\n observer.observe(header);\n\n return () => observer.disconnect();\n }, [hasTransitionCompleted]);\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-pane\"\n in={isOpen}\n timeout={230}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"pane-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end\",\n backdropClassName\n )}\n >\n <div\n data-cy=\"pane-wrapper\"\n key=\"pane-wrapper\"\n ref={paneWrapperRef}\n className={classnames(\"neeto-ui-pane__wrapper\", {\n \"neeto-ui-pane__wrapper--small\": size === SIZES.small,\n \"neeto-ui-pane__wrapper--large\": size === SIZES.large,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-pane__close\"\n data-cy=\"pane-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n onClick={handleOverlayClose}\n />\n )}\n {hasTransitionCompleted && (\n <>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </>\n )}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nPane.propTypes = {\n /**\n * To specify the size of the Pane.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Pane component is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the close button of Pane is clicked.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Pane component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classname to the Pane component.\n */\n className: PropTypes.string,\n /**\n * To specify whether the Pane component should close on esc key press.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Pane component should render close button.\n */\n closeButton: PropTypes.bool,\n /**\n * To specify the classname to be applied to the backdrop element.\n */\n backdropClassName: PropTypes.string,\n /**\n * To specify whether the Pane component should close on outside click.\n */\n closeOnOutsideClick: PropTypes.bool,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is opened.\n * If not specified, the first focusable element inside the Pane component will be focused.\n * If there are no focusable elements, the Pane component itself will be focused.\n */\n initialFocusRef: PropTypes.object,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is closed.\n * If not specified, the element which was focused when the Pane component was opened will be focused.\n */\n finalFocusRef: PropTypes.object,\n};\n\nPane.Header = Header;\nPane.Body = Body;\nPane.Footer = Footer;\n\nexport default Pane;\n"],"names":["Body","_ref","children","className","_ref$hasFooter","hasFooter","React","createElement","classnames","_defineProperty","Footer","Header","DEFAULT_PANE_HEADER_HEIGHT","getHeader","paneWrapperRef","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","style","setProperty","concat","removeProperty","SIZES","small","large","Pane","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","initialFocusRef","finalFocusRef","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","useRef","backdropRef","observerRef","ResizeObserver","_ref2","_ref3","entry","target","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","undefined","observer","observe","disconnect","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","Button","icon","Close","onClick","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CA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mB,GAAA,CAE/B,EACAd,sBAAsB,iBACrB/C,cAAA,CAAAC,aAAA,CAAAD,cAAA,CAAAqF,QAAA,QACG,OAAOzF,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEkE,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BlE,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDD0B,IAAI,CAACjB,MAAM,GAAGA,MAAM,CAAA;AACpBiB,IAAI,CAAC5B,IAAI,GAAGA,IAAI,CAAA;AAChB4B,IAAI,CAAClB,MAAM,GAAGA,MAAM;;;;"}
|
|
1
|
+
{"version":3,"file":"Pane.js","sources":["../src/components/Pane/Body.jsx","../src/components/Pane/Footer.jsx","../src/components/Pane/Header.jsx","../src/components/Pane/constants.js","../src/components/Pane/utils.js","../src/components/Pane/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, hasFooter = true }) => (\n <div\n data-cy=\"pane-body\"\n className={classnames(\n \"neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start\",\n {\n \"neeto-ui-pane__body--has-footer\": hasFooter,\n [className]: className,\n }\n )}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify if the Pane has a footer.\n * @default true\n */\n hasFooter: PropTypes.bool,\n /**\n * To specify className to be applied to the Pane Body container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className }) => (\n <div\n className={classnames(\n \"neeto-ui-pane__footer neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Pane Footer container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Header = ({ children, className }) => (\n <div\n className={classnames(\"neeto-ui-pane__header\", className)}\n data-cy=\"pane-header\"\n >\n {children}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * To specify className to be applied to the Pane Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\n","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeader = paneWrapperRef =>\n paneWrapperRef.current.querySelector(\".neeto-ui-pane__header\");\n\nexport const updateHeaderHeight = (header, paneWrapperRef) => {\n const headerHeight = header?.offsetHeight;\n\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapperRef.current?.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n } else {\n paneWrapperRef.current?.style.removeProperty(\n \"--neeto-ui-pane-header-height\"\n );\n }\n};\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlay, useOverlayManager } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeader, updateHeaderHeight } from \"./utils\";\n\nconst SIZES = { small: \"small\", large: \"large\" };\n\nconst Pane = ({\n size = SIZES.small,\n isOpen = false,\n onClose = () => {},\n children,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const paneWrapperRef = useRef(null);\n const backdropRef = useRef(null);\n\n const observerRef = useRef(\n new ResizeObserver(([entry]) =>\n updateHeaderHeight(entry.target, paneWrapperRef)\n )\n );\n\n useOverlayManager(paneWrapperRef, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapperRef,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return undefined;\n\n const header = getHeader(paneWrapperRef);\n if (!header) return undefined;\n\n const observer = observerRef.current;\n observer.observe(header);\n\n return () => observer.disconnect();\n }, [hasTransitionCompleted]);\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-pane\"\n in={isOpen}\n timeout={230}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"pane-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end\",\n backdropClassName\n )}\n >\n <div\n data-cy=\"pane-wrapper\"\n key=\"pane-wrapper\"\n ref={paneWrapperRef}\n className={classnames(\"neeto-ui-pane__wrapper\", {\n \"neeto-ui-pane__wrapper--small\": size === SIZES.small,\n \"neeto-ui-pane__wrapper--large\": size === SIZES.large,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-pane__close\"\n data-cy=\"pane-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n onClick={handleOverlayClose}\n />\n )}\n {hasTransitionCompleted && (\n <>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </>\n )}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nPane.propTypes = {\n /**\n * To specify the size of the Pane.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Pane component is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the close button of Pane is clicked.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Pane component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classname to the Pane component.\n */\n className: PropTypes.string,\n /**\n * To specify whether the Pane component should close on esc key press.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Pane component should render close button.\n */\n closeButton: PropTypes.bool,\n /**\n * To specify the classname to be applied to the backdrop element.\n */\n backdropClassName: PropTypes.string,\n /**\n * To specify whether the Pane component should close on outside click.\n */\n closeOnOutsideClick: PropTypes.bool,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is opened.\n * If not specified, the first focusable element inside the Pane component will be focused.\n * If there are no focusable elements, the Pane component itself will be focused.\n */\n initialFocusRef: PropTypes.object,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is closed.\n * If not specified, the element which was focused when the Pane component was opened will be focused.\n */\n finalFocusRef: PropTypes.object,\n};\n\nPane.Header = Header;\nPane.Body = Body;\nPane.Footer = Footer;\n\nexport default Pane;\n"],"names":["Body","_ref","children","className","_ref$hasFooter","hasFooter","React","createElement","classnames","_defineProperty","Footer","Header","DEFAULT_PANE_HEADER_HEIGHT","getHeader","paneWrapperRef","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre","style","setProperty","concat","_paneWrapperRef$curre2","removeProperty","SIZES","small","large","Pane","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","initialFocusRef","finalFocusRef","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","useRef","backdropRef","observerRef","ResizeObserver","_ref2","_ref3","entry","target","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","undefined","observer","observe","disconnect","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","Button","icon","Close","onClick","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA,CAAA;EAAA,oBACnDE,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,WAAW;AACnBJ,IAAAA,SAAS,EAAEK,UAAU,CACnB,iGAAiG,EAAAC,eAAA,CAAA;AAE/F,MAAA,iCAAiC,EAAEJ,SAAAA;KAClCF,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;AAExB,GAAA,EAEDD,QAAQ,CACL,CAAA;AAAA,CACP;;ACbD,IAAMQ,MAAM,GAAG,SAATA,MAAMA,CAAAT,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS,CAAA;EAAA,oBACnCG,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,UAAU,CACnB,2DAA2D,EAC3DL,SAAS,CAAA;AACT,GAAA,EAEDD,QAAQ,CACL,CAAA;AAAA,CACP;;ACTD,IAAMS,MAAM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B8B,IAAI,CAACpB,MAAM,GAAGA,MAAM;;;;"}
|
package/dist/ProgressBar.js
CHANGED
package/dist/ProgressBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../src/components/ProgressBar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport propTypes from \"prop-types\";\n\nconst ProgressBar = ({ progressPercentage, progressValue, className = \"\" }) => (\n <div\n className={classNames([\n \"neeto-ui-progress-bar__wrapper neeto-ui-rounded-full\",\n className,\n ])}\n >\n <motion.div\n animate={{ width: `${progressPercentage}%` }}\n className=\"neeto-ui-progress-bar neeto-ui-rounded-full\"\n initial={{ width: 0 }}\n transition={{ duration: 0.5, ease: \"easeInOut\" }}\n >\n {progressValue ?? `${progressPercentage}%`}\n </motion.div>\n </div>\n);\n\nProgressBar.propTypes = {\n /**\n * To specify the value to be used as the width of the progress bar.\n */\n progressPercentage: propTypes.number,\n /**\n * To specify the progress value to be displayed on the progress bar as text.\n */\n progressValue: propTypes.string,\n /**\n * To specify external classnames as overrides to the ProgressBar component.\n */\n className: propTypes.string,\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","_ref","progressPercentage","progressValue","_ref$className","className","React","createElement","classNames","motion","div","animate","width","concat","initial","transition","duration","ease"],"mappings":";;;;AAMA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,kBAAkB,GAAAD,IAAA,CAAlBC,kBAAkB;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,oBACtEE,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEF,IAAAA,SAAS,EAAEG,UAAU,CAAC,CACpB,sDAAsD,EACtDH,SAAS,CACV,CAAA;AAAE,GAAA,eAEHC,cAAA,CAAAC,aAAA,CAACE,MAAM,CAACC,GAAG,EAAA;AACTC,IAAAA,OAAO,EAAE;MAAEC,KAAK,EAAA,EAAA,CAAAC,MAAA,CAAKX,kBAAkB,EAAA,GAAA,CAAA;KAAM;AAC7CG,IAAAA,SAAS,EAAC,6CAA6C;
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":["../src/components/ProgressBar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport propTypes from \"prop-types\";\n\nconst ProgressBar = ({ progressPercentage, progressValue, className = \"\" }) => (\n <div\n className={classNames([\n \"neeto-ui-progress-bar__wrapper neeto-ui-rounded-full\",\n className,\n ])}\n >\n <motion.div\n animate={{ width: `${progressPercentage}%` }}\n className=\"neeto-ui-progress-bar neeto-ui-rounded-full\"\n data-cy=\"progress-bar\"\n initial={{ width: 0 }}\n transition={{ duration: 0.5, ease: \"easeInOut\" }}\n >\n {progressValue ?? `${progressPercentage}%`}\n </motion.div>\n </div>\n);\n\nProgressBar.propTypes = {\n /**\n * To specify the value to be used as the width of the progress bar.\n */\n progressPercentage: propTypes.number,\n /**\n * To specify the progress value to be displayed on the progress bar as text.\n */\n progressValue: propTypes.string,\n /**\n * To specify external classnames as overrides to the ProgressBar component.\n */\n className: propTypes.string,\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","_ref","progressPercentage","progressValue","_ref$className","className","React","createElement","classNames","motion","div","animate","width","concat","initial","transition","duration","ease"],"mappings":";;;;AAMA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,kBAAkB,GAAAD,IAAA,CAAlBC,kBAAkB;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,oBACtEE,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEF,IAAAA,SAAS,EAAEG,UAAU,CAAC,CACpB,sDAAsD,EACtDH,SAAS,CACV,CAAA;AAAE,GAAA,eAEHC,cAAA,CAAAC,aAAA,CAACE,MAAM,CAACC,GAAG,EAAA;AACTC,IAAAA,OAAO,EAAE;MAAEC,KAAK,EAAA,EAAA,CAAAC,MAAA,CAAKX,kBAAkB,EAAA,GAAA,CAAA;KAAM;AAC7CG,IAAAA,SAAS,EAAC,6CAA6C;AACvD,IAAA,SAAA,EAAQ,cAAc;AACtBS,IAAAA,OAAO,EAAE;AAAEF,MAAAA,KAAK,EAAE,CAAA;KAAI;AACtBG,IAAAA,UAAU,EAAE;AAAEC,MAAAA,QAAQ,EAAE,GAAG;AAAEC,MAAAA,IAAI,EAAE,WAAA;AAAY,KAAA;GAE9Cd,EAAAA,aAAa,KAAbA,IAAAA,IAAAA,aAAa,KAAbA,KAAAA,CAAAA,GAAAA,aAAa,MAAAU,MAAA,CAAOX,kBAAkB,EAAA,GAAA,CAAA,CAC5B,CACT,CAAA;AAAA;;;;"}
|
package/dist/cjs/Pane.js
CHANGED
|
@@ -70,11 +70,13 @@ var getHeader = function getHeader(paneWrapperRef) {
|
|
|
70
70
|
return paneWrapperRef.current.querySelector(".neeto-ui-pane__header");
|
|
71
71
|
};
|
|
72
72
|
var updateHeaderHeight = function updateHeaderHeight(header, paneWrapperRef) {
|
|
73
|
-
var headerHeight = header.offsetHeight;
|
|
73
|
+
var headerHeight = header === null || header === void 0 ? void 0 : header.offsetHeight;
|
|
74
74
|
if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {
|
|
75
|
-
|
|
75
|
+
var _paneWrapperRef$curre;
|
|
76
|
+
(_paneWrapperRef$curre = paneWrapperRef.current) === null || _paneWrapperRef$curre === void 0 || _paneWrapperRef$curre.style.setProperty("--neeto-ui-pane-header-height", "".concat(headerHeight, "px"));
|
|
76
77
|
} else {
|
|
77
|
-
|
|
78
|
+
var _paneWrapperRef$curre2;
|
|
79
|
+
(_paneWrapperRef$curre2 = paneWrapperRef.current) === null || _paneWrapperRef$curre2 === void 0 || _paneWrapperRef$curre2.style.removeProperty("--neeto-ui-pane-header-height");
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
82
|
|
package/dist/cjs/Pane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pane.js","sources":["../../src/components/Pane/Body.jsx","../../src/components/Pane/Footer.jsx","../../src/components/Pane/Header.jsx","../../src/components/Pane/constants.js","../../src/components/Pane/utils.js","../../src/components/Pane/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, hasFooter = true }) => (\n <div\n data-cy=\"pane-body\"\n className={classnames(\n \"neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start\",\n {\n \"neeto-ui-pane__body--has-footer\": hasFooter,\n [className]: className,\n }\n )}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify if the Pane has a footer.\n * @default true\n */\n hasFooter: PropTypes.bool,\n /**\n * To specify className to be applied to the Pane Body container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className }) => (\n <div\n className={classnames(\n \"neeto-ui-pane__footer neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Pane Footer container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Header = ({ children, className }) => (\n <div\n className={classnames(\"neeto-ui-pane__header\", className)}\n data-cy=\"pane-header\"\n >\n {children}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * To specify className to be applied to the Pane Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\n","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeader = paneWrapperRef =>\n paneWrapperRef.current.querySelector(\".neeto-ui-pane__header\");\n\nexport const updateHeaderHeight = (header, paneWrapperRef) => {\n const headerHeight = header.offsetHeight;\n\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapperRef.current.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n } else {\n paneWrapperRef.current.style.removeProperty(\n \"--neeto-ui-pane-header-height\"\n );\n }\n};\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlay, useOverlayManager } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeader, updateHeaderHeight } from \"./utils\";\n\nconst SIZES = { small: \"small\", large: \"large\" };\n\nconst Pane = ({\n size = SIZES.small,\n isOpen = false,\n onClose = () => {},\n children,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const paneWrapperRef = useRef(null);\n const backdropRef = useRef(null);\n\n const observerRef = useRef(\n new ResizeObserver(([entry]) =>\n updateHeaderHeight(entry.target, paneWrapperRef)\n )\n );\n\n useOverlayManager(paneWrapperRef, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapperRef,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return undefined;\n\n const header = getHeader(paneWrapperRef);\n if (!header) return undefined;\n\n const observer = observerRef.current;\n observer.observe(header);\n\n return () => observer.disconnect();\n }, [hasTransitionCompleted]);\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-pane\"\n in={isOpen}\n timeout={230}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"pane-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end\",\n backdropClassName\n )}\n >\n <div\n data-cy=\"pane-wrapper\"\n key=\"pane-wrapper\"\n ref={paneWrapperRef}\n className={classnames(\"neeto-ui-pane__wrapper\", {\n \"neeto-ui-pane__wrapper--small\": size === SIZES.small,\n \"neeto-ui-pane__wrapper--large\": size === SIZES.large,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-pane__close\"\n data-cy=\"pane-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n onClick={handleOverlayClose}\n />\n )}\n {hasTransitionCompleted && (\n <>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </>\n )}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nPane.propTypes = {\n /**\n * To specify the size of the Pane.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Pane component is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the close button of Pane is clicked.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Pane component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classname to the Pane component.\n */\n className: PropTypes.string,\n /**\n * To specify whether the Pane component should close on esc key press.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Pane component should render close button.\n */\n closeButton: PropTypes.bool,\n /**\n * To specify the classname to be applied to the backdrop element.\n */\n backdropClassName: PropTypes.string,\n /**\n * To specify whether the Pane component should close on outside click.\n */\n closeOnOutsideClick: PropTypes.bool,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is opened.\n * If not specified, the first focusable element inside the Pane component will be focused.\n * If there are no focusable elements, the Pane component itself will be focused.\n */\n initialFocusRef: PropTypes.object,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is closed.\n * If not specified, the element which was focused when the Pane component was opened will be focused.\n */\n finalFocusRef: PropTypes.object,\n};\n\nPane.Header = Header;\nPane.Body = Body;\nPane.Footer = Footer;\n\nexport default Pane;\n"],"names":["Body","_ref","children","className","_ref$hasFooter","hasFooter","React","createElement","classnames","_defineProperty","Footer","Header","DEFAULT_PANE_HEADER_HEIGHT","getHeader","paneWrapperRef","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","style","setProperty","concat","removeProperty","SIZES","small","large","Pane","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","initialFocusRef","finalFocusRef","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","useRef","backdropRef","observerRef","ResizeObserver","_ref2","_ref3","entry","target","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","undefined","observer","observe","disconnect","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","Button","icon","Close","onClick","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA,CAAA;EAAA,oBACnDE,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,WAAW;AACnBJ,IAAAA,SAAS,EAAEK,UAAU,CACnB,iGAAiG,EAAAC,eAAA,CAAA;AAE/F,MAAA,iCAAiC,EAAEJ,SAAAA;KAClCF,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;AAExB,GAAA,EAEDD,QAAQ,CACL,CAAA;AAAA,CACP;;ACbD,IAAMQ,MAAM,GAAG,SAATA,MAAMA,CAAAT,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS,CAAA;EAAA,oBACnCG,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEJ,IAAAA,SAAS,EAAEK,UAAU,CACnB,2DAA2D,EAC3DL,SAAS,CAAA;AACT,GAAA,EAEDD,QAAQ,CACL,CAAA;AAAA,CACP;;ACTD,IAAMS,MAAM,GAAG,SAATA,MAAMA,CAAAV,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS,CAAA;EAAA,oBACnCG,K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,KAAK,CAACE,KAAAA;KAC/CxB,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;GAEpB2C,EAAAA,UAAU,GAEbP,WAAW,iBACVjC,KAAA,CAAAC,aAAA,CAACgF,MAAM,EAAA;AACL,IAAA,YAAA,EAAW,OAAO;AAClBpF,IAAAA,SAAS,EAAC,sBAAsB;AAChC,IAAA,SAAA,EAAQ,mBAAmB;AAC3B,IAAA,aAAA,EAAY,cAAc;AAC1BqF,IAAAA,IAAI,EAAEC,gBAAM;AACZ3D,IAAAA,IAAI,EAAC,OAAO;AACZT,IAAAA,KAAK,EAAC,MAAM;AACZqE,IAAAA,OAAO,EAAEvB,kBAAAA;AAAmB,GAAA,CAE/B,EACAd,sBAAsB,iBACrB/C,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAqF,QAAA,QACG,OAAOzF,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEkE,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BlE,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDD0B,IAAI,CAACjB,MAAM,GAAGA,MAAM,CAAA;AACpBiB,IAAI,CAAC5B,IAAI,GAAGA,IAAI,CAAA;AAChB4B,IAAI,CAAClB,MAAM,GAAGA,MAAM;;;;"}
|
|
1
|
+
{"version":3,"file":"Pane.js","sources":["../../src/components/Pane/Body.jsx","../../src/components/Pane/Footer.jsx","../../src/components/Pane/Header.jsx","../../src/components/Pane/constants.js","../../src/components/Pane/utils.js","../../src/components/Pane/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, hasFooter = true }) => (\n <div\n data-cy=\"pane-body\"\n className={classnames(\n \"neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start\",\n {\n \"neeto-ui-pane__body--has-footer\": hasFooter,\n [className]: className,\n }\n )}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify if the Pane has a footer.\n * @default true\n */\n hasFooter: PropTypes.bool,\n /**\n * To specify className to be applied to the Pane Body container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className }) => (\n <div\n className={classnames(\n \"neeto-ui-pane__footer neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Pane Footer container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Header = ({ children, className }) => (\n <div\n className={classnames(\"neeto-ui-pane__header\", className)}\n data-cy=\"pane-header\"\n >\n {children}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * To specify className to be applied to the Pane Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\n","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeader = paneWrapperRef =>\n paneWrapperRef.current.querySelector(\".neeto-ui-pane__header\");\n\nexport const updateHeaderHeight = (header, paneWrapperRef) => {\n const headerHeight = header?.offsetHeight;\n\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapperRef.current?.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n } else {\n paneWrapperRef.current?.style.removeProperty(\n \"--neeto-ui-pane-header-height\"\n );\n }\n};\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlay, useOverlayManager } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeader, updateHeaderHeight } from \"./utils\";\n\nconst SIZES = { small: \"small\", large: \"large\" };\n\nconst Pane = ({\n size = SIZES.small,\n isOpen = false,\n onClose = () => {},\n children,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const paneWrapperRef = useRef(null);\n const backdropRef = useRef(null);\n\n const observerRef = useRef(\n new ResizeObserver(([entry]) =>\n updateHeaderHeight(entry.target, paneWrapperRef)\n )\n );\n\n useOverlayManager(paneWrapperRef, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapperRef,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return undefined;\n\n const header = getHeader(paneWrapperRef);\n if (!header) return undefined;\n\n const observer = observerRef.current;\n observer.observe(header);\n\n return () => observer.disconnect();\n }, [hasTransitionCompleted]);\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-pane\"\n in={isOpen}\n timeout={230}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"pane-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end\",\n backdropClassName\n )}\n >\n <div\n data-cy=\"pane-wrapper\"\n key=\"pane-wrapper\"\n ref={paneWrapperRef}\n className={classnames(\"neeto-ui-pane__wrapper\", {\n \"neeto-ui-pane__wrapper--small\": size === SIZES.small,\n \"neeto-ui-pane__wrapper--large\": size === SIZES.large,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-pane__close\"\n data-cy=\"pane-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n onClick={handleOverlayClose}\n />\n )}\n {hasTransitionCompleted && (\n <>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </>\n )}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nPane.propTypes = {\n /**\n * To specify the size of the Pane.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Pane component is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the close button of Pane is clicked.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Pane component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classname to the Pane component.\n */\n className: PropTypes.string,\n /**\n * To specify whether the Pane component should close on esc key press.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Pane component should render close button.\n */\n closeButton: PropTypes.bool,\n /**\n * To specify the classname to be applied to the backdrop element.\n */\n backdropClassName: PropTypes.string,\n /**\n * To specify whether the Pane component should close on outside click.\n */\n closeOnOutsideClick: PropTypes.bool,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is opened.\n * If not specified, the first focusable element inside the Pane component will be focused.\n * If there are no focusable elements, the Pane component itself will be focused.\n */\n initialFocusRef: PropTypes.object,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is closed.\n * If not specified, the element which was focused when the Pane component was opened will be focused.\n */\n finalFocusRef: PropTypes.object,\n};\n\nPane.Header = Header;\nPane.Body = Body;\nPane.Footer = Footer;\n\nexport default Pane;\n"],"names":["Body","_ref","children","className","_ref$hasFooter","hasFooter","React","createElement","classnames","_defineProperty","Footer","Header","DEFAULT_PANE_HEADER_HEIGHT","getHeader","paneWrapperRef","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre","style","setProperty","concat","_paneWrapperRef$curre2","removeProperty","SIZES","small","large","Pane","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","initialFocusRef","finalFocusRef","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","useRef","backdropRef","observerRef","ResizeObserver","_ref2","_ref3","entry","target","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","undefined","observer","observe","disconnect","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","Button","icon","Close","onClick","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA,CAAA;EAAA,oBACnDE,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,WAAW;AACnBJ,IAAAA,SAAS,EAAEK,UAAU,CACnB,iGAAiG,EAAAC,eAAA,CAAA;AAE/F,MAAA,iCAAiC,EAAEJ,SAAAA;KACl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EAAC,OAAO;AACZV,IAAAA,KAAK,EAAC,MAAM;AACZsE,IAAAA,OAAO,EAAEvB,kBAAAA;AAAmB,GAAA,CAE/B,EACAd,sBAAsB,iBACrBjD,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAuF,QAAA,QACG,OAAO3F,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEoE,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BpE,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDD4B,IAAI,CAACnB,MAAM,GAAGA,MAAM,CAAA;AACpBmB,IAAI,CAAC9B,IAAI,GAAGA,IAAI,CAAA;AAChB8B,IAAI,CAACpB,MAAM,GAAGA,MAAM;;;;"}
|
package/dist/cjs/ProgressBar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../../src/components/ProgressBar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport propTypes from \"prop-types\";\n\nconst ProgressBar = ({ progressPercentage, progressValue, className = \"\" }) => (\n <div\n className={classNames([\n \"neeto-ui-progress-bar__wrapper neeto-ui-rounded-full\",\n className,\n ])}\n >\n <motion.div\n animate={{ width: `${progressPercentage}%` }}\n className=\"neeto-ui-progress-bar neeto-ui-rounded-full\"\n initial={{ width: 0 }}\n transition={{ duration: 0.5, ease: \"easeInOut\" }}\n >\n {progressValue ?? `${progressPercentage}%`}\n </motion.div>\n </div>\n);\n\nProgressBar.propTypes = {\n /**\n * To specify the value to be used as the width of the progress bar.\n */\n progressPercentage: propTypes.number,\n /**\n * To specify the progress value to be displayed on the progress bar as text.\n */\n progressValue: propTypes.string,\n /**\n * To specify external classnames as overrides to the ProgressBar component.\n */\n className: propTypes.string,\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","_ref","progressPercentage","progressValue","_ref$className","className","React","createElement","classNames","motion","div","animate","width","concat","initial","transition","duration","ease"],"mappings":";;;;;;AAMA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,kBAAkB,GAAAD,IAAA,CAAlBC,kBAAkB;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,oBACtEE,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEF,IAAAA,SAAS,EAAEG,UAAU,CAAC,CACpB,sDAAsD,EACtDH,SAAS,CACV,CAAA;AAAE,GAAA,eAEHC,KAAA,CAAAC,aAAA,CAACE,mBAAM,CAACC,GAAG,EAAA;AACTC,IAAAA,OAAO,EAAE;MAAEC,KAAK,EAAA,EAAA,CAAAC,MAAA,CAAKX,kBAAkB,EAAA,GAAA,CAAA;KAAM;AAC7CG,IAAAA,SAAS,EAAC,6CAA6C;
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":["../../src/components/ProgressBar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport propTypes from \"prop-types\";\n\nconst ProgressBar = ({ progressPercentage, progressValue, className = \"\" }) => (\n <div\n className={classNames([\n \"neeto-ui-progress-bar__wrapper neeto-ui-rounded-full\",\n className,\n ])}\n >\n <motion.div\n animate={{ width: `${progressPercentage}%` }}\n className=\"neeto-ui-progress-bar neeto-ui-rounded-full\"\n data-cy=\"progress-bar\"\n initial={{ width: 0 }}\n transition={{ duration: 0.5, ease: \"easeInOut\" }}\n >\n {progressValue ?? `${progressPercentage}%`}\n </motion.div>\n </div>\n);\n\nProgressBar.propTypes = {\n /**\n * To specify the value to be used as the width of the progress bar.\n */\n progressPercentage: propTypes.number,\n /**\n * To specify the progress value to be displayed on the progress bar as text.\n */\n progressValue: propTypes.string,\n /**\n * To specify external classnames as overrides to the ProgressBar component.\n */\n className: propTypes.string,\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","_ref","progressPercentage","progressValue","_ref$className","className","React","createElement","classNames","motion","div","animate","width","concat","initial","transition","duration","ease"],"mappings":";;;;;;AAMA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,kBAAkB,GAAAD,IAAA,CAAlBC,kBAAkB;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,oBACtEE,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEF,IAAAA,SAAS,EAAEG,UAAU,CAAC,CACpB,sDAAsD,EACtDH,SAAS,CACV,CAAA;AAAE,GAAA,eAEHC,KAAA,CAAAC,aAAA,CAACE,mBAAM,CAACC,GAAG,EAAA;AACTC,IAAAA,OAAO,EAAE;MAAEC,KAAK,EAAA,EAAA,CAAAC,MAAA,CAAKX,kBAAkB,EAAA,GAAA,CAAA;KAAM;AAC7CG,IAAAA,SAAS,EAAC,6CAA6C;AACvD,IAAA,SAAA,EAAQ,cAAc;AACtBS,IAAAA,OAAO,EAAE;AAAEF,MAAAA,KAAK,EAAE,CAAA;KAAI;AACtBG,IAAAA,UAAU,EAAE;AAAEC,MAAAA,QAAQ,EAAE,GAAG;AAAEC,MAAAA,IAAI,EAAE,WAAA;AAAY,KAAA;GAE9Cd,EAAAA,aAAa,KAAbA,IAAAA,IAAAA,aAAa,KAAbA,KAAAA,CAAAA,GAAAA,aAAa,MAAAU,MAAA,CAAOX,kBAAkB,EAAA,GAAA,CAAA,CAC5B,CACT,CAAA;AAAA;;;;"}
|