@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.
Files changed (133) hide show
  1. package/dist/components/Alert/alert.test.js +9 -1
  2. package/dist/components/Alert/index.js +47 -35
  3. package/dist/components/Avatar/avatar.test.js +9 -1
  4. package/dist/components/Avatar/index.js +47 -27
  5. package/dist/components/Avatar/styles.d.ts.map +1 -1
  6. package/dist/components/Avatar/styles.js +4 -4
  7. package/dist/components/Badge/badge.test.js +9 -1
  8. package/dist/components/Badge/index.js +24 -15
  9. package/dist/components/Button/Button.test.js +19 -7
  10. package/dist/components/Button/index.js +28 -16
  11. package/dist/components/Card/ButtonCard/index.js +24 -10
  12. package/dist/components/Card/Expansion/index.js +24 -17
  13. package/dist/components/Card/card.test.js +9 -1
  14. package/dist/components/Card/index.js +43 -19
  15. package/dist/components/CheckboxInput/checkbox-input.test.js +9 -1
  16. package/dist/components/CheckboxInput/components/MultipleCheckbox.js +58 -43
  17. package/dist/components/CheckboxInput/index.js +29 -18
  18. package/dist/components/ColorPicker/colorpicker.test.js +9 -1
  19. package/dist/components/ColorPicker/components/ColorHue.js +17 -10
  20. package/dist/components/ColorPicker/components/ColorInput.js +3 -1
  21. package/dist/components/ColorPicker/components/ColorPickerBox.js +13 -9
  22. package/dist/components/ColorPicker/components/ColorPointer.js +3 -1
  23. package/dist/components/ColorPicker/components/ColorSelector.js +8 -2
  24. package/dist/components/ColorPicker/index.js +44 -34
  25. package/dist/components/DatePicker/components/DatePickerContent.js +113 -79
  26. package/dist/components/DatePicker/components/DateYearPicker.js +45 -32
  27. package/dist/components/DatePicker/datepicker.test.js +9 -1
  28. package/dist/components/DatePicker/index.js +40 -29
  29. package/dist/components/Dialog/dialog-example.js +21 -13
  30. package/dist/components/Dialog/dialog.test.js +5 -1
  31. package/dist/components/Dialog/index.js +59 -46
  32. package/dist/components/Dropzone/dropzone.test.js +9 -1
  33. package/dist/components/Dropzone/index.js +122 -97
  34. package/dist/components/Flex/flex.test.js +128 -14
  35. package/dist/components/Flex/index.js +11 -3
  36. package/dist/components/Grid/grid.test.js +86 -81
  37. package/dist/components/Grid/index.js +11 -3
  38. package/dist/components/Icon/icon.test.js +3 -3
  39. package/dist/components/Icon/index.js +8 -2
  40. package/dist/components/IconItem/IconItem.test.js +9 -1
  41. package/dist/components/IconItem/index.js +33 -18
  42. package/dist/components/ImageItem/imageFake.js +13 -9
  43. package/dist/components/ImageItem/index.js +36 -24
  44. package/dist/components/ImageItem/input.test.js +10 -7
  45. package/dist/components/Input/index.js +67 -40
  46. package/dist/components/Input/input.test.js +4 -4
  47. package/dist/components/Label/index.js +12 -9
  48. package/dist/components/Label/input.test.js +3 -1
  49. package/dist/components/List/index.js +15 -4
  50. package/dist/components/List/list.test.js +36 -18
  51. package/dist/components/Menu/components/Submenu.d.ts.map +1 -1
  52. package/dist/components/Menu/components/Submenu.js +49 -26
  53. package/dist/components/Menu/index.d.ts.map +1 -1
  54. package/dist/components/Menu/index.js +19 -10
  55. package/dist/components/Menu/menu.test.js +14 -14
  56. package/dist/components/Menu/styles.d.ts +1 -0
  57. package/dist/components/Menu/styles.d.ts.map +1 -1
  58. package/dist/components/Menu/styles.js +19 -15
  59. package/dist/components/Modal/index.js +24 -19
  60. package/dist/components/Modal/modal.test.js +44 -12
  61. package/dist/components/Pagination/index.js +54 -45
  62. package/dist/components/Pagination/pagination.test.js +13 -11
  63. package/dist/components/Progress/Circle/index.js +38 -29
  64. package/dist/components/Progress/Linear/index.js +24 -17
  65. package/dist/components/Progress/index.js +4 -2
  66. package/dist/components/Progress/progress.test.js +9 -1
  67. package/dist/components/RadioInput/components/ChoiceList/index.js +28 -20
  68. package/dist/components/RadioInput/index.js +27 -22
  69. package/dist/components/RadioInput/radio-input.test.js +118 -87
  70. package/dist/components/Rating/components/GradientIcon/index.js +24 -17
  71. package/dist/components/Rating/components/RatingWithMultipleValues/RatingWithMultipleValues.js +24 -22
  72. package/dist/components/Rating/components/RatingWithSingleValue/RatingWithSingleValue.js +21 -17
  73. package/dist/components/Rating/index.js +29 -26
  74. package/dist/components/Rating/rating.test.js +3 -1
  75. package/dist/components/SelectInput/components/OptionsArea/index.js +37 -32
  76. package/dist/components/SelectInput/components/SelectArea/index.js +46 -34
  77. package/dist/components/SelectInput/index.js +26 -23
  78. package/dist/components/SelectInput/selectInput.test.js +10 -4
  79. package/dist/components/Skeleton/index.js +11 -1
  80. package/dist/components/Skeleton/skeleton.test.js +3 -1
  81. package/dist/components/Slider/components/SliderPointer.d.ts.map +1 -1
  82. package/dist/components/Slider/components/SliderPointer.js +23 -8
  83. package/dist/components/Slider/components/SliderRail.js +8 -2
  84. package/dist/components/Slider/components/SliderSelector.js +86 -78
  85. package/dist/components/Slider/index.js +28 -16
  86. package/dist/components/Slider/slider.test.js +9 -1
  87. package/dist/components/Spinner/index.js +3 -1
  88. package/dist/components/Spinner/spinner.test.js +9 -1
  89. package/dist/components/Steps/index.js +25 -17
  90. package/dist/components/Steps/steps.test.js +3 -1
  91. package/dist/components/Switch/index.js +23 -17
  92. package/dist/components/Switch/input.test.js +3 -1
  93. package/dist/components/Table/components/MenuItem.js +16 -13
  94. package/dist/components/Table/index.js +139 -99
  95. package/dist/components/Table/table.test.js +3 -1
  96. package/dist/components/Tabs/TabsExample.js +37 -23
  97. package/dist/components/Tabs/components/Tab.js +12 -3
  98. package/dist/components/Tabs/components/TabPanel.js +8 -3
  99. package/dist/components/Tabs/components/Tabs.js +33 -23
  100. package/dist/components/Tabs/tabs.test.js +103 -83
  101. package/dist/components/Tag/index.js +21 -16
  102. package/dist/components/Tag/tag.test.js +9 -7
  103. package/dist/components/TextAreaInput/index.js +25 -15
  104. package/dist/components/TextAreaInput/text-area-input.test.js +8 -2
  105. package/dist/components/Thumbnail/index.js +71 -60
  106. package/dist/components/Thumbnail/thumbnail.test.js +9 -1
  107. package/dist/components/Timeline/components/Timeline.js +9 -5
  108. package/dist/components/Timeline/components/TimelineContent.js +31 -15
  109. package/dist/components/Timeline/components/TimelineItem.js +11 -1
  110. package/dist/components/Timeline/components/TimelineSeparator.js +9 -4
  111. package/dist/components/Timeline/timeline.test.js +105 -76
  112. package/dist/components/Toast/button-example.js +10 -5
  113. package/dist/components/Toast/components/Toast.js +16 -11
  114. package/dist/components/Toast/contexts/ToastProvider.js +6 -3
  115. package/dist/components/Toast/index.js +90 -62
  116. package/dist/components/Toast/toast.test.js +11 -1
  117. package/dist/components/Tooltip/componenteTeste.js +42 -14
  118. package/dist/components/Tooltip/index.js +56 -46
  119. package/dist/components/Tooltip/tooltip.test.js +13 -8
  120. package/dist/components/Typography/index.js +11 -3
  121. package/dist/components/Typography/typography.test.js +3 -1
  122. package/dist/shared/components/FocusLock/index.js +11 -4
  123. package/dist/shared/tests/test-utils.js +6 -3
  124. package/dist/shared/theme/button-example.js +6 -3
  125. package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
  126. package/dist/shared/theme/contexts/ThemeContext.js +12 -29
  127. package/dist/shared/theme/theme.test.js +25 -11
  128. package/package.json +1 -1
  129. package/dist/components/Slider/icons/pointer.js +0 -15
  130. package/dist/shared/logos/pp_logo_horizontal.js +0 -51
  131. package/dist/shared/logos/pp_logo_horizontal_dark_mode.js +0 -51
  132. package/dist/shared/logos/pp_logo_vertical.js +0 -51
  133. 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__*/React.createElement(_styles.TimelineItemContent, rest, /*#__PURE__*/React.createElement(_Flex.default, {
40
- direction: "column"
41
- }, /*#__PURE__*/React.createElement(_Typography.default, {
42
- fontWeight: "600",
43
- fontSize: "xs"
44
- }, title), /*#__PURE__*/React.createElement(_Typography.default, {
45
- fontSize: "xs"
46
- }, description)), date && /*#__PURE__*/React.createElement(_Flex.default, {
47
- direction: "column"
48
- }, /*#__PURE__*/React.createElement(_Typography.default, {
49
- fontWeight: "600",
50
- fontSize: "xs"
51
- }, getDay, " ", getShortMonth.charAt(0).toUpperCase() + getShortMonth.slice(1)), /*#__PURE__*/React.createElement(_Typography.default, {
52
- fontSize: "xs"
53
- }, getHours, ":", getMinutes)));
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__*/React.createElement(_styles.TimelineItemContainer, rest, children);
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__*/React.createElement(_styles.TimelineSeparatorContainer, null, /*#__PURE__*/React.createElement(_styles.TimelineSeparatorLine, null), /*#__PURE__*/React.createElement(_styles.TimelineSeparatorCircle, {
14
- icon: icon === null || icon === void 0 ? void 0 : icon.toString().length,
15
- circleColor: circleColor
16
- }, icon));
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__*/React.createElement(_.Timeline, null, /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, null), /*#__PURE__*/React.createElement(_.TimelineContent, {
16
- title: "Title",
17
- description: "Description",
18
- date: new Date()
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__*/React.createElement(_.Timeline, {
26
- position: "right"
27
- }, /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, null), /*#__PURE__*/React.createElement(_.TimelineContent, {
28
- title: "Title",
29
- description: "Description",
30
- date: new Date()
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__*/React.createElement(_.Timeline, {
38
- fullWidth: true
39
- }, /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, null), /*#__PURE__*/React.createElement(_.TimelineContent, {
40
- title: "Title",
41
- description: "Description",
42
- date: new Date()
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__*/React.createElement(_.Timeline, null, /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, {
50
- icon: /*#__PURE__*/React.createElement(_Icon.default, {
51
- name: "shopping-cart"
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
- }), /*#__PURE__*/React.createElement(_.TimelineContent, {
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__*/React.createElement(_.Timeline, null, /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, {
65
- icon: /*#__PURE__*/React.createElement(_Icon.default, {
66
- name: "shopping-cart"
67
- }),
68
- circleColor: "primary.default"
69
- }), /*#__PURE__*/React.createElement(_.TimelineContent, {
70
- title: "Title",
71
- description: "Description",
72
- date: new Date()
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__*/React.createElement(_.Timeline, {
81
- position: "alternate"
82
- }, /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, {
83
- icon: /*#__PURE__*/React.createElement(_Icon.default, {
84
- name: "shopping-cart"
85
- }),
86
- circleColor: "primary.default"
87
- }), /*#__PURE__*/React.createElement(_.TimelineContent, {
88
- title: "Title",
89
- description: "Description",
90
- date: new Date()
91
- })), /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, {
92
- icon: /*#__PURE__*/React.createElement(_Icon.default, {
93
- name: "shopping-cart"
94
- }),
95
- circleColor: "primary.default"
96
- }), /*#__PURE__*/React.createElement(_.TimelineContent, {
97
- title: "Title",
98
- description: "Description",
99
- date: new Date()
100
- })), /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, {
101
- icon: /*#__PURE__*/React.createElement(_Icon.default, {
102
- name: "shopping-cart"
103
- }),
104
- circleColor: "primary.default"
105
- }), /*#__PURE__*/React.createElement(_.TimelineContent, {
106
- title: "Title",
107
- description: "Description",
108
- date: new Date()
109
- })), /*#__PURE__*/React.createElement(_.TimelineItem, null, /*#__PURE__*/React.createElement(_.TimelineSeparator, {
110
- icon: /*#__PURE__*/React.createElement(_Icon.default, {
111
- name: "shopping-cart"
112
- }),
113
- circleColor: "primary.default"
114
- }), /*#__PURE__*/React.createElement(_.TimelineContent, {
115
- title: "Title",
116
- description: "Description",
117
- date: new Date()
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__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
32
- onClick: function onClick() {
33
- return toast(options);
34
- }
35
- }, buttonText || 'Show toast'));
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__*/React.createElement(_framerMotion.motion.div, {
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
- }, /*#__PURE__*/React.createElement(_styles.StyledToastComponent, null, /*#__PURE__*/React.createElement(_Alert.default, {
73
- message: message,
74
- title: title,
75
- variant: "closable",
76
- type: type,
77
- buttonTitle: buttonTitle,
78
- onButtonClick: onButtonClick,
79
- onClose: handleCloseButtonClick
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__*/React.createElement(ToastContext.Provider, {
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
- }, children, /*#__PURE__*/React.createElement(_.default, null));
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 _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); }
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__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement(_styles.StyledToastContainerOverlay, null, /*#__PURE__*/React.createElement(_styles.StyledToastManagerOverlay, {
28
- position: "top"
29
- }, /*#__PURE__*/React.createElement(_styles.StyledToastManagerInner, null, /*#__PURE__*/React.createElement(_framerMotion.AnimatePresence, {
30
- initial: false
31
- }, toasts && toasts.map(function (toast) {
32
- return toast.config.position === 'top' && /*#__PURE__*/React.createElement(_Toast.default, _extends({
33
- key: toast.id,
34
- toastId: toast.id,
35
- close: remove
36
- }, toast.config));
37
- })))), /*#__PURE__*/React.createElement(_styles.StyledToastManagerOverlay, {
38
- position: "top-right"
39
- }, /*#__PURE__*/React.createElement(_styles.StyledToastManagerInner, null, /*#__PURE__*/React.createElement(_framerMotion.AnimatePresence, {
40
- initial: false
41
- }, toasts && toasts.map(function (toast) {
42
- return toast.config.position === 'top-right' && /*#__PURE__*/React.createElement(_Toast.default, _extends({
43
- key: toast.id,
44
- toastId: toast.id,
45
- close: remove
46
- }, toast.config));
47
- })))), /*#__PURE__*/React.createElement(_styles.StyledToastManagerOverlay, {
48
- position: "top-left"
49
- }, /*#__PURE__*/React.createElement(_styles.StyledToastManagerInner, null, /*#__PURE__*/React.createElement(_framerMotion.AnimatePresence, {
50
- initial: false
51
- }, toasts && toasts.map(function (toast) {
52
- return toast.config.position === 'top-left' && /*#__PURE__*/React.createElement(_Toast.default, _extends({
53
- key: toast.id,
54
- toastId: toast.id,
55
- close: remove
56
- }, toast.config));
57
- })))), /*#__PURE__*/React.createElement(_styles.StyledToastManagerOverlay, {
58
- position: "bottom"
59
- }, /*#__PURE__*/React.createElement(_styles.StyledToastManagerInner, null, /*#__PURE__*/React.createElement(_framerMotion.AnimatePresence, {
60
- initial: false
61
- }, toasts && toasts.map(function (toast) {
62
- return toast.config.position === 'bottom' && /*#__PURE__*/React.createElement(_Toast.default, _extends({
63
- key: toast.id,
64
- toastId: toast.id,
65
- close: remove
66
- }, toast.config));
67
- })))), /*#__PURE__*/React.createElement(_styles.StyledToastManagerOverlay, {
68
- position: "bottom-right"
69
- }, /*#__PURE__*/React.createElement(_styles.StyledToastManagerInner, null, /*#__PURE__*/React.createElement(_framerMotion.AnimatePresence, {
70
- initial: false
71
- }, toasts && toasts.map(function (toast) {
72
- return toast.config.position === 'bottom-right' && /*#__PURE__*/React.createElement(_Toast.default, _extends({
73
- key: toast.id,
74
- toastId: toast.id,
75
- close: remove
76
- }, toast.config));
77
- })))), /*#__PURE__*/React.createElement(_styles.StyledToastManagerOverlay, {
78
- position: "bottom-left"
79
- }, /*#__PURE__*/React.createElement(_styles.StyledToastManagerInner, null, /*#__PURE__*/React.createElement(_framerMotion.AnimatePresence, {
80
- initial: false
81
- }, toasts && toasts.map(function (toast) {
82
- return toast.config.position === 'bottom-left' && /*#__PURE__*/React.createElement(_Toast.default, _extends({
83
- key: toast.id,
84
- toastId: toast.id,
85
- close: remove
86
- }, toast.config));
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;