@bigbinary/neetoui 8.2.23 → 8.2.24
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/ActionDropdown.js +2 -2
- package/dist/Alert.js +3 -4
- package/dist/Alert.js.map +1 -1
- package/dist/Checkbox.js +3 -3
- package/dist/ColorPicker.js +3 -3
- package/dist/ColorPicker.js.map +1 -1
- package/dist/DatePicker.js +15 -16
- package/dist/DatePicker.js.map +1 -1
- package/dist/Dropdown.js +2 -2
- package/dist/Input.js +3 -3
- package/dist/Modal.js +3 -4
- package/dist/Modal.js.map +1 -1
- package/dist/MultiEmailInput.js +15 -15
- package/dist/Pagination.js +3 -3
- package/dist/Pane.js +3 -4
- package/dist/Pane.js.map +1 -1
- package/dist/Radio.js +3 -3
- package/dist/Select.js +4 -4
- package/dist/Select.js.map +1 -1
- package/dist/Sidebar.js +3 -2
- package/dist/Sidebar.js.map +1 -1
- package/dist/Slider.js +3 -3
- package/dist/Switch.js +3 -3
- package/dist/Table.js +4 -7
- package/dist/Table.js.map +1 -1
- package/dist/{Textarea-afac4a3e.js → Textarea-BcglKMaG.js} +3 -3
- package/dist/{Textarea-afac4a3e.js.map → Textarea-BcglKMaG.js.map} +1 -1
- package/dist/Textarea.js +4 -4
- package/dist/TimePicker.js +15 -16
- package/dist/TimePicker.js.map +1 -1
- package/dist/Toastr.js +2 -2
- package/dist/TranslationProvider.js +3 -1
- package/dist/TranslationProvider.js.map +1 -1
- package/dist/Tree.js +2 -2
- package/dist/TreeSelect.js +2 -2
- package/dist/cjs/Accordion.js +18 -27
- package/dist/cjs/Accordion.js.map +1 -1
- package/dist/cjs/ActionDropdown.js +8 -16
- package/dist/cjs/ActionDropdown.js.map +1 -1
- package/dist/cjs/Alert.js +9 -15
- package/dist/cjs/Alert.js.map +1 -1
- package/dist/cjs/Avatar.js +10 -19
- package/dist/cjs/Avatar.js.map +1 -1
- package/dist/cjs/Button.js +13 -21
- package/dist/cjs/Button.js.map +1 -1
- package/dist/cjs/Callout.js +5 -13
- package/dist/cjs/Callout.js.map +1 -1
- package/dist/cjs/Checkbox.js +10 -17
- package/dist/cjs/Checkbox.js.map +1 -1
- package/dist/cjs/ColorPicker.js +30 -40
- package/dist/cjs/ColorPicker.js.map +1 -1
- package/dist/cjs/DatePicker.js +15 -16
- package/dist/cjs/DatePicker.js.map +1 -1
- package/dist/cjs/Dropdown.js +30 -40
- package/dist/cjs/Dropdown.js.map +1 -1
- package/dist/cjs/Input.js +20 -29
- package/dist/cjs/Input.js.map +1 -1
- package/dist/cjs/Kbd.js +4 -11
- package/dist/cjs/Kbd.js.map +1 -1
- package/dist/cjs/Label.js +14 -22
- package/dist/cjs/Label.js.map +1 -1
- package/dist/cjs/Modal.js +22 -32
- package/dist/cjs/Modal.js.map +1 -1
- package/dist/cjs/MultiEmailInput.js +51 -62
- package/dist/cjs/MultiEmailInput.js.map +1 -1
- package/dist/cjs/NoData.js +14 -21
- package/dist/cjs/NoData.js.map +1 -1
- package/dist/cjs/Pagination.js +19 -25
- package/dist/cjs/Pagination.js.map +1 -1
- package/dist/cjs/Pane.js +19 -29
- package/dist/cjs/Pane.js.map +1 -1
- package/dist/cjs/Popover.js +5 -12
- package/dist/cjs/Popover.js.map +1 -1
- package/dist/cjs/ProgressBar.js +3 -8
- package/dist/cjs/ProgressBar.js.map +1 -1
- package/dist/cjs/Radio.js +17 -26
- package/dist/cjs/Radio.js.map +1 -1
- package/dist/cjs/Select.js +49 -62
- package/dist/cjs/Select.js.map +1 -1
- package/dist/cjs/Sidebar.js +69 -77
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/Slider.js +12 -21
- package/dist/cjs/Slider.js.map +1 -1
- package/dist/cjs/Spinner.js +2 -7
- package/dist/cjs/Spinner.js.map +1 -1
- package/dist/cjs/Stepper.js +6 -11
- package/dist/cjs/Stepper.js.map +1 -1
- package/dist/cjs/Switch.js +16 -23
- package/dist/cjs/Switch.js.map +1 -1
- package/dist/cjs/Tab.js +10 -18
- package/dist/cjs/Tab.js.map +1 -1
- package/dist/cjs/Table.js +54 -70
- package/dist/cjs/Table.js.map +1 -1
- package/dist/cjs/Tag.js +9 -16
- package/dist/cjs/Tag.js.map +1 -1
- package/dist/cjs/{Textarea-c6496fa2.js → Textarea-XjB9bG3I.js} +19 -28
- package/dist/cjs/{Textarea-c6496fa2.js.map → Textarea-XjB9bG3I.js.map} +1 -1
- package/dist/cjs/Textarea.js +4 -4
- package/dist/cjs/TimePicker.js +15 -16
- package/dist/cjs/TimePicker.js.map +1 -1
- package/dist/cjs/Toastr.js +24 -34
- package/dist/cjs/Toastr.js.map +1 -1
- package/dist/cjs/Tooltip.js +4 -12
- package/dist/cjs/Tooltip.js.map +1 -1
- package/dist/cjs/TranslationProvider.js +6 -9
- package/dist/cjs/TranslationProvider.js.map +1 -1
- package/dist/cjs/Tree.js +8 -17
- package/dist/cjs/Tree.js.map +1 -1
- package/dist/cjs/TreeSelect.js +14 -24
- package/dist/cjs/TreeSelect.js.map +1 -1
- package/dist/cjs/Typography.js +4 -12
- package/dist/cjs/Typography.js.map +1 -1
- package/dist/cjs/constants.js +7 -19
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/{en-c69be2fb.js → en-1dfvTYgC.js} +1 -1
- package/dist/cjs/en-1dfvTYgC.js.map +1 -0
- package/dist/cjs/formik/ActionBlock.js +7 -13
- package/dist/cjs/formik/ActionBlock.js.map +1 -1
- package/dist/cjs/formik/BlockNavigation.js +12 -20
- package/dist/cjs/formik/BlockNavigation.js.map +1 -1
- package/dist/cjs/formik/Button.js +2 -8
- package/dist/cjs/formik/Button.js.map +1 -1
- package/dist/cjs/formik/Checkbox.js +7 -14
- package/dist/cjs/formik/Checkbox.js.map +1 -1
- package/dist/cjs/formik/Form.js +13 -24
- package/dist/cjs/formik/Form.js.map +1 -1
- package/dist/cjs/formik/Input.js +7 -14
- package/dist/cjs/formik/Input.js.map +1 -1
- package/dist/cjs/formik/MultiEmailInput.js +6 -13
- package/dist/cjs/formik/MultiEmailInput.js.map +1 -1
- package/dist/cjs/formik/Radio.js +7 -15
- package/dist/cjs/formik/Radio.js.map +1 -1
- package/dist/cjs/formik/Select.js +8 -16
- package/dist/cjs/formik/Select.js.map +1 -1
- package/dist/cjs/formik/Slider.js +7 -15
- package/dist/cjs/formik/Slider.js.map +1 -1
- package/dist/cjs/formik/Switch.js +7 -14
- package/dist/cjs/formik/Switch.js.map +1 -1
- package/dist/cjs/formik/Textarea.js +8 -15
- package/dist/cjs/formik/Textarea.js.map +1 -1
- package/dist/cjs/formik/TreeSelect.js +5 -12
- package/dist/cjs/formik/TreeSelect.js.map +1 -1
- package/dist/cjs/formik/index.js +6 -9
- package/dist/cjs/formik/index.js.map +1 -1
- package/dist/cjs/{index-3c44e0c7.js → index-CvMjRZDt.js} +19 -33
- package/dist/cjs/{index-3c44e0c7.js.map → index-CvMjRZDt.js.map} +1 -1
- package/dist/cjs/{index-87f2e2dc.js → index-DoQ9g6qh.js} +53 -70
- package/dist/cjs/{index-87f2e2dc.js.map → index-DoQ9g6qh.js.map} +1 -1
- package/dist/cjs/index.js +22 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts.js +2 -4
- package/dist/cjs/layouts.js.map +1 -1
- package/dist/cjs/managers.js +0 -2
- package/dist/cjs/managers.js.map +1 -1
- package/dist/cjs/overlayManager.js +2 -9
- package/dist/cjs/overlayManager.js.map +1 -1
- package/dist/cjs/{react-select-creatable.esm-23eddf9f.js → react-select-creatable.esm-Bdv9YAMt.js} +231 -140
- package/dist/cjs/{react-select-creatable.esm-23eddf9f.js.map → react-select-creatable.esm-Bdv9YAMt.js.map} +1 -1
- package/dist/cjs/tinycolor-C4a31PPv.js +1214 -0
- package/dist/cjs/tinycolor-C4a31PPv.js.map +1 -0
- package/dist/cjs/{useId-4e3deb5c.js → useId-DXHUzdxd.js} +1 -1
- package/dist/cjs/{useId-4e3deb5c.js.map → useId-DXHUzdxd.js.map} +1 -1
- package/dist/cjs/{useOverlayManager-b8134604.js → useOverlayManager-CXLC179x.js} +19 -741
- package/dist/cjs/useOverlayManager-CXLC179x.js.map +1 -0
- package/dist/cjs/{useQueryParams-a8ee2f76.js → useQueryParams-l5fJJYCR.js} +2 -6
- package/dist/cjs/useQueryParams-l5fJJYCR.js.map +1 -0
- package/dist/cjs/{useRestoreScrollPosition-26e8d203.js → useRestoreScrollPosition-Dmq0tlvp.js} +18 -22
- package/dist/cjs/{useRestoreScrollPosition-26e8d203.js.map → useRestoreScrollPosition-Dmq0tlvp.js.map} +1 -1
- package/dist/{en-2d3f9fc1.js → en-CJac0MnO.js} +1 -1
- package/dist/en-CJac0MnO.js.map +1 -0
- package/dist/formik/ActionBlock.js +2 -2
- package/dist/formik/BlockNavigation.js +3 -4
- package/dist/formik/BlockNavigation.js.map +1 -1
- package/dist/formik/Checkbox.js +3 -3
- package/dist/formik/Input.js +3 -3
- package/dist/formik/MultiEmailInput.js +3 -3
- package/dist/formik/Radio.js +3 -3
- package/dist/formik/Select.js +4 -4
- package/dist/formik/Slider.js +3 -3
- package/dist/formik/Switch.js +3 -3
- package/dist/formik/Textarea.js +4 -4
- package/dist/formik/TreeSelect.js +2 -2
- package/dist/formik/index.js +6 -7
- package/dist/formik/index.js.map +1 -1
- package/dist/{index-6e82a862.js → index-BojMT3ps.js} +3 -3
- package/dist/{index-6e82a862.js.map → index-BojMT3ps.js.map} +1 -1
- package/dist/{index-b037e9fc.js → index-H3jaZAFp.js} +6 -12
- package/dist/{index-b037e9fc.js.map → index-H3jaZAFp.js.map} +1 -1
- package/dist/index.js +22 -23
- package/dist/index.js.map +1 -1
- package/dist/layouts.js +2 -2
- package/dist/{react-select-creatable.esm-ad71b0c0.js → react-select-creatable.esm-Dx_vEnyD.js} +137 -31
- package/dist/{react-select-creatable.esm-ad71b0c0.js.map → react-select-creatable.esm-Dx_vEnyD.js.map} +1 -1
- package/dist/tinycolor-DX-kZ4bq.js +1212 -0
- package/dist/tinycolor-DX-kZ4bq.js.map +1 -0
- package/dist/{useId-c1d20bba.js → useId-Jj9hXm-g.js} +1 -1
- package/dist/{useId-c1d20bba.js.map → useId-Jj9hXm-g.js.map} +1 -1
- package/dist/{useOverlayManager-65f6d80a.js → useOverlayManager-Dyv5Y8Ug.js} +3 -713
- package/dist/useOverlayManager-Dyv5Y8Ug.js.map +1 -0
- package/dist/{useQueryParams-dcb34865.js → useQueryParams-b60CHFUx.js} +1 -1
- package/dist/{useQueryParams-dcb34865.js.map → useQueryParams-b60CHFUx.js.map} +1 -1
- package/dist/{useRestoreScrollPosition-631cf3e5.js → useRestoreScrollPosition-DnEaioaR.js} +2 -2
- package/dist/{useRestoreScrollPosition-631cf3e5.js.map → useRestoreScrollPosition-DnEaioaR.js.map} +1 -1
- package/package.json +10 -10
- package/dist/cjs/en-c69be2fb.js.map +0 -1
- package/dist/cjs/tinycolor-b1e9a7b2.js +0 -1202
- package/dist/cjs/tinycolor-b1e9a7b2.js.map +0 -1
- package/dist/cjs/useOverlayManager-b8134604.js.map +0 -1
- package/dist/cjs/useQueryParams-a8ee2f76.js.map +0 -1
- package/dist/en-2d3f9fc1.js.map +0 -1
- package/dist/tinycolor-282c618c.js +0 -1200
- package/dist/tinycolor-282c618c.js.map +0 -1
- package/dist/useOverlayManager-65f6d80a.js.map +0 -1
package/dist/cjs/Slider.js
CHANGED
|
@@ -9,12 +9,12 @@ var React = require('react');
|
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var constants = require('./constants.js');
|
|
11
11
|
var Label = require('./Label.js');
|
|
12
|
-
var useId = require('./useId-
|
|
12
|
+
var useId = require('./useId-DXHUzdxd.js');
|
|
13
13
|
require('@babel/runtime/helpers/slicedToArray');
|
|
14
14
|
require('react-router-dom');
|
|
15
15
|
require('@bigbinary/neeto-hotkeys');
|
|
16
16
|
require('./overlayManager.js');
|
|
17
|
-
var index = require('./index-
|
|
17
|
+
var index = require('./index-CvMjRZDt.js');
|
|
18
18
|
require('qs');
|
|
19
19
|
require('antd/locale/de_DE');
|
|
20
20
|
require('antd/locale/en_US');
|
|
@@ -43,20 +43,11 @@ require('dayjs/plugin/weekday');
|
|
|
43
43
|
require('dayjs/plugin/weekOfYear');
|
|
44
44
|
require('@bigbinary/neeto-cist');
|
|
45
45
|
require('ramda');
|
|
46
|
-
require('./en-
|
|
47
|
-
|
|
48
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
49
|
-
|
|
50
|
-
var _ConfigProvider__default = /*#__PURE__*/_interopDefaultLegacy(_ConfigProvider);
|
|
51
|
-
var _Slider__default = /*#__PURE__*/_interopDefaultLegacy(_Slider);
|
|
52
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
53
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
54
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
55
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
46
|
+
require('./en-1dfvTYgC.js');
|
|
56
47
|
|
|
57
48
|
var _excluded = ["min", "max", "defaultValue", "onChange", "value", "label", "required", "labelProps", "error", "helpText"];
|
|
58
49
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
59
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
50
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
60
51
|
var Slider = function Slider(_ref) {
|
|
61
52
|
var _ref$min = _ref.min,
|
|
62
53
|
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
@@ -75,13 +66,13 @@ var Slider = function Slider(_ref) {
|
|
|
75
66
|
labelProps = _ref$labelProps === void 0 ? {} : _ref$labelProps,
|
|
76
67
|
error = _ref.error,
|
|
77
68
|
helpText = _ref.helpText,
|
|
78
|
-
otherProps =
|
|
69
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
79
70
|
var id = useId.useId(otherProps.id);
|
|
80
71
|
var errorId = "error_".concat(id);
|
|
81
72
|
var helpTextId = "helpText_".concat(id);
|
|
82
73
|
var _useTranslation = reactI18next.useTranslation(),
|
|
83
74
|
i18n = _useTranslation.i18n;
|
|
84
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React.createElement(_ConfigProvider, {
|
|
85
76
|
locale: constants.ANTD_LOCALE[i18n.language || "en"],
|
|
86
77
|
theme: {
|
|
87
78
|
token: _objectSpread({}, index.ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES),
|
|
@@ -101,15 +92,15 @@ var Slider = function Slider(_ref) {
|
|
|
101
92
|
}
|
|
102
93
|
}
|
|
103
94
|
}
|
|
104
|
-
}, /*#__PURE__*/
|
|
95
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
105
96
|
className: "neeto-ui-input__wrapper"
|
|
106
|
-
}, /*#__PURE__*/
|
|
97
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
107
98
|
className: "neeto-ui-input__label-wrapper"
|
|
108
|
-
}, label && /*#__PURE__*/
|
|
99
|
+
}, label && /*#__PURE__*/React.createElement(Label, _extends({
|
|
109
100
|
required: required,
|
|
110
101
|
"data-cy": "".concat(index.hyphenize(label), "-slider-label"),
|
|
111
102
|
htmlFor: id
|
|
112
|
-
}, labelProps), label)), /*#__PURE__*/
|
|
103
|
+
}, labelProps), label)), /*#__PURE__*/React.createElement(_Slider, _extends({
|
|
113
104
|
className: "neeto-ui-w-full",
|
|
114
105
|
tooltip: {
|
|
115
106
|
formatter: null
|
|
@@ -122,11 +113,11 @@ var Slider = function Slider(_ref) {
|
|
|
122
113
|
value: value
|
|
123
114
|
}, otherProps), {}, {
|
|
124
115
|
id: id
|
|
125
|
-
}))), !!error && /*#__PURE__*/
|
|
116
|
+
}))), !!error && /*#__PURE__*/React.createElement("p", {
|
|
126
117
|
className: "neeto-ui-input__error",
|
|
127
118
|
"data-cy": "".concat(index.hyphenize(label), "-input-error"),
|
|
128
119
|
id: errorId
|
|
129
|
-
}, error), helpText && /*#__PURE__*/
|
|
120
|
+
}, error), helpText && /*#__PURE__*/React.createElement("p", {
|
|
130
121
|
className: "neeto-ui-input__help-text",
|
|
131
122
|
"data-cy": "".concat(index.hyphenize(label), "-input-help"),
|
|
132
123
|
id: helpTextId
|
package/dist/cjs/Slider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sources":["../../src/components/Slider/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Slider as AntdSlider, ConfigProvider } from \"antd\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport Label from \"components/Label\";\nimport { useId } from \"hooks\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES, hyphenize, noop } from \"utils\";\n\nconst Slider = ({\n min = 0,\n max = 100,\n defaultValue = 0,\n onChange = noop,\n value = undefined,\n label,\n required = false,\n labelProps = {},\n error,\n helpText,\n ...otherProps\n}) => {\n const id = useId(otherProps.id);\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Slider: {\n dotActiveBorderColor: \"rgb(var(--neeto-ui-primary-500))\",\n dotBorderColor: \"rgb(var(--neeto-ui-gray-500))\",\n handleActiveColor: \"rgb(var(--neeto-ui-primary-600))\",\n handleColor: \"rgb(var(--neeto-ui-primary-500))\",\n railBg: \"rgb(var(--neeto-ui-gray-200))\",\n railHoverBg: \"rgb(var(--neeto-ui-gray-300))\",\n trackBg: \"rgb(var(--neeto-ui-primary-500))\",\n trackBgDisabled: \"rgb(var(--neeto-ui-gray-100))\",\n trackHoverBg: \"rgb(var(--neeto-ui-primary-600))\",\n\n // Global overrides\n colorFillContentHover: \"rgb(var(--neeto-ui-gray-600))\",\n },\n },\n }}\n >\n <div className=\"neeto-ui-input__wrapper\">\n <div className=\"neeto-ui-input__label-wrapper\">\n {label && (\n <Label\n {...{ required }}\n data-cy={`${hyphenize(label)}-slider-label`}\n htmlFor={id}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n </div>\n <AntdSlider\n className=\"neeto-ui-w-full\"\n tooltip={{ formatter: null }}\n {...{ defaultValue, max, min, onChange, value, ...otherProps, id }}\n />\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(label)}-input-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n {helpText && (\n <p\n className=\"neeto-ui-input__help-text\"\n data-cy={`${hyphenize(label)}-input-help`}\n id={helpTextId}\n >\n {helpText}\n </p>\n )}\n </div>\n </ConfigProvider>\n );\n};\n\nSlider.propTypes = {\n /**\n * The minimum value the slider can slide to.\n */\n min: PropTypes.number,\n /**\n * The maximum value the slider can slide to.\n */\n max: PropTypes.number,\n /**\n * Callback function that is fired when the user changes the slider's value.\n */\n onChange: PropTypes.func,\n /**\n * The value of slider. When `range` is false, use number, otherwise, use [number, number]\n */\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\n /**\n * The value of slider. When `range` is false, use number, otherwise, use [number, number]\n *\n */\n defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\n};\n\nexport default Slider;\n"],"names":["Slider","_ref","_ref$min","min","_ref$max","max","_ref$defaultValue","defaultValue","_ref$onChange","onChange","noop","_ref$value","value","undefined","label","_ref$required","required","_ref$labelProps","labelProps","error","helpText","otherProps","_objectWithoutProperties","_excluded","id","useId","errorId","concat","helpTextId","_useTranslation","useTranslation","i18n","React","createElement","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","dotActiveBorderColor","dotBorderColor","handleActiveColor","handleColor","railBg","railHoverBg","trackBg","trackBgDisabled","trackHoverBg","colorFillContentHover","className","Label","_extends","hyphenize","htmlFor","_Slider","tooltip","formatter"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Slider.js","sources":["../../src/components/Slider/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { Slider as AntdSlider, ConfigProvider } from \"antd\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ANTD_LOCALE } from \"components/constants\";\nimport Label from \"components/Label\";\nimport { useId } from \"hooks\";\nimport { ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES, hyphenize, noop } from \"utils\";\n\nconst Slider = ({\n min = 0,\n max = 100,\n defaultValue = 0,\n onChange = noop,\n value = undefined,\n label,\n required = false,\n labelProps = {},\n error,\n helpText,\n ...otherProps\n}) => {\n const id = useId(otherProps.id);\n const errorId = `error_${id}`;\n const helpTextId = `helpText_${id}`;\n\n const { i18n } = useTranslation();\n\n return (\n <ConfigProvider\n locale={ANTD_LOCALE[i18n.language || \"en\"]}\n theme={{\n token: { ...ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES },\n components: {\n Slider: {\n dotActiveBorderColor: \"rgb(var(--neeto-ui-primary-500))\",\n dotBorderColor: \"rgb(var(--neeto-ui-gray-500))\",\n handleActiveColor: \"rgb(var(--neeto-ui-primary-600))\",\n handleColor: \"rgb(var(--neeto-ui-primary-500))\",\n railBg: \"rgb(var(--neeto-ui-gray-200))\",\n railHoverBg: \"rgb(var(--neeto-ui-gray-300))\",\n trackBg: \"rgb(var(--neeto-ui-primary-500))\",\n trackBgDisabled: \"rgb(var(--neeto-ui-gray-100))\",\n trackHoverBg: \"rgb(var(--neeto-ui-primary-600))\",\n\n // Global overrides\n colorFillContentHover: \"rgb(var(--neeto-ui-gray-600))\",\n },\n },\n }}\n >\n <div className=\"neeto-ui-input__wrapper\">\n <div className=\"neeto-ui-input__label-wrapper\">\n {label && (\n <Label\n {...{ required }}\n data-cy={`${hyphenize(label)}-slider-label`}\n htmlFor={id}\n {...labelProps}\n >\n {label}\n </Label>\n )}\n </div>\n <AntdSlider\n className=\"neeto-ui-w-full\"\n tooltip={{ formatter: null }}\n {...{ defaultValue, max, min, onChange, value, ...otherProps, id }}\n />\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(label)}-input-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n {helpText && (\n <p\n className=\"neeto-ui-input__help-text\"\n data-cy={`${hyphenize(label)}-input-help`}\n id={helpTextId}\n >\n {helpText}\n </p>\n )}\n </div>\n </ConfigProvider>\n );\n};\n\nSlider.propTypes = {\n /**\n * The minimum value the slider can slide to.\n */\n min: PropTypes.number,\n /**\n * The maximum value the slider can slide to.\n */\n max: PropTypes.number,\n /**\n * Callback function that is fired when the user changes the slider's value.\n */\n onChange: PropTypes.func,\n /**\n * The value of slider. When `range` is false, use number, otherwise, use [number, number]\n */\n value: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\n /**\n * The value of slider. When `range` is false, use number, otherwise, use [number, number]\n *\n */\n defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),\n};\n\nexport default Slider;\n"],"names":["Slider","_ref","_ref$min","min","_ref$max","max","_ref$defaultValue","defaultValue","_ref$onChange","onChange","noop","_ref$value","value","undefined","label","_ref$required","required","_ref$labelProps","labelProps","error","helpText","otherProps","_objectWithoutProperties","_excluded","id","useId","errorId","concat","helpTextId","_useTranslation","useTranslation","i18n","React","createElement","_ConfigProvider","locale","ANTD_LOCALE","language","theme","token","_objectSpread","ANT_DESIGN_GLOBAL_TOKEN_OVERRIDES","components","dotActiveBorderColor","dotBorderColor","handleActiveColor","handleColor","railBg","railHoverBg","trackBg","trackBgDisabled","trackHoverBg","colorFillContentHover","className","Label","_extends","hyphenize","htmlFor","_Slider","tooltip","formatter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAYN;AAAA,EAAA,IAAAC,QAAA,GAAAD,IAAA,CAXJE,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,QAAA;IAAAE,QAAA,GAAAH,IAAA,CACPI,GAAG;AAAHA,IAAAA,GAAG,GAAAD,QAAA,KAAG,KAAA,CAAA,GAAA,GAAG,GAAAA,QAAA;IAAAE,iBAAA,GAAAL,IAAA,CACTM,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,CAAC,GAAAA,iBAAA;IAAAE,aAAA,GAAAP,IAAA,CAChBQ,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAGE,KAAAA,CAAAA,GAAAA,UAAI,GAAAF,aAAA;IAAAG,UAAA,GAAAV,IAAA,CACfW,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAGE,KAAAA,CAAAA,GAAAA,SAAS,GAAAF,UAAA;IACjBG,KAAK,GAAAb,IAAA,CAALa,KAAK;IAAAC,aAAA,GAAAd,IAAA,CACLe,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;IAAAE,eAAA,GAAAhB,IAAA,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EXP,KAAK,CAET,EACAC,QAAQ,iBACPY,KAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AACEoB,IAAAA,SAAS,EAAC,2BAA2B;AACrC,IAAA,SAAA,EAAA,EAAA,CAAA1B,MAAA,CAAY6B,eAAS,CAAC1C,KAAK,CAAC,EAAc,aAAA,CAAA;AAC1CU,IAAAA,EAAE,EAAEI,UAAAA;GAEHR,EAAAA,QAAQ,CAEZ,CACG,CACS,CAAA;AAErB;;;;"}
|
package/dist/cjs/Spinner.js
CHANGED
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
5
|
|
|
6
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
-
|
|
8
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
10
|
-
|
|
11
6
|
var SPINNER_SIZES = {
|
|
12
7
|
small: "small",
|
|
13
8
|
medium: "medium"
|
|
@@ -19,10 +14,10 @@ var Spinner = function Spinner(_ref) {
|
|
|
19
14
|
size = _ref$size === void 0 ? SPINNER_SIZES.medium : _ref$size,
|
|
20
15
|
_ref$className = _ref.className,
|
|
21
16
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
22
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
23
18
|
"data-cy": "neeto-ui-spinner",
|
|
24
19
|
"data-testid": "spinner",
|
|
25
|
-
className:
|
|
20
|
+
className: classnames("neeto-ui-spinner", {
|
|
26
21
|
"neeto-ui-spinner--dark": theme === "dark",
|
|
27
22
|
"neeto-ui-spinner--light": theme === "light",
|
|
28
23
|
"neeto-ui-spinner--size-small": size === SPINNER_SIZES.small,
|
package/dist/cjs/Spinner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.js","sources":["../../src/components/Spinner.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst SPINNER_THEMES = { dark: \"dark\", light: \"light\" };\nconst SPINNER_SIZES = { small: \"small\", medium: \"medium\" };\n\nconst Spinner = ({\n theme = \"dark\",\n size = SPINNER_SIZES.medium,\n className = \"\",\n}) => (\n <span\n data-cy=\"neeto-ui-spinner\"\n data-testid=\"spinner\"\n className={classnames(\n \"neeto-ui-spinner\",\n {\n \"neeto-ui-spinner--dark\": theme === \"dark\",\n \"neeto-ui-spinner--light\": theme === \"light\",\n \"neeto-ui-spinner--size-small\": size === SPINNER_SIZES.small,\n \"neeto-ui-spinner--size-medium\": size === SPINNER_SIZES.medium,\n },\n [className]\n )}\n />\n);\n\nSpinner.propTypes = {\n /**\n * To specify the theme of the Spinner.\n */\n theme: PropTypes.oneOf(Object.values(SPINNER_THEMES)),\n /**\n * To set the size of the spinner\n */\n size: PropTypes.oneOf(Object.values(SPINNER_SIZES)),\n /**\n * Provide external classnames to Spinner component.\n */\n className: PropTypes.string,\n};\n\nexport default Spinner;\n"],"names":["SPINNER_SIZES","small","medium","Spinner","_ref","_ref$theme","theme","_ref$size","size","_ref$className","className","React","createElement","classnames"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Spinner.js","sources":["../../src/components/Spinner.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst SPINNER_THEMES = { dark: \"dark\", light: \"light\" };\nconst SPINNER_SIZES = { small: \"small\", medium: \"medium\" };\n\nconst Spinner = ({\n theme = \"dark\",\n size = SPINNER_SIZES.medium,\n className = \"\",\n}) => (\n <span\n data-cy=\"neeto-ui-spinner\"\n data-testid=\"spinner\"\n className={classnames(\n \"neeto-ui-spinner\",\n {\n \"neeto-ui-spinner--dark\": theme === \"dark\",\n \"neeto-ui-spinner--light\": theme === \"light\",\n \"neeto-ui-spinner--size-small\": size === SPINNER_SIZES.small,\n \"neeto-ui-spinner--size-medium\": size === SPINNER_SIZES.medium,\n },\n [className]\n )}\n />\n);\n\nSpinner.propTypes = {\n /**\n * To specify the theme of the Spinner.\n */\n theme: PropTypes.oneOf(Object.values(SPINNER_THEMES)),\n /**\n * To set the size of the spinner\n */\n size: PropTypes.oneOf(Object.values(SPINNER_SIZES)),\n /**\n * Provide external classnames to Spinner component.\n */\n className: PropTypes.string,\n};\n\nexport default Spinner;\n"],"names":["SPINNER_SIZES","small","medium","Spinner","_ref","_ref$theme","theme","_ref$size","size","_ref$className","className","React","createElement","classnames"],"mappings":";;;;;AAMA,IAAMA,aAAa,GAAG;AAAEC,EAAAA,KAAK,EAAE,OAAO;AAAEC,EAAAA,MAAM,EAAE,QAAA;AAAS,CAAC,CAAA;AAE1D,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CACXE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,UAAA;IAAAE,SAAA,GAAAH,IAAA,CACdI,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,KAAA,CAAA,GAAGP,aAAa,CAACE,MAAM,GAAAK,SAAA;IAAAE,cAAA,GAAAL,IAAA,CAC3BM,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,oBAEdE,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACE,IAAA,SAAA,EAAQ,kBAAkB;AAC1B,IAAA,aAAA,EAAY,SAAS;AACrBF,IAAAA,SAAS,EAAEG,UAAU,CACnB,kBAAkB,EAClB;MACE,wBAAwB,EAAEP,KAAK,KAAK,MAAM;MAC1C,yBAAyB,EAAEA,KAAK,KAAK,OAAO;AAC5C,MAAA,8BAA8B,EAAEE,IAAI,KAAKR,aAAa,CAACC,KAAK;AAC5D,MAAA,+BAA+B,EAAEO,IAAI,KAAKR,aAAa,CAACE,MAAAA;KACzD,EACD,CAACQ,SAAS,CAAC,CAAA;GAEb,CAAA,CAAA;AAAA;;;;"}
|
package/dist/cjs/Stepper.js
CHANGED
|
@@ -3,35 +3,30 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
5
|
|
|
6
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
-
|
|
8
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
10
|
-
|
|
11
6
|
var Stepper = function Stepper(_ref) {
|
|
12
7
|
var steps = _ref.steps,
|
|
13
8
|
activeIndex = _ref.activeIndex,
|
|
14
9
|
setActiveIndex = _ref.setActiveIndex;
|
|
15
|
-
return /*#__PURE__*/
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
11
|
className: "neeto-ui-stepper__wrapper"
|
|
17
12
|
}, steps.map(function (_ref2, index) {
|
|
18
13
|
var id = _ref2.id,
|
|
19
14
|
label = _ref2.label;
|
|
20
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
16
|
"data-testid": "stepper-item-".concat(id),
|
|
22
17
|
key: id,
|
|
23
|
-
className:
|
|
18
|
+
className: classnames("neeto-ui-stepper-item__wrapper", {
|
|
24
19
|
"neeto-ui-stepper-item__wrapper--active": index === activeIndex,
|
|
25
20
|
"neeto-ui-stepper-item__wrapper--done": index < activeIndex
|
|
26
21
|
})
|
|
27
|
-
}, /*#__PURE__*/
|
|
22
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
28
23
|
className: "neeto-ui-stepper-item",
|
|
29
24
|
onClick: function onClick() {
|
|
30
25
|
return setActiveIndex(index);
|
|
31
26
|
}
|
|
32
|
-
}, /*#__PURE__*/
|
|
27
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
33
28
|
className: "neeto-ui-stepper-item__stage"
|
|
34
|
-
}, /*#__PURE__*/
|
|
29
|
+
}, /*#__PURE__*/React.createElement("span", null, id)), /*#__PURE__*/React.createElement("span", {
|
|
35
30
|
className: "neeto-ui-stepper-item__label",
|
|
36
31
|
"data-text": label
|
|
37
32
|
}, label)));
|
package/dist/cjs/Stepper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sources":["../../src/components/Stepper/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Stepper = ({ steps, activeIndex, setActiveIndex }) => (\n <div className=\"neeto-ui-stepper__wrapper\">\n {steps.map(({ id, label }, index) => (\n <div\n data-testid={`stepper-item-${id}`}\n key={id}\n className={classnames(\"neeto-ui-stepper-item__wrapper\", {\n \"neeto-ui-stepper-item__wrapper--active\": index === activeIndex,\n \"neeto-ui-stepper-item__wrapper--done\": index < activeIndex,\n })}\n >\n <button\n className=\"neeto-ui-stepper-item\"\n onClick={() => setActiveIndex(index)}\n >\n <span className=\"neeto-ui-stepper-item__stage\">\n <span>{id}</span>\n </span>\n <span className=\"neeto-ui-stepper-item__label\" data-text={label}>\n {label}\n </span>\n </button>\n </div>\n ))}\n </div>\n);\n\nStepper.propTypes = {\n /**\n * To provide the array of steps\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n label: PropTypes.string,\n })\n ),\n /**\n * To specify the active step\n */\n activeIndex: PropTypes.number,\n /**\n * To specify the function to set the active step\n */\n setActiveIndex: PropTypes.func,\n};\n\nexport default Stepper;\n"],"names":["Stepper","_ref","steps","activeIndex","setActiveIndex","React","createElement","className","map","_ref2","index","id","label","concat","key","classnames","onClick"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stepper.js","sources":["../../src/components/Stepper/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst Stepper = ({ steps, activeIndex, setActiveIndex }) => (\n <div className=\"neeto-ui-stepper__wrapper\">\n {steps.map(({ id, label }, index) => (\n <div\n data-testid={`stepper-item-${id}`}\n key={id}\n className={classnames(\"neeto-ui-stepper-item__wrapper\", {\n \"neeto-ui-stepper-item__wrapper--active\": index === activeIndex,\n \"neeto-ui-stepper-item__wrapper--done\": index < activeIndex,\n })}\n >\n <button\n className=\"neeto-ui-stepper-item\"\n onClick={() => setActiveIndex(index)}\n >\n <span className=\"neeto-ui-stepper-item__stage\">\n <span>{id}</span>\n </span>\n <span className=\"neeto-ui-stepper-item__label\" data-text={label}>\n {label}\n </span>\n </button>\n </div>\n ))}\n </div>\n);\n\nStepper.propTypes = {\n /**\n * To provide the array of steps\n */\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n label: PropTypes.string,\n })\n ),\n /**\n * To specify the active step\n */\n activeIndex: PropTypes.number,\n /**\n * To specify the function to set the active step\n */\n setActiveIndex: PropTypes.func,\n};\n\nexport default Stepper;\n"],"names":["Stepper","_ref","steps","activeIndex","setActiveIndex","React","createElement","className","map","_ref2","index","id","label","concat","key","classnames","onClick"],"mappings":";;;;;AAKA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAAMC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAEC,cAAc,GAAAH,IAAA,CAAdG,cAAc,CAAA;EAAA,oBACnDC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,2BAAA;AAA2B,GAAA,EACvCL,KAAK,CAACM,GAAG,CAAC,UAAAC,KAAA,EAAgBC,KAAK,EAAA;AAAA,IAAA,IAAlBC,EAAE,GAAAF,KAAA,CAAFE,EAAE;MAAEC,KAAK,GAAAH,KAAA,CAALG,KAAK,CAAA;IAAA,oBACrBP,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MACE,aAAAO,EAAAA,eAAAA,CAAAA,MAAA,CAA6BF,EAAE,CAAG;AAClCG,MAAAA,GAAG,EAAEH,EAAG;AACRJ,MAAAA,SAAS,EAAEQ,UAAU,CAAC,gCAAgC,EAAE;QACtD,wCAAwC,EAAEL,KAAK,KAAKP,WAAW;QAC/D,sCAAsC,EAAEO,KAAK,GAAGP,WAAAA;OACjD,CAAA;KAEDE,eAAAA,KAAA,CAAAC,aAAA,CAAA,QAAA,EAAA;AACEC,MAAAA,SAAS,EAAC,uBAAuB;MACjCS,OAAO,EAAE,SAAAA,OAAA,GAAA;QAAA,OAAMZ,cAAc,CAACM,KAAK,CAAC,CAAA;AAAA,OAAA;KAEpCL,eAAAA,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMC,MAAAA,SAAS,EAAC,8BAAA;KACdF,eAAAA,KAAA,CAAAC,aAAA,CAAOK,MAAAA,EAAAA,IAAAA,EAAAA,EAAE,CAAQ,CACZ,eACPN,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMC,MAAAA,SAAS,EAAC,8BAA8B;MAAC,WAAWK,EAAAA,KAAAA;KACvDA,EAAAA,KAAK,CACD,CACA,CACL,CAAA;AAAA,GACP,CAAC,CACE,CAAA;AAAA;;;;"}
|
package/dist/cjs/Switch.js
CHANGED
|
@@ -5,12 +5,12 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
8
|
-
var useId = require('./useId-
|
|
8
|
+
var useId = require('./useId-DXHUzdxd.js');
|
|
9
9
|
require('@babel/runtime/helpers/slicedToArray');
|
|
10
10
|
require('react-router-dom');
|
|
11
11
|
require('@bigbinary/neeto-hotkeys');
|
|
12
12
|
require('./overlayManager.js');
|
|
13
|
-
var index = require('./index-
|
|
13
|
+
var index = require('./index-CvMjRZDt.js');
|
|
14
14
|
require('@babel/runtime/helpers/defineProperty');
|
|
15
15
|
require('qs');
|
|
16
16
|
var Label = require('./Label.js');
|
|
@@ -25,7 +25,7 @@ require('dayjs/plugin/weekday');
|
|
|
25
25
|
require('dayjs/plugin/weekOfYear');
|
|
26
26
|
require('@bigbinary/neeto-cist');
|
|
27
27
|
require('ramda');
|
|
28
|
-
require('./en-
|
|
28
|
+
require('./en-1dfvTYgC.js');
|
|
29
29
|
require('./Button.js');
|
|
30
30
|
require('./Spinner.js');
|
|
31
31
|
require('./Tooltip.js');
|
|
@@ -34,13 +34,6 @@ require('tippy.js');
|
|
|
34
34
|
require('./Popover.js');
|
|
35
35
|
require('./Typography.js');
|
|
36
36
|
|
|
37
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
38
|
-
|
|
39
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
40
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
41
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
43
|
-
|
|
44
37
|
var _excluded = ["label", "required", "className", "error", "onChange", "labelProps", "children"];
|
|
45
38
|
var Switch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
46
39
|
var _ref$label = _ref.label,
|
|
@@ -55,47 +48,47 @@ var Switch = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
55
48
|
onChange = _ref$onChange === void 0 ? index.noop : _ref$onChange,
|
|
56
49
|
labelProps = _ref.labelProps,
|
|
57
50
|
children = _ref.children,
|
|
58
|
-
otherProps =
|
|
51
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
59
52
|
var id = useId.useId(otherProps.id);
|
|
60
53
|
var errorId = "error_".concat(id);
|
|
61
54
|
var checked = otherProps.checked,
|
|
62
55
|
disabled = otherProps.disabled;
|
|
63
56
|
var renderLabel = label || children;
|
|
64
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
58
|
ref: ref,
|
|
66
|
-
className:
|
|
67
|
-
}, /*#__PURE__*/
|
|
59
|
+
className: classnames(["neeto-ui-switch__wrapper", className])
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
68
61
|
className: "neeto-ui-switch__container"
|
|
69
|
-
}, /*#__PURE__*/
|
|
62
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
70
63
|
tabIndex: 0,
|
|
71
|
-
className:
|
|
64
|
+
className: classnames("neeto-ui-switch__item", {
|
|
72
65
|
"neeto-ui-switch__item--checked": !!checked,
|
|
73
66
|
"neeto-ui-switch__item--disabled": disabled
|
|
74
67
|
})
|
|
75
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
76
69
|
onChange: onChange,
|
|
77
70
|
type: "checkbox"
|
|
78
|
-
}, otherProps)), /*#__PURE__*/
|
|
71
|
+
}, otherProps)), /*#__PURE__*/React.createElement("span", {
|
|
79
72
|
"aria-hidden": "true",
|
|
80
73
|
"data-cy": "".concat(index.hyphenize(renderLabel), "-switch"),
|
|
81
|
-
className:
|
|
74
|
+
className: classnames("neeto-ui-switch", {
|
|
82
75
|
"neeto-ui-switch--checked": !!checked
|
|
83
76
|
})
|
|
84
|
-
}, checked ? /*#__PURE__*/
|
|
77
|
+
}, checked ? /*#__PURE__*/React.createElement(neetoIcons.Check, {
|
|
85
78
|
"data-cy": "check-icon",
|
|
86
79
|
"data-testid": "check-icon",
|
|
87
80
|
size: "12",
|
|
88
81
|
strokeWidth: 4
|
|
89
|
-
}) : /*#__PURE__*/
|
|
82
|
+
}) : /*#__PURE__*/React.createElement(neetoIcons.Close, {
|
|
90
83
|
"data-cy": "close-icon",
|
|
91
84
|
"data-testid": "close-icon",
|
|
92
85
|
size: "12",
|
|
93
86
|
strokeWidth: 3
|
|
94
|
-
}))), renderLabel && /*#__PURE__*/
|
|
87
|
+
}))), renderLabel && /*#__PURE__*/React.createElement(Label, _extends({
|
|
95
88
|
required: required,
|
|
96
89
|
"data-cy": "".concat(index.hyphenize(renderLabel), "-switch-label"),
|
|
97
90
|
htmlFor: id
|
|
98
|
-
}, labelProps), renderLabel)), !!error && /*#__PURE__*/
|
|
91
|
+
}, labelProps), renderLabel)), !!error && /*#__PURE__*/React.createElement("p", {
|
|
99
92
|
className: "neeto-ui-input__error",
|
|
100
93
|
"data-cy": "".concat(index.hyphenize(renderLabel), "-switch-error"),
|
|
101
94
|
id: errorId
|
package/dist/cjs/Switch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../../src/components/Switch.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Check, Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\n\nimport { useId } from \"hooks\";\nimport { hyphenize, noop } from \"utils\";\n\nimport Label from \"./Label\";\n\nconst Switch = forwardRef(\n (\n {\n label = \"\",\n required = false,\n className = \"\",\n error = \"\",\n onChange = noop,\n labelProps,\n children,\n ...otherProps\n },\n ref\n ) => {\n const id = useId(otherProps.id);\n const errorId = `error_${id}`;\n const { checked, disabled } = otherProps;\n const renderLabel = label || children;\n\n return (\n <div\n {...{ ref }}\n className={classnames([\"neeto-ui-switch__wrapper\", className])}\n >\n <div className=\"neeto-ui-switch__container\">\n <label\n tabIndex={0}\n className={classnames(\"neeto-ui-switch__item\", {\n \"neeto-ui-switch__item--checked\": !!checked,\n \"neeto-ui-switch__item--disabled\": disabled,\n })}\n >\n <input {...{ onChange }} type=\"checkbox\" {...otherProps} />\n <span\n aria-hidden=\"true\"\n data-cy={`${hyphenize(renderLabel)}-switch`}\n className={classnames(\"neeto-ui-switch\", {\n \"neeto-ui-switch--checked\": !!checked,\n })}\n >\n {checked ? (\n <Check\n data-cy=\"check-icon\"\n data-testid=\"check-icon\"\n size=\"12\"\n strokeWidth={4}\n />\n ) : (\n <Close\n data-cy=\"close-icon\"\n data-testid=\"close-icon\"\n size=\"12\"\n strokeWidth={3}\n />\n )}\n </span>\n </label>\n {renderLabel && (\n <Label\n {...{ required }}\n data-cy={`${hyphenize(renderLabel)}-switch-label`}\n htmlFor={id}\n {...labelProps}\n >\n {renderLabel}\n </Label>\n )}\n </div>\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(renderLabel)}-switch-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n\nSwitch.displayName = \"Switch\";\n\nSwitch.propTypes = {\n /**\n * Text to be displayed above the 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 whether to show the required asterisk.\n */\n required: PropTypes.bool,\n /**\n * Provide external classnames to spinner component.\n */\n className: PropTypes.string,\n /**\n * To specify the error message to be shown.\n */\n error: PropTypes.string,\n /**\n * Checks whether the Switch is checked or not\n */\n checked: PropTypes.bool,\n /**\n * To disable the component\n */\n disabled: PropTypes.bool,\n /**\n * To specify the children label to be rendered inside the Checkbox.\n */\n children: PropTypes.string,\n};\n\nexport default Switch;\n"],"names":["Switch","forwardRef","_ref","ref","_ref$label","label","_ref$required","required","_ref$className","className","_ref$error","error","_ref$onChange","onChange","noop","labelProps","children","otherProps","_objectWithoutProperties","_excluded","id","useId","errorId","concat","checked","disabled","renderLabel","React","createElement","classnames","tabIndex","_extends","type","hyphenize","Check","size","strokeWidth","Close","Label","htmlFor","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../src/components/Switch.jsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\n\nimport classnames from \"classnames\";\nimport { Check, Close } from \"neetoicons\";\nimport PropTypes from \"prop-types\";\n\nimport { useId } from \"hooks\";\nimport { hyphenize, noop } from \"utils\";\n\nimport Label from \"./Label\";\n\nconst Switch = forwardRef(\n (\n {\n label = \"\",\n required = false,\n className = \"\",\n error = \"\",\n onChange = noop,\n labelProps,\n children,\n ...otherProps\n },\n ref\n ) => {\n const id = useId(otherProps.id);\n const errorId = `error_${id}`;\n const { checked, disabled } = otherProps;\n const renderLabel = label || children;\n\n return (\n <div\n {...{ ref }}\n className={classnames([\"neeto-ui-switch__wrapper\", className])}\n >\n <div className=\"neeto-ui-switch__container\">\n <label\n tabIndex={0}\n className={classnames(\"neeto-ui-switch__item\", {\n \"neeto-ui-switch__item--checked\": !!checked,\n \"neeto-ui-switch__item--disabled\": disabled,\n })}\n >\n <input {...{ onChange }} type=\"checkbox\" {...otherProps} />\n <span\n aria-hidden=\"true\"\n data-cy={`${hyphenize(renderLabel)}-switch`}\n className={classnames(\"neeto-ui-switch\", {\n \"neeto-ui-switch--checked\": !!checked,\n })}\n >\n {checked ? (\n <Check\n data-cy=\"check-icon\"\n data-testid=\"check-icon\"\n size=\"12\"\n strokeWidth={4}\n />\n ) : (\n <Close\n data-cy=\"close-icon\"\n data-testid=\"close-icon\"\n size=\"12\"\n strokeWidth={3}\n />\n )}\n </span>\n </label>\n {renderLabel && (\n <Label\n {...{ required }}\n data-cy={`${hyphenize(renderLabel)}-switch-label`}\n htmlFor={id}\n {...labelProps}\n >\n {renderLabel}\n </Label>\n )}\n </div>\n {!!error && (\n <p\n className=\"neeto-ui-input__error\"\n data-cy={`${hyphenize(renderLabel)}-switch-error`}\n id={errorId}\n >\n {error}\n </p>\n )}\n </div>\n );\n }\n);\n\nSwitch.displayName = \"Switch\";\n\nSwitch.propTypes = {\n /**\n * Text to be displayed above the 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 whether to show the required asterisk.\n */\n required: PropTypes.bool,\n /**\n * Provide external classnames to spinner component.\n */\n className: PropTypes.string,\n /**\n * To specify the error message to be shown.\n */\n error: PropTypes.string,\n /**\n * Checks whether the Switch is checked or not\n */\n checked: PropTypes.bool,\n /**\n * To disable the component\n */\n disabled: PropTypes.bool,\n /**\n * To specify the children label to be rendered inside the Checkbox.\n */\n children: PropTypes.string,\n};\n\nexport default Switch;\n"],"names":["Switch","forwardRef","_ref","ref","_ref$label","label","_ref$required","required","_ref$className","className","_ref$error","error","_ref$onChange","onChange","noop","labelProps","children","otherProps","_objectWithoutProperties","_excluded","id","useId","errorId","concat","checked","disabled","renderLabel","React","createElement","classnames","tabIndex","_extends","type","hyphenize","Check","size","strokeWidth","Close","Label","htmlFor","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWMA,IAAAA,MAAM,gBAAGC,gBAAU,CACvB,UAAAC,IAAA,EAWEC,GAAG,EACA;AAAA,EAAA,IAAAC,UAAA,GAAAF,IAAA,CAVDG,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IAAAE,aAAA,GAAAJ,IAAA,CACVK,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,aAAA;IAAAE,cAAA,GAAAN,IAAA,CAChBO,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IAAAE,UAAA,GAAAR,IAAA,CACdS,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,UAAA;IAAAE,aAAA,GAAAV,IAAA,CACVW,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAGE,KAAAA,CAAAA,GAAAA,UAAI,GAAAF,aAAA;IACfG,UAAU,GAAAb,IAAA,CAAVa,UAAU;IACVC,QAAQ,GAAA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@babel/runtime/helpers/defineProperty');
|
|
8
8
|
var reactRouterDom = require('react-router-dom');
|
|
9
9
|
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
13
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
16
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
-
|
|
18
10
|
var _excluded$1 = ["active", "className", "children", "icon", "onClick", "activeClassName"];
|
|
19
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
13
|
var Item = function Item(_ref) {
|
|
22
14
|
var active = _ref.active,
|
|
23
15
|
_ref$className = _ref.className,
|
|
@@ -29,25 +21,25 @@ var Item = function Item(_ref) {
|
|
|
29
21
|
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
30
22
|
_ref$activeClassName = _ref.activeClassName,
|
|
31
23
|
activeClassName = _ref$activeClassName === void 0 ? "" : _ref$activeClassName,
|
|
32
|
-
otherProps =
|
|
24
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
33
25
|
var Icon = typeof icon === "string" ? function () {
|
|
34
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("i", {
|
|
35
27
|
className: icon,
|
|
36
28
|
"data-cy": "tab-item-icon",
|
|
37
29
|
"data-testid": "tab-icon"
|
|
38
30
|
});
|
|
39
|
-
} : icon ||
|
|
31
|
+
} : icon || React.Fragment;
|
|
40
32
|
var Parent = activeClassName ? reactRouterDom.NavLink : "button";
|
|
41
33
|
var buttonAttributes = activeClassName ? {} : {
|
|
42
34
|
type: "button"
|
|
43
35
|
};
|
|
44
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/React.createElement(Parent, _extends({
|
|
45
37
|
"data-cy": "tab-item",
|
|
46
|
-
className:
|
|
38
|
+
className: classnames(["neeto-ui-tab neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center neeto-ui-select-none", className], {
|
|
47
39
|
active: active
|
|
48
40
|
}),
|
|
49
41
|
onClick: onClick
|
|
50
|
-
}, _objectSpread(_objectSpread({}, otherProps), buttonAttributes)), icon && /*#__PURE__*/
|
|
42
|
+
}, _objectSpread(_objectSpread({}, otherProps), buttonAttributes)), icon && /*#__PURE__*/React.createElement(Icon, {
|
|
51
43
|
className: "neeto-ui-tab__icon"
|
|
52
44
|
}), children);
|
|
53
45
|
};
|
|
@@ -66,10 +58,10 @@ var Tab = function Tab(_ref) {
|
|
|
66
58
|
children = _ref.children,
|
|
67
59
|
_ref$className = _ref.className,
|
|
68
60
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
69
|
-
otherProps =
|
|
70
|
-
return /*#__PURE__*/
|
|
61
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
62
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
71
63
|
"data-cy": "tab-container",
|
|
72
|
-
className:
|
|
64
|
+
className: classnames({
|
|
73
65
|
"neeto-ui-tab__wrapper neeto-ui-flex": true,
|
|
74
66
|
"neeto-ui-tab__wrapper--size-large": size === SIZES.large,
|
|
75
67
|
"neeto-ui-tab__wrapper--size-small": size === SIZES.small,
|
package/dist/cjs/Tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.js","sources":["../../src/components/Tab/Item.jsx","../../src/components/Tab/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { NavLink } from \"react-router-dom\";\n\nconst Item = ({\n active,\n className = \"\",\n children,\n icon = null,\n onClick = () => {},\n activeClassName = \"\",\n ...otherProps\n}) => {\n const Icon =\n typeof icon === \"string\"\n ? () => (\n <i className={icon} data-cy=\"tab-item-icon\" data-testid=\"tab-icon\" />\n )\n : icon || React.Fragment;\n\n const Parent = activeClassName ? NavLink : \"button\";\n const buttonAttributes = activeClassName ? {} : { type: \"button\" };\n\n return (\n <Parent\n data-cy=\"tab-item\"\n className={classnames(\n [\n \"neeto-ui-tab neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center neeto-ui-select-none\",\n className,\n ],\n { active }\n )}\n onClick={onClick}\n {...{ ...otherProps, ...buttonAttributes }}\n >\n {icon && <Icon className=\"neeto-ui-tab__icon\" />}\n {children}\n </Parent>\n );\n};\n\nItem.displayName = \"Tab.Item\";\n\nItem.propTypes = {\n /**\n * To set the active Tab\n */\n active: PropTypes.bool,\n /**\n * Extra classes can be provided to the TabItem\n */\n className: PropTypes.string,\n /**\n * To add content inside TabItem\n */\n children: PropTypes.node,\n /**\n * To add icons to TabItem\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),\n /**\n * Callback to be triggered when user clicks on the TabItem\n */\n onClick: PropTypes.func,\n activeClassName: PropTypes.string,\n};\n\nexport default Item;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Item from \"./Item\";\n\nconst SIZES = { large: \"large\", small: \"small\" };\n\nconst Tab = ({\n size = SIZES.small,\n noUnderline = false,\n children,\n className = \"\",\n ...otherProps\n}) => (\n <div\n data-cy=\"tab-container\"\n className={classnames(\n {\n \"neeto-ui-tab__wrapper neeto-ui-flex\": true,\n \"neeto-ui-tab__wrapper--size-large\": size === SIZES.large,\n \"neeto-ui-tab__wrapper--size-small\": size === SIZES.small,\n \"neeto-ui-tab__wrapper--underline-none\": noUnderline,\n },\n [className]\n )}\n {...otherProps}\n >\n {children}\n </div>\n);\n\nTab.propTypes = {\n /**\n * To hide the underline\n */\n noUnderline: PropTypes.bool,\n /**\n * Set the size of the Tabs.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To add content inside the Tab\n */\n children: PropTypes.node,\n /**\n * Extra classes can be provided to the Tab\n */\n className: PropTypes.string,\n};\n\nTab.Item = Item;\n\nexport default Tab;\n"],"names":["Item","_ref","active","_ref$className","className","children","_ref$icon","icon","_ref$onClick","onClick","_ref$activeClassName","activeClassName","otherProps","_objectWithoutProperties","_excluded","Icon","React","createElement","Fragment","Parent","NavLink","buttonAttributes","type","_extends","classnames","_objectSpread","displayName","SIZES","large","small","Tab","_ref$size","size","_ref$noUnderline","noUnderline"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tab.js","sources":["../../src/components/Tab/Item.jsx","../../src/components/Tab/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { NavLink } from \"react-router-dom\";\n\nconst Item = ({\n active,\n className = \"\",\n children,\n icon = null,\n onClick = () => {},\n activeClassName = \"\",\n ...otherProps\n}) => {\n const Icon =\n typeof icon === \"string\"\n ? () => (\n <i className={icon} data-cy=\"tab-item-icon\" data-testid=\"tab-icon\" />\n )\n : icon || React.Fragment;\n\n const Parent = activeClassName ? NavLink : \"button\";\n const buttonAttributes = activeClassName ? {} : { type: \"button\" };\n\n return (\n <Parent\n data-cy=\"tab-item\"\n className={classnames(\n [\n \"neeto-ui-tab neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center neeto-ui-select-none\",\n className,\n ],\n { active }\n )}\n onClick={onClick}\n {...{ ...otherProps, ...buttonAttributes }}\n >\n {icon && <Icon className=\"neeto-ui-tab__icon\" />}\n {children}\n </Parent>\n );\n};\n\nItem.displayName = \"Tab.Item\";\n\nItem.propTypes = {\n /**\n * To set the active Tab\n */\n active: PropTypes.bool,\n /**\n * Extra classes can be provided to the TabItem\n */\n className: PropTypes.string,\n /**\n * To add content inside TabItem\n */\n children: PropTypes.node,\n /**\n * To add icons to TabItem\n */\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),\n /**\n * Callback to be triggered when user clicks on the TabItem\n */\n onClick: PropTypes.func,\n activeClassName: PropTypes.string,\n};\n\nexport default Item;\n","import React from \"react\";\n\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport Item from \"./Item\";\n\nconst SIZES = { large: \"large\", small: \"small\" };\n\nconst Tab = ({\n size = SIZES.small,\n noUnderline = false,\n children,\n className = \"\",\n ...otherProps\n}) => (\n <div\n data-cy=\"tab-container\"\n className={classnames(\n {\n \"neeto-ui-tab__wrapper neeto-ui-flex\": true,\n \"neeto-ui-tab__wrapper--size-large\": size === SIZES.large,\n \"neeto-ui-tab__wrapper--size-small\": size === SIZES.small,\n \"neeto-ui-tab__wrapper--underline-none\": noUnderline,\n },\n [className]\n )}\n {...otherProps}\n >\n {children}\n </div>\n);\n\nTab.propTypes = {\n /**\n * To hide the underline\n */\n noUnderline: PropTypes.bool,\n /**\n * Set the size of the Tabs.\n */\n size: PropTypes.oneOf(Object.values(SIZES)),\n /**\n * To add content inside the Tab\n */\n children: PropTypes.node,\n /**\n * Extra classes can be provided to the Tab\n */\n className: PropTypes.string,\n};\n\nTab.Item = Item;\n\nexport default Tab;\n"],"names":["Item","_ref","active","_ref$className","className","children","_ref$icon","icon","_ref$onClick","onClick","_ref$activeClassName","activeClassName","otherProps","_objectWithoutProperties","_excluded","Icon","React","createElement","Fragment","Parent","NavLink","buttonAttributes","type","_extends","classnames","_objectSpread","displayName","SIZES","large","small","Tab","_ref$size","size","_ref$noUnderline","noUnderline"],"mappings":";;;;;;;;;;;;AAMA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,CAAAC,IAAA,EAQJ;AAAA,EAAA,IAPJC,MAAM,GAAAD,IAAA,CAANC,MAAM;IAAAC,cAAA,GAAAF,IAAA,CACNG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IACdE,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IAAAC,SAAA,GAAAL,IAAA,CACRM,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,SAAA;IAAAE,YAAA,GAAAP,IAAA,CACXQ,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAA,KAAA,CAAA,GAAG,YAAM,EAAE,GAAAA,YAAA;IAAAE,oBAAA,GAAAT,IAAA,CAClBU,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA;AACjBE,IAAAA,UAAU,GAAAC,wBAAA,CAAAZ,IAAA,EAAAa,WAAA,CAAA,CAAA;AAEb,EAAA,IAAMC,IAAI,GACR,OAAOR,IAAI,KAAK,QAAQ,GACpB,YAAA;IAAA,oBACES,KAAA,CAAAC,aAAA,CAAA,GAAA,EAAA;AAAGb,MAAAA,SAAS,EAAEG,IAAK;AAAC,MAAA,SAAA,EAAQ,eAAe;MAAC,aAAY,EAAA,UAAA;KAAa,CAAA,CAAA;AAAA,GACtE,GACDA,IAAI,IAAIS,KAAK,CAACE,QAAQ,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