@bigbinary/neetoui 8.2.74 → 8.2.76
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/DatePicker.js +1 -1
- package/dist/Pane.js +4 -2
- package/dist/Pane.js.map +1 -1
- package/dist/TimePicker.js +1 -1
- package/dist/Tree.js +2 -0
- package/dist/Tree.js.map +1 -1
- package/dist/cjs/DatePicker.js +1 -1
- package/dist/cjs/Pane.js +4 -2
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/TimePicker.js +1 -1
- package/dist/cjs/Tree.js +2 -0
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/{index-BQo8SODl.js → index-DOPn4zaJ.js} +1 -1
- package/dist/cjs/{index-BQo8SODl.js.map → index-DOPn4zaJ.js.map} +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/{index-C_NVUIv9.js → index-CVm5OYJT.js} +1 -1
- package/dist/{index-C_NVUIv9.js.map → index-CVm5OYJT.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/types/Pane.d.ts +1 -1
package/dist/DatePicker.js
CHANGED
|
@@ -26,7 +26,7 @@ import 'react-i18next';
|
|
|
26
26
|
import './useRecentlyUsedColors-CvgVrIg-.js';
|
|
27
27
|
import './Dropdown.js';
|
|
28
28
|
import './index-C9RIWUPw.js';
|
|
29
|
-
export { D as default } from './index-
|
|
29
|
+
export { D as default } from './index-CVm5OYJT.js';
|
|
30
30
|
import './Input.js';
|
|
31
31
|
import './Label.js';
|
|
32
32
|
import './MultiEmailInput.js';
|
package/dist/Pane.js
CHANGED
|
@@ -82,7 +82,8 @@ var updateHeaderHeight = function updateHeaderHeight(header, paneWrapperRef) {
|
|
|
82
82
|
var _excluded = ["size", "isOpen", "onClose", "children", "className", "closeOnEsc", "closeButton", "backdropClassName", "closeOnOutsideClick", "initialFocusRef", "finalFocusRef"];
|
|
83
83
|
var SIZES = {
|
|
84
84
|
small: "small",
|
|
85
|
-
large: "large"
|
|
85
|
+
large: "large",
|
|
86
|
+
extraLarge: "extraLarge"
|
|
86
87
|
};
|
|
87
88
|
var Pane = function Pane(_ref) {
|
|
88
89
|
var _ref$size = _ref.size,
|
|
@@ -181,7 +182,8 @@ var Pane = function Pane(_ref) {
|
|
|
181
182
|
ref: paneWrapperRef,
|
|
182
183
|
className: classnames("neeto-ui-pane__wrapper", _defineProperty({
|
|
183
184
|
"neeto-ui-pane__wrapper--small": size === SIZES.small,
|
|
184
|
-
"neeto-ui-pane__wrapper--large": size === SIZES.large
|
|
185
|
+
"neeto-ui-pane__wrapper--large": size === SIZES.large,
|
|
186
|
+
"neeto-ui-pane__wrapper--extralarge": size === SIZES.extraLarge
|
|
185
187
|
}, className, className))
|
|
186
188
|
}, otherProps), closeButton && /*#__PURE__*/React__default.createElement(Button, {
|
|
187
189
|
"aria-label": "Close",
|
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, isTopOverlay } = 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 || !paneWrapperRef.current) return undefined;\n\n const observer = observerRef.current;\n const header = getHeader(paneWrapperRef);\n\n if (header) {\n observer.observe(header);\n\n return () => observer.disconnect();\n }\n\n const mutationObserver = new MutationObserver(() => {\n const header = getHeader(paneWrapperRef);\n if (!header) return;\n\n observer.observe(header);\n mutationObserver.disconnect();\n });\n\n mutationObserver.observe(paneWrapperRef.current, {\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n observer.disconnect();\n };\n }, [hasTransitionCompleted, isTopOverlay]);\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","_paneWrapperRef$curre","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre2","style","setProperty","concat","_paneWrapperRef$curre3","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","isTopOverlay","useEffect","undefined","observer","observe","disconnect","mutationObserver","MutationObserver","childList","subtree","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,C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AI,GAAGA,IAAI,CAAA;AAChB+B,IAAI,CAACrB,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\", extraLarge: \"extraLarge\" };\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, isTopOverlay } = 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 || !paneWrapperRef.current) return undefined;\n\n const observer = observerRef.current;\n const header = getHeader(paneWrapperRef);\n\n if (header) {\n observer.observe(header);\n\n return () => observer.disconnect();\n }\n\n const mutationObserver = new MutationObserver(() => {\n const header = getHeader(paneWrapperRef);\n if (!header) return;\n\n observer.observe(header);\n mutationObserver.disconnect();\n });\n\n mutationObserver.observe(paneWrapperRef.current, {\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n observer.disconnect();\n };\n }, [hasTransitionCompleted, isTopOverlay]);\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 \"neeto-ui-pane__wrapper--extralarge\": size === SIZES.extraLarge,\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","_paneWrapperRef$curre","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre2","style","setProperty","concat","_paneWrapperRef$curre3","removeProperty","SIZES","small","large","extraLarge","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","isTopOverlay","useEffect","undefined","observer","observe","disconnect","mutationObserver","MutationObserver","childList","subtree","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;;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+B,EAAEK,IAAI,KAAKN,KAAK,CAACE,KAAK;AACrD,MAAA,oCAAoC,EAAEI,IAAI,KAAKN,KAAK,CAACG,UAAAA;KACpD5B,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;GAEpB+C,EAAAA,UAAU,GAEbP,WAAW,iBACVrC,cAAA,CAAAC,aAAA,CAACyF,MAAM,EAAA;AACL,IAAA,YAAA,EAAW,OAAO;AAClB7F,IAAAA,SAAS,EAAC,sBAAsB;AAChC,IAAA,SAAA,EAAQ,mBAAmB;AAC3B,IAAA,aAAA,EAAY,cAAc;AAC1B8F,IAAAA,IAAI,EAAEC,KAAM;AACZhE,IAAAA,IAAI,EAAC,OAAO;AACZX,IAAAA,KAAK,EAAC,MAAM;AACZ4E,IAAAA,OAAO,EAAE5B,kBAAAA;AAAmB,GAAA,CAE/B,EACAd,sBAAsB,iBACrBnD,cAAA,CAAAC,aAAA,CAAAD,cAAA,CAAA8F,QAAA,QACG,OAAOlG,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEsE,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BtE,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDD8B,IAAI,CAACrB,MAAM,GAAGA,MAAM,CAAA;AACpBqB,IAAI,CAAChC,IAAI,GAAGA,IAAI,CAAA;AAChBgC,IAAI,CAACtB,MAAM,GAAGA,MAAM;;;;"}
|
package/dist/TimePicker.js
CHANGED
|
@@ -25,7 +25,7 @@ import 'react-colorful';
|
|
|
25
25
|
import './useRecentlyUsedColors-CvgVrIg-.js';
|
|
26
26
|
import './Dropdown.js';
|
|
27
27
|
import './index-C9RIWUPw.js';
|
|
28
|
-
export { T as default } from './index-
|
|
28
|
+
export { T as default } from './index-CVm5OYJT.js';
|
|
29
29
|
import './Input.js';
|
|
30
30
|
import './Label.js';
|
|
31
31
|
import './MultiEmailInput.js';
|
package/dist/Tree.js
CHANGED
|
@@ -33,8 +33,10 @@ import 'dayjs/plugin/weekOfYear';
|
|
|
33
33
|
var SwitcherIcon = function SwitcherIcon(_ref) {
|
|
34
34
|
var expanded = _ref.expanded;
|
|
35
35
|
return expanded ? /*#__PURE__*/React__default.createElement(Down, {
|
|
36
|
+
className: "neeto-ui-relative",
|
|
36
37
|
size: 16
|
|
37
38
|
}) : /*#__PURE__*/React__default.createElement(Right, {
|
|
39
|
+
className: "neeto-ui-relative",
|
|
38
40
|
size: 16
|
|
39
41
|
});
|
|
40
42
|
};
|
package/dist/Tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sources":["../src/components/Tree/SwitcherIcon.jsx","../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? <Down size={16}
|
|
1
|
+
{"version":3,"file":"Tree.js","sources":["../src/components/Tree/SwitcherIcon.jsx","../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? (\n <Down className=\"neeto-ui-relative\" size={16} />\n ) : (\n <Right className=\"neeto-ui-relative\" size={16} />\n );\n\nexport default SwitcherIcon;\n","import React from \"react\";\n\nimport { ConfigProvider, Tree as TreeComponent } from \"antd\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from \"utils\";\n\nimport SwitcherIcon from \"./SwitcherIcon\";\n\nconst Tree = ({ componentToken, ...props }) => {\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Tree: {\n directoryNodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n directoryNodeSelectedColor: \"rgb(var(--neeto-ui-white))\",\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-100))\",\n ...componentToken,\n },\n },\n }}\n >\n <TreeComponent\n switcherIcon={SwitcherIcon}\n {...props}\n className={classnames(\"neeto-ui-tree\", props.className)}\n />\n </ConfigProvider>\n );\n};\n\nTree.propTypes = {\n /**\n * Whether to allow dropping on the node\n */\n allowDrop: PropTypes.bool,\n /**\n * Whether to automatically expand a parent treeNode\n */\n autoExpandParent: PropTypes.bool,\n /**\n * Whether treeNode fill remaining horizontal space\n */\n blockNode: PropTypes.bool,\n /**\n * Add a Checkbox before the treeNodes.\n */\n checkable: PropTypes.bool,\n /**\n * Specifies the keys of the checked treeNodes\n */\n checkedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Check treeNode precisely; parent treeNode and children treeNodes are not associated\n */\n checkStrictly: PropTypes.bool,\n /**\n * Specifies the keys of the default checked treeNodes.\n */\n defaultCheckedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specify the keys of the default expanded treeNodes.\n */\n defaultExpandedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specifies the keys of the default selected treeNodes.\n */\n defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Callback function for when the onCheck event occurs.\n */\n onCheck: PropTypes.func,\n /**\n * Whether disabled the tree\n */\n disabled: PropTypes.bool,\n /**\n * The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array).\n */\n treeData: PropTypes.array,\n /**\n * Callback function for when the user clicks a treeNode.\n */\n onSelect: PropTypes.func,\n /**\n * Shows a connecting line.\n */\n showLine: PropTypes.bool,\n /**\n * Config virtual scroll height. Will not support horizontal scroll when enable this.\n */\n height: PropTypes.number,\n /**\n * Specifies whether this Tree or the node is draggable.\n */\n draggable: PropTypes.bool,\n /**\n * Object to override default theme styles for the component\n */\n componentToken: PropTypes.object,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnter: PropTypes.func,\n /**\n * Callback function for when the onDragStart event occurs\n */\n onDragStart: PropTypes.func,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnd: PropTypes.func,\n /**\n * Callback function for when the onDragLeave event occurs\n */\n onDragLeave: PropTypes.func,\n /**\n * Callback function for when the onDragOver event occurs\n */\n onDragOver: PropTypes.func,\n /**\n * Callback function for when the onDrop event occurs\n */\n onDrop: PropTypes.func,\n /**\n * Defines a function to filter (highlight) treeNodes. When the function returns true, the corresponding treeNode will be highlighted\n */\n filterTreeNode: PropTypes.func,\n /**\n * Load data asynchronously\n */\n loadData: PropTypes.func,\n /**\n * Set loaded tree nodes. Need work with loadData\n */\n loadedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Whether can be selected\n */\n selectable: PropTypes.bool,\n /**\n * Specifies the keys of the selected treeNodes, multiple selection needs to set multiple to true\n */\n selectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Allows selecting multiple treeNodes\n */\n multiple: PropTypes.bool,\n /**\n * Customize tree node title render\n */\n titleRender: PropTypes.func,\n /**\n * Disable virtual scroll when set to false\n */\n virtual: PropTypes.bool,\n /**\n * Callback function for when a treeNode is expanded or collapsed\n */\n onExpand: PropTypes.func,\n /**\n * Callback function for when a treeNode is loaded\n */\n onLoad: PropTypes.func,\n /**\n * Customize collapse/expand icon of tree node\n */\n switcherIcon: PropTypes.node,\n};\n\nexport default Tree;\n"],"names":["SwitcherIcon","_ref","expanded","React","createElement","Down","className","size","Right","Tree","componentToken","props","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","i18n","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","directoryNodeSelectedBg","directoryNodeSelectedColor","nodeHoverBg","nodeSelectedBg","_Tree","_extends","switcherIcon","classnames"],"mappings":";;;;;;;;;;;;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AAA,CAAAC,aAAA,CAAA0B,KAAA,EAAAC,QAAA,CAAA;AACEC,IAAAA,YAAY,EAAEhC,YAAAA;AAAa,GAAA,EACvBW,KAAK,EAAA;AACTL,IAAAA,SAAS,EAAE2B,UAAU,CAAC,eAAe,EAAEtB,KAAK,CAACL,SAAS,CAAA;AAAE,GAAA,CAAA,CACxD,CACa,CAAA;AAErB;;;;"}
|
package/dist/cjs/DatePicker.js
CHANGED
|
@@ -28,7 +28,7 @@ require('react-i18next');
|
|
|
28
28
|
require('./useRecentlyUsedColors-D9b7Om0L.js');
|
|
29
29
|
require('./Dropdown.js');
|
|
30
30
|
require('./index-Ci1VcKxO.js');
|
|
31
|
-
var DatePicker = require('./index-
|
|
31
|
+
var DatePicker = require('./index-DOPn4zaJ.js');
|
|
32
32
|
require('./Input.js');
|
|
33
33
|
require('./Label.js');
|
|
34
34
|
require('./MultiEmailInput.js');
|
package/dist/cjs/Pane.js
CHANGED
|
@@ -84,7 +84,8 @@ var updateHeaderHeight = function updateHeaderHeight(header, paneWrapperRef) {
|
|
|
84
84
|
var _excluded = ["size", "isOpen", "onClose", "children", "className", "closeOnEsc", "closeButton", "backdropClassName", "closeOnOutsideClick", "initialFocusRef", "finalFocusRef"];
|
|
85
85
|
var SIZES = {
|
|
86
86
|
small: "small",
|
|
87
|
-
large: "large"
|
|
87
|
+
large: "large",
|
|
88
|
+
extraLarge: "extraLarge"
|
|
88
89
|
};
|
|
89
90
|
var Pane = function Pane(_ref) {
|
|
90
91
|
var _ref$size = _ref.size,
|
|
@@ -183,7 +184,8 @@ var Pane = function Pane(_ref) {
|
|
|
183
184
|
ref: paneWrapperRef,
|
|
184
185
|
className: classnames("neeto-ui-pane__wrapper", _defineProperty({
|
|
185
186
|
"neeto-ui-pane__wrapper--small": size === SIZES.small,
|
|
186
|
-
"neeto-ui-pane__wrapper--large": size === SIZES.large
|
|
187
|
+
"neeto-ui-pane__wrapper--large": size === SIZES.large,
|
|
188
|
+
"neeto-ui-pane__wrapper--extralarge": size === SIZES.extraLarge
|
|
187
189
|
}, className, className))
|
|
188
190
|
}, otherProps), closeButton && /*#__PURE__*/React.createElement(Button, {
|
|
189
191
|
"aria-label": "Close",
|
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, isTopOverlay } = 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 || !paneWrapperRef.current) return undefined;\n\n const observer = observerRef.current;\n const header = getHeader(paneWrapperRef);\n\n if (header) {\n observer.observe(header);\n\n return () => observer.disconnect();\n }\n\n const mutationObserver = new MutationObserver(() => {\n const header = getHeader(paneWrapperRef);\n if (!header) return;\n\n observer.observe(header);\n mutationObserver.disconnect();\n });\n\n mutationObserver.observe(paneWrapperRef.current, {\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n observer.disconnect();\n };\n }, [hasTransitionCompleted, isTopOverlay]);\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","_paneWrapperRef$curre","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre2","style","setProperty","concat","_paneWrapperRef$curre3","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","isTopOverlay","useEffect","undefined","observer","observe","disconnect","mutationObserver","MutationObserver","childList","subtree","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,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AA,+BAA+B,EAAEI,IAAI,KAAKL,KAAK,CAACE,KAAAA;KAC/C3B,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;GAEpB8C,EAAAA,UAAU,GAEbP,WAAW,iBACVpC,KAAA,CAAAC,aAAA,CAACwF,MAAM,EAAA;AACL,IAAA,YAAA,EAAW,OAAO;AAClB5F,IAAAA,SAAS,EAAC,sBAAsB;AAChC,IAAA,SAAA,EAAQ,mBAAmB;AAC3B,IAAA,aAAA,EAAY,cAAc;AAC1B6F,IAAAA,IAAI,EAAEC,gBAAM;AACZhE,IAAAA,IAAI,EAAC,OAAO;AACZV,IAAAA,KAAK,EAAC,MAAM;AACZ2E,IAAAA,OAAO,EAAE5B,kBAAAA;AAAmB,GAAA,CAE/B,EACAd,sBAAsB,iBACrBlD,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAA6F,QAAA,QACG,OAAOjG,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEqE,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BrE,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDD6B,IAAI,CAACpB,MAAM,GAAGA,MAAM,CAAA;AACpBoB,IAAI,CAAC/B,IAAI,GAAGA,IAAI,CAAA;AAChB+B,IAAI,CAACrB,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\", extraLarge: \"extraLarge\" };\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, isTopOverlay } = 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 || !paneWrapperRef.current) return undefined;\n\n const observer = observerRef.current;\n const header = getHeader(paneWrapperRef);\n\n if (header) {\n observer.observe(header);\n\n return () => observer.disconnect();\n }\n\n const mutationObserver = new MutationObserver(() => {\n const header = getHeader(paneWrapperRef);\n if (!header) return;\n\n observer.observe(header);\n mutationObserver.disconnect();\n });\n\n mutationObserver.observe(paneWrapperRef.current, {\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n observer.disconnect();\n };\n }, [hasTransitionCompleted, isTopOverlay]);\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 \"neeto-ui-pane__wrapper--extralarge\": size === SIZES.extraLarge,\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","_paneWrapperRef$curre","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre2","style","setProperty","concat","_paneWrapperRef$curre3","removeProperty","SIZES","small","large","extraLarge","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","isTopOverlay","useEffect","undefined","observer","observe","disconnect","mutationObserver","MutationObserver","childList","subtree","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,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AACZX,IAAAA,KAAK,EAAC,MAAM;AACZ4E,IAAAA,OAAO,EAAE5B,kBAAAA;AAAmB,GAAA,CAE/B,EACAd,sBAAsB,iBACrBnD,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAA8F,QAAA,QACG,OAAOlG,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEsE,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BtE,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDD8B,IAAI,CAACrB,MAAM,GAAGA,MAAM,CAAA;AACpBqB,IAAI,CAAChC,IAAI,GAAGA,IAAI,CAAA;AAChBgC,IAAI,CAACtB,MAAM,GAAGA,MAAM;;;;"}
|
package/dist/cjs/TimePicker.js
CHANGED
|
@@ -27,7 +27,7 @@ require('react-colorful');
|
|
|
27
27
|
require('./useRecentlyUsedColors-D9b7Om0L.js');
|
|
28
28
|
require('./Dropdown.js');
|
|
29
29
|
require('./index-Ci1VcKxO.js');
|
|
30
|
-
var DatePicker = require('./index-
|
|
30
|
+
var DatePicker = require('./index-DOPn4zaJ.js');
|
|
31
31
|
require('./Input.js');
|
|
32
32
|
require('./Label.js');
|
|
33
33
|
require('./MultiEmailInput.js');
|
package/dist/cjs/Tree.js
CHANGED
|
@@ -35,8 +35,10 @@ require('dayjs/plugin/weekOfYear');
|
|
|
35
35
|
var SwitcherIcon = function SwitcherIcon(_ref) {
|
|
36
36
|
var expanded = _ref.expanded;
|
|
37
37
|
return expanded ? /*#__PURE__*/React.createElement(neetoIcons.Down, {
|
|
38
|
+
className: "neeto-ui-relative",
|
|
38
39
|
size: 16
|
|
39
40
|
}) : /*#__PURE__*/React.createElement(neetoIcons.Right, {
|
|
41
|
+
className: "neeto-ui-relative",
|
|
40
42
|
size: 16
|
|
41
43
|
});
|
|
42
44
|
};
|
package/dist/cjs/Tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sources":["../../src/components/Tree/SwitcherIcon.jsx","../../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? <Down size={16}
|
|
1
|
+
{"version":3,"file":"Tree.js","sources":["../../src/components/Tree/SwitcherIcon.jsx","../../src/components/Tree/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Down, Right } from \"neetoicons\";\n\nconst SwitcherIcon = ({ expanded }) =>\n expanded ? (\n <Down className=\"neeto-ui-relative\" size={16} />\n ) : (\n <Right className=\"neeto-ui-relative\" size={16} />\n );\n\nexport default SwitcherIcon;\n","import React from \"react\";\n\nimport { ConfigProvider, Tree as TreeComponent } from \"antd\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES } from \"utils\";\n\nimport SwitcherIcon from \"./SwitcherIcon\";\n\nconst Tree = ({ componentToken, ...props }) => {\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Tree: {\n directoryNodeSelectedBg: \"rgb(var(--neeto-ui-primary-500))\",\n directoryNodeSelectedColor: \"rgb(var(--neeto-ui-white))\",\n nodeHoverBg: \"rgb(var(--neeto-ui-gray-100))\",\n nodeSelectedBg: \"rgb(var(--neeto-ui-primary-100))\",\n ...componentToken,\n },\n },\n }}\n >\n <TreeComponent\n switcherIcon={SwitcherIcon}\n {...props}\n className={classnames(\"neeto-ui-tree\", props.className)}\n />\n </ConfigProvider>\n );\n};\n\nTree.propTypes = {\n /**\n * Whether to allow dropping on the node\n */\n allowDrop: PropTypes.bool,\n /**\n * Whether to automatically expand a parent treeNode\n */\n autoExpandParent: PropTypes.bool,\n /**\n * Whether treeNode fill remaining horizontal space\n */\n blockNode: PropTypes.bool,\n /**\n * Add a Checkbox before the treeNodes.\n */\n checkable: PropTypes.bool,\n /**\n * Specifies the keys of the checked treeNodes\n */\n checkedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Check treeNode precisely; parent treeNode and children treeNodes are not associated\n */\n checkStrictly: PropTypes.bool,\n /**\n * Specifies the keys of the default checked treeNodes.\n */\n defaultCheckedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specify the keys of the default expanded treeNodes.\n */\n defaultExpandedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Specifies the keys of the default selected treeNodes.\n */\n defaultSelectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Callback function for when the onCheck event occurs.\n */\n onCheck: PropTypes.func,\n /**\n * Whether disabled the tree\n */\n disabled: PropTypes.bool,\n /**\n * The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array).\n */\n treeData: PropTypes.array,\n /**\n * Callback function for when the user clicks a treeNode.\n */\n onSelect: PropTypes.func,\n /**\n * Shows a connecting line.\n */\n showLine: PropTypes.bool,\n /**\n * Config virtual scroll height. Will not support horizontal scroll when enable this.\n */\n height: PropTypes.number,\n /**\n * Specifies whether this Tree or the node is draggable.\n */\n draggable: PropTypes.bool,\n /**\n * Object to override default theme styles for the component\n */\n componentToken: PropTypes.object,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnter: PropTypes.func,\n /**\n * Callback function for when the onDragStart event occurs\n */\n onDragStart: PropTypes.func,\n /**\n * Callback function for when the onDragEnter event occurs\n */\n onDragEnd: PropTypes.func,\n /**\n * Callback function for when the onDragLeave event occurs\n */\n onDragLeave: PropTypes.func,\n /**\n * Callback function for when the onDragOver event occurs\n */\n onDragOver: PropTypes.func,\n /**\n * Callback function for when the onDrop event occurs\n */\n onDrop: PropTypes.func,\n /**\n * Defines a function to filter (highlight) treeNodes. When the function returns true, the corresponding treeNode will be highlighted\n */\n filterTreeNode: PropTypes.func,\n /**\n * Load data asynchronously\n */\n loadData: PropTypes.func,\n /**\n * Set loaded tree nodes. Need work with loadData\n */\n loadedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Whether can be selected\n */\n selectable: PropTypes.bool,\n /**\n * Specifies the keys of the selected treeNodes, multiple selection needs to set multiple to true\n */\n selectedKeys: PropTypes.arrayOf(PropTypes.string),\n /**\n * Allows selecting multiple treeNodes\n */\n multiple: PropTypes.bool,\n /**\n * Customize tree node title render\n */\n titleRender: PropTypes.func,\n /**\n * Disable virtual scroll when set to false\n */\n virtual: PropTypes.bool,\n /**\n * Callback function for when a treeNode is expanded or collapsed\n */\n onExpand: PropTypes.func,\n /**\n * Callback function for when a treeNode is loaded\n */\n onLoad: PropTypes.func,\n /**\n * Customize collapse/expand icon of tree node\n */\n switcherIcon: PropTypes.node,\n};\n\nexport default Tree;\n"],"names":["SwitcherIcon","_ref","expanded","React","createElement","Down","className","size","Right","Tree","componentToken","props","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","i18n","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","directoryNodeSelectedBg","directoryNodeSelectedColor","nodeHoverBg","nodeSelectedBg","_Tree","_extends","switcherIcon","classnames"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ,CAAA;AAAA,EAAA,OAC9BA,QAAQ,gBACNC,KAAA,CAAAC,aAAA,CAACC,eAAI,EAAA;AAACC,IAAAA,SAAS,EAAC,mBAAmB;AAACC,IAAAA,IAAI,EAAE,EAAA;AAAG,GAAA,CAAG,gBAEhDJ,KAAA,CAAAC,aAAA,CAACI,gBAAK,EAAA;AAACF,IAAAA,SAAS,EAAC,mBAAmB;AAACC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