@pedidopago/ui 1.0.7 → 1.1.1
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/components/Alert/alert.test.js +9 -1
- package/dist/components/Alert/index.js +47 -35
- package/dist/components/Avatar/avatar.test.js +9 -1
- package/dist/components/Avatar/index.js +47 -27
- package/dist/components/Badge/badge.test.js +9 -1
- package/dist/components/Badge/index.js +24 -15
- package/dist/components/Button/Button.test.js +19 -7
- package/dist/components/Button/index.js +28 -16
- package/dist/components/Card/ButtonCard/index.js +24 -10
- package/dist/components/Card/Expansion/index.js +24 -17
- package/dist/components/Card/card.test.js +9 -1
- package/dist/components/Card/index.js +43 -19
- package/dist/components/CheckboxInput/checkbox-input.test.js +9 -1
- package/dist/components/CheckboxInput/components/MultipleCheckbox.js +58 -43
- package/dist/components/CheckboxInput/index.js +29 -18
- package/dist/components/ColorPicker/colorpicker.test.js +9 -1
- package/dist/components/ColorPicker/components/ColorHue.js +17 -10
- package/dist/components/ColorPicker/components/ColorInput.js +3 -1
- package/dist/components/ColorPicker/components/ColorPickerBox.js +13 -9
- package/dist/components/ColorPicker/components/ColorPointer.js +3 -1
- package/dist/components/ColorPicker/components/ColorSelector.js +8 -2
- package/dist/components/ColorPicker/index.js +44 -34
- package/dist/components/DatePicker/components/DatePickerContent.js +113 -79
- package/dist/components/DatePicker/components/DateYearPicker.js +45 -32
- package/dist/components/DatePicker/datepicker.test.js +9 -1
- package/dist/components/DatePicker/index.js +40 -29
- package/dist/components/Dialog/dialog-example.js +21 -13
- package/dist/components/Dialog/dialog.test.js +5 -1
- package/dist/components/Dialog/index.js +59 -46
- package/dist/components/Dropzone/dropzone.test.js +9 -1
- package/dist/components/Dropzone/index.js +122 -97
- package/dist/components/Flex/flex.test.js +128 -14
- package/dist/components/Flex/index.js +11 -3
- package/dist/components/Grid/grid.test.js +86 -81
- package/dist/components/Grid/index.js +11 -3
- package/dist/components/Icon/icon.test.js +3 -3
- package/dist/components/Icon/index.js +8 -2
- package/dist/components/IconItem/IconItem.test.js +9 -1
- package/dist/components/IconItem/index.js +33 -18
- package/dist/components/ImageItem/imageFake.js +13 -9
- package/dist/components/ImageItem/index.js +36 -24
- package/dist/components/ImageItem/input.test.js +10 -7
- package/dist/components/Input/index.js +67 -40
- package/dist/components/Input/input.test.js +4 -4
- package/dist/components/Label/index.js +12 -9
- package/dist/components/Label/input.test.js +3 -1
- package/dist/components/List/index.js +15 -4
- package/dist/components/List/list.test.js +36 -18
- package/dist/components/Menu/components/Submenu.js +49 -26
- package/dist/components/Menu/index.js +19 -10
- package/dist/components/Menu/menu.test.js +14 -14
- package/dist/components/Modal/index.js +24 -19
- package/dist/components/Modal/modal.test.js +44 -12
- package/dist/components/Pagination/index.js +54 -45
- package/dist/components/Pagination/pagination.test.js +13 -11
- package/dist/components/Progress/Circle/index.js +38 -29
- package/dist/components/Progress/Linear/index.js +24 -17
- package/dist/components/Progress/index.js +4 -2
- package/dist/components/Progress/progress.test.js +9 -1
- package/dist/components/RadioInput/components/ChoiceList/index.js +28 -20
- package/dist/components/RadioInput/index.js +27 -22
- package/dist/components/RadioInput/radio-input.test.js +118 -87
- package/dist/components/Rating/components/GradientIcon/index.js +24 -17
- package/dist/components/Rating/components/RatingWithMultipleValues/RatingWithMultipleValues.js +24 -22
- package/dist/components/Rating/components/RatingWithSingleValue/RatingWithSingleValue.js +21 -17
- package/dist/components/Rating/index.js +29 -26
- package/dist/components/Rating/rating.test.js +3 -1
- package/dist/components/SelectInput/components/OptionsArea/index.js +37 -32
- package/dist/components/SelectInput/components/SelectArea/Label.js +2 -2
- package/dist/components/SelectInput/components/SelectArea/index.js +46 -34
- package/dist/components/SelectInput/index.js +26 -23
- package/dist/components/SelectInput/selectInput.test.js +10 -4
- package/dist/components/Skeleton/index.js +11 -1
- package/dist/components/Skeleton/skeleton.test.js +3 -1
- package/dist/components/Slider/components/SliderPointer.d.ts.map +1 -1
- package/dist/components/Slider/components/SliderPointer.js +23 -8
- package/dist/components/Slider/components/SliderRail.js +8 -2
- package/dist/components/Slider/components/SliderSelector.js +86 -78
- package/dist/components/Slider/index.js +28 -16
- package/dist/components/Slider/slider.test.js +9 -1
- package/dist/components/Spinner/index.js +3 -1
- package/dist/components/Spinner/spinner.test.js +9 -1
- package/dist/components/Steps/index.js +25 -17
- package/dist/components/Steps/steps.test.js +3 -1
- package/dist/components/Switch/index.js +23 -17
- package/dist/components/Switch/input.test.js +3 -1
- package/dist/components/Table/components/MenuItem.js +16 -13
- package/dist/components/Table/index.js +139 -99
- package/dist/components/Table/table.test.js +3 -1
- package/dist/components/Tabs/TabsExample.js +37 -23
- package/dist/components/Tabs/components/Tab.js +12 -3
- package/dist/components/Tabs/components/TabPanel.js +8 -3
- package/dist/components/Tabs/components/Tabs.js +33 -23
- package/dist/components/Tabs/tabs.test.js +103 -83
- package/dist/components/Tag/index.js +21 -16
- package/dist/components/Tag/tag.test.js +9 -7
- package/dist/components/TextAreaInput/index.js +25 -15
- package/dist/components/TextAreaInput/text-area-input.test.js +8 -2
- package/dist/components/Thumbnail/index.js +71 -60
- package/dist/components/Thumbnail/thumbnail.test.js +9 -1
- package/dist/components/Timeline/components/Timeline.js +9 -5
- package/dist/components/Timeline/components/TimelineContent.js +31 -15
- package/dist/components/Timeline/components/TimelineItem.js +11 -1
- package/dist/components/Timeline/components/TimelineSeparator.js +9 -4
- package/dist/components/Timeline/timeline.test.js +105 -76
- package/dist/components/Toast/button-example.js +10 -5
- package/dist/components/Toast/components/Toast.js +16 -11
- package/dist/components/Toast/contexts/ToastProvider.js +6 -3
- package/dist/components/Toast/index.js +90 -62
- package/dist/components/Toast/toast.test.js +11 -1
- package/dist/components/Tooltip/componenteTeste.js +42 -14
- package/dist/components/Tooltip/index.js +56 -46
- package/dist/components/Tooltip/tooltip.test.js +13 -8
- package/dist/components/Typography/index.js +11 -3
- package/dist/components/Typography/typography.test.js +3 -1
- package/dist/shared/components/FocusLock/index.js +11 -4
- package/dist/shared/tests/test-utils.js +6 -3
- package/dist/shared/theme/button-example.js +6 -3
- package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.js +12 -29
- package/dist/shared/theme/theme.test.js +25 -11
- package/package.json +1 -1
|
@@ -13,6 +13,8 @@ var _SliderRail = require("./SliderRail");
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("../styles");
|
|
15
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
16
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
17
19
|
|
|
18
20
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -82,86 +84,92 @@ var Selector = function Selector(_ref) {
|
|
|
82
84
|
var thumbPositions = Array.isArray(value) ? value.map(function (v) {
|
|
83
85
|
return (v - min) / (max - min);
|
|
84
86
|
}) : [];
|
|
85
|
-
return /*#__PURE__*/
|
|
86
|
-
|
|
87
|
-
step: step,
|
|
88
|
-
trackColor: trackColor,
|
|
89
|
-
direction: direction,
|
|
90
|
-
onChange: handleChangePercentage
|
|
91
|
-
}, /*#__PURE__*/React.createElement(_styles.SliderTrack, {
|
|
92
|
-
style: Array.isArray(value) ? direction === 'vertical' ? {
|
|
93
|
-
height: "".concat(Math.abs(thumbPositions[0] - thumbPositions[thumbPositions.length - 1]) * 100, "%"),
|
|
94
|
-
bottom: "".concat(thumbPositions[0] * 100, "%")
|
|
95
|
-
} : {
|
|
96
|
-
width: "".concat(Math.abs(thumbPositions[0] - thumbPositions[thumbPositions.length - 1]) * 100, "%"),
|
|
97
|
-
left: "".concat(thumbPositions[0] * 100, "%")
|
|
98
|
-
} : direction === 'vertical' ? {
|
|
99
|
-
height: "".concat((Number(value) - min) / (max - min) * 100, "%")
|
|
100
|
-
} : {
|
|
101
|
-
width: "".concat((Number(value) - min) / (max - min) * 100, "%")
|
|
102
|
-
},
|
|
103
|
-
direction: direction,
|
|
104
|
-
thumbColor: thumbColor || 'primary.default',
|
|
105
|
-
disabled: disabled
|
|
106
|
-
}), !Array.isArray(value) ? /*#__PURE__*/React.createElement(_styles.SliderThumb, {
|
|
107
|
-
direction: direction,
|
|
108
|
-
style: direction === 'vertical' ? {
|
|
109
|
-
bottom: "".concat((value - min) / (max - min) * 100, "%")
|
|
110
|
-
} : {
|
|
111
|
-
left: "".concat((value - min) / (max - min) * 100, "%")
|
|
112
|
-
},
|
|
113
|
-
disabled: disabled,
|
|
114
|
-
size: size,
|
|
115
|
-
thumbColor: thumbColor || 'primary.default',
|
|
116
|
-
thumbType: thumbType
|
|
117
|
-
}, thumbType === 'pointer' && /*#__PURE__*/React.createElement(_SliderPointer.SliderPointer, {
|
|
118
|
-
thumbColor: thumbColor || 'primary.default',
|
|
119
|
-
direction: direction
|
|
120
|
-
}), /*#__PURE__*/React.createElement(_styles.SliderInput, {
|
|
121
|
-
type: "range",
|
|
122
|
-
min: min,
|
|
123
|
-
max: max,
|
|
124
|
-
step: step,
|
|
125
|
-
value: value,
|
|
126
|
-
"aria-valuenow": value,
|
|
127
|
-
"aria-valuemax": max,
|
|
128
|
-
"aria-valuemin": min,
|
|
129
|
-
"aria-label": "slider",
|
|
130
|
-
readOnly: true
|
|
131
|
-
}), valueLabelDisplay !== 'off' && /*#__PURE__*/React.createElement(_styles.SliderLabel, {
|
|
132
|
-
direction: direction
|
|
133
|
-
}, valueLabelDisplay === 'auto' ? value : valueLabelDisplay ? valueLabelDisplay.indexOf('%v') !== -1 ? valueLabelDisplay.replace(/%v/g, String(value)) : valueLabelDisplay : value)) : value.map(function (item, index) {
|
|
134
|
-
return /*#__PURE__*/React.createElement(_styles.SliderThumb, {
|
|
135
|
-
key: index,
|
|
136
|
-
"data-index": index,
|
|
137
|
-
direction: direction,
|
|
138
|
-
style: direction === 'vertical' ? {
|
|
139
|
-
bottom: "".concat(thumbPositions[index] * 100, "%")
|
|
140
|
-
} : {
|
|
141
|
-
left: "".concat(thumbPositions[index] * 100, "%")
|
|
142
|
-
},
|
|
143
|
-
disabled: disabled,
|
|
144
|
-
size: size,
|
|
145
|
-
thumbColor: thumbColor || 'primary.default',
|
|
146
|
-
thumbType: thumbType
|
|
147
|
-
}, thumbType === 'pointer' && /*#__PURE__*/React.createElement(_SliderPointer.SliderPointer, {
|
|
148
|
-
thumbColor: thumbColor || 'primary.default',
|
|
149
|
-
direction: direction
|
|
150
|
-
}), /*#__PURE__*/React.createElement(_styles.SliderInput, {
|
|
151
|
-
type: "range",
|
|
152
|
-
min: min,
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderContainer, {
|
|
88
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_SliderRail.SliderRail, {
|
|
153
89
|
max: max,
|
|
154
90
|
step: step,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
91
|
+
trackColor: trackColor,
|
|
92
|
+
direction: direction,
|
|
93
|
+
onChange: handleChangePercentage,
|
|
94
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderTrack, {
|
|
95
|
+
style: Array.isArray(value) ? direction === 'vertical' ? {
|
|
96
|
+
height: "".concat(Math.abs(thumbPositions[0] - thumbPositions[thumbPositions.length - 1]) * 100, "%"),
|
|
97
|
+
bottom: "".concat(thumbPositions[0] * 100, "%")
|
|
98
|
+
} : {
|
|
99
|
+
width: "".concat(Math.abs(thumbPositions[0] - thumbPositions[thumbPositions.length - 1]) * 100, "%"),
|
|
100
|
+
left: "".concat(thumbPositions[0] * 100, "%")
|
|
101
|
+
} : direction === 'vertical' ? {
|
|
102
|
+
height: "".concat((Number(value) - min) / (max - min) * 100, "%")
|
|
103
|
+
} : {
|
|
104
|
+
width: "".concat((Number(value) - min) / (max - min) * 100, "%")
|
|
105
|
+
},
|
|
106
|
+
direction: direction,
|
|
107
|
+
thumbColor: thumbColor || 'primary.default',
|
|
108
|
+
disabled: disabled
|
|
109
|
+
}), !Array.isArray(value) ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SliderThumb, {
|
|
110
|
+
direction: direction,
|
|
111
|
+
style: direction === 'vertical' ? {
|
|
112
|
+
bottom: "".concat((value - min) / (max - min) * 100, "%")
|
|
113
|
+
} : {
|
|
114
|
+
left: "".concat((value - min) / (max - min) * 100, "%")
|
|
115
|
+
},
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
size: size,
|
|
118
|
+
thumbColor: thumbColor || 'primary.default',
|
|
119
|
+
thumbType: thumbType,
|
|
120
|
+
children: [thumbType === 'pointer' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SliderPointer.SliderPointer, {
|
|
121
|
+
thumbColor: thumbColor || 'primary.default',
|
|
122
|
+
direction: direction
|
|
123
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderInput, {
|
|
124
|
+
type: "range",
|
|
125
|
+
min: min,
|
|
126
|
+
max: max,
|
|
127
|
+
step: step,
|
|
128
|
+
value: value,
|
|
129
|
+
"aria-valuenow": value,
|
|
130
|
+
"aria-valuemax": max,
|
|
131
|
+
"aria-valuemin": min,
|
|
132
|
+
"aria-label": "slider",
|
|
133
|
+
readOnly: true
|
|
134
|
+
}), valueLabelDisplay !== 'off' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderLabel, {
|
|
135
|
+
direction: direction,
|
|
136
|
+
children: valueLabelDisplay === 'auto' ? value : valueLabelDisplay ? valueLabelDisplay.indexOf('%v') !== -1 ? valueLabelDisplay.replace(/%v/g, String(value)) : valueLabelDisplay : value
|
|
137
|
+
})]
|
|
138
|
+
}) : value.map(function (item, index) {
|
|
139
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SliderThumb, {
|
|
140
|
+
"data-index": index,
|
|
141
|
+
direction: direction,
|
|
142
|
+
style: direction === 'vertical' ? {
|
|
143
|
+
bottom: "".concat(thumbPositions[index] * 100, "%")
|
|
144
|
+
} : {
|
|
145
|
+
left: "".concat(thumbPositions[index] * 100, "%")
|
|
146
|
+
},
|
|
147
|
+
disabled: disabled,
|
|
148
|
+
size: size,
|
|
149
|
+
thumbColor: thumbColor || 'primary.default',
|
|
150
|
+
thumbType: thumbType,
|
|
151
|
+
children: [thumbType === 'pointer' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SliderPointer.SliderPointer, {
|
|
152
|
+
thumbColor: thumbColor || 'primary.default',
|
|
153
|
+
direction: direction
|
|
154
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderInput, {
|
|
155
|
+
type: "range",
|
|
156
|
+
min: min,
|
|
157
|
+
max: max,
|
|
158
|
+
step: step,
|
|
159
|
+
value: item,
|
|
160
|
+
"aria-valuenow": item,
|
|
161
|
+
"aria-valuemax": max,
|
|
162
|
+
"aria-valuemin": min,
|
|
163
|
+
"aria-label": "slider",
|
|
164
|
+
readOnly: true
|
|
165
|
+
}), valueLabelDisplay !== 'off' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderLabel, {
|
|
166
|
+
direction: direction,
|
|
167
|
+
children: valueLabelDisplay === 'auto' ? item : valueLabelDisplay ? valueLabelDisplay.indexOf('%v') !== -1 ? valueLabelDisplay.replace(/%v/g, String(item)) : valueLabelDisplay : item
|
|
168
|
+
})]
|
|
169
|
+
}, index);
|
|
170
|
+
})]
|
|
171
|
+
})
|
|
172
|
+
});
|
|
165
173
|
};
|
|
166
174
|
|
|
167
175
|
var SliderSelector = /*#__PURE__*/(0, _react.memo)(Selector);
|
|
@@ -13,11 +13,17 @@ var _useValues3 = require("./hooks/useValues");
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("./styles");
|
|
15
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
16
18
|
var _excluded = ["value", "onChange", "step", "max", "min", "fullSize", "direction", "valueLabelDisplay"];
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
function
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
27
|
|
|
22
28
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
29
|
|
|
@@ -77,24 +83,30 @@ var Slider = function Slider(_ref) {
|
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
85
|
|
|
80
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SliderContent, {
|
|
81
87
|
direction: direction,
|
|
82
88
|
fullSize: fullSize,
|
|
83
89
|
size: rest.size,
|
|
84
|
-
disabled: rest.disabled
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
disabled: rest.disabled,
|
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Flex.default, {
|
|
92
|
+
direction: direction === 'vertical' ? 'column-reverse' : 'row',
|
|
93
|
+
justifyContent: "space-between",
|
|
94
|
+
alignItems: "flex-end",
|
|
95
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderExtremesText, {
|
|
96
|
+
children: min
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SliderExtremesText, {
|
|
98
|
+
children: max
|
|
99
|
+
})]
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SliderSelector.SliderSelector, _objectSpread({
|
|
101
|
+
value: values,
|
|
102
|
+
min: min,
|
|
103
|
+
max: max,
|
|
104
|
+
step: step,
|
|
105
|
+
onChange: handleChangeValue,
|
|
106
|
+
direction: direction,
|
|
107
|
+
valueLabelDisplay: valueLabelDisplay
|
|
108
|
+
}, rest))]
|
|
109
|
+
});
|
|
98
110
|
};
|
|
99
111
|
|
|
100
112
|
var _default = Slider;
|
|
@@ -6,10 +6,18 @@ require("@testing-library/jest-dom");
|
|
|
6
6
|
|
|
7
7
|
var _ = _interopRequireDefault(require("."));
|
|
8
8
|
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
12
|
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
|
|
11
19
|
var setup = function setup(props) {
|
|
12
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/
|
|
20
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
13
21
|
return utils;
|
|
14
22
|
};
|
|
15
23
|
|
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styles = require("./styles");
|
|
9
9
|
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
10
12
|
var Spinner = function Spinner(_ref) {
|
|
11
13
|
var _ref$size = _ref.size,
|
|
12
14
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
@@ -15,7 +17,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
15
17
|
emptyColor = _ref.emptyColor,
|
|
16
18
|
thickness = _ref.thickness,
|
|
17
19
|
speed = _ref.speed;
|
|
18
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledSpinner, {
|
|
19
21
|
size: size,
|
|
20
22
|
color: color,
|
|
21
23
|
emptyColor: emptyColor,
|
|
@@ -6,10 +6,18 @@ require("@testing-library/jest-dom");
|
|
|
6
6
|
|
|
7
7
|
var _ = _interopRequireDefault(require("."));
|
|
8
8
|
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
12
|
|
|
13
|
+
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; }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
|
|
11
19
|
var setup = function setup(props) {
|
|
12
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/
|
|
20
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
13
21
|
return utils;
|
|
14
22
|
};
|
|
15
23
|
|
|
@@ -9,6 +9,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
|
9
9
|
|
|
10
10
|
var _styles = require("./styles");
|
|
11
11
|
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
14
16
|
var Steps = function Steps(_ref) {
|
|
@@ -17,23 +19,29 @@ var Steps = function Steps(_ref) {
|
|
|
17
19
|
_ref$activeColor = _ref.activeColor,
|
|
18
20
|
activeColor = _ref$activeColor === void 0 ? 'primary' : _ref$activeColor,
|
|
19
21
|
fullWidth = _ref.fullWidth;
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
-
fullWidth: fullWidth
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StepsContainer, {
|
|
23
|
+
fullWidth: fullWidth,
|
|
24
|
+
children: steps && steps.map(function (step, index) {
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StepsItemContainer, {
|
|
26
|
+
id: "simple-step-".concat(index + 1),
|
|
27
|
+
tabIndex: index + 1 === current ? 0 : -1,
|
|
28
|
+
isCurrent: current === index + 1,
|
|
29
|
+
isFinished: current > index + 1,
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StepsItemsDetailsContainer, {
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StepsCircle, {
|
|
32
|
+
activeColor: activeColor,
|
|
33
|
+
isCurrent: current === index + 1,
|
|
34
|
+
isFinished: current > index + 1,
|
|
35
|
+
children: current > index + 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
36
|
+
name: "check"
|
|
37
|
+
}) : index + 1
|
|
38
|
+
}), current === index + 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StepsItemText, {
|
|
39
|
+
children: step
|
|
40
|
+
})]
|
|
41
|
+
}), current === index + 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StepsSeparator, {})]
|
|
42
|
+
}, index);
|
|
43
|
+
})
|
|
44
|
+
});
|
|
37
45
|
};
|
|
38
46
|
|
|
39
47
|
var _default = Steps;
|
|
@@ -6,6 +6,8 @@ require("@testing-library/jest-dom");
|
|
|
6
6
|
|
|
7
7
|
var _ = _interopRequireDefault(require("."));
|
|
8
8
|
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
12
|
|
|
11
13
|
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; }
|
|
@@ -15,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
15
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
18
|
|
|
17
19
|
var setup = function setup(props) {
|
|
18
|
-
return _objectSpread({}, (0, _testUtils.render)( /*#__PURE__*/
|
|
20
|
+
return _objectSpread({}, (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props))));
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
describe('Steps', function () {
|
|
@@ -11,6 +11,8 @@ var _styles = require("./styles");
|
|
|
11
11
|
|
|
12
12
|
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
13
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
14
16
|
var _excluded = ["disabled", "helpText", "alert", "SwitchType", "onChangeValue", "onError"];
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -102,23 +104,27 @@ var SwitchInput = function SwitchInput(_ref) {
|
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
return /*#__PURE__*/
|
|
106
|
-
"data-testid": "switch-wrapper"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
107
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SwitchWrapper, {
|
|
108
|
+
"data-testid": "switch-wrapper",
|
|
109
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Switch, {
|
|
110
|
+
"data-testid": "switch",
|
|
111
|
+
onClick: handleOnClick,
|
|
112
|
+
onKeyDown: handleOnKeyDown,
|
|
113
|
+
disabled: disabled,
|
|
114
|
+
isActive: alert || disabled ? false : isActive,
|
|
115
|
+
tabIndex: 0,
|
|
116
|
+
SwitchType: SwitchType,
|
|
117
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.SwitchToken, {
|
|
118
|
+
className: "switch-token",
|
|
119
|
+
children: isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
120
|
+
name: "check"
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
}), helpText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.HelpText, {
|
|
124
|
+
disabled: disabled,
|
|
125
|
+
children: helpText
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
122
128
|
};
|
|
123
129
|
|
|
124
130
|
var _default = SwitchInput;
|
|
@@ -8,6 +8,8 @@ require("@testing-library/jest-dom/extend-expect");
|
|
|
8
8
|
|
|
9
9
|
var _ = _interopRequireDefault(require("."));
|
|
10
10
|
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
|
|
11
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
14
|
|
|
13
15
|
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; }
|
|
@@ -17,7 +19,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
19
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
20
|
|
|
19
21
|
var setup = function setup(props) {
|
|
20
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/
|
|
22
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
21
23
|
var SwitchElement = utils.getByTestId('switch');
|
|
22
24
|
var SwitchWrapper = utils.getByTestId('switch-wrapper');
|
|
23
25
|
return _objectSpread({
|
|
@@ -13,6 +13,8 @@ var _useOnClickOutside = require("../../../shared/hooks/useOnClickOutside");
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("../styles");
|
|
15
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
16
18
|
function MenuItem(_ref) {
|
|
17
19
|
var items = _ref.items,
|
|
18
20
|
isOpen = _ref.isOpen,
|
|
@@ -26,20 +28,21 @@ function MenuItem(_ref) {
|
|
|
26
28
|
(0, _useKeyPress.useKeyPress)('Escape', function () {
|
|
27
29
|
return onClickOutside && onClickOutside();
|
|
28
30
|
});
|
|
29
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.MenuItemContainer, {
|
|
30
32
|
ref: menuRef,
|
|
31
33
|
isOpen: isOpen,
|
|
32
34
|
posTop: top,
|
|
33
|
-
posRight: right
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
posRight: right,
|
|
36
|
+
children: items.map(function (_ref2, index) {
|
|
37
|
+
var label = _ref2.label,
|
|
38
|
+
handler = _ref2.handler;
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.MenuItemContent, {
|
|
40
|
+
tabIndex: 0,
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
handler && handler();
|
|
43
|
+
},
|
|
44
|
+
children: label
|
|
45
|
+
}, index);
|
|
46
|
+
})
|
|
47
|
+
});
|
|
45
48
|
}
|