@bigbinary/neetoui 8.3.30 → 8.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.js +94 -76
- package/dist/Accordion.js.map +1 -1
- package/dist/ActionDropdown.js +29 -32
- package/dist/ActionDropdown.js.map +1 -1
- package/dist/Alert.js +44 -38
- package/dist/Alert.js.map +1 -1
- package/dist/Avatar.js +28 -22
- package/dist/Avatar.js.map +1 -1
- package/dist/Button.js +45 -43
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js +12 -7
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js +35 -28
- package/dist/Checkbox.js.map +1 -1
- package/dist/ColorPicker.js +134 -117
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +25 -9
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dropdown.js +75 -83
- package/dist/Dropdown.js.map +1 -1
- package/dist/Input.js +82 -70
- package/dist/Input.js.map +1 -1
- package/dist/Kbd.js +13 -7
- package/dist/Kbd.js.map +1 -1
- package/dist/Label.js +59 -40
- package/dist/Label.js.map +1 -1
- package/dist/Modal.js +76 -65
- package/dist/Modal.js.map +1 -1
- package/dist/MultiEmailInput.js +118 -99
- package/dist/MultiEmailInput.js.map +1 -1
- package/dist/NoData.js +55 -39
- package/dist/NoData.js.map +1 -1
- package/dist/Pagination.js +64 -52
- package/dist/Pagination.js.map +1 -1
- package/dist/Pane.js +66 -56
- package/dist/Pane.js.map +1 -1
- package/dist/Popover.js +10 -7
- package/dist/Popover.js.map +1 -1
- package/dist/ProgressBar.js +20 -17
- package/dist/ProgressBar.js.map +1 -1
- package/dist/Radio.js +50 -40
- package/dist/Radio.js.map +1 -1
- package/dist/Select.js +111 -90
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +265 -216
- package/dist/Sidebar.js.map +1 -1
- package/dist/Slider.js +45 -38
- package/dist/Slider.js.map +1 -1
- package/dist/Spinner.js +3 -2
- package/dist/Spinner.js.map +1 -1
- package/dist/Stepper.js +33 -26
- package/dist/Stepper.js.map +1 -1
- package/dist/Switch.js +56 -46
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +17 -11
- package/dist/Tab.js.map +1 -1
- package/dist/Table.js +221 -182
- package/dist/Table.js.map +1 -1
- package/dist/Tag.js +31 -24
- package/dist/Tag.js.map +1 -1
- package/dist/{Textarea-DlEGZFfG.js → Textarea-D1gsiIxm.js} +66 -56
- package/dist/{Textarea-DlEGZFfG.js.map → Textarea-D1gsiIxm.js.map} +1 -1
- package/dist/Textarea.js +4 -4
- package/dist/TimePicker.js +25 -9
- package/dist/TimePicker.js.map +1 -1
- package/dist/Toastr.js +46 -37
- package/dist/Toastr.js.map +1 -1
- package/dist/Tooltip.js +10 -6
- package/dist/Tooltip.js.map +1 -1
- package/dist/TranslationProvider.js +6 -4
- package/dist/TranslationProvider.js.map +1 -1
- package/dist/Tree.js +17 -15
- package/dist/Tree.js.map +1 -1
- package/dist/TreeSelect.js +65 -58
- package/dist/TreeSelect.js.map +1 -1
- package/dist/Typography.js +7 -3
- package/dist/Typography.js.map +1 -1
- package/dist/cjs/Accordion.js +94 -76
- package/dist/cjs/Accordion.js.map +1 -1
- package/dist/cjs/ActionDropdown.js +29 -32
- package/dist/cjs/ActionDropdown.js.map +1 -1
- package/dist/cjs/Alert.js +43 -37
- package/dist/cjs/Alert.js.map +1 -1
- package/dist/cjs/Avatar.js +27 -21
- package/dist/cjs/Avatar.js.map +1 -1
- package/dist/cjs/Button.js +45 -43
- package/dist/cjs/Button.js.map +1 -1
- package/dist/cjs/Callout.js +11 -6
- package/dist/cjs/Callout.js.map +1 -1
- package/dist/cjs/Checkbox.js +34 -27
- package/dist/cjs/Checkbox.js.map +1 -1
- package/dist/cjs/ColorPicker.js +132 -115
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +25 -9
- package/dist/cjs/DatePicker.js.map +1 -1
- package/dist/cjs/Dropdown.js +74 -82
- package/dist/cjs/Dropdown.js.map +1 -1
- package/dist/cjs/Input.js +81 -69
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Kbd.js +13 -7
- package/dist/cjs/Kbd.js.map +1 -1
- package/dist/cjs/Label.js +59 -40
- package/dist/cjs/Label.js.map +1 -1
- package/dist/cjs/Modal.js +76 -65
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +117 -98
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/NoData.js +55 -39
- package/dist/cjs/NoData.js.map +1 -1
- package/dist/cjs/Pagination.js +63 -51
- package/dist/cjs/Pagination.js.map +1 -1
- package/dist/cjs/Pane.js +65 -55
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/Popover.js +10 -7
- package/dist/cjs/Popover.js.map +1 -1
- package/dist/cjs/ProgressBar.js +20 -17
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/dist/cjs/Radio.js +49 -39
- package/dist/cjs/Radio.js.map +1 -1
- package/dist/cjs/Select.js +110 -89
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/Sidebar.js +268 -219
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/Slider.js +45 -38
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Spinner.js +3 -2
- package/dist/cjs/Spinner.js.map +1 -1
- package/dist/cjs/Stepper.js +33 -26
- package/dist/cjs/Stepper.js.map +1 -1
- package/dist/cjs/Switch.js +55 -45
- package/dist/cjs/Switch.js.map +1 -1
- package/dist/cjs/Tab.js +17 -11
- package/dist/cjs/Tab.js.map +1 -1
- package/dist/cjs/Table.js +224 -185
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/Tag.js +30 -23
- package/dist/cjs/Tag.js.map +1 -1
- package/dist/cjs/{Textarea-CiUKmQHr.js → Textarea-BzBZbgdT.js} +65 -55
- package/dist/cjs/{Textarea-CiUKmQHr.js.map → Textarea-BzBZbgdT.js.map} +1 -1
- package/dist/cjs/Textarea.js +4 -4
- package/dist/cjs/TimePicker.js +25 -9
- package/dist/cjs/TimePicker.js.map +1 -1
- package/dist/cjs/Toastr.js +45 -36
- package/dist/cjs/Toastr.js.map +1 -1
- package/dist/cjs/Tooltip.js +10 -6
- package/dist/cjs/Tooltip.js.map +1 -1
- package/dist/cjs/TranslationProvider.js +5 -3
- package/dist/cjs/TranslationProvider.js.map +1 -1
- package/dist/cjs/Tree.js +17 -15
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/TreeSelect.js +66 -59
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/Typography.js +7 -3
- package/dist/cjs/Typography.js.map +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/formik/ActionBlock.js +16 -9
- package/dist/cjs/formik/ActionBlock.js.map +1 -1
- package/dist/cjs/formik/BlockNavigation.js +40 -30
- package/dist/cjs/formik/BlockNavigation.js.map +1 -1
- package/dist/cjs/formik/Button.js +5 -3
- package/dist/cjs/formik/Button.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +29 -28
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Form.js +53 -47
- package/dist/cjs/formik/Form.js.map +1 -1
- package/dist/cjs/formik/Input.js +27 -26
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +10 -6
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Radio.js +7 -7
- package/dist/cjs/formik/Radio.js.map +1 -1
- package/dist/cjs/formik/Select.js +15 -10
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +7 -7
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +31 -28
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +28 -27
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +8 -5
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +11 -7
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/{index-eifA8CnA.js → index-Dv40T5Ly.js} +195 -169
- package/dist/cjs/{index-eifA8CnA.js.map → index-Dv40T5Ly.js.map} +1 -1
- package/dist/cjs/{index--BeRLo6L.js → index-h3QcOeWw.js} +12 -14
- package/dist/cjs/{index--BeRLo6L.js.map → index-h3QcOeWw.js.map} +1 -1
- package/dist/cjs/index.css +1 -2
- package/dist/cjs/index.js +26 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts.js +8 -3
- package/dist/cjs/layouts.js.map +1 -1
- package/dist/cjs/overlayManager.js +1 -2
- package/dist/cjs/overlayManager.js.map +1 -1
- package/dist/cjs/{react-select-creatable.esm-Bdv9YAMt.js → react-select-creatable.esm-lcdODVBz.js} +449 -243
- package/dist/cjs/react-select-creatable.esm-lcdODVBz.js.map +1 -0
- package/dist/cjs/useId-DXHUzdxd.js.map +1 -1
- package/dist/cjs/{useOverlayManager-CxBh9gVG.js → useOverlayManager-Bj58uLfc.js} +14 -9
- package/dist/cjs/{useOverlayManager-CxBh9gVG.js.map → useOverlayManager-Bj58uLfc.js.map} +1 -1
- package/dist/cjs/useQueryParams-BrrbBvY_.js +18 -0
- package/dist/cjs/{useQueryParams-l5fJJYCR.js.map → useQueryParams-BrrbBvY_.js.map} +1 -1
- package/dist/cjs/useRecentlyUsedColors-BcOkiB-v.js +1239 -0
- package/dist/cjs/useRecentlyUsedColors-BcOkiB-v.js.map +1 -0
- package/dist/cjs/useRestoreScrollPosition-DP8SUs19.js +236 -0
- package/dist/cjs/useRestoreScrollPosition-DP8SUs19.js.map +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/formik/ActionBlock.js +16 -9
- package/dist/formik/ActionBlock.js.map +1 -1
- package/dist/formik/BlockNavigation.js +41 -31
- package/dist/formik/BlockNavigation.js.map +1 -1
- package/dist/formik/Button.js +6 -4
- package/dist/formik/Button.js.map +1 -1
- package/dist/formik/Checkbox.js +30 -29
- package/dist/formik/Checkbox.js.map +1 -1
- package/dist/formik/Form.js +54 -48
- package/dist/formik/Form.js.map +1 -1
- package/dist/formik/Input.js +28 -27
- package/dist/formik/Input.js.map +1 -1
- package/dist/formik/MultiEmailInput.js +11 -7
- package/dist/formik/MultiEmailInput.js.map +1 -1
- package/dist/formik/Radio.js +7 -7
- package/dist/formik/Radio.js.map +1 -1
- package/dist/formik/Select.js +17 -12
- package/dist/formik/Select.js.map +1 -1
- package/dist/formik/Slider.js +8 -8
- package/dist/formik/Slider.js.map +1 -1
- package/dist/formik/Switch.js +31 -28
- package/dist/formik/Switch.js.map +1 -1
- package/dist/formik/Textarea.js +29 -28
- package/dist/formik/Textarea.js.map +1 -1
- package/dist/formik/TreeSelect.js +9 -6
- package/dist/formik/TreeSelect.js.map +1 -1
- package/dist/formik/index.js +11 -7
- package/dist/formik/index.js.map +1 -1
- package/dist/{index-Dxaw6gl9.js → index-D6vmwyYl.js} +14 -16
- package/dist/index-D6vmwyYl.js.map +1 -0
- package/dist/{index-ITIifSw4.js → index-D6yXgUQN.js} +196 -170
- package/dist/{index-ITIifSw4.js.map → index-D6yXgUQN.js.map} +1 -1
- package/dist/index.css +1 -2
- package/dist/index.js +26 -10
- package/dist/index.js.map +1 -1
- package/dist/layouts.js +8 -3
- package/dist/layouts.js.map +1 -1
- package/dist/overlayManager.js +1 -2
- package/dist/overlayManager.js.map +1 -1
- package/dist/{react-select-creatable.esm-Dx_vEnyD.js → react-select-creatable.esm-opiJTCqo.js} +450 -244
- package/dist/react-select-creatable.esm-opiJTCqo.js.map +1 -0
- package/dist/useId-Jj9hXm-g.js.map +1 -1
- package/dist/{useOverlayManager-AZIGhUYS.js → useOverlayManager-BzuBvhPZ.js} +14 -9
- package/dist/{useOverlayManager-AZIGhUYS.js.map → useOverlayManager-BzuBvhPZ.js.map} +1 -1
- package/dist/useQueryParams-BKsf4FPY.js +16 -0
- package/dist/{useQueryParams-b60CHFUx.js.map → useQueryParams-BKsf4FPY.js.map} +1 -1
- package/dist/useRecentlyUsedColors-CtvdF-KQ.js +1236 -0
- package/dist/useRecentlyUsedColors-CtvdF-KQ.js.map +1 -0
- package/dist/useRestoreScrollPosition-BVX-mT5c.js +225 -0
- package/dist/useRestoreScrollPosition-BVX-mT5c.js.map +1 -0
- package/package.json +42 -48
- package/dist/cjs/react-select-creatable.esm-Bdv9YAMt.js.map +0 -1
- package/dist/cjs/useQueryParams-l5fJJYCR.js +0 -18
- package/dist/cjs/useRecentlyUsedColors-3cKx-eDH.js +0 -1270
- package/dist/cjs/useRecentlyUsedColors-3cKx-eDH.js.map +0 -1
- package/dist/cjs/useRestoreScrollPosition-PsoENtiB.js +0 -218
- package/dist/cjs/useRestoreScrollPosition-PsoENtiB.js.map +0 -1
- package/dist/index-Dxaw6gl9.js.map +0 -1
- package/dist/react-select-creatable.esm-Dx_vEnyD.js.map +0 -1
- package/dist/useQueryParams-b60CHFUx.js +0 -16
- package/dist/useRecentlyUsedColors-CqUfqfck.js +0 -1267
- package/dist/useRecentlyUsedColors-CqUfqfck.js.map +0 -1
- package/dist/useRestoreScrollPosition-C1NSANQW.js +0 -207
- package/dist/useRestoreScrollPosition-C1NSANQW.js.map +0 -1
- package/src/translations/ar.json +0 -41
- package/src/translations/bg.json +0 -41
- package/src/translations/ca.json +0 -41
- package/src/translations/cs.json +0 -41
- package/src/translations/da.json +0 -41
- package/src/translations/de.json +0 -41
- package/src/translations/en.json +0 -41
- package/src/translations/es-MX.json +0 -41
- package/src/translations/es.json +0 -41
- package/src/translations/et.json +0 -41
- package/src/translations/fi.json +0 -41
- package/src/translations/fil.json +0 -41
- package/src/translations/fr.json +0 -41
- package/src/translations/hi.json +0 -41
- package/src/translations/hr.json +0 -41
- package/src/translations/id.json +0 -41
- package/src/translations/index.js +0 -18
- package/src/translations/it.json +0 -41
- package/src/translations/ja.json +0 -41
- package/src/translations/ko.json +0 -41
- package/src/translations/nl.json +0 -41
- package/src/translations/pl.json +0 -41
- package/src/translations/pt-BR.json +0 -41
- package/src/translations/pt.json +0 -41
- package/src/translations/ro.json +0 -41
- package/src/translations/ru.json +0 -41
- package/src/translations/sk.json +0 -41
- package/src/translations/sl.json +0 -41
- package/src/translations/sv.json +0 -41
- package/src/translations/th.json +0 -41
- package/src/translations/tr.json +0 -41
- package/src/translations/uk.json +0 -41
- package/src/translations/vi.json +0 -41
- package/src/translations/zh-CN.json +0 -41
- package/src/translations/zh-TW.json +0 -41
package/dist/Pane.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pane.js","sources":["../src/components/Pane/Body.jsx","../src/components/Pane/Footer.jsx","../src/components/Pane/Header.jsx","../src/components/Pane/constants.js","../src/components/Pane/utils.js","../src/components/Pane/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, hasFooter = true }) => (\n <div\n data-cy=\"pane-body\"\n className={classnames(\n \"neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start\",\n {\n \"neeto-ui-pane__body--has-footer\": hasFooter,\n [className]: className,\n }\n )}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify if the Pane has a footer.\n * @default true\n */\n hasFooter: PropTypes.bool,\n /**\n * To specify className to be applied to the Pane Body container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className }) => (\n <div\n className={classnames(\n \"neeto-ui-pane__footer neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Pane Footer container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Header = ({ children, className }) => (\n <div\n className={classnames(\"neeto-ui-pane__header\", className)}\n data-cy=\"pane-header\"\n >\n {children}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * To specify className to be applied to the Pane Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\n","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeader = paneWrapperRef =>\n paneWrapperRef.current?.querySelector(\".neeto-ui-pane__header\");\n\nexport const updateHeaderHeight = (header, paneWrapperRef) => {\n const headerHeight = header?.offsetHeight;\n\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapperRef.current?.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n } else {\n paneWrapperRef.current?.style.removeProperty(\n \"--neeto-ui-pane-header-height\"\n );\n }\n};\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlay, useOverlayManager } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeader, updateHeaderHeight } from \"./utils\";\n\nconst SIZES = { small: \"small\", large: \"large\", extraLarge: \"extraLarge\" };\n\nconst Pane = ({\n size = SIZES.small,\n isOpen = false,\n onClose = () => {},\n children,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const paneWrapperRef = useRef(null);\n const backdropRef = useRef(null);\n\n const observerRef = useRef(\n new ResizeObserver(([entry]) =>\n updateHeaderHeight(entry.target, paneWrapperRef)\n )\n );\n\n useOverlayManager(paneWrapperRef, isOpen);\n\n const { handleOverlayClose, setFocusField, isTopOverlay } = useOverlay({\n overlayWrapper: paneWrapperRef,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted || !paneWrapperRef.current) return undefined;\n\n const observer = observerRef.current;\n const header = getHeader(paneWrapperRef);\n\n if (header) {\n observer.observe(header);\n\n return () => observer.disconnect();\n }\n\n const mutationObserver = new MutationObserver(() => {\n const header = getHeader(paneWrapperRef);\n if (!header) return;\n\n observer.observe(header);\n mutationObserver.disconnect();\n });\n\n mutationObserver.observe(paneWrapperRef.current, {\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n observer.disconnect();\n };\n }, [hasTransitionCompleted, isTopOverlay]);\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-pane\"\n in={isOpen}\n timeout={230}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"pane-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end\",\n backdropClassName\n )}\n >\n <div\n data-cy=\"pane-wrapper\"\n key=\"pane-wrapper\"\n ref={paneWrapperRef}\n className={classnames(\"neeto-ui-pane__wrapper\", {\n \"neeto-ui-pane__wrapper--small\": size === SIZES.small,\n \"neeto-ui-pane__wrapper--large\": size === SIZES.large,\n \"neeto-ui-pane__wrapper--extralarge\": size === SIZES.extraLarge,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-pane__close\"\n data-cy=\"pane-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n onClick={handleOverlayClose}\n />\n )}\n {hasTransitionCompleted && (\n <>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </>\n )}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nPane.propTypes = {\n /**\n * To specify the size of the Pane.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Pane component is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the close button of Pane is clicked.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Pane component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classname to the Pane component.\n */\n className: PropTypes.string,\n /**\n * To specify whether the Pane component should close on esc key press.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Pane component should render close button.\n */\n closeButton: PropTypes.bool,\n /**\n * To specify the classname to be applied to the backdrop element.\n */\n backdropClassName: PropTypes.string,\n /**\n * To specify whether the Pane component should close on outside click.\n */\n closeOnOutsideClick: PropTypes.bool,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is opened.\n * If not specified, the first focusable element inside the Pane component will be focused.\n * If there are no focusable elements, the Pane component itself will be focused.\n */\n initialFocusRef: PropTypes.object,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is closed.\n * If not specified, the element which was focused when the Pane component was opened will be focused.\n */\n finalFocusRef: PropTypes.object,\n};\n\nPane.Header = Header;\nPane.Body = Body;\nPane.Footer = Footer;\n\nexport default Pane;\n"],"names":["Body","_ref","children","className","_ref$hasFooter","hasFooter","React","createElement","classnames","_defineProperty","Footer","Header","DEFAULT_PANE_HEADER_HEIGHT","getHeader","paneWrapperRef","_paneWrapperRef$curre","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre2","style","setProperty","concat","_paneWrapperRef$curre3","removeProperty","SIZES","small","large","extraLarge","Pane","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","initialFocusRef","finalFocusRef","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","useRef","backdropRef","observerRef","ResizeObserver","_ref2","_ref3","entry","target","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isTopOverlay","useEffect","undefined","observer","observe","disconnect","mutationObserver","MutationObserver","childList","subtree","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","key","ref","_extends","Button","icon","Close","onClick","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,cAAA,CAAA;EAAA,oBACnDE,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,WAAW;AACnBJ,IAAAA,SAAS,EAAEK,UAAU,CACnB,iGAAiG,EAAAC,eAAA,CAAA;AAE/F,MAAA,iCAAiC,EAAEJ,SAAAA;KAClCF,EAAAA,SAAS,EAAGA,SAAS,CAAA,CAAA;AAExB,GAAA,EAEDD,QAAQ,CACL,CAAA;AAAA,CACP;;ACbD,IAAMQ,MA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"file":"Pane.js","sources":["../src/components/Pane/Body.jsx","../src/components/Pane/Footer.jsx","../src/components/Pane/Header.jsx","../src/components/Pane/constants.js","../src/components/Pane/utils.js","../src/components/Pane/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Body = ({ children, className, hasFooter = true }) => (\n <div\n data-cy=\"pane-body\"\n className={classnames(\n \"neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start\",\n {\n \"neeto-ui-pane__body--has-footer\": hasFooter,\n [className]: className,\n }\n )}\n >\n {children}\n </div>\n);\n\nBody.propTypes = {\n /**\n * To specify if the Pane has a footer.\n * @default true\n */\n hasFooter: PropTypes.bool,\n /**\n * To specify className to be applied to the Pane Body container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Body.\n */\n children: PropTypes.node,\n};\n\nexport default Body;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Footer = ({ children, className }) => (\n <div\n className={classnames(\n \"neeto-ui-pane__footer neeto-ui-flex neeto-ui-items-center\",\n className\n )}\n >\n {children}\n </div>\n);\n\nFooter.propTypes = {\n /**\n * To specify className to be applied to the Pane Footer container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Footer.\n */\n children: PropTypes.node,\n};\n\nexport default Footer;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Header = ({ children, className }) => (\n <div\n className={classnames(\"neeto-ui-pane__header\", className)}\n data-cy=\"pane-header\"\n >\n {children}\n </div>\n);\n\nHeader.propTypes = {\n /**\n * To specify className to be applied to the Pane Header container.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Pane Header.\n */\n children: PropTypes.node,\n};\n\nexport default Header;\n","export const DEFAULT_PANE_HEADER_HEIGHT = 78;\n","import { DEFAULT_PANE_HEADER_HEIGHT } from \"./constants\";\n\nexport const getHeader = paneWrapperRef =>\n paneWrapperRef.current?.querySelector(\".neeto-ui-pane__header\");\n\nexport const updateHeaderHeight = (header, paneWrapperRef) => {\n const headerHeight = header?.offsetHeight;\n\n if (headerHeight > DEFAULT_PANE_HEADER_HEIGHT) {\n paneWrapperRef.current?.style.setProperty(\n \"--neeto-ui-pane-header-height\",\n `${headerHeight}px`\n );\n } else {\n paneWrapperRef.current?.style.removeProperty(\n \"--neeto-ui-pane-header-height\"\n );\n }\n};\n","import React, { useRef, useState, useEffect } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\nimport { CSSTransition } from \"react-transition-group\";\n\nimport Backdrop from \"atoms/Backdrop\";\nimport Portal from \"atoms/Portal\";\nimport Button from \"components/Button\";\nimport { useOverlay, useOverlayManager } from \"hooks\";\n\nimport Body from \"./Body\";\nimport Footer from \"./Footer\";\nimport Header from \"./Header\";\nimport { getHeader, updateHeaderHeight } from \"./utils\";\n\nconst SIZES = { small: \"small\", large: \"large\", extraLarge: \"extraLarge\" };\n\nconst Pane = ({\n size = SIZES.small,\n isOpen = false,\n onClose = () => {},\n children,\n className = \"\",\n closeOnEsc = true,\n closeButton = true,\n backdropClassName = \"\",\n closeOnOutsideClick = true,\n initialFocusRef,\n finalFocusRef,\n ...otherProps\n}) => {\n const [hasTransitionCompleted, setHasTransitionCompleted] = useState(false);\n\n const paneWrapperRef = useRef(null);\n const backdropRef = useRef(null);\n\n const observerRef = useRef(\n new ResizeObserver(([entry]) =>\n updateHeaderHeight(entry.target, paneWrapperRef)\n )\n );\n\n useOverlayManager(paneWrapperRef, isOpen);\n\n const { handleOverlayClose, setFocusField, isTopOverlay } = useOverlay({\n overlayWrapper: paneWrapperRef,\n backdropRef,\n closeOnOutsideClick,\n closeOnEsc,\n onClose,\n isOpen,\n initialFocusRef,\n finalFocusRef,\n hasTransitionCompleted,\n });\n\n useEffect(() => {\n if (!hasTransitionCompleted || !paneWrapperRef.current) return undefined;\n\n const observer = observerRef.current;\n const header = getHeader(paneWrapperRef);\n\n if (header) {\n observer.observe(header);\n\n return () => observer.disconnect();\n }\n\n const mutationObserver = new MutationObserver(() => {\n const header = getHeader(paneWrapperRef);\n if (!header) return;\n\n observer.observe(header);\n mutationObserver.disconnect();\n });\n\n mutationObserver.observe(paneWrapperRef.current, {\n childList: true,\n subtree: true,\n });\n\n return () => {\n mutationObserver.disconnect();\n observer.disconnect();\n };\n }, [hasTransitionCompleted, isTopOverlay]);\n\n return (\n <Portal rootId=\"neeto-ui-portal\">\n <CSSTransition\n unmountOnExit\n appear={isOpen}\n classNames=\"neeto-ui-pane\"\n in={isOpen}\n timeout={230}\n onEntered={() => setHasTransitionCompleted(true)}\n onExited={() => setHasTransitionCompleted(false)}\n >\n <Backdrop\n data-testid=\"backdrop\"\n key=\"pane-backdrop\"\n ref={backdropRef}\n className={classnames(\n \"neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end\",\n backdropClassName\n )}\n >\n <div\n data-cy=\"pane-wrapper\"\n key=\"pane-wrapper\"\n ref={paneWrapperRef}\n className={classnames(\"neeto-ui-pane__wrapper\", {\n \"neeto-ui-pane__wrapper--small\": size === SIZES.small,\n \"neeto-ui-pane__wrapper--large\": size === SIZES.large,\n \"neeto-ui-pane__wrapper--extralarge\": size === SIZES.extraLarge,\n [className]: className,\n })}\n {...otherProps}\n >\n {closeButton && (\n <Button\n aria-label=\"Close\"\n className=\"neeto-ui-pane__close\"\n data-cy=\"pane-close-button\"\n data-testid=\"close-button\"\n icon={Close}\n size=\"small\"\n style=\"text\"\n onClick={handleOverlayClose}\n />\n )}\n {hasTransitionCompleted && (\n <>\n {typeof children === \"function\"\n ? children({ setFocusField })\n : children}\n </>\n )}\n </div>\n </Backdrop>\n </CSSTransition>\n </Portal>\n );\n};\n\nPane.propTypes = {\n /**\n * To specify the size of the Pane.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To specify whether the Pane component is open or not.\n */\n isOpen: PropTypes.bool,\n /**\n * To specify the callback which will be invoked when the close button of Pane is clicked.\n */\n onClose: PropTypes.func,\n /**\n * To specify the content to be rendered inside the Pane component.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * To provide external classname to the Pane component.\n */\n className: PropTypes.string,\n /**\n * To specify whether the Pane component should close on esc key press.\n */\n closeOnEsc: PropTypes.bool,\n /**\n * To specify whether the Pane component should render close button.\n */\n closeButton: PropTypes.bool,\n /**\n * To specify the classname to be applied to the backdrop element.\n */\n backdropClassName: PropTypes.string,\n /**\n * To specify whether the Pane component should close on outside click.\n */\n closeOnOutsideClick: PropTypes.bool,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is opened.\n * If not specified, the first focusable element inside the Pane component will be focused.\n * If there are no focusable elements, the Pane component itself will be focused.\n */\n initialFocusRef: PropTypes.object,\n\n /**\n * To specify the ref of the element which should be focused when the Pane component is closed.\n * If not specified, the element which was focused when the Pane component was opened will be focused.\n */\n finalFocusRef: PropTypes.object,\n};\n\nPane.Header = Header;\nPane.Body = Body;\nPane.Footer = Footer;\n\nexport default Pane;\n"],"names":["Body","_ref","children","className","_ref$hasFooter","hasFooter","_jsx","classnames","_defineProperty","Footer","Header","DEFAULT_PANE_HEADER_HEIGHT","getHeader","paneWrapperRef","_paneWrapperRef$curre","current","querySelector","updateHeaderHeight","header","headerHeight","offsetHeight","_paneWrapperRef$curre2","style","setProperty","concat","_paneWrapperRef$curre3","removeProperty","SIZES","small","large","extraLarge","Pane","_ref$size","size","_ref$isOpen","isOpen","_ref$onClose","onClose","_ref$className","_ref$closeOnEsc","closeOnEsc","_ref$closeButton","closeButton","_ref$backdropClassNam","backdropClassName","_ref$closeOnOutsideCl","closeOnOutsideClick","initialFocusRef","finalFocusRef","otherProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","hasTransitionCompleted","setHasTransitionCompleted","useRef","backdropRef","observerRef","ResizeObserver","_ref2","_ref3","entry","target","useOverlayManager","_useOverlay","useOverlay","overlayWrapper","handleOverlayClose","setFocusField","isTopOverlay","useEffect","undefined","observer","observe","disconnect","mutationObserver","MutationObserver","childList","subtree","Portal","rootId","CSSTransition","unmountOnExit","appear","classNames","timeout","onEntered","onExited","Backdrop","ref","_jsxs","_objectSpread","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,KAAA,MAAA,GAAG,IAAI,GAAAA,cAAA;AAAA,EAAA,oBACnDE,GAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,WAAW;AACnBH,IAAAA,SAAS,EAAEI,UAAU,CACnB,iGAAiG,EAAAC,eAAA,CAAA;AAE/F,MAAA,iCAAiC,EAAEH;AAAS,KAAA,EAC3CF,SAAS,EAAGA,SAAS,CAE1B,CAAE;AAAAD,IAAAA,QAAA,EAEDA;AAAQ,GACN,CAAC;AAAA,CACP;;ACbD,IAAMO,MAAM,GAAG,SAATA,MAAMA,CAAAR,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;AAAA,EAAA,oBACnCG,GAAA,CAAA,KAAA,EAAA;AACEH,IAAAA,SAAS,EAAEI,UAAU,CACnB,2DAA2D,EAC3DJ,SACF,CAAE;AAAAD,IAAAA,QAAA,EAEDA;AAAQ,GACN,CAAC;AAAA,CACP;;ACTD,IAAMQ,MAAM,GAAG,SAATA,MAAMA,CAAAT,IAAA,EAAA;AAAA,EAAA,IAAMC,QAAQ,GAAAD,IAAA,CAAR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M;AACZ4E,YAAAA,OAAO,EAAE5B;AAAmB,WAC7B,CACF,EACAd,sBAAsB,iBACrBlD,GAAA,CAAA6F,QAAA,EAAA;AAAAjG,YAAAA,QAAA,EACG,OAAOA,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;AAAEqE,cAAAA,aAAa,EAAbA;AAAc,aAAC,CAAC,GAC3BrE;AAAQ,WACZ,CACH;AAAA,SAAA,CAAA,EA5BG,cA6BD;AAAC,OAAA,EAtCF,eAuCI;KACG;AAAC,GACV,CAAC;AAEb;AAsDA6B,IAAI,CAACrB,MAAM,GAAGA,MAAM;AACpBqB,IAAI,CAAC/B,IAAI,GAAGA,IAAI;AAChB+B,IAAI,CAACtB,MAAM,GAAGA,MAAM;;;;"}
|
package/dist/Popover.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
-
import
|
|
3
|
+
import 'react';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import Typography from './Typography.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
7
|
import Tooltip from './Tooltip.js';
|
|
7
|
-
import '@babel/runtime/helpers/defineProperty';
|
|
8
8
|
import '@babel/runtime/helpers/slicedToArray';
|
|
9
9
|
import '@tippyjs/react';
|
|
10
10
|
import 'tippy.js';
|
|
@@ -12,16 +12,19 @@ import 'tippy.js';
|
|
|
12
12
|
var Title = function Title(_ref) {
|
|
13
13
|
var className = _ref.className,
|
|
14
14
|
children = _ref.children;
|
|
15
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
16
16
|
className: classnames("neeto-ui-mb-1", className),
|
|
17
17
|
"data-testid": "popover-title",
|
|
18
18
|
lineHeight: "snug",
|
|
19
19
|
style: "h5",
|
|
20
|
-
weight: "semibold"
|
|
21
|
-
|
|
20
|
+
weight: "semibold",
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
var _excluded = ["children", "className", "theme"];
|
|
26
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
28
|
var Popover = function Popover(_ref) {
|
|
26
29
|
var children = _ref.children,
|
|
27
30
|
_ref$className = _ref.className,
|
|
@@ -29,7 +32,7 @@ var Popover = function Popover(_ref) {
|
|
|
29
32
|
_ref$theme = _ref.theme,
|
|
30
33
|
theme = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
31
34
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/jsx(Tooltip, _objectSpread({
|
|
33
36
|
theme: theme,
|
|
34
37
|
arrow: true,
|
|
35
38
|
interactive: true,
|
package/dist/Popover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../src/components/Popover/Title.jsx","../src/components/Popover/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Typography from \"../Typography\";\n\nconst Title = ({ className, children }) => (\n <Typography\n className={classnames(\"neeto-ui-mb-1\", className)}\n data-testid=\"popover-title\"\n lineHeight=\"snug\"\n style=\"h5\"\n weight=\"semibold\"\n >\n {children}\n </Typography>\n);\n\nTitle.propTypes = {\n /**\n * To specify className to be applied to the Popover Title.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Popover Title.\n */\n children: PropTypes.node,\n};\n\nexport default Title;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Title from \"./Title\";\n\nimport Tooltip from \"../Tooltip\";\n\nconst Popover = ({\n children,\n className = \"\",\n theme = \"light\",\n ...otherProps\n}) => (\n <Tooltip\n {...{ theme }}\n arrow\n interactive\n className={classnames(\"neeto-ui-popover\", className)}\n content={children}\n {...otherProps}\n />\n);\n\nPopover.propTypes = {\n /**\n * The content to be rendered inside the popup.\n */\n children: PropTypes.node,\n /**\n * The popover will be positioned next to the specified element.\n */\n reference: PropTypes.oneOfType([\n // Either a function\n PropTypes.func,\n // Or the instance of a DOM native element (see the note about SSR)\n PropTypes.shape({ current: PropTypes.instanceOf(Element) }),\n ]),\n /**\n * To display Popover in dark or light theme. By default the theme is dark.\n */\n theme: PropTypes.oneOf([\"dark\", \"light\"]),\n /**\n * To specify whether the Popover is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify the position of the Popover.\n */\n position: PropTypes.string,\n /**\n * To auto-hide the Popover after n-milliseconds.\n * Negative values to this prop disables this feature.\n * By default it's disabled.\n */\n hideAfter: PropTypes.number,\n /**\n * To auto-hide the Popover on when target leaves the screen.\n * By default it's disabled.\n */\n hideOnTargetExit: PropTypes.bool,\n};\n\nPopover.Title = Title;\n\nexport default Popover;\n"],"names":["Title","_ref","className","children","
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../src/components/Popover/Title.jsx","../src/components/Popover/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Typography from \"../Typography\";\n\nconst Title = ({ className, children }) => (\n <Typography\n className={classnames(\"neeto-ui-mb-1\", className)}\n data-testid=\"popover-title\"\n lineHeight=\"snug\"\n style=\"h5\"\n weight=\"semibold\"\n >\n {children}\n </Typography>\n);\n\nTitle.propTypes = {\n /**\n * To specify className to be applied to the Popover Title.\n */\n className: PropTypes.string,\n /**\n * To specify the content to be rendered inside the Popover Title.\n */\n children: PropTypes.node,\n};\n\nexport default Title;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Title from \"./Title\";\n\nimport Tooltip from \"../Tooltip\";\n\nconst Popover = ({\n children,\n className = \"\",\n theme = \"light\",\n ...otherProps\n}) => (\n <Tooltip\n {...{ theme }}\n arrow\n interactive\n className={classnames(\"neeto-ui-popover\", className)}\n content={children}\n {...otherProps}\n />\n);\n\nPopover.propTypes = {\n /**\n * The content to be rendered inside the popup.\n */\n children: PropTypes.node,\n /**\n * The popover will be positioned next to the specified element.\n */\n reference: PropTypes.oneOfType([\n // Either a function\n PropTypes.func,\n // Or the instance of a DOM native element (see the note about SSR)\n PropTypes.shape({ current: PropTypes.instanceOf(Element) }),\n ]),\n /**\n * To display Popover in dark or light theme. By default the theme is dark.\n */\n theme: PropTypes.oneOf([\"dark\", \"light\"]),\n /**\n * To specify whether the Popover is disabled or not.\n */\n disabled: PropTypes.bool,\n /**\n * To specify the position of the Popover.\n */\n position: PropTypes.string,\n /**\n * To auto-hide the Popover after n-milliseconds.\n * Negative values to this prop disables this feature.\n * By default it's disabled.\n */\n hideAfter: PropTypes.number,\n /**\n * To auto-hide the Popover on when target leaves the screen.\n * By default it's disabled.\n */\n hideOnTargetExit: PropTypes.bool,\n};\n\nPopover.Title = Title;\n\nexport default Popover;\n"],"names":["Title","_ref","className","children","_jsx","Typography","classnames","lineHeight","style","weight","Popover","_ref$className","_ref$theme","theme","otherProps","_objectWithoutProperties","_excluded","Tooltip","_objectSpread","arrow","interactive","content"],"mappings":";;;;;;;;;;;AAOA,IAAMA,KAAK,GAAG,SAARA,KAAKA,CAAAC,IAAA,EAAA;AAAA,EA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
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
var ProgressBar = function ProgressBar(_ref) {
|
|
6
7
|
var progressPercentage = _ref.progressPercentage,
|
|
7
8
|
progressValue = _ref.progressValue,
|
|
8
9
|
_ref$className = _ref.className,
|
|
9
10
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
10
|
-
return /*#__PURE__*/
|
|
11
|
-
className: classnames(["neeto-ui-progress-bar__wrapper neeto-ui-rounded-full", className])
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
return /*#__PURE__*/jsx("div", {
|
|
12
|
+
className: classnames(["neeto-ui-progress-bar__wrapper neeto-ui-rounded-full", className]),
|
|
13
|
+
children: /*#__PURE__*/jsx(motion.div, {
|
|
14
|
+
animate: {
|
|
15
|
+
width: "".concat(progressPercentage, "%")
|
|
16
|
+
},
|
|
17
|
+
className: "neeto-ui-progress-bar neeto-ui-rounded-full",
|
|
18
|
+
"data-cy": "progress-bar",
|
|
19
|
+
initial: {
|
|
20
|
+
width: 0
|
|
21
|
+
},
|
|
22
|
+
transition: {
|
|
23
|
+
duration: 0.5,
|
|
24
|
+
ease: "easeInOut"
|
|
25
|
+
},
|
|
26
|
+
children: progressValue !== null && progressValue !== void 0 ? progressValue : "".concat(progressPercentage, "%")
|
|
27
|
+
})
|
|
28
|
+
});
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
export { ProgressBar as default };
|
package/dist/ProgressBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../src/components/ProgressBar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport propTypes from \"prop-types\";\n\nconst ProgressBar = ({ progressPercentage, progressValue, className = \"\" }) => (\n <div\n className={classNames([\n \"neeto-ui-progress-bar__wrapper neeto-ui-rounded-full\",\n className,\n ])}\n >\n <motion.div\n animate={{ width: `${progressPercentage}%` }}\n className=\"neeto-ui-progress-bar neeto-ui-rounded-full\"\n data-cy=\"progress-bar\"\n initial={{ width: 0 }}\n transition={{ duration: 0.5, ease: \"easeInOut\" }}\n >\n {progressValue ?? `${progressPercentage}%`}\n </motion.div>\n </div>\n);\n\nProgressBar.propTypes = {\n /**\n * To specify the value to be used as the width of the progress bar.\n */\n progressPercentage: propTypes.number,\n /**\n * To specify the progress value to be displayed on the progress bar as text.\n */\n progressValue: propTypes.string,\n /**\n * To specify external classnames as overrides to the ProgressBar component.\n */\n className: propTypes.string,\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","_ref","progressPercentage","progressValue","_ref$className","className","
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":["../src/components/ProgressBar.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classNames from \"classnames\";\nimport { motion } from \"framer-motion\";\nimport propTypes from \"prop-types\";\n\nconst ProgressBar = ({ progressPercentage, progressValue, className = \"\" }) => (\n <div\n className={classNames([\n \"neeto-ui-progress-bar__wrapper neeto-ui-rounded-full\",\n className,\n ])}\n >\n <motion.div\n animate={{ width: `${progressPercentage}%` }}\n className=\"neeto-ui-progress-bar neeto-ui-rounded-full\"\n data-cy=\"progress-bar\"\n initial={{ width: 0 }}\n transition={{ duration: 0.5, ease: \"easeInOut\" }}\n >\n {progressValue ?? `${progressPercentage}%`}\n </motion.div>\n </div>\n);\n\nProgressBar.propTypes = {\n /**\n * To specify the value to be used as the width of the progress bar.\n */\n progressPercentage: propTypes.number,\n /**\n * To specify the progress value to be displayed on the progress bar as text.\n */\n progressValue: propTypes.string,\n /**\n * To specify external classnames as overrides to the ProgressBar component.\n */\n className: propTypes.string,\n};\n\nexport default ProgressBar;\n"],"names":["ProgressBar","_ref","progressPercentage","progressValue","_ref$className","className","_jsx","classNames","children","motion","div","animate","width","concat","initial","transition","duration","ease"],"mappings":";;;;;AAMA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,kBAAkB,GAAAD,IAAA,CAAlBC,kBAAkB;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAA,EAAA,oBACtEE,GAAA,CAAA,KAAA,EAAA;IACED,SAAS,EAAEE,UAAU,CAAC,CACpB,sDAAsD,EACtDF,SAAS,CACV,CAAE;AAAAG,IAAAA,QAAA,eAEHF,GAAA,CAACG,MAAM,CAACC,GAAG,EAAA;AACTC,MAAAA,OAAO,EAAE;QAAEC,KAAK,EAAA,EAAA,CAAAC,MAAA,CAAKX,kBAAkB,EAAA,GAAA;OAAM;AAC7CG,MAAAA,SAAS,EAAC,6CAA6C;AACvD,MAAA,SAAA,EAAQ,cAAc;AACtBS,MAAAA,OAAO,EAAE;AAAEF,QAAAA,KAAK,EAAE;OAAI;AACtBG,MAAAA,UAAU,EAAE;AAAEC,QAAAA,QAAQ,EAAE,GAAG;AAAEC,QAAAA,IAAI,EAAE;OAAc;MAAAT,QAAA,EAEhDL,aAAa,KAAA,IAAA,IAAbA,aAAa,cAAbA,aAAa,GAAA,EAAA,CAAAU,MAAA,CAAOX,kBAAkB,EAAA,GAAA;KAC7B;AAAC,GACV,CAAC;AAAA;;;;"}
|
package/dist/Radio.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
3
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
-
import
|
|
4
|
+
import { forwardRef, useState, Children, cloneElement } from 'react';
|
|
6
5
|
import classnames from 'classnames';
|
|
7
6
|
import Label from './Label.js';
|
|
8
7
|
import { u as useId } from './useId-Jj9hXm-g.js';
|
|
9
8
|
import 'react-router-dom';
|
|
10
9
|
import '@bigbinary/neeto-hotkeys';
|
|
11
10
|
import './overlayManager.js';
|
|
12
|
-
import { h as hyphenize } from './index-
|
|
11
|
+
import { h as hyphenize } from './index-D6vmwyYl.js';
|
|
13
12
|
import 'qs';
|
|
14
|
-
import '
|
|
13
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
|
+
import '@bigbinary/neeto-icons/Help';
|
|
15
15
|
import './Button.js';
|
|
16
16
|
import './Spinner.js';
|
|
17
17
|
import './Tooltip.js';
|
|
@@ -32,6 +32,8 @@ import 'dayjs/plugin/weekday';
|
|
|
32
32
|
import 'dayjs/plugin/weekOfYear';
|
|
33
33
|
|
|
34
34
|
var _excluded$1 = ["name", "label", "className", "labelProps", "dataCy"];
|
|
35
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
37
|
var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
38
|
var _ref$name = _ref.name,
|
|
37
39
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
@@ -44,25 +46,28 @@ var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
44
46
|
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy,
|
|
45
47
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
46
48
|
var id = useId(otherProps.id);
|
|
47
|
-
return /*#__PURE__*/
|
|
48
|
-
className: classnames(["neeto-ui-radio__item", className])
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
return /*#__PURE__*/jsxs("div", {
|
|
50
|
+
className: classnames(["neeto-ui-radio__item", className]),
|
|
51
|
+
children: [/*#__PURE__*/jsx("input", _objectSpread$1({
|
|
52
|
+
id: id,
|
|
53
|
+
name: name,
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: "neeto-ui-radio",
|
|
56
|
+
"data-cy": dataCy || "".concat(hyphenize(label), "-radio-input"),
|
|
57
|
+
type: "radio"
|
|
58
|
+
}, otherProps)), label && /*#__PURE__*/jsx(Label, _objectSpread$1(_objectSpread$1({
|
|
59
|
+
"data-cy": dataCy || "".concat(hyphenize(label), "-radio-label"),
|
|
60
|
+
htmlFor: id
|
|
61
|
+
}, labelProps), {}, {
|
|
62
|
+
children: label
|
|
63
|
+
}))]
|
|
64
|
+
});
|
|
60
65
|
});
|
|
61
66
|
Item.displayName = "Radio.Item";
|
|
62
67
|
|
|
63
68
|
var _excluded = ["label", "children", "stacked", "className", "containerClassName", "error", "onChange", "labelProps"];
|
|
64
|
-
function ownKeys(
|
|
65
|
-
function _objectSpread(
|
|
69
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
70
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
66
71
|
var Radio = function Radio(_ref) {
|
|
67
72
|
var _ref$label = _ref.label,
|
|
68
73
|
label = _ref$label === void 0 ? "" : _ref$label,
|
|
@@ -87,27 +92,32 @@ var Radio = function Radio(_ref) {
|
|
|
87
92
|
var internalOnChange = function internalOnChange(e) {
|
|
88
93
|
return setInternalValue(e.target.value);
|
|
89
94
|
};
|
|
90
|
-
return /*#__PURE__*/
|
|
91
|
-
className: classnames(["neeto-ui-radio__wrapper", className])
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"neeto-ui-radio__container
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
95
|
+
return /*#__PURE__*/jsxs("div", {
|
|
96
|
+
className: classnames(["neeto-ui-radio__wrapper", className]),
|
|
97
|
+
children: [label && /*#__PURE__*/jsx(Label, _objectSpread(_objectSpread({
|
|
98
|
+
className: "neeto-ui-radio__label"
|
|
99
|
+
}, labelProps), {}, {
|
|
100
|
+
children: label
|
|
101
|
+
})), /*#__PURE__*/jsx("div", {
|
|
102
|
+
className: classnames(["neeto-ui-radio__container"], _defineProperty({
|
|
103
|
+
"neeto-ui-radio__container--stacked": stacked,
|
|
104
|
+
"neeto-ui-radio__container--error": error
|
|
105
|
+
}, containerClassName, containerClassName)),
|
|
106
|
+
children: Children.map(children, function (child) {
|
|
107
|
+
var _child$props$checked, _ref2, _child$props$onChange;
|
|
108
|
+
return /*#__PURE__*/cloneElement(child, _objectSpread(_objectSpread(_objectSpread({}, child.props), props), {}, {
|
|
109
|
+
value: child.props.value,
|
|
110
|
+
checked: (_child$props$checked = child.props.checked) !== null && _child$props$checked !== void 0 ? _child$props$checked : [internalValue, props.value].includes(child.props.value),
|
|
111
|
+
onChange: (_ref2 = (_child$props$onChange = child.props.onChange) !== null && _child$props$onChange !== void 0 ? _child$props$onChange : onChange) !== null && _ref2 !== void 0 ? _ref2 : internalOnChange
|
|
112
|
+
}));
|
|
113
|
+
})
|
|
114
|
+
}), !!error && /*#__PURE__*/jsx("p", {
|
|
115
|
+
className: "neeto-ui-radio-input__error",
|
|
116
|
+
"data-cy": "".concat(hyphenize(label), "-radio-input-error"),
|
|
117
|
+
id: errorId,
|
|
118
|
+
children: error
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
111
121
|
};
|
|
112
122
|
Radio.Item = Item;
|
|
113
123
|
|
package/dist/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../src/components/Radio/Item.jsx","../src/components/Radio/index.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Label from \"components/Label\";\nimport { useId } from \"hooks\";\nimport { hyphenize } from \"utils\";\n\nconst Item = forwardRef(\n (\n {\n name = \"\",\n label = \"\",\n className = \"\",\n labelProps,\n dataCy = \"\",\n ...otherProps\n },\n ref\n ) => {\n const id = useId(otherProps.id);\n\n return (\n <div className={classnames([\"neeto-ui-radio__item\", className])}>\n <input\n {...{ id, name, ref }}\n className=\"neeto-ui-radio\"\n data-cy={dataCy || `${hyphenize(label)}-radio-input`}\n type=\"radio\"\n {...otherProps}\n />\n {label && (\n <Label\n data-cy={dataCy || `${hyphenize(label)}-radio-label`}\n htmlFor={id}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n </div>\n );\n }\n);\n\nItem.displayName = \"Radio.Item\";\n\nItem.propTypes = {\n /**\n * To specify the name of the radio group.\n */\n name: PropTypes.string,\n /**\n * To specify the label to be displayed for radio item.\n */\n label: PropTypes.node,\n /**\n * To specify external classnames as overrides to the radio item.\n */\n className: PropTypes.string,\n};\n\nexport default Item;\n","import React, { useState, Children, cloneElement } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Label from \"components/Label\";\nimport { useId } from \"hooks\";\nimport { hyphenize } from \"utils\";\n\nimport Item from \"./Item\";\n\nconst Radio = ({\n label = \"\",\n children,\n stacked = false,\n className = \"\",\n containerClassName = \"\",\n error = \"\",\n onChange,\n labelProps,\n ...props\n}) => {\n const [internalValue, setInternalValue] = useState(\"\");\n\n const id = useId(props.id);\n const errorId = `error_${id}`;\n\n const internalOnChange = e => setInternalValue(e.target.value);\n\n return (\n <div className={classnames([\"neeto-ui-radio__wrapper\", className])}>\n {label && (\n <Label className=\"neeto-ui-radio__label\" {...labelProps}>\n {label}\n </Label>\n )}\n <div\n className={classnames([\"neeto-ui-radio__container\"], {\n \"neeto-ui-radio__container--stacked\": stacked,\n \"neeto-ui-radio__container--error\": error,\n [containerClassName]: containerClassName,\n })}\n >\n {Children.map(children, child =>\n cloneElement(child, {\n ...child.props,\n ...props,\n value: child.props.value,\n checked:\n child.props.checked ??\n [internalValue, props.value].includes(child.props.value),\n onChange: child.props.onChange ?? onChange ?? internalOnChange,\n })\n )}\n </div>\n {!!error && (\n <p\n className=\"neeto-ui-radio-input__error\"\n data-cy={`${hyphenize(label)}-radio-input-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n </div>\n );\n};\n\nRadio.propTypes = {\n /**\n * To specify the label to be displayed for Radio component.\n */\n label: PropTypes.string,\n /**\n * To specify the label props to be passed to the Label component.\n */\n labelProps: PropTypes.object,\n /**\n * To specify the content to be rendered inside the Radio component.\n */\n children: PropTypes.node,\n /**\n * To specify whether the Radio items should be stacked vertically or not.\n */\n stacked: PropTypes.bool,\n /**\n * To specify external classnames as overrides to the Radio component.\n */\n className: PropTypes.string,\n /**\n * To specify external classnames for the container of Radio component.\n */\n containerClassName: PropTypes.string,\n /**\n * To specify the error message to be displayed when the Radio input is invalid.\n */\n error: PropTypes.string,\n};\n\nRadio.Item = Item;\n\nexport default Radio;\n"],"names":["Item","forwardRef","_ref","ref","_ref$name","name","_ref$label","label","_ref$className","className","labelProps","_ref$dataCy","dataCy","otherProps","_objectWithoutProperties","_excluded","id","useId","
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../src/components/Radio/Item.jsx","../src/components/Radio/index.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Label from \"components/Label\";\nimport { useId } from \"hooks\";\nimport { hyphenize } from \"utils\";\n\nconst Item = forwardRef(\n (\n {\n name = \"\",\n label = \"\",\n className = \"\",\n labelProps,\n dataCy = \"\",\n ...otherProps\n },\n ref\n ) => {\n const id = useId(otherProps.id);\n\n return (\n <div className={classnames([\"neeto-ui-radio__item\", className])}>\n <input\n {...{ id, name, ref }}\n className=\"neeto-ui-radio\"\n data-cy={dataCy || `${hyphenize(label)}-radio-input`}\n type=\"radio\"\n {...otherProps}\n />\n {label && (\n <Label\n data-cy={dataCy || `${hyphenize(label)}-radio-label`}\n htmlFor={id}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n </div>\n );\n }\n);\n\nItem.displayName = \"Radio.Item\";\n\nItem.propTypes = {\n /**\n * To specify the name of the radio group.\n */\n name: PropTypes.string,\n /**\n * To specify the label to be displayed for radio item.\n */\n label: PropTypes.node,\n /**\n * To specify external classnames as overrides to the radio item.\n */\n className: PropTypes.string,\n};\n\nexport default Item;\n","import React, { useState, Children, cloneElement } from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Label from \"components/Label\";\nimport { useId } from \"hooks\";\nimport { hyphenize } from \"utils\";\n\nimport Item from \"./Item\";\n\nconst Radio = ({\n label = \"\",\n children,\n stacked = false,\n className = \"\",\n containerClassName = \"\",\n error = \"\",\n onChange,\n labelProps,\n ...props\n}) => {\n const [internalValue, setInternalValue] = useState(\"\");\n\n const id = useId(props.id);\n const errorId = `error_${id}`;\n\n const internalOnChange = e => setInternalValue(e.target.value);\n\n return (\n <div className={classnames([\"neeto-ui-radio__wrapper\", className])}>\n {label && (\n <Label className=\"neeto-ui-radio__label\" {...labelProps}>\n {label}\n </Label>\n )}\n <div\n className={classnames([\"neeto-ui-radio__container\"], {\n \"neeto-ui-radio__container--stacked\": stacked,\n \"neeto-ui-radio__container--error\": error,\n [containerClassName]: containerClassName,\n })}\n >\n {Children.map(children, child =>\n cloneElement(child, {\n ...child.props,\n ...props,\n value: child.props.value,\n checked:\n child.props.checked ??\n [internalValue, props.value].includes(child.props.value),\n onChange: child.props.onChange ?? onChange ?? internalOnChange,\n })\n )}\n </div>\n {!!error && (\n <p\n className=\"neeto-ui-radio-input__error\"\n data-cy={`${hyphenize(label)}-radio-input-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n </div>\n );\n};\n\nRadio.propTypes = {\n /**\n * To specify the label to be displayed for Radio component.\n */\n label: PropTypes.string,\n /**\n * To specify the label props to be passed to the Label component.\n */\n labelProps: PropTypes.object,\n /**\n * To specify the content to be rendered inside the Radio component.\n */\n children: PropTypes.node,\n /**\n * To specify whether the Radio items should be stacked vertically or not.\n */\n stacked: PropTypes.bool,\n /**\n * To specify external classnames as overrides to the Radio component.\n */\n className: PropTypes.string,\n /**\n * To specify external classnames for the container of Radio component.\n */\n containerClassName: PropTypes.string,\n /**\n * To specify the error message to be displayed when the Radio input is invalid.\n */\n error: PropTypes.string,\n};\n\nRadio.Item = Item;\n\nexport default Radio;\n"],"names":["Item","forwardRef","_ref","ref","_ref$name","name","_ref$label","label","_ref$className","className","labelProps","_ref$dataCy","dataCy","otherProps","_objectWithoutProperties","_excluded","id","useId","_jsxs","classnames","children","_jsx","_objectSpread","concat","hyphenize","type","Label","htmlFor","displayName","Radio","_ref$stacked","stacked","_ref$containerClassNa","containerClassName","_ref$error","error","onChange","props","_useState","useState","_useState2","_slicedToArray","internalValue","setInternalValue","errorId","internalOnChange","e","target","value","_defineProperty","Children","map","child","_child$props$checked","_ref2","_child$props$onChange","cloneElement","checked","includes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,IAAI,gBAAGC,UAAU,CACrB,UAAAC,IAAA,EASEC,GAAG,EACA;AAAA,EAAA,IAAAC,SAAA,GAAAF,IAAA,CARDG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,SAAA;IAAAE,UAAA,GAAAJ,IAAA,CACTK,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IAAAE,cAAA,GAAAN,IAAA,CACVO,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IACdE,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IAAAC,WAAA,GAAAT,IAAA,CACVU,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,WAAA;AACRE,IAAAA,UAAU,GAAAC,wBAAA,CAAAZ,IAAA,EAAAa,WAAA,CAAA;AAIf,EAAA,IAAMC,EAAE,GAAGC,KAAK,CAACJ,UAAU,CAACG,EAAE,CAAC;AAE/B,EAAA,oBACEE,IAAA,CAAA,KAAA,EAAA;IAAKT,SAAS,EAAEU,UAAU,CAAC,CAAC,sBAAsB,EAAEV,SAAS,CAAC,CAAE;IAAAW,QAAA,EAAA,cAC9DC,GAAA,CAAA,OAAA,EAAAC,eAAA,CAAA;AACQN,MAAAA,EAAE,EAAFA,EAAE;AAAEX,MAAAA,IAAI,EAAJA,IAAI;AAAEF,MAAAA,GAAG,EAAHA,GAAG;AACnBM,MAAAA,SAAS,EAAC,gBAAgB;MAC1B,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