@pedidopago/ui 1.0.8 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/Avatar/styles.d.ts.map +1 -1
- package/dist/components/Avatar/styles.js +4 -4
- 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.d.ts.map +1 -1
- package/dist/components/Menu/components/Submenu.js +49 -26
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js +19 -10
- package/dist/components/Menu/menu.test.js +14 -14
- package/dist/components/Menu/styles.d.ts +1 -0
- package/dist/components/Menu/styles.d.ts.map +1 -1
- package/dist/components/Menu/styles.js +19 -15
- 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/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
- package/dist/components/Slider/icons/pointer.js +0 -15
- package/dist/shared/logos/pp_logo_horizontal.js +0 -51
- package/dist/shared/logos/pp_logo_horizontal_dark_mode.js +0 -51
- package/dist/shared/logos/pp_logo_vertical.js +0 -51
- package/dist/shared/logos/pp_logo_vertical_dark_mode.js +0 -51
|
@@ -8,68 +8,72 @@ require("@testing-library/jest-dom");
|
|
|
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
|
describe('Grid', function () {
|
|
14
16
|
it('should render the grid container', function () {
|
|
15
|
-
(0, _testUtils.render)( /*#__PURE__*/
|
|
17
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
16
18
|
container: true,
|
|
17
19
|
"data-testid": "grid-container"
|
|
18
20
|
}));
|
|
19
21
|
expect(_react.screen.getByTestId('grid-container')).toBeInTheDocument();
|
|
20
22
|
});
|
|
21
23
|
it('should render grid container with item element', function () {
|
|
22
|
-
(0, _testUtils.render)( /*#__PURE__*/
|
|
24
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
23
25
|
container: true,
|
|
24
|
-
"data-testid": "grid-container"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"data-testid": "grid-container",
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
28
|
+
item: true,
|
|
29
|
+
"data-testid": "grid-item"
|
|
30
|
+
})
|
|
31
|
+
}));
|
|
29
32
|
expect(_react.screen.getByTestId('grid-item')).toBeInTheDocument();
|
|
30
33
|
});
|
|
31
34
|
it('should render grid container with multiple items', function () {
|
|
32
|
-
(0, _testUtils.render)( /*#__PURE__*/
|
|
35
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.default, {
|
|
33
36
|
container: true,
|
|
34
37
|
templateColumns: "repeat(12, 1fr)",
|
|
35
|
-
"data-testid": "grid-container"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
"data-testid": "grid-container",
|
|
39
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
40
|
+
item: true,
|
|
41
|
+
"data-testid": "grid-item-1"
|
|
42
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
43
|
+
item: true,
|
|
44
|
+
"data-testid": "grid-item-2"
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
46
|
+
item: true,
|
|
47
|
+
"data-testid": "grid-item-3"
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
49
|
+
item: true,
|
|
50
|
+
"data-testid": "grid-item-4"
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
52
|
+
item: true,
|
|
53
|
+
"data-testid": "grid-item-5"
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
55
|
+
item: true,
|
|
56
|
+
"data-testid": "grid-item-6"
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
58
|
+
item: true,
|
|
59
|
+
"data-testid": "grid-item-7"
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
61
|
+
item: true,
|
|
62
|
+
"data-testid": "grid-item-8"
|
|
63
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
64
|
+
item: true,
|
|
65
|
+
"data-testid": "grid-item-9"
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
67
|
+
item: true,
|
|
68
|
+
"data-testid": "grid-item-10"
|
|
69
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
70
|
+
item: true,
|
|
71
|
+
"data-testid": "grid-item-11"
|
|
72
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
73
|
+
item: true,
|
|
74
|
+
"data-testid": "grid-item-12"
|
|
75
|
+
})]
|
|
76
|
+
}));
|
|
73
77
|
expect(_react.screen.getByTestId('grid-item-1')).toBeInTheDocument();
|
|
74
78
|
expect(_react.screen.getByTestId('grid-item-2')).toBeInTheDocument();
|
|
75
79
|
expect(_react.screen.getByTestId('grid-item-3')).toBeInTheDocument();
|
|
@@ -84,7 +88,7 @@ describe('Grid', function () {
|
|
|
84
88
|
expect(_react.screen.getByTestId('grid-item-12')).toBeInTheDocument();
|
|
85
89
|
});
|
|
86
90
|
it('should render grid container with multiply elements of different sizes', function () {
|
|
87
|
-
(0, _testUtils.render)( /*#__PURE__*/
|
|
91
|
+
(0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.default, {
|
|
88
92
|
container: true,
|
|
89
93
|
gridGap: 6,
|
|
90
94
|
"data-testid": "grid-container",
|
|
@@ -92,40 +96,41 @@ describe('Grid', function () {
|
|
|
92
96
|
templateRows: "repeat(2, 1fr)",
|
|
93
97
|
style: {
|
|
94
98
|
height: '200px'
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
99
|
+
},
|
|
100
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
101
|
+
item: true,
|
|
102
|
+
rowSpan: 2,
|
|
103
|
+
colSpan: 2,
|
|
104
|
+
"data-testid": "grid-item-xs-2",
|
|
105
|
+
style: {
|
|
106
|
+
background: '#000'
|
|
107
|
+
}
|
|
108
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
109
|
+
item: true,
|
|
110
|
+
rowSpan: 2,
|
|
111
|
+
colSpan: 4,
|
|
112
|
+
"data-testid": "grid-item-xs-4",
|
|
113
|
+
style: {
|
|
114
|
+
background: '#000'
|
|
115
|
+
}
|
|
116
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
117
|
+
item: true,
|
|
118
|
+
rowSpan: 2,
|
|
119
|
+
colSpan: 6,
|
|
120
|
+
"data-testid": "grid-item-xs-6",
|
|
121
|
+
style: {
|
|
122
|
+
background: '#000'
|
|
123
|
+
}
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
125
|
+
item: true,
|
|
126
|
+
rowSpan: 2,
|
|
127
|
+
colSpan: 10,
|
|
128
|
+
"data-testid": "grid-item-xs-10",
|
|
129
|
+
style: {
|
|
130
|
+
background: '#000'
|
|
131
|
+
}
|
|
132
|
+
})]
|
|
133
|
+
}));
|
|
129
134
|
expect(_react.screen.getByTestId('grid-container')).toBeInTheDocument();
|
|
130
135
|
expect(_react.screen.getByTestId('grid-item-xs-2')).toBeInTheDocument();
|
|
131
136
|
expect(_react.screen.getByTestId('grid-item-xs-4')).toBeInTheDocument();
|
|
@@ -7,9 +7,15 @@ 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 _excluded = ["container", "item", "gridGap", "templateAreas", "templateColumns", "templateRows", "colSpan", "colEnd", "colStart", "rowEnd", "rowStart", "rowSpan", "children"];
|
|
11
13
|
|
|
12
|
-
function
|
|
14
|
+
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
|
+
|
|
16
|
+
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; }
|
|
17
|
+
|
|
18
|
+
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; }
|
|
13
19
|
|
|
14
20
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
21
|
|
|
@@ -31,7 +37,7 @@ var Grid = function Grid(_ref) {
|
|
|
31
37
|
children = _ref.children,
|
|
32
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
39
|
|
|
34
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.GridComponent, _objectSpread(_objectSpread({
|
|
35
41
|
container: container,
|
|
36
42
|
item: item,
|
|
37
43
|
gridGap: gridGap,
|
|
@@ -44,7 +50,9 @@ var Grid = function Grid(_ref) {
|
|
|
44
50
|
rowEnd: rowEnd,
|
|
45
51
|
rowStart: rowStart,
|
|
46
52
|
rowSpan: rowSpan
|
|
47
|
-
}, rest),
|
|
53
|
+
}, rest), {}, {
|
|
54
|
+
children: children
|
|
55
|
+
}));
|
|
48
56
|
};
|
|
49
57
|
|
|
50
58
|
var _default = Grid;
|
|
@@ -8,6 +8,8 @@ require("@testing-library/jest-dom");
|
|
|
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; }
|
|
@@ -16,10 +18,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
18
|
|
|
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
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
20
|
-
|
|
21
21
|
var setup = function setup(props) {
|
|
22
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/
|
|
22
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({
|
|
23
23
|
"data-testid": "icon"
|
|
24
24
|
}, props)));
|
|
25
25
|
|
|
@@ -15,9 +15,15 @@ var _styles = require("./styles");
|
|
|
15
15
|
|
|
16
16
|
var _allIcons = require("./utils/allIcons");
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
18
20
|
var _excluded = ["name", "color", "secondColor", "size"];
|
|
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 _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
29
|
|
|
@@ -43,7 +49,7 @@ var Icon = function Icon(_ref) {
|
|
|
43
49
|
var havePrimaryColor = html.match(/fill="#22E0A1"/g);
|
|
44
50
|
var haveErrorColor = html.match(/fill="#F64F77"/g);
|
|
45
51
|
var parsedHtml = havePrimaryColor ? html.replace(/fill="#22E0A1"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(secondColor || 'primary.default', theme), "\"")).replace(/fill="#34423D"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(color || '', theme), "\"")) : haveErrorColor ? html.replace(/fill="#22E0A1"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(secondColor || 'errors.default', theme), "\"")).replace(/fill="#34423D"/g, "fill=\"".concat((0, _getColorValue.getColorValue)(color || '', theme), "\"")) : html;
|
|
46
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconComponent, _objectSpread({
|
|
47
53
|
colorText: color,
|
|
48
54
|
havePrimaryColor: havePrimaryColor || haveErrorColor,
|
|
49
55
|
xmlns: xmlns,
|
|
@@ -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
|
|
|
@@ -11,6 +11,8 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
|
11
11
|
|
|
12
12
|
var _styles = require("./styles");
|
|
13
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
var IconItem = function IconItem(_ref) {
|
|
@@ -20,24 +22,37 @@ var IconItem = function IconItem(_ref) {
|
|
|
20
22
|
description = _ref.description,
|
|
21
23
|
size = _ref.size,
|
|
22
24
|
isLoading = _ref.isLoading;
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemContainer, {
|
|
26
|
+
children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
27
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemSkeleton, {
|
|
28
|
+
circle: true,
|
|
29
|
+
haveText: Boolean(title || description)
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.IconItemTexts, {
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemSkeleton, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemSkeleton, {
|
|
32
|
+
description: true
|
|
33
|
+
})]
|
|
34
|
+
})]
|
|
35
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
36
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.IconItemIcon, {
|
|
37
|
+
haveText: Boolean(title || description),
|
|
38
|
+
colorText: color,
|
|
39
|
+
boxSize: size,
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
41
|
+
name: icon,
|
|
42
|
+
size: 18
|
|
43
|
+
})
|
|
44
|
+
}), Boolean(title || description) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.IconItemTexts, {
|
|
45
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
46
|
+
fontWeight: "600",
|
|
47
|
+
fontSize: "xxs",
|
|
48
|
+
children: title
|
|
49
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
50
|
+
fontSize: "xxs",
|
|
51
|
+
children: description
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
});
|
|
41
56
|
};
|
|
42
57
|
|
|
43
58
|
var _default = IconItem;
|
|
@@ -4,20 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ImageFake = void 0;
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
|
|
10
|
+
var ImageFake = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
8
11
|
style: {
|
|
9
12
|
display: 'flex',
|
|
10
13
|
alignItems: 'center',
|
|
11
14
|
justifyContent: 'center',
|
|
12
15
|
position: 'absolute',
|
|
13
16
|
inset: 0
|
|
14
|
-
}
|
|
15
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
16
|
-
style: {
|
|
17
|
-
width: '100%',
|
|
18
|
-
height: '100%'
|
|
19
17
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
19
|
+
style: {
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%'
|
|
22
|
+
},
|
|
23
|
+
src: "/img.png",
|
|
24
|
+
alt: "sdsadas"
|
|
25
|
+
})
|
|
26
|
+
});
|
|
23
27
|
exports.ImageFake = ImageFake;
|
|
@@ -9,9 +9,15 @@ var _imageFake = require("./imageFake");
|
|
|
9
9
|
|
|
10
10
|
var _styles = require("./styles");
|
|
11
11
|
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
12
14
|
var _excluded = ["title", "subtitle", "size", "styles", "color", "disabled", "children", "imageSide"];
|
|
13
15
|
|
|
14
|
-
function
|
|
16
|
+
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
|
+
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
15
21
|
|
|
16
22
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
23
|
|
|
@@ -31,32 +37,38 @@ var ImageItem = function ImageItem(_ref) {
|
|
|
31
37
|
imageSide = _ref$imageSide === void 0 ? 'left' : _ref$imageSide,
|
|
32
38
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
39
|
|
|
34
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ImageItemWrapper, _objectSpread(_objectSpread({}, rest), {}, {
|
|
35
41
|
color: color,
|
|
36
42
|
tabIndex: 0,
|
|
37
43
|
disabled: disabled,
|
|
38
|
-
style: styles && styles.imageItemStyle
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
style: styles && styles.imageItemStyle,
|
|
45
|
+
children: [imageSide === 'left' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ImageWrapper, {
|
|
46
|
+
size: size,
|
|
47
|
+
"data-testid": "ImageItem-ImageWrapper",
|
|
48
|
+
id: "ImageItem-ImageWrapper",
|
|
49
|
+
style: styles && styles.imageStyle,
|
|
50
|
+
children: children || _imageFake.ImageFake
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.DescriptionWrapper, {
|
|
52
|
+
size: size,
|
|
53
|
+
imageSide: imageSide,
|
|
54
|
+
"data-testid": "ImageItem-DescriptionWrapper",
|
|
55
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Title, {
|
|
56
|
+
style: styles && styles.titleStyle,
|
|
57
|
+
id: "ImageItem-Title",
|
|
58
|
+
children: title || 'Default Title'
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Subtitle, {
|
|
60
|
+
style: styles && styles.subtitleStyle,
|
|
61
|
+
id: "ImageItem-Subtitle",
|
|
62
|
+
children: subtitle || 'Default Subtitle'
|
|
63
|
+
})]
|
|
64
|
+
}), imageSide === 'right' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ImageWrapper, {
|
|
65
|
+
size: size,
|
|
66
|
+
"data-testid": "ImageItem-ImageWrapper",
|
|
67
|
+
id: "ImageItem-ImageWrapper",
|
|
68
|
+
style: styles && styles.imageStyle,
|
|
69
|
+
children: children || _imageFake.ImageFake
|
|
70
|
+
})]
|
|
71
|
+
}));
|
|
60
72
|
};
|
|
61
73
|
|
|
62
74
|
var _default = ImageItem;
|
|
@@ -6,6 +6,8 @@ require("@testing-library/jest-dom/extend-expect");
|
|
|
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 asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
@@ -18,7 +20,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
18
20
|
|
|
19
21
|
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; }
|
|
20
22
|
|
|
21
|
-
var imageMock = /*#__PURE__*/
|
|
23
|
+
var imageMock = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
24
|
style: {
|
|
23
25
|
display: 'flex',
|
|
24
26
|
alignItems: 'center',
|
|
@@ -28,14 +30,15 @@ var imageMock = /*#__PURE__*/React.createElement("div", {
|
|
|
28
30
|
left: 0,
|
|
29
31
|
right: 0,
|
|
30
32
|
bottom: 0
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
33
|
+
},
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
35
|
+
src: "/img.png",
|
|
36
|
+
alt: "sdsadas"
|
|
37
|
+
})
|
|
38
|
+
});
|
|
36
39
|
|
|
37
40
|
var setup = function setup(props) {
|
|
38
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/
|
|
41
|
+
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread({}, props)));
|
|
39
42
|
var ImageWrapper = utils.getByTestId('ImageItem-ImageWrapper');
|
|
40
43
|
var DescriptionWrapper = utils.getByTestId('ImageItem-DescriptionWrapper');
|
|
41
44
|
return _objectSpread({
|