@bigbinary/neetoui 8.3.53 → 8.3.55
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/CHANGELOG.md +21 -21
- package/dist/ActionDropdown.js +1 -2
- package/dist/ActionDropdown.js.map +1 -1
- package/dist/Alert.js +7 -7
- package/dist/Alert.js.map +1 -1
- package/dist/Avatar.js +6 -10
- package/dist/Avatar.js.map +1 -1
- package/dist/Checkbox.js +7 -5
- package/dist/Checkbox.js.map +1 -1
- package/dist/ColorPicker.js +5 -6
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +5 -5
- package/dist/Dropdown.js +3 -3
- package/dist/Dropdown.js.map +1 -1
- package/dist/Input.js +11 -11
- package/dist/Input.js.map +1 -1
- package/dist/Label.js +1 -4
- package/dist/Label.js.map +1 -1
- package/dist/Modal.js +10 -11
- package/dist/Modal.js.map +1 -1
- package/dist/MultiEmailInput.js +12 -12
- package/dist/MultiEmailInput.js.map +1 -1
- package/dist/NoData.js +5 -7
- package/dist/NoData.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pane.js +6 -7
- package/dist/Pane.js.map +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/ProgressBar.js.map +1 -1
- package/dist/Radio.js +15 -8
- package/dist/Radio.js.map +1 -1
- package/dist/Select.js +20 -25
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +11 -12
- package/dist/Sidebar.js.map +1 -1
- package/dist/Slider.js +4 -4
- package/dist/Slider.js.map +1 -1
- package/dist/Spinner.js +1 -2
- package/dist/Spinner.js.map +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Stepper.js.map +1 -1
- package/dist/Switch.js +9 -9
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.js +9 -6
- package/dist/Tab.js.map +1 -1
- package/dist/Table.js +6 -6
- package/dist/Table.js.map +1 -1
- package/dist/Tag.js +1 -3
- package/dist/Tag.js.map +1 -1
- package/dist/{Textarea-D3WmOs_6.js → Textarea-DucQtmjX.js} +14 -8
- package/dist/Textarea-DucQtmjX.js.map +1 -0
- package/dist/Textarea.js +3 -3
- package/dist/TimePicker.js +5 -5
- package/dist/Toastr.js +4 -9
- package/dist/Toastr.js.map +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/Tree.js +1 -1
- package/dist/TreeSelect.js +2 -2
- package/dist/TreeSelect.js.map +1 -1
- package/dist/cjs/ActionDropdown.js +1 -2
- package/dist/cjs/ActionDropdown.js.map +1 -1
- package/dist/cjs/Alert.js +7 -7
- package/dist/cjs/Alert.js.map +1 -1
- package/dist/cjs/Avatar.js +5 -9
- package/dist/cjs/Avatar.js.map +1 -1
- package/dist/cjs/Checkbox.js +7 -5
- package/dist/cjs/Checkbox.js.map +1 -1
- package/dist/cjs/ColorPicker.js +5 -6
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +5 -5
- package/dist/cjs/Dropdown.js +3 -3
- package/dist/cjs/Dropdown.js.map +1 -1
- package/dist/cjs/Input.js +11 -11
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Label.js +1 -4
- package/dist/cjs/Label.js.map +1 -1
- package/dist/cjs/Modal.js +10 -11
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +12 -12
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/NoData.js +5 -7
- package/dist/cjs/NoData.js.map +1 -1
- package/dist/cjs/Pagination.js +1 -1
- package/dist/cjs/Pane.js +6 -7
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/ProgressBar.js +1 -1
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/dist/cjs/Radio.js +15 -8
- package/dist/cjs/Radio.js.map +1 -1
- package/dist/cjs/Select.js +20 -25
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/Sidebar.js +11 -12
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/Slider.js +4 -4
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Spinner.js +1 -2
- package/dist/cjs/Spinner.js.map +1 -1
- package/dist/cjs/Stepper.js +1 -1
- package/dist/cjs/Stepper.js.map +1 -1
- package/dist/cjs/Switch.js +9 -9
- package/dist/cjs/Switch.js.map +1 -1
- package/dist/cjs/Tab.js +9 -6
- package/dist/cjs/Tab.js.map +1 -1
- package/dist/cjs/Table.js +6 -6
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/Tag.js +1 -3
- package/dist/cjs/Tag.js.map +1 -1
- package/dist/cjs/{Textarea-JUquK4ix.js → Textarea-BxE7T1u3.js} +14 -8
- package/dist/cjs/Textarea-BxE7T1u3.js.map +1 -0
- package/dist/cjs/Textarea.js +3 -3
- package/dist/cjs/TimePicker.js +5 -5
- package/dist/cjs/Toastr.js +4 -9
- package/dist/cjs/Toastr.js.map +1 -1
- package/dist/cjs/Tooltip.js +1 -1
- package/dist/cjs/Tooltip.js.map +1 -1
- package/dist/cjs/Tree.js +1 -1
- package/dist/cjs/TreeSelect.js +2 -2
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/ActionBlock.js +3 -5
- package/dist/cjs/formik/ActionBlock.js.map +1 -1
- package/dist/cjs/formik/BlockNavigation.js +7 -7
- package/dist/cjs/formik/BlockNavigation.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +1 -1
- package/dist/cjs/formik/Input.js +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +1 -1
- package/dist/cjs/formik/Radio.js +1 -1
- package/dist/cjs/formik/Select.js +1 -1
- package/dist/cjs/formik/Slider.js +1 -1
- package/dist/cjs/formik/Switch.js +1 -1
- package/dist/cjs/formik/Textarea.js +3 -3
- package/dist/cjs/formik/TreeSelect.js +1 -1
- package/dist/cjs/formik/index.js +3 -3
- package/dist/cjs/{index-C7kNDKSZ.js → index-BGsAR8rN.js} +16 -17
- package/dist/cjs/index-BGsAR8rN.js.map +1 -0
- package/dist/cjs/{index-kRTNbSPu.js → index-wzq3p_0z.js} +2 -2
- package/dist/cjs/index-wzq3p_0z.js.map +1 -0
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/layouts.js +1 -1
- package/dist/cjs/{useOverlayManager-BKMTt29E.js → useOverlayManager-BMNCjew1.js} +4 -5
- package/dist/cjs/{useOverlayManager-BKMTt29E.js.map → useOverlayManager-BMNCjew1.js.map} +1 -1
- package/dist/cjs/{useRecentlyUsedColors-Cqmsh4rp.js → useRecentlyUsedColors-zjpSW-oL.js} +2 -2
- package/dist/cjs/{useRecentlyUsedColors-Cqmsh4rp.js.map → useRecentlyUsedColors-zjpSW-oL.js.map} +1 -1
- package/dist/formik/ActionBlock.js +3 -5
- package/dist/formik/ActionBlock.js.map +1 -1
- package/dist/formik/BlockNavigation.js +7 -7
- package/dist/formik/BlockNavigation.js.map +1 -1
- package/dist/formik/Checkbox.js +1 -1
- package/dist/formik/Input.js +1 -1
- package/dist/formik/MultiEmailInput.js +1 -1
- package/dist/formik/Radio.js +1 -1
- package/dist/formik/Select.js +1 -1
- package/dist/formik/Slider.js +1 -1
- package/dist/formik/Switch.js +1 -1
- package/dist/formik/Textarea.js +3 -3
- package/dist/formik/TreeSelect.js +1 -1
- package/dist/formik/index.js +3 -3
- package/dist/{index-DasLFwoo.js → index-Dlo3HdFv.js} +16 -17
- package/dist/index-Dlo3HdFv.js.map +1 -0
- package/dist/{index-D_BsZoxj.js → index-DmicnBCQ.js} +2 -2
- package/dist/index-DmicnBCQ.js.map +1 -0
- package/dist/index.js +5 -5
- package/dist/layouts.js +1 -1
- package/dist/{useOverlayManager-B2c6fBF6.js → useOverlayManager-Bn2Stdmg.js} +4 -5
- package/dist/{useOverlayManager-B2c6fBF6.js.map → useOverlayManager-Bn2Stdmg.js.map} +1 -1
- package/dist/{useRecentlyUsedColors-DVZT_MHc.js → useRecentlyUsedColors-zQ7y37Sk.js} +2 -2
- package/dist/{useRecentlyUsedColors-DVZT_MHc.js.map → useRecentlyUsedColors-zQ7y37Sk.js.map} +1 -1
- package/package.json +1 -1
- package/dist/Textarea-D3WmOs_6.js.map +0 -1
- package/dist/cjs/Textarea-JUquK4ix.js.map +0 -1
- package/dist/cjs/index-C7kNDKSZ.js.map +0 -1
- package/dist/cjs/index-kRTNbSPu.js.map +0 -1
- package/dist/index-D_BsZoxj.js.map +0 -1
- package/dist/index-DasLFwoo.js.map +0 -1
package/dist/Pagination.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useHistory } from 'react-router-dom';
|
|
|
7
7
|
import '@babel/runtime/helpers/slicedToArray';
|
|
8
8
|
import '@bigbinary/neeto-hotkeys';
|
|
9
9
|
import './overlayManager.js';
|
|
10
|
-
import { c as buildUrl } from './index-
|
|
10
|
+
import { c as buildUrl } from './index-DmicnBCQ.js';
|
|
11
11
|
import { u as useQueryParams } from './useQueryParams-BKsf4FPY.js';
|
|
12
12
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
13
13
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
package/dist/Pane.js
CHANGED
|
@@ -4,7 +4,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
4
4
|
import { useState, useRef, useEffect } from 'react';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import Close from '@bigbinary/neeto-icons/Close';
|
|
7
|
-
import { u as useOverlayManager, a as useOverlay, P as Portal, C as CSSTransition, B as Backdrop } from './useOverlayManager-
|
|
7
|
+
import { u as useOverlayManager, a as useOverlay, P as Portal, C as CSSTransition, B as Backdrop } from './useOverlayManager-Bn2Stdmg.js';
|
|
8
8
|
import Button from './Button.js';
|
|
9
9
|
import 'react-router-dom';
|
|
10
10
|
import 'qs';
|
|
@@ -18,7 +18,7 @@ import '@bigbinary/neeto-hotkeys';
|
|
|
18
18
|
import './overlayManager.js';
|
|
19
19
|
import '@babel/runtime/helpers/classCallCheck';
|
|
20
20
|
import '@babel/runtime/helpers/createClass';
|
|
21
|
-
import './index-
|
|
21
|
+
import './index-DmicnBCQ.js';
|
|
22
22
|
import '@bigbinary/neeto-cist';
|
|
23
23
|
import './en-DVlE9xuu.js';
|
|
24
24
|
import '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -39,7 +39,7 @@ var Body = function Body(_ref) {
|
|
|
39
39
|
_ref$hasFooter = _ref.hasFooter,
|
|
40
40
|
hasFooter = _ref$hasFooter === void 0 ? true : _ref$hasFooter;
|
|
41
41
|
return /*#__PURE__*/jsx("div", {
|
|
42
|
-
"data-
|
|
42
|
+
"data-testid": "pane-body",
|
|
43
43
|
className: classnames("neeto-ui-pane__body neeto-ui-flex neeto-ui-flex-col neeto-ui-items-start neeto-ui-justify-start", _defineProperty({
|
|
44
44
|
"neeto-ui-pane__body--has-footer": hasFooter
|
|
45
45
|
}, className, className)),
|
|
@@ -61,7 +61,7 @@ var Header = function Header(_ref) {
|
|
|
61
61
|
className = _ref.className;
|
|
62
62
|
return /*#__PURE__*/jsx("div", {
|
|
63
63
|
className: classnames("neeto-ui-pane__header", className),
|
|
64
|
-
"data-
|
|
64
|
+
"data-testid": "pane-header",
|
|
65
65
|
children: children
|
|
66
66
|
});
|
|
67
67
|
};
|
|
@@ -182,7 +182,7 @@ var Pane = function Pane(_ref) {
|
|
|
182
182
|
ref: backdropRef,
|
|
183
183
|
className: classnames("neeto-ui-pane__backdrop neeto-ui-flex neeto-ui-justify-end", backdropClassName),
|
|
184
184
|
children: /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
185
|
-
"data-
|
|
185
|
+
"data-testid": "pane-wrapper",
|
|
186
186
|
ref: paneWrapperRef,
|
|
187
187
|
className: classnames("neeto-ui-pane__wrapper", _defineProperty({
|
|
188
188
|
"neeto-ui-pane__wrapper--small": size === SIZES.small,
|
|
@@ -193,8 +193,7 @@ var Pane = function Pane(_ref) {
|
|
|
193
193
|
children: [closeButton && /*#__PURE__*/jsx(Button, {
|
|
194
194
|
"aria-label": "Close",
|
|
195
195
|
className: "neeto-ui-pane__close",
|
|
196
|
-
"data-
|
|
197
|
-
"data-testid": "close-button",
|
|
196
|
+
"data-testid": "pane-close-button",
|
|
198
197
|
icon: Close,
|
|
199
198
|
size: "small",
|
|
200
199
|
style: "text",
|
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","_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,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EAAA;AACL,YAAA,YAAA,EAAW,OAAO;AAClB5F,YAAAA,SAAS,EAAC,sBAAsB;AAChC,YAAA,SAAA,EAAQ,mBAAmB;AAC3B,YAAA,aAAA,EAAY,cAAc;AAC1B6F,YAAAA,IAAI,EAAEC,KAAM;AACZhE,YAAAA,IAAI,EAAC,OAAO;AACZX,YAAAA,KAAK,EAAC,MAAM;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;;;;"}
|
|
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-testid=\"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-testid=\"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-testid=\"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-testid=\"pane-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,c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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-
|
|
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-testid=\"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,aAAA,EAAY,cAAc;AAC1BS,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
|
@@ -8,7 +8,7 @@ import { u as useId } from './useId-Jj9hXm-g.js';
|
|
|
8
8
|
import 'react-router-dom';
|
|
9
9
|
import '@bigbinary/neeto-hotkeys';
|
|
10
10
|
import './overlayManager.js';
|
|
11
|
-
import { h as hyphenize } from './index-
|
|
11
|
+
import { h as hyphenize } from './index-DmicnBCQ.js';
|
|
12
12
|
import 'qs';
|
|
13
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
14
|
import '@bigbinary/neeto-icons/Help';
|
|
@@ -32,7 +32,7 @@ import 'dayjs/plugin/weekday';
|
|
|
32
32
|
import 'dayjs/plugin/weekOfYear';
|
|
33
33
|
import 'i18next';
|
|
34
34
|
|
|
35
|
-
var _excluded$1 = ["name", "label", "className", "labelProps", "
|
|
35
|
+
var _excluded$1 = ["name", "label", "className", "labelProps", "dataTestid"];
|
|
36
36
|
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; }
|
|
37
37
|
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; }
|
|
38
38
|
var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -43,8 +43,8 @@ var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
43
43
|
_ref$className = _ref.className,
|
|
44
44
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
45
45
|
labelProps = _ref.labelProps,
|
|
46
|
-
_ref$
|
|
47
|
-
|
|
46
|
+
_ref$dataTestid = _ref.dataTestid,
|
|
47
|
+
dataTestid = _ref$dataTestid === void 0 ? "" : _ref$dataTestid,
|
|
48
48
|
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
49
49
|
var id = useId(otherProps.id);
|
|
50
50
|
return /*#__PURE__*/jsxs("div", {
|
|
@@ -54,10 +54,10 @@ var Item = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
54
54
|
name: name,
|
|
55
55
|
ref: ref,
|
|
56
56
|
className: "neeto-ui-radio",
|
|
57
|
-
"data-
|
|
57
|
+
"data-testid": dataTestid || "".concat(hyphenize(label), "-radio-input"),
|
|
58
58
|
type: "radio"
|
|
59
59
|
}, otherProps)), label && /*#__PURE__*/jsx(Label, _objectSpread$1(_objectSpread$1({
|
|
60
|
-
"data-
|
|
60
|
+
"data-testid": dataTestid || "".concat(hyphenize(label), "-radio-label"),
|
|
61
61
|
htmlFor: id
|
|
62
62
|
}, labelProps), {}, {
|
|
63
63
|
children: label
|
|
@@ -90,16 +90,23 @@ var Radio = function Radio(_ref) {
|
|
|
90
90
|
setInternalValue = _useState2[1];
|
|
91
91
|
var id = useId(props.id);
|
|
92
92
|
var errorId = "error_".concat(id);
|
|
93
|
+
var labelId = label ? "label_".concat(id) : undefined;
|
|
94
|
+
var finalLabelId = label ? (labelProps === null || labelProps === void 0 ? void 0 : labelProps.id) || labelId : undefined;
|
|
93
95
|
var internalOnChange = function internalOnChange(e) {
|
|
94
96
|
return setInternalValue(e.target.value);
|
|
95
97
|
};
|
|
96
98
|
return /*#__PURE__*/jsxs("div", {
|
|
97
99
|
className: classnames(["neeto-ui-radio__wrapper", className]),
|
|
98
100
|
children: [label && /*#__PURE__*/jsx(Label, _objectSpread(_objectSpread({
|
|
99
|
-
className: "neeto-ui-radio__label"
|
|
101
|
+
className: "neeto-ui-radio__label",
|
|
102
|
+
id: finalLabelId
|
|
100
103
|
}, labelProps), {}, {
|
|
101
104
|
children: label
|
|
102
105
|
})), /*#__PURE__*/jsx("div", {
|
|
106
|
+
"aria-describedby": error ? errorId : undefined,
|
|
107
|
+
"aria-invalid": !!error,
|
|
108
|
+
"aria-labelledby": finalLabelId,
|
|
109
|
+
role: "radiogroup",
|
|
103
110
|
className: classnames(["neeto-ui-radio__container"], _defineProperty({
|
|
104
111
|
"neeto-ui-radio__container--stacked": stacked,
|
|
105
112
|
"neeto-ui-radio__container--error": error
|
|
@@ -114,7 +121,7 @@ var Radio = function Radio(_ref) {
|
|
|
114
121
|
})
|
|
115
122
|
}), !!error && /*#__PURE__*/jsx("p", {
|
|
116
123
|
className: "neeto-ui-radio-input__error",
|
|
117
|
-
"data-
|
|
124
|
+
"data-testid": "".concat(hyphenize(label), "-radio-input-error"),
|
|
118
125
|
id: errorId,
|
|
119
126
|
children: error
|
|
120
127
|
})]
|
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
|
|
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 dataTestid = \"\",\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-testid={dataTestid || `${hyphenize(label)}-radio-input`}\n type=\"radio\"\n {...otherProps}\n />\n {label && (\n <Label\n data-testid={dataTestid || `${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 const labelId = label ? `label_${id}` : undefined;\n const finalLabelId = label ? labelProps?.id || labelId : undefined;\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\n className=\"neeto-ui-radio__label\"\n id={finalLabelId}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n <div\n aria-describedby={error ? errorId : undefined}\n aria-invalid={!!error}\n aria-labelledby={finalLabelId}\n role=\"radiogroup\"\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-testid={`${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$dataTestid","dataTestid","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","labelId","undefined","finalLabelId","internalOnChange","e","target","value","role","_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,eAAA,GAAAT,IAAA,CACVU,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,eAAA;AACZE,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,SA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QAAQ,CAACN,KAAK,CAACnB,KAAK,CAACc,KAAK,CAAC;UAC1Df,QAAQ,EAAA,CAAAsB,KAAA,GAAA,CAAAC,qBAAA,GAAEH,KAAK,CAACnB,KAAK,CAACD,QAAQ,cAAAuB,qBAAA,KAAA,MAAA,GAAAA,qBAAA,GAAIvB,QAAQ,cAAAsB,KAAA,KAAA,MAAA,GAAAA,KAAA,GAAIV;AAAgB,SAAA,CAC/D,CAAC;MAAA,CACJ;AAAC,KACE,CAAC,EACL,CAAC,CAACb,KAAK,iBACNd,GAAA,CAAA,GAAA,EAAA;AACEZ,MAAAA,SAAS,EAAC,6BAA6B;AACvC,MAAA,aAAA,EAAA,EAAA,CAAAc,MAAA,CAAgBC,SAAS,CAACjB,KAAK,CAAC,EAAA,oBAAA,CAAqB;AACrDS,MAAAA,EAAE,EAAE4B,OAAQ;AAAAxB,MAAAA,QAAA,EAEXe;AAAK,KACL,CACJ;AAAA,GACE,CAAC;AAEV;AAiCAN,KAAK,CAAC7B,IAAI,GAAGA,IAAI;;;;"}
|
package/dist/Select.js
CHANGED
|
@@ -27,7 +27,7 @@ import { u as useId } from './useId-Jj9hXm-g.js';
|
|
|
27
27
|
import 'react-router-dom';
|
|
28
28
|
import '@bigbinary/neeto-hotkeys';
|
|
29
29
|
import './overlayManager.js';
|
|
30
|
-
import { h as hyphenize } from './index-
|
|
30
|
+
import { h as hyphenize } from './index-DmicnBCQ.js';
|
|
31
31
|
import 'qs';
|
|
32
32
|
import Label from './Label.js';
|
|
33
33
|
import Spinner from './Spinner.js';
|
|
@@ -211,7 +211,7 @@ var AsyncCreatableSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
211
211
|
});
|
|
212
212
|
|
|
213
213
|
var _excluded = ["children"],
|
|
214
|
-
_excluded2 = ["size", "label", "required", "error", "helpText", "className", "innerRef", "isCreateable", "strategy", "id", "labelProps", "value", "defaultValue", "components", "optionRemapping", "onMenuClose", "onMenuOpen", "onKeyDown", "styles", "
|
|
214
|
+
_excluded2 = ["size", "label", "required", "error", "helpText", "className", "innerRef", "isCreateable", "strategy", "id", "labelProps", "value", "defaultValue", "components", "optionRemapping", "onMenuClose", "onMenuOpen", "onKeyDown", "styles", "dataTestid"];
|
|
215
215
|
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; }
|
|
216
216
|
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$1(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; }
|
|
217
217
|
var SIZES = {
|
|
@@ -237,7 +237,7 @@ var Control = function Control(_ref) {
|
|
|
237
237
|
};
|
|
238
238
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
239
239
|
return /*#__PURE__*/jsx(components.DropdownIndicator, _objectSpread(_objectSpread({}, props), {}, {
|
|
240
|
-
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, _defineProperty$1({}, "data-
|
|
240
|
+
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, _defineProperty$1({}, "data-testid", "action-select-indicator")),
|
|
241
241
|
children: /*#__PURE__*/jsx(Down, {
|
|
242
242
|
size: 16
|
|
243
243
|
})
|
|
@@ -246,7 +246,7 @@ var DropdownIndicator = function DropdownIndicator(props) {
|
|
|
246
246
|
var ClearIndicator = function ClearIndicator(props) {
|
|
247
247
|
return /*#__PURE__*/jsx(components.ClearIndicator, _objectSpread(_objectSpread({}, props), {}, {
|
|
248
248
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
249
|
-
"data-
|
|
249
|
+
"data-testid": "clear-select-indicator"
|
|
250
250
|
}),
|
|
251
251
|
children: /*#__PURE__*/jsx(Close, {
|
|
252
252
|
size: 16
|
|
@@ -263,8 +263,7 @@ var MultiValueRemove = function MultiValueRemove(props) {
|
|
|
263
263
|
var CustomInput = function CustomInput(props) {
|
|
264
264
|
var selectProps = props.selectProps;
|
|
265
265
|
return /*#__PURE__*/jsx(components.Input, _objectSpread(_objectSpread({}, props), {}, {
|
|
266
|
-
"data-
|
|
267
|
-
"data-testid": selectProps && selectProps["data-testid"],
|
|
266
|
+
"data-testid": selectProps ? selectProps["data-testid"] : "select-input",
|
|
268
267
|
maxLength: selectProps && selectProps.maxLength
|
|
269
268
|
}));
|
|
270
269
|
};
|
|
@@ -272,7 +271,7 @@ var CustomOption = function CustomOption(props) {
|
|
|
272
271
|
var ref = useRef();
|
|
273
272
|
var innerProps = props.innerProps,
|
|
274
273
|
_props$data = props.data,
|
|
275
|
-
|
|
274
|
+
dataTestid = _props$data.dataTestid,
|
|
276
275
|
_props$data$tooltipPr = _props$data.tooltipProps,
|
|
277
276
|
tooltipProps = _props$data$tooltipPr === void 0 ? {} : _props$data$tooltipPr;
|
|
278
277
|
useEffect(function () {
|
|
@@ -281,7 +280,7 @@ var CustomOption = function CustomOption(props) {
|
|
|
281
280
|
var optionComponent = /*#__PURE__*/jsx(components.Option, _objectSpread(_objectSpread({}, props), {}, {
|
|
282
281
|
innerRef: ref,
|
|
283
282
|
innerProps: _objectSpread(_objectSpread({}, innerProps), {}, {
|
|
284
|
-
"data-
|
|
283
|
+
"data-testid": dataTestid || "".concat(hyphenize(props.label), "-select-option")
|
|
285
284
|
})
|
|
286
285
|
}));
|
|
287
286
|
return isPresent(tooltipProps) ? /*#__PURE__*/jsx(Tooltip, _objectSpread(_objectSpread({
|
|
@@ -297,7 +296,7 @@ var Placeholder = function Placeholder(props) {
|
|
|
297
296
|
var selectProps = props.selectProps;
|
|
298
297
|
return /*#__PURE__*/jsx(components.Placeholder, _objectSpread(_objectSpread({}, props), {}, {
|
|
299
298
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
300
|
-
"data-
|
|
299
|
+
"data-testid": selectProps !== null && selectProps !== void 0 && selectProps.hyphenatedDataTestIdLabel ? "".concat(selectProps.hyphenatedDataTestIdLabel, "-select-placeholder") : "select-placeholder"
|
|
301
300
|
})
|
|
302
301
|
}));
|
|
303
302
|
};
|
|
@@ -305,14 +304,14 @@ var Menu = function Menu(props) {
|
|
|
305
304
|
var selectProps = props.selectProps;
|
|
306
305
|
return /*#__PURE__*/jsx(components.Menu, _objectSpread(_objectSpread({}, props), {}, {
|
|
307
306
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
308
|
-
"data-
|
|
307
|
+
"data-testid": selectProps ? "".concat(selectProps.hyphenatedDataTestIdLabel, "-select-menu") : "select-menu"
|
|
309
308
|
})
|
|
310
309
|
}));
|
|
311
310
|
};
|
|
312
311
|
var SingleValue = function SingleValue(props) {
|
|
313
312
|
return /*#__PURE__*/jsx(components.SingleValue, _objectSpread(_objectSpread({}, props), {}, {
|
|
314
313
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
315
|
-
"data-
|
|
314
|
+
"data-testid": "select-single-value"
|
|
316
315
|
})
|
|
317
316
|
}));
|
|
318
317
|
};
|
|
@@ -321,7 +320,7 @@ var ValueContainer = function ValueContainer(props) {
|
|
|
321
320
|
return /*#__PURE__*/jsx(components.ValueContainer, _objectSpread(_objectSpread({}, props), {}, {
|
|
322
321
|
innerProps: _objectSpread(_objectSpread({}, props.innerProps), {}, {
|
|
323
322
|
name: selectProps.name,
|
|
324
|
-
"data-
|
|
323
|
+
"data-testid": selectProps ? "".concat(selectProps.hyphenatedDataTestIdLabel, "-select-value-container") : "select-value-container"
|
|
325
324
|
})
|
|
326
325
|
}));
|
|
327
326
|
};
|
|
@@ -394,12 +393,12 @@ var Select = function Select(_ref2) {
|
|
|
394
393
|
onKeyDown = _ref2.onKeyDown,
|
|
395
394
|
_ref2$styles = _ref2.styles,
|
|
396
395
|
styles = _ref2$styles === void 0 ? {} : _ref2$styles,
|
|
397
|
-
_ref2$
|
|
398
|
-
|
|
396
|
+
_ref2$dataTestid = _ref2.dataTestid,
|
|
397
|
+
dataTestid = _ref2$dataTestid === void 0 ? "nui" : _ref2$dataTestid,
|
|
399
398
|
otherProps = _objectWithoutProperties$1(_ref2, _excluded2);
|
|
400
399
|
var inputId = useId(id);
|
|
401
400
|
var isMenuOpen = useRef((_ref3 = (_otherProps$isMenuOpe = otherProps.isMenuOpen) !== null && _otherProps$isMenuOpe !== void 0 ? _otherProps$isMenuOpe : otherProps.defaultMenuIsOpen) !== null && _ref3 !== void 0 ? _ref3 : false);
|
|
402
|
-
var
|
|
401
|
+
var hyphenatedDataTestIdLabel = isEmpty(label) ? hyphenize(dataTestid) : hyphenize(label);
|
|
403
402
|
var Parent = StateManagedSelect;
|
|
404
403
|
if (isCreateable) {
|
|
405
404
|
Parent = CreatableSelect;
|
|
@@ -463,12 +462,10 @@ var Select = function Select(_ref2) {
|
|
|
463
462
|
};
|
|
464
463
|
return /*#__PURE__*/jsxs("div", {
|
|
465
464
|
className: classnames(["neeto-ui-input__wrapper", className]),
|
|
466
|
-
"data-
|
|
467
|
-
"data-testid": "select",
|
|
465
|
+
"data-testid": "".concat(hyphenatedDataTestIdLabel, "-select-container-wrapper"),
|
|
468
466
|
children: [label && /*#__PURE__*/jsx(Label, _objectSpread(_objectSpread({
|
|
469
467
|
required: required,
|
|
470
|
-
"data-
|
|
471
|
-
"data-testid": "select-label",
|
|
468
|
+
"data-testid": "".concat(hyphenatedDataTestIdLabel, "-input-label"),
|
|
472
469
|
htmlFor: inputId
|
|
473
470
|
}, labelProps), {}, {
|
|
474
471
|
children: label
|
|
@@ -476,7 +473,7 @@ var Select = function Select(_ref2) {
|
|
|
476
473
|
blurInputOnSelect: false,
|
|
477
474
|
classNamePrefix: "neeto-ui-react-select",
|
|
478
475
|
closeMenuOnSelect: !otherProps.isMulti,
|
|
479
|
-
"data-
|
|
476
|
+
"data-testid": "".concat(hyphenatedDataTestIdLabel, "-select-container"),
|
|
480
477
|
defaultValue: findInOptions(defaultValue),
|
|
481
478
|
ref: innerRef,
|
|
482
479
|
value: findInOptions(value),
|
|
@@ -507,16 +504,14 @@ var Select = function Select(_ref2) {
|
|
|
507
504
|
label: label,
|
|
508
505
|
styles: styles
|
|
509
506
|
}, portalProps), otherProps), {}, {
|
|
510
|
-
|
|
507
|
+
hyphenatedDataTestIdLabel: hyphenatedDataTestIdLabel
|
|
511
508
|
}))), !!error && /*#__PURE__*/jsx("p", {
|
|
512
509
|
className: "neeto-ui-input__error",
|
|
513
|
-
"data-
|
|
514
|
-
"data-testid": "select-error",
|
|
510
|
+
"data-testid": "".concat(hyphenatedDataTestIdLabel, "-select-error"),
|
|
515
511
|
children: error
|
|
516
512
|
}), helpText && /*#__PURE__*/jsx("p", {
|
|
517
513
|
className: "neeto-ui-input__help-text",
|
|
518
|
-
"data-
|
|
519
|
-
"data-testid": "select-help-text",
|
|
514
|
+
"data-testid": "".concat(hyphenatedDataTestIdLabel, "-select-help-text"),
|
|
520
515
|
children: helpText
|
|
521
516
|
})]
|
|
522
517
|
});
|