@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
|
@@ -11,10 +11,18 @@ var _Flex = _interopRequireDefault(require("../../Flex"));
|
|
|
11
11
|
|
|
12
12
|
var _styles = require("../styles");
|
|
13
13
|
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
|
|
14
16
|
var _excluded = ["title", "description", "date"];
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
18
26
|
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; }
|
|
19
27
|
|
|
20
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -36,21 +44,29 @@ var TimelineContent = function TimelineContent(_ref) {
|
|
|
36
44
|
var getMinutes = parseDate === null || parseDate === void 0 ? void 0 : parseDate.getMinutes().toLocaleString('default', {
|
|
37
45
|
minimumIntegerDigits: 2
|
|
38
46
|
});
|
|
39
|
-
return /*#__PURE__*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.TimelineItemContent, _objectSpread(_objectSpread({}, rest), {}, {
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Flex.default, {
|
|
49
|
+
direction: "column",
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
51
|
+
fontWeight: "600",
|
|
52
|
+
fontSize: "xs",
|
|
53
|
+
children: title
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
55
|
+
fontSize: "xs",
|
|
56
|
+
children: description
|
|
57
|
+
})]
|
|
58
|
+
}), date && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Flex.default, {
|
|
59
|
+
direction: "column",
|
|
60
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
61
|
+
fontWeight: "600",
|
|
62
|
+
fontSize: "xs",
|
|
63
|
+
children: [getDay, " ", getShortMonth.charAt(0).toUpperCase() + getShortMonth.slice(1)]
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
65
|
+
fontSize: "xs",
|
|
66
|
+
children: [getHours, ":", getMinutes]
|
|
67
|
+
})]
|
|
68
|
+
})]
|
|
69
|
+
}));
|
|
54
70
|
};
|
|
55
71
|
|
|
56
72
|
exports.TimelineContent = TimelineContent;
|
|
@@ -7,8 +7,16 @@ exports.TimelineItem = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styles = require("../styles");
|
|
9
9
|
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
10
12
|
var _excluded = ["children"];
|
|
11
13
|
|
|
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; }
|
|
19
|
+
|
|
12
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; }
|
|
13
21
|
|
|
14
22
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -17,7 +25,9 @@ var TimelineItem = function TimelineItem(_ref) {
|
|
|
17
25
|
var children = _ref.children,
|
|
18
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
27
|
|
|
20
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TimelineItemContainer, _objectSpread(_objectSpread({}, rest), {}, {
|
|
29
|
+
children: children
|
|
30
|
+
}));
|
|
21
31
|
};
|
|
22
32
|
|
|
23
33
|
exports.TimelineItem = TimelineItem;
|
|
@@ -7,13 +7,18 @@ exports.TimelineSeparator = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styles = require("../styles");
|
|
9
9
|
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
10
12
|
var TimelineSeparator = function TimelineSeparator(_ref) {
|
|
11
13
|
var icon = _ref.icon,
|
|
12
14
|
circleColor = _ref.circleColor;
|
|
13
|
-
return /*#__PURE__*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.TimelineSeparatorContainer, {
|
|
16
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TimelineSeparatorLine, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TimelineSeparatorCircle, {
|
|
17
|
+
icon: icon === null || icon === void 0 ? void 0 : icon.toString().length,
|
|
18
|
+
circleColor: circleColor,
|
|
19
|
+
children: icon
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
exports.TimelineSeparator = TimelineSeparator;
|
|
@@ -8,114 +8,143 @@ var _Icon = _interopRequireDefault(require("../Icon"));
|
|
|
8
8
|
|
|
9
9
|
var _ = 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('Timeline', function () {
|
|
14
16
|
it('should it render the Timeline component with childrens', function () {
|
|
15
|
-
var _render = (0, _testUtils.render)( /*#__PURE__*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var _render = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
19
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
20
|
+
title: "Title",
|
|
21
|
+
description: "Description",
|
|
22
|
+
date: new Date()
|
|
23
|
+
})]
|
|
24
|
+
})
|
|
25
|
+
})),
|
|
20
26
|
container = _render.container;
|
|
21
27
|
|
|
22
28
|
expect(container).toBeInTheDocument();
|
|
23
29
|
});
|
|
24
30
|
it('should it render the Timeline component with different position', function () {
|
|
25
|
-
var _render2 = (0, _testUtils.render)( /*#__PURE__*/
|
|
26
|
-
position: "right"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
var _render2 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
32
|
+
position: "right",
|
|
33
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
35
|
+
title: "Title",
|
|
36
|
+
description: "Description",
|
|
37
|
+
date: new Date()
|
|
38
|
+
})]
|
|
39
|
+
})
|
|
40
|
+
})),
|
|
32
41
|
container = _render2.container;
|
|
33
42
|
|
|
34
43
|
expect(container).toBeInTheDocument();
|
|
35
44
|
});
|
|
36
45
|
it('should it render the Timeline component with full width', function () {
|
|
37
|
-
var _render3 = (0, _testUtils.render)( /*#__PURE__*/
|
|
38
|
-
fullWidth: true
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
var _render3 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
47
|
+
fullWidth: true,
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
49
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
50
|
+
title: "Title",
|
|
51
|
+
description: "Description",
|
|
52
|
+
date: new Date()
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
})),
|
|
44
56
|
container = _render3.container;
|
|
45
57
|
|
|
46
58
|
expect(container).toBeInTheDocument();
|
|
47
59
|
});
|
|
48
60
|
it('should it render the TimelineSeparator component with an icon', function () {
|
|
49
|
-
var _render4 = (0, _testUtils.render)( /*#__PURE__*/
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
var _render4 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
63
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
64
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
65
|
+
name: "shopping-cart"
|
|
66
|
+
})
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
68
|
+
title: "Title",
|
|
69
|
+
description: "Description",
|
|
70
|
+
date: new Date()
|
|
71
|
+
})]
|
|
52
72
|
})
|
|
53
|
-
}),
|
|
54
|
-
title: "Title",
|
|
55
|
-
description: "Description",
|
|
56
|
-
date: new Date()
|
|
57
|
-
})))),
|
|
73
|
+
})),
|
|
58
74
|
container = _render4.container;
|
|
59
75
|
|
|
60
76
|
expect(container).toBeInTheDocument();
|
|
61
77
|
expect(container.querySelector('svg')).toBeInTheDocument();
|
|
62
78
|
});
|
|
63
79
|
it('should it render the TimelineSeparator component with an icon and different color in the circle', function () {
|
|
64
|
-
var _render5 = (0, _testUtils.render)( /*#__PURE__*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
var _render5 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Timeline, {
|
|
81
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
82
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
83
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
84
|
+
name: "shopping-cart"
|
|
85
|
+
}),
|
|
86
|
+
circleColor: "primary.default"
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
88
|
+
title: "Title",
|
|
89
|
+
description: "Description",
|
|
90
|
+
date: new Date()
|
|
91
|
+
})]
|
|
92
|
+
})
|
|
93
|
+
})),
|
|
74
94
|
container = _render5.container;
|
|
75
95
|
|
|
76
96
|
expect(container).toBeInTheDocument();
|
|
77
97
|
expect(container.querySelector('svg')).toBeInTheDocument();
|
|
78
98
|
});
|
|
79
99
|
it('should it render the Timeline component with multiply childrens', function () {
|
|
80
|
-
var _render6 = (0, _testUtils.render)( /*#__PURE__*/
|
|
81
|
-
position: "alternate"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
100
|
+
var _render6 = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Timeline, {
|
|
101
|
+
position: "alternate",
|
|
102
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
104
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
105
|
+
name: "shopping-cart"
|
|
106
|
+
}),
|
|
107
|
+
circleColor: "primary.default"
|
|
108
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
109
|
+
title: "Title",
|
|
110
|
+
description: "Description",
|
|
111
|
+
date: new Date()
|
|
112
|
+
})]
|
|
113
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
114
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
115
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
116
|
+
name: "shopping-cart"
|
|
117
|
+
}),
|
|
118
|
+
circleColor: "primary.default"
|
|
119
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
120
|
+
title: "Title",
|
|
121
|
+
description: "Description",
|
|
122
|
+
date: new Date()
|
|
123
|
+
})]
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
125
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
126
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
127
|
+
name: "shopping-cart"
|
|
128
|
+
}),
|
|
129
|
+
circleColor: "primary.default"
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
131
|
+
title: "Title",
|
|
132
|
+
description: "Description",
|
|
133
|
+
date: new Date()
|
|
134
|
+
})]
|
|
135
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_.TimelineItem, {
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineSeparator, {
|
|
137
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
138
|
+
name: "shopping-cart"
|
|
139
|
+
}),
|
|
140
|
+
circleColor: "primary.default"
|
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TimelineContent, {
|
|
142
|
+
title: "Title",
|
|
143
|
+
description: "Description",
|
|
144
|
+
date: new Date()
|
|
145
|
+
})]
|
|
146
|
+
})]
|
|
147
|
+
})),
|
|
119
148
|
container = _render6.container;
|
|
120
149
|
|
|
121
150
|
expect(container).toBeInTheDocument();
|
|
@@ -9,6 +9,8 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
|
9
9
|
|
|
10
10
|
var _useToast = _interopRequireDefault(require("./hooks/useToast"));
|
|
11
11
|
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
12
14
|
var _excluded = ["buttonText"];
|
|
13
15
|
|
|
14
16
|
var _templateObject;
|
|
@@ -28,11 +30,14 @@ var ToastButtonExample = function ToastButtonExample(_ref) {
|
|
|
28
30
|
options = _objectWithoutProperties(_ref, _excluded);
|
|
29
31
|
|
|
30
32
|
var toast = (0, _useToast.default)();
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
|
|
35
|
+
onClick: function onClick() {
|
|
36
|
+
return toast(options);
|
|
37
|
+
},
|
|
38
|
+
children: buttonText || 'Show toast'
|
|
39
|
+
})
|
|
40
|
+
});
|
|
36
41
|
};
|
|
37
42
|
|
|
38
43
|
var _default = ToastButtonExample;
|
|
@@ -13,6 +13,8 @@ var _Alert = _interopRequireDefault(require("../../Alert"));
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("../styles");
|
|
15
15
|
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
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; }
|
|
@@ -58,7 +60,7 @@ var Toast = function Toast(_ref) {
|
|
|
58
60
|
scale: 0.8
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.motion.div, {
|
|
62
64
|
layout: true,
|
|
63
65
|
variants: toastAnimationVariants,
|
|
64
66
|
initial: "initial",
|
|
@@ -68,16 +70,19 @@ var Toast = function Toast(_ref) {
|
|
|
68
70
|
duration: 0.35
|
|
69
71
|
},
|
|
70
72
|
id: id,
|
|
71
|
-
className: "pp-toast-".concat(position)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
className: "pp-toast-".concat(position),
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastComponent, {
|
|
75
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alert.default, {
|
|
76
|
+
message: message,
|
|
77
|
+
title: title,
|
|
78
|
+
variant: "closable",
|
|
79
|
+
type: type,
|
|
80
|
+
buttonTitle: buttonTitle,
|
|
81
|
+
onButtonClick: onButtonClick,
|
|
82
|
+
onClose: handleCloseButtonClick
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
});
|
|
81
86
|
};
|
|
82
87
|
|
|
83
88
|
var _default = Toast;
|
|
@@ -9,6 +9,8 @@ var _react = require("react");
|
|
|
9
9
|
|
|
10
10
|
var _ = _interopRequireDefault(require(".."));
|
|
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
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -73,13 +75,14 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
73
75
|
});
|
|
74
76
|
});
|
|
75
77
|
}, []);
|
|
76
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ToastContext.Provider, {
|
|
77
79
|
value: {
|
|
78
80
|
add: addToast,
|
|
79
81
|
remove: remoteToast,
|
|
80
82
|
toasts: toasts
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
+
},
|
|
84
|
+
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {})]
|
|
85
|
+
});
|
|
83
86
|
};
|
|
84
87
|
|
|
85
88
|
var _default = ToastProvider;
|
|
@@ -15,76 +15,104 @@ var _ToastProvider = require("./contexts/ToastProvider");
|
|
|
15
15
|
|
|
16
16
|
var _styles = require("./styles");
|
|
17
17
|
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
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
|
var ToastContainer = function ToastContainer() {
|
|
23
29
|
var _useContext = (0, _react.useContext)(_ToastProvider.ToastContext),
|
|
24
30
|
toasts = _useContext.toasts,
|
|
25
31
|
remove = _useContext.remove;
|
|
26
32
|
|
|
27
|
-
return /*#__PURE__*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledToastContainerOverlay, {
|
|
35
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
36
|
+
position: "top",
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
39
|
+
initial: false,
|
|
40
|
+
children: toasts && toasts.map(function (toast) {
|
|
41
|
+
return toast.config.position === 'top' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
42
|
+
toastId: toast.id,
|
|
43
|
+
close: remove
|
|
44
|
+
}, toast.config), toast.id);
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
49
|
+
position: "top-right",
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
52
|
+
initial: false,
|
|
53
|
+
children: toasts && toasts.map(function (toast) {
|
|
54
|
+
return toast.config.position === 'top-right' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
55
|
+
toastId: toast.id,
|
|
56
|
+
close: remove
|
|
57
|
+
}, toast.config), toast.id);
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
62
|
+
position: "top-left",
|
|
63
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
65
|
+
initial: false,
|
|
66
|
+
children: toasts && toasts.map(function (toast) {
|
|
67
|
+
return toast.config.position === 'top-left' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
68
|
+
toastId: toast.id,
|
|
69
|
+
close: remove
|
|
70
|
+
}, toast.config), toast.id);
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
75
|
+
position: "bottom",
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
77
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
78
|
+
initial: false,
|
|
79
|
+
children: toasts && toasts.map(function (toast) {
|
|
80
|
+
return toast.config.position === 'bottom' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
81
|
+
toastId: toast.id,
|
|
82
|
+
close: remove
|
|
83
|
+
}, toast.config), toast.id);
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
88
|
+
position: "bottom-right",
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
91
|
+
initial: false,
|
|
92
|
+
children: toasts && toasts.map(function (toast) {
|
|
93
|
+
return toast.config.position === 'bottom-right' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
94
|
+
toastId: toast.id,
|
|
95
|
+
close: remove
|
|
96
|
+
}, toast.config), toast.id);
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
101
|
+
position: "bottom-left",
|
|
102
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
103
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
104
|
+
initial: false,
|
|
105
|
+
children: toasts && toasts.map(function (toast) {
|
|
106
|
+
return toast.config.position === 'bottom-left' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
107
|
+
toastId: toast.id,
|
|
108
|
+
close: remove
|
|
109
|
+
}, toast.config), toast.id);
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
|
+
});
|
|
88
116
|
};
|
|
89
117
|
|
|
90
118
|
var _default = ToastContainer;
|