@bigbinary/neetoui 8.1.1 → 8.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/Alert.js +1 -2
  2. package/dist/Alert.js.map +1 -1
  3. package/dist/DatePicker.js +2 -3
  4. package/dist/DatePicker.js.map +1 -1
  5. package/dist/Modal.js +1 -2
  6. package/dist/Modal.js.map +1 -1
  7. package/dist/Pane.js +1 -2
  8. package/dist/Pane.js.map +1 -1
  9. package/dist/TimePicker.js +2 -3
  10. package/dist/TimePicker.js.map +1 -1
  11. package/dist/cjs/Alert.js +1 -2
  12. package/dist/cjs/Alert.js.map +1 -1
  13. package/dist/cjs/DatePicker.js +2 -3
  14. package/dist/cjs/DatePicker.js.map +1 -1
  15. package/dist/cjs/Modal.js +1 -2
  16. package/dist/cjs/Modal.js.map +1 -1
  17. package/dist/cjs/Pane.js +1 -2
  18. package/dist/cjs/Pane.js.map +1 -1
  19. package/dist/cjs/TimePicker.js +2 -3
  20. package/dist/cjs/TimePicker.js.map +1 -1
  21. package/dist/cjs/formik/BlockNavigation.js +1 -2
  22. package/dist/cjs/formik/BlockNavigation.js.map +1 -1
  23. package/dist/cjs/formik/Form.js +56 -48
  24. package/dist/cjs/formik/Form.js.map +1 -1
  25. package/dist/cjs/formik/index.js +1 -2
  26. package/dist/cjs/formik/index.js.map +1 -1
  27. package/dist/cjs/{index-34eccc77.js → index-481904b2.js} +1 -1
  28. package/dist/cjs/{index-34eccc77.js.map → index-481904b2.js.map} +1 -1
  29. package/dist/cjs/index.js +2 -3
  30. package/dist/cjs/index.js.map +1 -1
  31. package/dist/cjs/{useOverlayManager-91348551.js → useOverlayManager-763ee731.js} +87 -2
  32. package/dist/cjs/useOverlayManager-763ee731.js.map +1 -0
  33. package/dist/formik/BlockNavigation.js +1 -2
  34. package/dist/formik/BlockNavigation.js.map +1 -1
  35. package/dist/formik/Form.js +54 -47
  36. package/dist/formik/Form.js.map +1 -1
  37. package/dist/formik/index.js +1 -2
  38. package/dist/formik/index.js.map +1 -1
  39. package/dist/{index-23406db4.js → index-23b5ba50.js} +1 -1
  40. package/dist/{index-23406db4.js.map → index-23b5ba50.js.map} +1 -1
  41. package/dist/index.js +2 -3
  42. package/dist/index.js.map +1 -1
  43. package/dist/{useOverlayManager-c4efbaee.js → useOverlayManager-5be3be10.js} +87 -2
  44. package/dist/useOverlayManager-5be3be10.js.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/cjs/index-63580e68.js +0 -92
  47. package/dist/cjs/index-63580e68.js.map +0 -1
  48. package/dist/cjs/useOverlayManager-91348551.js.map +0 -1
  49. package/dist/index-283bc6a6.js +0 -90
  50. package/dist/index-283bc6a6.js.map +0 -1
  51. package/dist/useOverlayManager-c4efbaee.js.map +0 -1
package/dist/Alert.js CHANGED
@@ -13,11 +13,10 @@ import '@babel/runtime/helpers/slicedToArray';
13
13
  import '@tippyjs/react';
14
14
  import 'tippy.js';
15
15
  import '@bigbinary/neeto-icons';
16
- import './useOverlayManager-c4efbaee.js';
16
+ import './useOverlayManager-5be3be10.js';
17
17
  import '@babel/runtime/helpers/esm/extends';
18
18
  import '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
19
19
  import '@babel/runtime/helpers/esm/inheritsLoose';
20
- import './index-283bc6a6.js';
21
20
  import 'react-dom';
22
21
  import '@babel/runtime/helpers/esm/assertThisInitialized';
23
22
  import 'ramda';
package/dist/Alert.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../src/components/Alert.jsx"],"sourcesContent":["import React, { useRef } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Button from \"./Button\";\nimport Modal from \"./Modal\";\nimport Typography from \"./Typography\";\n\nconst SIZES = { small: \"small\", medium: \"medium\", large: \"large\" };\n\nconst FOCUSABLE_ELEMENTS = { submit: \"submit\", cancel: \"cancel\" };\n\nconst Alert = ({\n size = SIZES.medium,\n isOpen = false,\n isSubmitting = false,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n onClose = () => {},\n onSubmit = () => {},\n title = \"\",\n message = \"\",\n submitButtonLabel = \"Continue\",\n cancelButtonLabel = \"Cancel\",\n initialFocusRef,\n initialFocusElement,\n hideCancelButton = false,\n}) => {\n const submitButtonRef = useRef(null);\n const cancelButtonRef = useRef(null);\n\n const hasCustomFocusableElement = !!initialFocusRef || initialFocusElement;\n const initialFocusElementRef =\n initialFocusElement === FOCUSABLE_ELEMENTS.submit\n ? submitButtonRef\n : cancelButtonRef;\n\n return (\n <Modal\n {...{\n backdropClassName,\n className,\n closeButton,\n closeOnEsc,\n closeOnOutsideClick,\n isOpen,\n onClose,\n size,\n }}\n data-cy=\"alert-box\"\n {...(hasCustomFocusableElement && {\n initialFocusRef: initialFocusRef || initialFocusElementRef,\n })}\n >\n <Modal.Header>\n <Typography data-cy=\"alert-title\" style=\"h2\">\n {title}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n <Typography data-cy=\"alert-message\" lineHeight=\"normal\" style=\"body2\">\n {message}\n </Typography>\n </Modal.Body>\n <Modal.Footer className=\"neeto-ui-gap-2 neeto-ui-flex neeto-ui-justify-end neeto-ui-items-center\">\n {!hideCancelButton && (\n <Button\n data-cy=\"alert-cancel-button\"\n label={cancelButtonLabel}\n ref={cancelButtonRef}\n style=\"tertiary\"\n onClick={onClose}\n />\n )}\n <Button\n data-cy=\"alert-submit-button\"\n disabled={!isOpen}\n label={submitButtonLabel}\n loading={isSubmitting}\n ref={submitButtonRef}\n style=\"danger\"\n onClick={onSubmit}\n />\n </Modal.Footer>\n </Modal>\n );\n};\n\nAlert.propTypes = {\n /**\n * To specify the size of the Alert.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Alert is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Alert is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the callback which will be invoked when the Alert is submitted.\n */\n onSubmit: PropTypes.func,\n /**\n * To provide title to the Alert.\n */\n title: PropTypes.string,\n /**\n * To provide description to the Alert.\n */\n message: PropTypes.node,\n /**\n * To add loading state to submit button\n */\n isSubmitting: PropTypes.bool,\n /**\n * To provide external classNames to the Alert.\n */\n className: PropTypes.string,\n /**\n * To close the Alert on pressing the `Esc` key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Alert should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To provide label to the submit button.\n */\n submitButtonLabel: PropTypes.string,\n /**\n * To provide label to the cancel button.\n */\n cancelButtonLabel: PropTypes.string,\n /**\n * To add custom classes to Backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Alert content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /**\n * To specify the ref of the element which will receive focus when the Alert is opened.\n * If not specified, the focus will be set to the submit button inside the Alert.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * To specify the element which will receive focus when the Alert is opened.\n */\n initialFocusElement: PropTypes.oneOf(Object.values(FOCUSABLE_ELEMENTS)),\n /**\n * To hide the cancel button\n */\n hideCancelButton: PropTypes.bool,\n};\n\nexport default Alert;\n"],"names":["SIZES","small","medium","large","FOCUSABLE_ELEMENTS","submit","cancel","Alert","_ref","_ref$size","size","_ref$isOpen","isOpen","_ref$isSubmitting","isSubmitting","_ref$className","className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","_ref$onClose","onClose","_ref$onSubmit","onSubmit","_ref$title","title","_ref$message","message","_ref$submitButtonLabe","submitButtonLabel","_ref$cancelButtonLabe","cancelButtonLabel","initialFocusRef","initialFocusElement","_ref$hideCancelButton","hideCancelButton","submitButtonRef","useRef","cancelButtonRef","hasCustomFocusableElement","initialFocusElementRef","React","createElement","Modal","_extends","Header","Typography","style","Body","lineHeight","Footer","Button","label","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,aAAA,CAACS,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,qBAAqB;AAC7BC,IAAAA,KAAK,EAAErB,iBAAkB;AACzBsB,IAAAA,GAAG,EAAEf,eAAgB;AACrBS,IAAAA,KAAK,EAAC,UAAU;AAChBO,IAAAA,OAAO,EAAEjC,OAAAA;AAAQ,GAAA,CAEpB,eACDoB,cAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,qBAAqB;IAC7BI,QAAQ,EAAE,CAAChD,MAAO;AAClB6C,IAAAA,KAAK,EAAEvB,iBAAkB;AACzB2B,IAAAA,OAAO,EAAE/C,YAAa;AACtB4C,IAAAA,GAAG,EAAEjB,eAAgB;AACrBW,IAAAA,KAAK,EAAC,QAAQ;AACdO,IAAAA,OAAO,EAAE/B,QAAAA;AAAS,GAAA,CAClB,CACW,CACT,CAAA;AAEZ;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../src/components/Alert.jsx"],"sourcesContent":["import React, { useRef } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Button from \"./Button\";\nimport Modal from \"./Modal\";\nimport Typography from \"./Typography\";\n\nconst SIZES = { small: \"small\", medium: \"medium\", large: \"large\" };\n\nconst FOCUSABLE_ELEMENTS = { submit: \"submit\", cancel: \"cancel\" };\n\nconst Alert = ({\n size = SIZES.medium,\n isOpen = false,\n isSubmitting = false,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n onClose = () => {},\n onSubmit = () => {},\n title = \"\",\n message = \"\",\n submitButtonLabel = \"Continue\",\n cancelButtonLabel = \"Cancel\",\n initialFocusRef,\n initialFocusElement,\n hideCancelButton = false,\n}) => {\n const submitButtonRef = useRef(null);\n const cancelButtonRef = useRef(null);\n\n const hasCustomFocusableElement = !!initialFocusRef || initialFocusElement;\n const initialFocusElementRef =\n initialFocusElement === FOCUSABLE_ELEMENTS.submit\n ? submitButtonRef\n : cancelButtonRef;\n\n return (\n <Modal\n {...{\n backdropClassName,\n className,\n closeButton,\n closeOnEsc,\n closeOnOutsideClick,\n isOpen,\n onClose,\n size,\n }}\n data-cy=\"alert-box\"\n {...(hasCustomFocusableElement && {\n initialFocusRef: initialFocusRef || initialFocusElementRef,\n })}\n >\n <Modal.Header>\n <Typography data-cy=\"alert-title\" style=\"h2\">\n {title}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n <Typography data-cy=\"alert-message\" lineHeight=\"normal\" style=\"body2\">\n {message}\n </Typography>\n </Modal.Body>\n <Modal.Footer className=\"neeto-ui-gap-2 neeto-ui-flex neeto-ui-justify-end neeto-ui-items-center\">\n {!hideCancelButton && (\n <Button\n data-cy=\"alert-cancel-button\"\n label={cancelButtonLabel}\n ref={cancelButtonRef}\n style=\"tertiary\"\n onClick={onClose}\n />\n )}\n <Button\n data-cy=\"alert-submit-button\"\n disabled={!isOpen}\n label={submitButtonLabel}\n loading={isSubmitting}\n ref={submitButtonRef}\n style=\"danger\"\n onClick={onSubmit}\n />\n </Modal.Footer>\n </Modal>\n );\n};\n\nAlert.propTypes = {\n /**\n * To specify the size of the Alert.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Alert is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Alert is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the callback which will be invoked when the Alert is submitted.\n */\n onSubmit: PropTypes.func,\n /**\n * To provide title to the Alert.\n */\n title: PropTypes.string,\n /**\n * To provide description to the Alert.\n */\n message: PropTypes.node,\n /**\n * To add loading state to submit button\n */\n isSubmitting: PropTypes.bool,\n /**\n * To provide external classNames to the Alert.\n */\n className: PropTypes.string,\n /**\n * To close the Alert on pressing the `Esc` key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Alert should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To provide label to the submit button.\n */\n submitButtonLabel: PropTypes.string,\n /**\n * To provide label to the cancel button.\n */\n cancelButtonLabel: PropTypes.string,\n /**\n * To add custom classes to Backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Alert content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /**\n * To specify the ref of the element which will receive focus when the Alert is opened.\n * If not specified, the focus will be set to the submit button inside the Alert.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * To specify the element which will receive focus when the Alert is opened.\n */\n initialFocusElement: PropTypes.oneOf(Object.values(FOCUSABLE_ELEMENTS)),\n /**\n * To hide the cancel button\n */\n hideCancelButton: PropTypes.bool,\n};\n\nexport default Alert;\n"],"names":["SIZES","small","medium","large","FOCUSABLE_ELEMENTS","submit","cancel","Alert","_ref","_ref$size","size","_ref$isOpen","isOpen","_ref$isSubmitting","isSubmitting","_ref$className","className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","_ref$onClose","onClose","_ref$onSubmit","onSubmit","_ref$title","title","_ref$message","message","_ref$submitButtonLabe","submitButtonLabel","_ref$cancelButtonLabe","cancelButtonLabel","initialFocusRef","initialFocusElement","_ref$hideCancelButton","hideCancelButton","submitButtonRef","useRef","cancelButtonRef","hasCustomFocusableElement","initialFocusElementRef","React","createElement","Modal","_extends","Header","Typography","style","Body","lineHeight","Footer","Button","label","ref","onClick","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,KAAK,GAAG;AAAEC,EAAAA,KAAK,EAAE,OAAO;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,KAAK,EAAE,OAAA;AAAQ,CAAC,CAAA;AAElE,IAAMC,kBAAkB,GAAG;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,MAAM,EAAE,QAAA;AAAS,CAAC,CAAA;AAEjE,IAAMC,KAAK,GAAG,SAARA,KAAKA,CAAAC,IA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ACzB2B,IAAAA,OAAO,EAAE/C,YAAa;AACtB4C,IAAAA,GAAG,EAAEjB,eAAgB;AACrBW,IAAAA,KAAK,EAAC,QAAQ;AACdO,IAAAA,OAAO,EAAE/B,QAAAA;AAAS,GAAA,CAClB,CACW,CACT,CAAA;AAEZ;;;;"}
@@ -23,7 +23,7 @@ import 'react-colorful';
23
23
  import './tinycolor-282c618c.js';
24
24
  import './Dropdown.js';
25
25
  import './index-9040fef3.js';
26
- export { D as default } from './index-23406db4.js';
26
+ export { D as default } from './index-23b5ba50.js';
27
27
  import './Input.js';
28
28
  import './Label.js';
29
29
  import './MultiEmailInput.js';
@@ -81,10 +81,9 @@ import 'dayjs/plugin/weekday';
81
81
  import 'dayjs/plugin/weekOfYear';
82
82
  import './en-ffa387d9.js';
83
83
  import './Tooltip.js';
84
- import './useOverlayManager-c4efbaee.js';
84
+ import './useOverlayManager-5be3be10.js';
85
85
  import '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
86
86
  import '@babel/runtime/helpers/esm/inheritsLoose';
87
- import './index-283bc6a6.js';
88
87
  import '@babel/runtime/helpers/esm/assertThisInitialized';
89
88
  import './constants.js';
90
89
  import '@babel/runtime/helpers/toArray';
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"DatePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Modal.js CHANGED
@@ -5,7 +5,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
5
5
  import React__default, { useState, useRef } from 'react';
6
6
  import classnames from 'classnames';
7
7
  import { Close } from '@bigbinary/neeto-icons';
8
- import { u as useOverlayManager, a as useOverlay, P as Portal, C as CSSTransition, B as Backdrop } from './useOverlayManager-c4efbaee.js';
8
+ import { u as useOverlayManager, a as useOverlay, P as Portal, C as CSSTransition, B as Backdrop } from './useOverlayManager-5be3be10.js';
9
9
  import Button from './Button.js';
10
10
  import 'react-router-dom';
11
11
  import 'qs';
@@ -13,7 +13,6 @@ import Typography from './Typography.js';
13
13
  import '@babel/runtime/helpers/esm/extends';
14
14
  import '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
15
15
  import '@babel/runtime/helpers/esm/inheritsLoose';
16
- import './index-283bc6a6.js';
17
16
  import 'react-dom';
18
17
  import '@babel/runtime/helpers/esm/assertThisInitialized';
19
18
  import 'ramda';
package/dist/Modal.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../src/components/Modal/Body.jsx","../src/components/Modal/Footer.jsx","../src/components/Modal/Header.jsx","../src/components/Modal/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__body\", className)}\n data-cy={dataCy ?? \"modal-body\"}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify className to be applied to the Modal Body.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__footer\", className)}\n data-cy={dataCy ?? \"modal-footer\"}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Modal Footer.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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\nimport Typography from \"../Typography\";\n\nconst Header = ({ description = \"\", children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__header\", className)}\n data-cy={dataCy ?? \"modal-header\"}\n >\n {children}\n {description && (\n <div className=\"neeto-ui-modal__header-desc\" data-cy=\"modal-header-desc\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {description}\n </Typography>\n </div>\n )}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the short description of the Modal.\n */\n description: PropTypes.string,\n /**\n * To specify className to be applied to the Modal Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","import React, { useRef, useState } 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 { useOverlayManager, useOverlay } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\n\nconst SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n fullScreen: \"fullScreen\",\n};\n\nconst Modal = ({\n size = SIZES.medium,\n isOpen = false,\n onClose = () => {},\n children,\n finalFocusRef,\n initialFocusRef,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n blockScrollOnMount = true,\n closeOnOutsideClick = true,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const modalWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(modalWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n isOpen,\n initialFocusRef,\n finalFocusRef,\n overlayWrapper: modalWrapper,\n onClose,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n blockScrollOnMount,\n hasTransitionCompleted,\n });\n\n const isFullScreenModal = size === SIZES.fullScreen;\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-modal\"\n in={isOpen}\n timeout={300}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"modal-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-modal__backdrop\",\n {\n \"neeto-ui-modal__backdrop--fullscreen\": isFullScreenModal,\n },\n backdropClassName\n )}\n >\n <div\n aria-modal\n key=\"modal-wrapper\"\n ref={modalWrapper}\n role=\"dialog\"\n className={classnames(\"neeto-ui-modal__wrapper\", {\n \"neeto-ui-modal__wrapper--small\": size === SIZES.small,\n \"neeto-ui-modal__wrapper--medium\": size === SIZES.medium,\n \"neeto-ui-modal__wrapper--large\": size === SIZES.large,\n \"neeto-ui-modal__wrapper--fullscreen\": isFullScreenModal,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-modal__close\"\n data-cy=\"modal-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size={isFullScreenModal ? \"large\" : \"small\"}\n style={isFullScreenModal ? \"secondary\" : \"text\"}\n onClick={handleOverlayClose}\n />\n )}\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nModal.propTypes = {\n /**\n * To specify the size of the Modal.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Modal is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Modal is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Modal component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classNames to the Modal.\n */\n className: PropTypes.string,\n /**\n * To close the Modal on pressing the Esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Modal should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To add custom classes to backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Modal content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /*\n * To specify the ref of the element which will receive focus when the Modal is closed.\n * If not specified, the focus will be set to the element which was focused when the Modal was opened.\n * If the Modal was opened by clicking on a button, then the focus will be set to the button.\n * */\n finalFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the ref of the element which will receive focus when the Modal is opened.\n * If not specified, the focus will be set to the first focusable element inside the Modal.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify whether the scroll should be blocked when the Modal is opened.\n * */\n blockScrollOnMount: PropTypes.bool,\n};\n\nModal.Header = Header;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport default Modal;\n"],"names":["Body","_ref","children","className","dataCy","React","createElement","classnames","Footer","Header","_ref$description","description","Typography","lineHeight","style","SIZES","small","medium","large","fullScreen","Modal","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","finalFocusRef","initialFocusRef","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$blockScrollOnMou","blockScrollOnMount","_ref$closeOnOutsideCl","closeOnOutsideClick","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","modalWrapper","useRef","backdropRef","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isFullScreenModal","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","role","_defineProperty","Button","icon","Close","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBACzCC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CAAC,sBAAsB,EAAEJ,SAAS,CAAE;AACzD,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,YAAA;AAAa,GAAA,EAE/BF,QAAQ,CACL,CAAA;AAAA,CACP;;ACPD,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAP,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBAC3CC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CAAC,wBAAwB,EAAEJ,SAAS,CAAE;AAC3D,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,cAAA;AAAe,GAAA,EAEjCF,QAAQ,CACL,CAAA;AAAA,CACP;;ACLD,IAAMO,MAAM,GAAG,SAATA,MAAMA,CAAAR,IAAA,EAAA;AAAA,E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I,EAAEoC,iBAAiB,GAAG,OAAO,GAAG,OAAQ;AAC5C5C,IAAAA,KAAK,EAAE4C,iBAAiB,GAAG,WAAW,GAAG,MAAO;AAChDmB,IAAAA,OAAO,EAAErB,kBAAAA;AAAmB,GAAA,CAE/B,EACA,OAAOtD,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEuD,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BvD,QAAQ,CACR,CACG,CACG,CACT,CAAA;AAEb,EAAC;AA8DDkB,KAAK,CAACX,MAAM,GAAGA,MAAM,CAAA;AACrBW,KAAK,CAACpB,IAAI,GAAGA,IAAI,CAAA;AACjBoB,KAAK,CAACZ,MAAM,GAAGA,MAAM;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../src/components/Modal/Body.jsx","../src/components/Modal/Footer.jsx","../src/components/Modal/Header.jsx","../src/components/Modal/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__body\", className)}\n data-cy={dataCy ?? \"modal-body\"}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify className to be applied to the Modal Body.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__footer\", className)}\n data-cy={dataCy ?? \"modal-footer\"}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Modal Footer.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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\nimport Typography from \"../Typography\";\n\nconst Header = ({ description = \"\", children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__header\", className)}\n data-cy={dataCy ?? \"modal-header\"}\n >\n {children}\n {description && (\n <div className=\"neeto-ui-modal__header-desc\" data-cy=\"modal-header-desc\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {description}\n </Typography>\n </div>\n )}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the short description of the Modal.\n */\n description: PropTypes.string,\n /**\n * To specify className to be applied to the Modal Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","import React, { useRef, useState } 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 { useOverlayManager, useOverlay } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\n\nconst SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n fullScreen: \"fullScreen\",\n};\n\nconst Modal = ({\n size = SIZES.medium,\n isOpen = false,\n onClose = () => {},\n children,\n finalFocusRef,\n initialFocusRef,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n blockScrollOnMount = true,\n closeOnOutsideClick = true,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const modalWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(modalWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n isOpen,\n initialFocusRef,\n finalFocusRef,\n overlayWrapper: modalWrapper,\n onClose,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n blockScrollOnMount,\n hasTransitionCompleted,\n });\n\n const isFullScreenModal = size === SIZES.fullScreen;\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-modal\"\n in={isOpen}\n timeout={300}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"modal-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-modal__backdrop\",\n {\n \"neeto-ui-modal__backdrop--fullscreen\": isFullScreenModal,\n },\n backdropClassName\n )}\n >\n <div\n aria-modal\n key=\"modal-wrapper\"\n ref={modalWrapper}\n role=\"dialog\"\n className={classnames(\"neeto-ui-modal__wrapper\", {\n \"neeto-ui-modal__wrapper--small\": size === SIZES.small,\n \"neeto-ui-modal__wrapper--medium\": size === SIZES.medium,\n \"neeto-ui-modal__wrapper--large\": size === SIZES.large,\n \"neeto-ui-modal__wrapper--fullscreen\": isFullScreenModal,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-modal__close\"\n data-cy=\"modal-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size={isFullScreenModal ? \"large\" : \"small\"}\n style={isFullScreenModal ? \"secondary\" : \"text\"}\n onClick={handleOverlayClose}\n />\n )}\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nModal.propTypes = {\n /**\n * To specify the size of the Modal.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Modal is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Modal is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Modal component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classNames to the Modal.\n */\n className: PropTypes.string,\n /**\n * To close the Modal on pressing the Esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Modal should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To add custom classes to backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Modal content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /*\n * To specify the ref of the element which will receive focus when the Modal is closed.\n * If not specified, the focus will be set to the element which was focused when the Modal was opened.\n * If the Modal was opened by clicking on a button, then the focus will be set to the button.\n * */\n finalFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the ref of the element which will receive focus when the Modal is opened.\n * If not specified, the focus will be set to the first focusable element inside the Modal.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify whether the scroll should be blocked when the Modal is opened.\n * */\n blockScrollOnMount: PropTypes.bool,\n};\n\nModal.Header = Header;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport default Modal;\n"],"names":["Body","_ref","children","className","dataCy","React","createElement","classnames","Footer","Header","_ref$description","description","Typography","lineHeight","style","SIZES","small","medium","large","fullScreen","Modal","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","finalFocusRef","initialFocusRef","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$blockScrollOnMou","blockScrollOnMount","_ref$closeOnOutsideCl","closeOnOutsideClick","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","modalWrapper","useRef","backdropRef","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isFullScreenModal","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","role","_defineProperty","Button","icon","Close","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBACzCC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CAAC,sBAAsB,EAAEJ,SAAS,CAAE;AACzD,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,YAAA;AAAa,GAAA,EAE/BF,QAAQ,CACL,CAAA;AAAA,CACP;;ACPD,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAP,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBAC3CC,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CAAC,wBAAwB,EAAEJ,SAAS,CAAE;AAC3D,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,cAAA;AAAe,GAAA,EAEjCF,QAAQ,CACL,CAAA;AAAA,CACP;;ACLD,IAAMO,MAAM,GAAG,SAATA,MAAMA,CAAAR,IAAA,EAAA;AAAA,EAAA,IAAAS,gBAAA,GAAAT,IAAA,CAAMU,WAAW;AAAXA,IAAAA,WAAW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K,EAAE4C,iBAAiB,GAAG,WAAW,GAAG,MAAO;AAChDmB,IAAAA,OAAO,EAAErB,kBAAAA;AAAmB,GAAA,CAE/B,EACA,OAAOtD,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEuD,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BvD,QAAQ,CACR,CACG,CACG,CACT,CAAA;AAEb,EAAC;AA8DDkB,KAAK,CAACX,MAAM,GAAGA,MAAM,CAAA;AACrBW,KAAK,CAACpB,IAAI,GAAGA,IAAI,CAAA;AACjBoB,KAAK,CAACZ,MAAM,GAAGA,MAAM;;;;"}
package/dist/Pane.js CHANGED
@@ -5,14 +5,13 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
5
5
  import React__default, { useState, useRef, useEffect } from 'react';
6
6
  import classnames from 'classnames';
7
7
  import { Close } from '@bigbinary/neeto-icons';
8
- import { u as useOverlayManager, a as useOverlay, P as Portal, C as CSSTransition, B as Backdrop } from './useOverlayManager-c4efbaee.js';
8
+ import { u as useOverlayManager, a as useOverlay, P as Portal, C as CSSTransition, B as Backdrop } from './useOverlayManager-5be3be10.js';
9
9
  import Button from './Button.js';
10
10
  import 'react-router-dom';
11
11
  import 'qs';
12
12
  import '@babel/runtime/helpers/esm/extends';
13
13
  import '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
14
14
  import '@babel/runtime/helpers/esm/inheritsLoose';
15
- import './index-283bc6a6.js';
16
15
  import 'react-dom';
17
16
  import '@babel/runtime/helpers/esm/assertThisInitialized';
18
17
  import 'ramda';
package/dist/Pane.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Pane.js","sources":["../src/components/Pane/Body.jsx","../src/components/Pane/constants.js","../src/components/Pane/Footer.jsx","../src/components/Pane/Header.jsx","../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","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\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","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeaderHeight = paneWrapper => {\n const header = paneWrapper.current.querySelector(\".neeto-ui-pane__header\");\n\n return header ? header.offsetHeight : DEFAULT_PANE_HEADER_HEIGHT;\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 { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeaderHeight } 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 paneWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(paneWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapper,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return;\n const headerHeight = getHeaderHeight(paneWrapper);\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapper.current.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n }\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={paneWrapper}\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","DEFAULT_PANE_HEADER_HEIGHT","Footer","Header","getHeaderHeight","paneWrapper","header","current","querySelector","offsetHeight","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","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","headerHeight","style","setProperty","concat","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;;AClBM,IAAMQ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1ByE,IAAAA,IAAI,EAAEC,KAAM;AACZrD,IAAAA,IAAI,EAAC,OAAO;AACZmC,IAAAA,KAAK,EAAC,MAAM;AACZmB,IAAAA,OAAO,EAAEvB,kBAAAA;AAAmB,GAAA,CAE/B,EACAR,sBAAsB,iBACrBzC,cAAA,CAAAC,aAAA,CAAAD,cAAA,CAAAyE,QAAA,QACG,OAAO7E,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEsD,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BtD,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDDoB,IAAI,CAACV,MAAM,GAAGA,MAAM,CAAA;AACpBU,IAAI,CAACtB,IAAI,GAAGA,IAAI,CAAA;AAChBsB,IAAI,CAACX,MAAM,GAAGA,MAAM;;;;"}
1
+ {"version":3,"file":"Pane.js","sources":["../src/components/Pane/Body.jsx","../src/components/Pane/constants.js","../src/components/Pane/Footer.jsx","../src/components/Pane/Header.jsx","../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","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\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","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeaderHeight = paneWrapper => {\n const header = paneWrapper.current.querySelector(\".neeto-ui-pane__header\");\n\n return header ? header.offsetHeight : DEFAULT_PANE_HEADER_HEIGHT;\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 { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeaderHeight } 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 paneWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(paneWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapper,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return;\n const headerHeight = getHeaderHeight(paneWrapper);\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapper.current.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n }\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={paneWrapper}\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","DEFAULT_PANE_HEADER_HEIGHT","Footer","Header","getHeaderHeight","paneWrapper","header","current","querySelector","offsetHeight","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","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","headerHeight","style","setProperty","concat","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;;AClBM,IAAMQ,0BAA0B,GAAG,EAAE;;ACK5C,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAAV,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,IAAMU,MAAM,GAAG,SAATA,MAAMA,CAAAX,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,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BsB,IAAI,CAACX,MAAM,GAAGA,MAAM;;;;"}
@@ -23,7 +23,7 @@ import 'react-colorful';
23
23
  import './tinycolor-282c618c.js';
24
24
  import './Dropdown.js';
25
25
  import './index-9040fef3.js';
26
- export { T as default } from './index-23406db4.js';
26
+ export { T as default } from './index-23b5ba50.js';
27
27
  import './Input.js';
28
28
  import './Label.js';
29
29
  import './MultiEmailInput.js';
@@ -74,10 +74,9 @@ import 'dayjs/plugin/weekday';
74
74
  import 'dayjs/plugin/weekOfYear';
75
75
  import './en-ffa387d9.js';
76
76
  import './Tooltip.js';
77
- import './useOverlayManager-c4efbaee.js';
77
+ import './useOverlayManager-5be3be10.js';
78
78
  import '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
79
79
  import '@babel/runtime/helpers/esm/inheritsLoose';
80
- import './index-283bc6a6.js';
81
80
  import '@babel/runtime/helpers/esm/assertThisInitialized';
82
81
  import 'antd/lib/date-picker';
83
82
  import 'antd/locale/de_DE';
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"TimePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/cjs/Alert.js CHANGED
@@ -15,11 +15,10 @@ require('@babel/runtime/helpers/slicedToArray');
15
15
  require('@tippyjs/react');
16
16
  require('tippy.js');
17
17
  require('@bigbinary/neeto-icons');
18
- require('./useOverlayManager-91348551.js');
18
+ require('./useOverlayManager-763ee731.js');
19
19
  require('@babel/runtime/helpers/esm/extends');
20
20
  require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
21
21
  require('@babel/runtime/helpers/esm/inheritsLoose');
22
- require('./index-63580e68.js');
23
22
  require('react-dom');
24
23
  require('@babel/runtime/helpers/esm/assertThisInitialized');
25
24
  require('ramda');
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../src/components/Alert.jsx"],"sourcesContent":["import React, { useRef } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Button from \"./Button\";\nimport Modal from \"./Modal\";\nimport Typography from \"./Typography\";\n\nconst SIZES = { small: \"small\", medium: \"medium\", large: \"large\" };\n\nconst FOCUSABLE_ELEMENTS = { submit: \"submit\", cancel: \"cancel\" };\n\nconst Alert = ({\n size = SIZES.medium,\n isOpen = false,\n isSubmitting = false,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n onClose = () => {},\n onSubmit = () => {},\n title = \"\",\n message = \"\",\n submitButtonLabel = \"Continue\",\n cancelButtonLabel = \"Cancel\",\n initialFocusRef,\n initialFocusElement,\n hideCancelButton = false,\n}) => {\n const submitButtonRef = useRef(null);\n const cancelButtonRef = useRef(null);\n\n const hasCustomFocusableElement = !!initialFocusRef || initialFocusElement;\n const initialFocusElementRef =\n initialFocusElement === FOCUSABLE_ELEMENTS.submit\n ? submitButtonRef\n : cancelButtonRef;\n\n return (\n <Modal\n {...{\n backdropClassName,\n className,\n closeButton,\n closeOnEsc,\n closeOnOutsideClick,\n isOpen,\n onClose,\n size,\n }}\n data-cy=\"alert-box\"\n {...(hasCustomFocusableElement && {\n initialFocusRef: initialFocusRef || initialFocusElementRef,\n })}\n >\n <Modal.Header>\n <Typography data-cy=\"alert-title\" style=\"h2\">\n {title}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n <Typography data-cy=\"alert-message\" lineHeight=\"normal\" style=\"body2\">\n {message}\n </Typography>\n </Modal.Body>\n <Modal.Footer className=\"neeto-ui-gap-2 neeto-ui-flex neeto-ui-justify-end neeto-ui-items-center\">\n {!hideCancelButton && (\n <Button\n data-cy=\"alert-cancel-button\"\n label={cancelButtonLabel}\n ref={cancelButtonRef}\n style=\"tertiary\"\n onClick={onClose}\n />\n )}\n <Button\n data-cy=\"alert-submit-button\"\n disabled={!isOpen}\n label={submitButtonLabel}\n loading={isSubmitting}\n ref={submitButtonRef}\n style=\"danger\"\n onClick={onSubmit}\n />\n </Modal.Footer>\n </Modal>\n );\n};\n\nAlert.propTypes = {\n /**\n * To specify the size of the Alert.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Alert is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Alert is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the callback which will be invoked when the Alert is submitted.\n */\n onSubmit: PropTypes.func,\n /**\n * To provide title to the Alert.\n */\n title: PropTypes.string,\n /**\n * To provide description to the Alert.\n */\n message: PropTypes.node,\n /**\n * To add loading state to submit button\n */\n isSubmitting: PropTypes.bool,\n /**\n * To provide external classNames to the Alert.\n */\n className: PropTypes.string,\n /**\n * To close the Alert on pressing the `Esc` key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Alert should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To provide label to the submit button.\n */\n submitButtonLabel: PropTypes.string,\n /**\n * To provide label to the cancel button.\n */\n cancelButtonLabel: PropTypes.string,\n /**\n * To add custom classes to Backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Alert content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /**\n * To specify the ref of the element which will receive focus when the Alert is opened.\n * If not specified, the focus will be set to the submit button inside the Alert.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * To specify the element which will receive focus when the Alert is opened.\n */\n initialFocusElement: PropTypes.oneOf(Object.values(FOCUSABLE_ELEMENTS)),\n /**\n * To hide the cancel button\n */\n hideCancelButton: PropTypes.bool,\n};\n\nexport default Alert;\n"],"names":["SIZES","small","medium","large","FOCUSABLE_ELEMENTS","submit","cancel","Alert","_ref","_ref$size","size","_ref$isOpen","isOpen","_ref$isSubmitting","isSubmitting","_ref$className","className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","_ref$onClose","onClose","_ref$onSubmit","onSubmit","_ref$title","title","_ref$message","message","_ref$submitButtonLabe","submitButtonLabel","_ref$cancelButtonLabe","cancelButtonLabel","initialFocusRef","initialFocusElement","_ref$hideCancelButton","hideCancelButton","submitButtonRef","useRef","cancelButtonRef","hasCustomFocusableElement","initialFocusElementRef","React","createElement","Modal","_extends","Header","Typography","style","Body","lineHeight","Footer","Button","label","ref","onClick","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,KAAK,GAAG;AAAEC,EAAAA,KAAK,EAAE,OAAO;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,KAAK,EAAE,OAAA;AAAQ,CAAC,CAAA;AAElE,IAAMC,kBAAkB,GAAG;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,MAAM,EAAE,QAAA;AAAS,CAAC,CAAA;AAEjE,IAAMC,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAkBL;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAjBJE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,KAAA,CAAA,GAAGT,KAAK,CAACE,MAAM,GAAAO,SAAA;IAAAE,WAAA,GAAAH,IAAA,CACnBI,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;IAAAE,iBAAA,GAAAL,IAAA,CACdM,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,iBAAA;IAAAE,cAAA,GAA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AQ,aAAa;AAACC,IAAAA,KAAK,EAAC,IAAA;AAAI,GAAA,EACzCtB,KAAK,CACK,CACA,eACfgB,yBAAA,CAAAC,aAAA,CAACC,KAAK,CAACK,IAAI,EACTP,IAAAA,eAAAA,yBAAA,CAAAC,aAAA,CAACI,UAAU,EAAA;AAAC,IAAA,SAAA,EAAQ,eAAe;AAACG,IAAAA,UAAU,EAAC,QAAQ;AAACF,IAAAA,KAAK,EAAC,OAAA;GAC3DpB,EAAAA,OAAO,CACG,CACF,eACbc,yBAAA,CAAAC,aAAA,CAACC,KAAK,CAACO,MAAM,EAAA;AAACvC,IAAAA,SAAS,EAAC,yEAAA;AAAyE,GAAA,EAC9F,CAACwB,gBAAgB,iBAChBM,yBAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,qBAAqB;AAC7BC,IAAAA,KAAK,EAAErB,iBAAkB;AACzBsB,IAAAA,GAAG,EAAEf,eAAgB;AACrBS,IAAAA,KAAK,EAAC,UAAU;AAChBO,IAAAA,OAAO,EAAEjC,OAAAA;AAAQ,GAAA,CAEpB,eACDoB,yBAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,qBAAqB;IAC7BI,QAAQ,EAAE,CAAChD,MAAO;AAClB6C,IAAAA,KAAK,EAAEvB,iBAAkB;AACzB2B,IAAAA,OAAO,EAAE/C,YAAa;AACtB4C,IAAAA,GAAG,EAAEjB,eAAgB;AACrBW,IAAAA,KAAK,EAAC,QAAQ;AACdO,IAAAA,OAAO,EAAE/B,QAAAA;AAAS,GAAA,CAClB,CACW,CACT,CAAA;AAEZ;;;;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../src/components/Alert.jsx"],"sourcesContent":["import React, { useRef } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport Button from \"./Button\";\nimport Modal from \"./Modal\";\nimport Typography from \"./Typography\";\n\nconst SIZES = { small: \"small\", medium: \"medium\", large: \"large\" };\n\nconst FOCUSABLE_ELEMENTS = { submit: \"submit\", cancel: \"cancel\" };\n\nconst Alert = ({\n size = SIZES.medium,\n isOpen = false,\n isSubmitting = false,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n onClose = () => {},\n onSubmit = () => {},\n title = \"\",\n message = \"\",\n submitButtonLabel = \"Continue\",\n cancelButtonLabel = \"Cancel\",\n initialFocusRef,\n initialFocusElement,\n hideCancelButton = false,\n}) => {\n const submitButtonRef = useRef(null);\n const cancelButtonRef = useRef(null);\n\n const hasCustomFocusableElement = !!initialFocusRef || initialFocusElement;\n const initialFocusElementRef =\n initialFocusElement === FOCUSABLE_ELEMENTS.submit\n ? submitButtonRef\n : cancelButtonRef;\n\n return (\n <Modal\n {...{\n backdropClassName,\n className,\n closeButton,\n closeOnEsc,\n closeOnOutsideClick,\n isOpen,\n onClose,\n size,\n }}\n data-cy=\"alert-box\"\n {...(hasCustomFocusableElement && {\n initialFocusRef: initialFocusRef || initialFocusElementRef,\n })}\n >\n <Modal.Header>\n <Typography data-cy=\"alert-title\" style=\"h2\">\n {title}\n </Typography>\n </Modal.Header>\n <Modal.Body>\n <Typography data-cy=\"alert-message\" lineHeight=\"normal\" style=\"body2\">\n {message}\n </Typography>\n </Modal.Body>\n <Modal.Footer className=\"neeto-ui-gap-2 neeto-ui-flex neeto-ui-justify-end neeto-ui-items-center\">\n {!hideCancelButton && (\n <Button\n data-cy=\"alert-cancel-button\"\n label={cancelButtonLabel}\n ref={cancelButtonRef}\n style=\"tertiary\"\n onClick={onClose}\n />\n )}\n <Button\n data-cy=\"alert-submit-button\"\n disabled={!isOpen}\n label={submitButtonLabel}\n loading={isSubmitting}\n ref={submitButtonRef}\n style=\"danger\"\n onClick={onSubmit}\n />\n </Modal.Footer>\n </Modal>\n );\n};\n\nAlert.propTypes = {\n /**\n * To specify the size of the Alert.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Alert is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Alert is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the callback which will be invoked when the Alert is submitted.\n */\n onSubmit: PropTypes.func,\n /**\n * To provide title to the Alert.\n */\n title: PropTypes.string,\n /**\n * To provide description to the Alert.\n */\n message: PropTypes.node,\n /**\n * To add loading state to submit button\n */\n isSubmitting: PropTypes.bool,\n /**\n * To provide external classNames to the Alert.\n */\n className: PropTypes.string,\n /**\n * To close the Alert on pressing the `Esc` key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Alert should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To provide label to the submit button.\n */\n submitButtonLabel: PropTypes.string,\n /**\n * To provide label to the cancel button.\n */\n cancelButtonLabel: PropTypes.string,\n /**\n * To add custom classes to Backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Alert content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /**\n * To specify the ref of the element which will receive focus when the Alert is opened.\n * If not specified, the focus will be set to the submit button inside the Alert.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * To specify the element which will receive focus when the Alert is opened.\n */\n initialFocusElement: PropTypes.oneOf(Object.values(FOCUSABLE_ELEMENTS)),\n /**\n * To hide the cancel button\n */\n hideCancelButton: PropTypes.bool,\n};\n\nexport default Alert;\n"],"names":["SIZES","small","medium","large","FOCUSABLE_ELEMENTS","submit","cancel","Alert","_ref","_ref$size","size","_ref$isOpen","isOpen","_ref$isSubmitting","isSubmitting","_ref$className","className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","_ref$onClose","onClose","_ref$onSubmit","onSubmit","_ref$title","title","_ref$message","message","_ref$submitButtonLabe","submitButtonLabel","_ref$cancelButtonLabe","cancelButtonLabel","initialFocusRef","initialFocusElement","_ref$hideCancelButton","hideCancelButton","submitButtonRef","useRef","cancelButtonRef","hasCustomFocusableElement","initialFocusElementRef","React","createElement","Modal","_extends","Header","Typography","style","Body","lineHeight","Footer","Button","label","ref","onClick","disabled","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAMA,KAAK,GAAG;AAAEC,EAAAA,KAAK,EAAE,OAAO;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,KAAK,EAAE,OAAA;AAAQ,CAAC,CAAA;AAElE,IAAMC,kBAAkB,GAAG;AAAEC,EAAAA,MAAM,EAAE,QAAQ;AAAEC,EAAAA,MAAM,EAAE,QAAA;AAAS,CAAC,CAAA;AAEjE,IAAMC,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAkBL;AAAA,EAAA,IAAAC,SAAA,GAAAD,IAAA,CAjBJE,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,KAAA,CAAA,GAAGT,KAAK,CAACE,MAAM,GAAAO,SAAA;IAAAE,WAAA,GAAAH,IAAA,CACnBI,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,WAAA;IAAAE,iBAAA,GAAAL,IAAA,CACdM,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,iBAAA;IAAAE,cAAA,GAAAP,IAAA,CACpBQ,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IAAAE,eAAA,GAAAT,IAAA,CACdU,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,eAAA;IAAAE,gBAAA,GAAAX,IAAA,CACjBY,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,gBAAA;IAAAE,qBAAA,G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AK,CAACO,MAAM,EAAA;AAACvC,IAAAA,SAAS,EAAC,yEAAA;AAAyE,GAAA,EAC9F,CAACwB,gBAAgB,iBAChBM,yBAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,qBAAqB;AAC7BC,IAAAA,KAAK,EAAErB,iBAAkB;AACzBsB,IAAAA,GAAG,EAAEf,eAAgB;AACrBS,IAAAA,KAAK,EAAC,UAAU;AAChBO,IAAAA,OAAO,EAAEjC,OAAAA;AAAQ,GAAA,CAEpB,eACDoB,yBAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACL,IAAA,SAAA,EAAQ,qBAAqB;IAC7BI,QAAQ,EAAE,CAAChD,MAAO;AAClB6C,IAAAA,KAAK,EAAEvB,iBAAkB;AACzB2B,IAAAA,OAAO,EAAE/C,YAAa;AACtB4C,IAAAA,GAAG,EAAEjB,eAAgB;AACrBW,IAAAA,KAAK,EAAC,QAAQ;AACdO,IAAAA,OAAO,EAAE/B,QAAAA;AAAS,GAAA,CAClB,CACW,CACT,CAAA;AAEZ;;;;"}
@@ -25,7 +25,7 @@ require('react-colorful');
25
25
  require('./tinycolor-b1e9a7b2.js');
26
26
  require('./Dropdown.js');
27
27
  require('./index-7a8fe498.js');
28
- var DatePicker = require('./index-34eccc77.js');
28
+ var DatePicker = require('./index-481904b2.js');
29
29
  require('./Input.js');
30
30
  require('./Label.js');
31
31
  require('./MultiEmailInput.js');
@@ -83,10 +83,9 @@ require('dayjs/plugin/weekday');
83
83
  require('dayjs/plugin/weekOfYear');
84
84
  require('./en-c1fe180c.js');
85
85
  require('./Tooltip.js');
86
- require('./useOverlayManager-91348551.js');
86
+ require('./useOverlayManager-763ee731.js');
87
87
  require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
88
88
  require('@babel/runtime/helpers/esm/inheritsLoose');
89
- require('./index-63580e68.js');
90
89
  require('@babel/runtime/helpers/esm/assertThisInitialized');
91
90
  require('./constants.js');
92
91
  require('@babel/runtime/helpers/toArray');
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"DatePicker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/cjs/Modal.js CHANGED
@@ -7,7 +7,7 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
7
7
  var React = require('react');
8
8
  var classnames = require('classnames');
9
9
  var neetoIcons = require('@bigbinary/neeto-icons');
10
- var useOverlayManager = require('./useOverlayManager-91348551.js');
10
+ var useOverlayManager = require('./useOverlayManager-763ee731.js');
11
11
  var Button = require('./Button.js');
12
12
  require('react-router-dom');
13
13
  require('qs');
@@ -15,7 +15,6 @@ var Typography = require('./Typography.js');
15
15
  require('@babel/runtime/helpers/esm/extends');
16
16
  require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
17
17
  require('@babel/runtime/helpers/esm/inheritsLoose');
18
- require('./index-63580e68.js');
19
18
  require('react-dom');
20
19
  require('@babel/runtime/helpers/esm/assertThisInitialized');
21
20
  require('ramda');
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.js","sources":["../../src/components/Modal/Body.jsx","../../src/components/Modal/Footer.jsx","../../src/components/Modal/Header.jsx","../../src/components/Modal/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__body\", className)}\n data-cy={dataCy ?? \"modal-body\"}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify className to be applied to the Modal Body.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__footer\", className)}\n data-cy={dataCy ?? \"modal-footer\"}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Modal Footer.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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\nimport Typography from \"../Typography\";\n\nconst Header = ({ description = \"\", children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__header\", className)}\n data-cy={dataCy ?? \"modal-header\"}\n >\n {children}\n {description && (\n <div className=\"neeto-ui-modal__header-desc\" data-cy=\"modal-header-desc\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {description}\n </Typography>\n </div>\n )}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the short description of the Modal.\n */\n description: PropTypes.string,\n /**\n * To specify className to be applied to the Modal Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","import React, { useRef, useState } 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 { useOverlayManager, useOverlay } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\n\nconst SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n fullScreen: \"fullScreen\",\n};\n\nconst Modal = ({\n size = SIZES.medium,\n isOpen = false,\n onClose = () => {},\n children,\n finalFocusRef,\n initialFocusRef,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n blockScrollOnMount = true,\n closeOnOutsideClick = true,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const modalWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(modalWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n isOpen,\n initialFocusRef,\n finalFocusRef,\n overlayWrapper: modalWrapper,\n onClose,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n blockScrollOnMount,\n hasTransitionCompleted,\n });\n\n const isFullScreenModal = size === SIZES.fullScreen;\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-modal\"\n in={isOpen}\n timeout={300}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"modal-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-modal__backdrop\",\n {\n \"neeto-ui-modal__backdrop--fullscreen\": isFullScreenModal,\n },\n backdropClassName\n )}\n >\n <div\n aria-modal\n key=\"modal-wrapper\"\n ref={modalWrapper}\n role=\"dialog\"\n className={classnames(\"neeto-ui-modal__wrapper\", {\n \"neeto-ui-modal__wrapper--small\": size === SIZES.small,\n \"neeto-ui-modal__wrapper--medium\": size === SIZES.medium,\n \"neeto-ui-modal__wrapper--large\": size === SIZES.large,\n \"neeto-ui-modal__wrapper--fullscreen\": isFullScreenModal,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-modal__close\"\n data-cy=\"modal-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size={isFullScreenModal ? \"large\" : \"small\"}\n style={isFullScreenModal ? \"secondary\" : \"text\"}\n onClick={handleOverlayClose}\n />\n )}\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nModal.propTypes = {\n /**\n * To specify the size of the Modal.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Modal is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Modal is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Modal component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classNames to the Modal.\n */\n className: PropTypes.string,\n /**\n * To close the Modal on pressing the Esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Modal should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To add custom classes to backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Modal content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /*\n * To specify the ref of the element which will receive focus when the Modal is closed.\n * If not specified, the focus will be set to the element which was focused when the Modal was opened.\n * If the Modal was opened by clicking on a button, then the focus will be set to the button.\n * */\n finalFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the ref of the element which will receive focus when the Modal is opened.\n * If not specified, the focus will be set to the first focusable element inside the Modal.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify whether the scroll should be blocked when the Modal is opened.\n * */\n blockScrollOnMount: PropTypes.bool,\n};\n\nModal.Header = Header;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport default Modal;\n"],"names":["Body","_ref","children","className","dataCy","React","createElement","classnames","Footer","Header","_ref$description","description","Typography","lineHeight","style","SIZES","small","medium","large","fullScreen","Modal","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","finalFocusRef","initialFocusRef","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$blockScrollOnMou","blockScrollOnMount","_ref$closeOnOutsideCl","closeOnOutsideClick","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","modalWrapper","useRef","backdropRef","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isFullScreenModal","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","role","_defineProperty","Button","icon","Close","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBACzCC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,8BAAU,CAAC,sBAAsB,EAAEJ,SAAS,CAAE;AACzD,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,YAAA;AAAa,GAAA,EAE/BF,QAAQ,CACL,CAAA;AAAA,CACP;;ACPD,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAP,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,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AEM,IAAI,KAAKP,KAAK,CAACE,MAAM;AACxD,MAAA,gCAAgC,EAAEK,IAAI,KAAKP,KAAK,CAACG,KAAK;AACtD,MAAA,qCAAqC,EAAEwC,iBAAAA;KACtCvD,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;GAEpBqC,EAAAA,UAAU,GAEbP,WAAW,iBACV5B,yBAAA,CAAAC,aAAA,CAACoE,MAAM,EAAA;AACL,IAAA,YAAA,EAAW,OAAO;AAClBvE,IAAAA,SAAS,EAAC,uBAAuB;AACjC,IAAA,SAAA,EAAQ,oBAAoB;AAC5B,IAAA,aAAA,EAAY,cAAc;AAC1BwE,IAAAA,IAAI,EAAEC,gBAAM;AACZtD,IAAAA,IAAI,EAAEoC,iBAAiB,GAAG,OAAO,GAAG,OAAQ;AAC5C5C,IAAAA,KAAK,EAAE4C,iBAAiB,GAAG,WAAW,GAAG,MAAO;AAChDmB,IAAAA,OAAO,EAAErB,kBAAAA;AAAmB,GAAA,CAE/B,EACA,OAAOtD,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEuD,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BvD,QAAQ,CACR,CACG,CACG,CACT,CAAA;AAEb,EAAC;AA8DDkB,KAAK,CAACX,MAAM,GAAGA,MAAM,CAAA;AACrBW,KAAK,CAACpB,IAAI,GAAGA,IAAI,CAAA;AACjBoB,KAAK,CAACZ,MAAM,GAAGA,MAAM;;;;"}
1
+ {"version":3,"file":"Modal.js","sources":["../../src/components/Modal/Body.jsx","../../src/components/Modal/Footer.jsx","../../src/components/Modal/Header.jsx","../../src/components/Modal/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__body\", className)}\n data-cy={dataCy ?? \"modal-body\"}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify className to be applied to the Modal Body.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__footer\", className)}\n data-cy={dataCy ?? \"modal-footer\"}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Modal Footer.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal 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\nimport Typography from \"../Typography\";\n\nconst Header = ({ description = \"\", children, className, dataCy }) => (\n <div\n className={classnames(\"neeto-ui-modal__header\", className)}\n data-cy={dataCy ?? \"modal-header\"}\n >\n {children}\n {description && (\n <div className=\"neeto-ui-modal__header-desc\" data-cy=\"modal-header-desc\">\n <Typography lineHeight=\"normal\" style=\"body2\">\n {description}\n </Typography>\n </div>\n )}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the short description of the Modal.\n */\n description: PropTypes.string,\n /**\n * To specify className to be applied to the Modal Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Modal Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","import React, { useRef, useState } 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 { useOverlayManager, useOverlay } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\n\nconst SIZES = {\n small: \"small\",\n medium: \"medium\",\n large: \"large\",\n fullScreen: \"fullScreen\",\n};\n\nconst Modal = ({\n size = SIZES.medium,\n isOpen = false,\n onClose = () => {},\n children,\n finalFocusRef,\n initialFocusRef,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n blockScrollOnMount = true,\n closeOnOutsideClick = true,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const modalWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(modalWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n isOpen,\n initialFocusRef,\n finalFocusRef,\n overlayWrapper: modalWrapper,\n onClose,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n blockScrollOnMount,\n hasTransitionCompleted,\n });\n\n const isFullScreenModal = size === SIZES.fullScreen;\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-modal\"\n in={isOpen}\n timeout={300}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"modal-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-modal__backdrop\",\n {\n \"neeto-ui-modal__backdrop--fullscreen\": isFullScreenModal,\n },\n backdropClassName\n )}\n >\n <div\n aria-modal\n key=\"modal-wrapper\"\n ref={modalWrapper}\n role=\"dialog\"\n className={classnames(\"neeto-ui-modal__wrapper\", {\n \"neeto-ui-modal__wrapper--small\": size === SIZES.small,\n \"neeto-ui-modal__wrapper--medium\": size === SIZES.medium,\n \"neeto-ui-modal__wrapper--large\": size === SIZES.large,\n \"neeto-ui-modal__wrapper--fullscreen\": isFullScreenModal,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-modal__close\"\n data-cy=\"modal-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size={isFullScreenModal ? \"large\" : \"small\"}\n style={isFullScreenModal ? \"secondary\" : \"text\"}\n onClick={handleOverlayClose}\n />\n )}\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nModal.propTypes = {\n /**\n * To specify the size of the Modal.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Modal is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the Modal is closed.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Modal component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classNames to the Modal.\n */\n className: PropTypes.string,\n /**\n * To close the Modal on pressing the Esc key.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the close button of the Modal should be displayed or not.\n */\n closeButton: PropTypes.bool,\n /**\n * To add custom classes to backdrop component.\n */\n backdropClassName: PropTypes.string,\n /**\n * To close on clicking outside the Modal content.\n */\n closeOnOutsideClick: PropTypes.bool,\n /*\n * To specify the ref of the element which will receive focus when the Modal is closed.\n * If not specified, the focus will be set to the element which was focused when the Modal was opened.\n * If the Modal was opened by clicking on a button, then the focus will be set to the button.\n * */\n finalFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify the ref of the element which will receive focus when the Modal is opened.\n * If not specified, the focus will be set to the first focusable element inside the Modal.\n * */\n initialFocusRef: PropTypes.object,\n /**\n * <div class=\"neeto-ui-tag neeto-ui-tag--size-small neeto-ui-tag--style-outline neeto-ui-tag--style-success mb-2\">\n * New\n * </div>\n * To specify whether the scroll should be blocked when the Modal is opened.\n * */\n blockScrollOnMount: PropTypes.bool,\n};\n\nModal.Header = Header;\nModal.Body = Body;\nModal.Footer = Footer;\n\nexport default Modal;\n"],"names":["Body","_ref","children","className","dataCy","React","createElement","classnames","Footer","Header","_ref$description","description","Typography","lineHeight","style","SIZES","small","medium","large","fullScreen","Modal","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","finalFocusRef","initialFocusRef","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$blockScrollOnMou","blockScrollOnMount","_ref$closeOnOutsideCl","closeOnOutsideClick","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","modalWrapper","useRef","backdropRef","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isFullScreenModal","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","role","_defineProperty","Button","icon","Close","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM,CAAA;EAAA,oBACzCC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,8BAAU,CAAC,sBAAsB,EAAEJ,SAAS,CAAE;AACzD,IAAA,SAAA,EAASC,MAAM,KAAA,IAAA,IAANA,MAAM,KAAA,KAAA,CAAA,GAANA,MAAM,GAAI,YAAA;AAAa,GAAA,EAE/BF,QAAQ,CACL,CAAA;AAAA,CACP;;ACPD,IAAMM,MAAM,GAAG,SAATA,MAAMA,CAAAP,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS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AAK,CAACE,MAAM;AACxD,MAAA,gCAAgC,EAAEK,IAAI,KAAKP,KAAK,CAACG,KAAK;AACtD,MAAA,qCAAqC,EAAEwC,iBAAAA;KACtCvD,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;GAEpBqC,EAAAA,UAAU,GAEbP,WAAW,iBACV5B,yBAAA,CAAAC,aAAA,CAACoE,MAAM,EAAA;AACL,IAAA,YAAA,EAAW,OAAO;AAClBvE,IAAAA,SAAS,EAAC,uBAAuB;AACjC,IAAA,SAAA,EAAQ,oBAAoB;AAC5B,IAAA,aAAA,EAAY,cAAc;AAC1BwE,IAAAA,IAAI,EAAEC,gBAAM;AACZtD,IAAAA,IAAI,EAAEoC,iBAAiB,GAAG,OAAO,GAAG,OAAQ;AAC5C5C,IAAAA,KAAK,EAAE4C,iBAAiB,GAAG,WAAW,GAAG,MAAO;AAChDmB,IAAAA,OAAO,EAAErB,kBAAAA;AAAmB,GAAA,CAE/B,EACA,OAAOtD,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEuD,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BvD,QAAQ,CACR,CACG,CACG,CACT,CAAA;AAEb,EAAC;AA8DDkB,KAAK,CAACX,MAAM,GAAGA,MAAM,CAAA;AACrBW,KAAK,CAACpB,IAAI,GAAGA,IAAI,CAAA;AACjBoB,KAAK,CAACZ,MAAM,GAAGA,MAAM;;;;"}
package/dist/cjs/Pane.js CHANGED
@@ -7,14 +7,13 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
7
7
  var React = require('react');
8
8
  var classnames = require('classnames');
9
9
  var neetoIcons = require('@bigbinary/neeto-icons');
10
- var useOverlayManager = require('./useOverlayManager-91348551.js');
10
+ var useOverlayManager = require('./useOverlayManager-763ee731.js');
11
11
  var Button = require('./Button.js');
12
12
  require('react-router-dom');
13
13
  require('qs');
14
14
  require('@babel/runtime/helpers/esm/extends');
15
15
  require('@babel/runtime/helpers/esm/objectWithoutPropertiesLoose');
16
16
  require('@babel/runtime/helpers/esm/inheritsLoose');
17
- require('./index-63580e68.js');
18
17
  require('react-dom');
19
18
  require('@babel/runtime/helpers/esm/assertThisInitialized');
20
19
  require('ramda');
@@ -1 +1 @@
1
- {"version":3,"file":"Pane.js","sources":["../../src/components/Pane/Body.jsx","../../src/components/Pane/constants.js","../../src/components/Pane/Footer.jsx","../../src/components/Pane/Header.jsx","../../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","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\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","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeaderHeight = paneWrapper => {\n const header = paneWrapper.current.querySelector(\".neeto-ui-pane__header\");\n\n return header ? header.offsetHeight : DEFAULT_PANE_HEADER_HEIGHT;\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 { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeaderHeight } 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 paneWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(paneWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapper,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return;\n const headerHeight = getHeaderHeight(paneWrapper);\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapper.current.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n }\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={paneWrapper}\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","DEFAULT_PANE_HEADER_HEIGHT","Footer","Header","getHeaderHeight","paneWrapper","header","current","querySelector","offsetHeight","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","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","headerHeight","style","setProperty","concat","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,I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CAAC,wBAAwB,EAAAC,mCAAA,CAAA;AAC5C,MAAA,+BAA+B,EAAEe,IAAI,KAAKL,KAAK,CAACC,KAAK;AACrD,MAAA,+BAA+B,EAAEI,IAAI,KAAKL,KAAK,CAACE,KAAAA;KAC/ClB,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;GAEpBqC,EAAAA,UAAU,GAEbP,WAAW,iBACV3B,yBAAA,CAAAC,aAAA,CAACoE,MAAM,EAAA;AACL,IAAA,YAAA,EAAW,OAAO;AAClBxE,IAAAA,SAAS,EAAC,sBAAsB;AAChC,IAAA,SAAA,EAAQ,mBAAmB;AAC3B,IAAA,aAAA,EAAY,cAAc;AAC1ByE,IAAAA,IAAI,EAAEC,gBAAM;AACZrD,IAAAA,IAAI,EAAC,OAAO;AACZmC,IAAAA,KAAK,EAAC,MAAM;AACZmB,IAAAA,OAAO,EAAEvB,kBAAAA;AAAmB,GAAA,CAE/B,EACAR,sBAAsB,iBACrBzC,yBAAA,CAAAC,aAAA,CAAAD,yBAAA,CAAAyE,QAAA,QACG,OAAO7E,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEsD,IAAAA,aAAa,EAAbA,aAAAA;AAAc,GAAC,CAAC,GAC3BtD,QAAQ,CAEf,CACG,CACG,CACG,CACT,CAAA;AAEb,EAAC;AAsDDoB,IAAI,CAACV,MAAM,GAAGA,MAAM,CAAA;AACpBU,IAAI,CAACtB,IAAI,GAAGA,IAAI,CAAA;AAChBsB,IAAI,CAACX,MAAM,GAAGA,MAAM;;;;"}
1
+ {"version":3,"file":"Pane.js","sources":["../../src/components/Pane/Body.jsx","../../src/components/Pane/constants.js","../../src/components/Pane/Footer.jsx","../../src/components/Pane/Header.jsx","../../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","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\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","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeaderHeight = paneWrapper => {\n const header = paneWrapper.current.querySelector(\".neeto-ui-pane__header\");\n\n return header ? header.offsetHeight : DEFAULT_PANE_HEADER_HEIGHT;\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 { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeaderHeight } 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 paneWrapper = useRef(null);\n const backdropRef = useRef(null);\n\n useOverlayManager(paneWrapper, isOpen);\n\n const { handleOverlayClose, setFocusField } = useOverlay({\n overlayWrapper: paneWrapper,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted) return;\n const headerHeight = getHeaderHeight(paneWrapper);\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapper.current.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n }\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={paneWrapper}\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","DEFAULT_PANE_HEADER_HEIGHT","Footer","Header","getHeaderHeight","paneWrapper","header","current","querySelector","offsetHeight","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","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","useEffect","headerHeight","style","setProperty","concat","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,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,WAAW;AACnBJ,IAAAA,SAAS,EAAEK,8BAAU,CACnB,iGAAiG,EAAAC,mCAAA,CAAA;AAE/F,MAAA,iCAAiC,EAAEJ,SAAAA;KAClCF,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;AAExB,GAAA,EAEDD,QAAQ,CACL,CAAA;AAAA,CACP;;AClBM,IAAMQ,0BAA0B,GAAG,EAAE;;ACK5C,IAAMC,MAAM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