@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
@@ -23,10 +23,18 @@ var _useColorMode2 = require("../../shared/theme/hooks/useColorMode");
23
23
 
24
24
  var _GenerateKey = require("../../utils/GenerateKey");
25
25
 
26
+ var _jsxRuntime = require("react/jsx-runtime");
27
+
26
28
  var _excluded = ["selectable", "primaryActions", "secondaryActions", "header", "rows", "rowMenuActions"];
27
29
 
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
32
+ 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; }
33
+
34
+ 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; }
35
+
36
+ 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; }
37
+
30
38
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
31
39
 
32
40
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -129,103 +137,135 @@ function Table(_ref) {
129
137
  setAllSelected(!allSelected);
130
138
  };
131
139
 
132
- return /*#__PURE__*/React.createElement(_styles.StyledTable, rest, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, selectedRows.length ? /*#__PURE__*/React.createElement("th", {
133
- colSpan: header.length + 1
134
- }, /*#__PURE__*/React.createElement(_styles.SelectedHeader, null, /*#__PURE__*/React.createElement(_styles.ActionsButton, {
135
- onClick: function onClick() {
136
- return toggleSelectAll();
137
- }
138
- }, /*#__PURE__*/React.createElement(_CheckboxInput.default, {
139
- isInderteminate: selectedRows.length > 0 && !allSelected,
140
- defaultIsChecked: allSelected || selectedRows.length > 0,
141
- onChangeValue: function onChangeValue(checked) {
142
- if (!checked && selectedRows.length > 0) {
143
- setSelectedRows([]);
144
- setAllSelected(false);
145
- }
146
- }
147
- }), /*#__PURE__*/React.createElement(_Typography.default, {
148
- fontSize: "xs",
149
- fontWeight: "500"
150
- }, selectedRows.length, " ", selectedRows.length > 1 ? 'selecionados' : 'selecionado')), !!primaryActions && primaryActions.map(function (action) {
151
- return /*#__PURE__*/React.createElement(_styles.ActionsButton, {
152
- key: (0, _GenerateKey.generateKey)(),
153
- onClick: function onClick() {
154
- return action.handler(selectedRows, allSelected);
155
- }
156
- }, /*#__PURE__*/React.createElement(_Typography.default, {
157
- fontSize: "xs",
158
- fontWeight: "500"
159
- }, action.label));
160
- }), !!secondaryActions && /*#__PURE__*/React.createElement(_styles.ActionsButton, {
161
- onClick: function onClick() {
162
- return setOpenSelectDropDownMenu(!openSelectDropDownMenu);
163
- }
164
- }, /*#__PURE__*/React.createElement(_Typography.default, {
165
- fontSize: "xs",
166
- fontWeight: "500"
167
- }, "Mais ", /*#__PURE__*/React.createElement(_Icon.default, {
168
- name: "chevron-down"
169
- })), /*#__PURE__*/React.createElement(_styles.MenuItemWrapper, null, /*#__PURE__*/React.createElement(_MenuItem.MenuItem, {
170
- isOpen: openSelectDropDownMenu,
171
- items: secondaryActions,
172
- onClickOutside: function onClickOutside() {
173
- return setOpenSelectDropDownMenu(false);
174
- },
175
- top: 25,
176
- right: -30
177
- }))))) : /*#__PURE__*/React.createElement(React.Fragment, null, selectable && /*#__PURE__*/React.createElement("th", null, /*#__PURE__*/React.createElement(_CheckboxInput.default, {
178
- onChangeValue: function onChangeValue() {
179
- return toggleSelectAll();
180
- }
181
- })), header.map(function (label) {
182
- return /*#__PURE__*/React.createElement("th", {
183
- key: (0, _GenerateKey.generateKey)()
184
- }, /*#__PURE__*/React.createElement(_Typography.default, {
185
- fontSize: "xxs",
186
- fontWeight: "600"
187
- }, label));
188
- })), !!rowMenuActions && /*#__PURE__*/React.createElement("th", null))), /*#__PURE__*/React.createElement("tbody", null, rowsWithKey.map(function (row) {
189
- return /*#__PURE__*/React.createElement("tr", {
190
- key: row.key,
191
- tabIndex: selectable ? 0 : undefined,
192
- "data-selected": selectedRows.includes(row.key)
193
- }, selectable && /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(_CheckboxInput.default, {
194
- defaultIsChecked: selectedRows.includes(row.key),
195
- onChangeValue: function onChangeValue(checked) {
196
- return rowCheckboxHandler(row.key, checked);
197
- }
198
- })), row.item.map(function (cell) {
199
- return /*#__PURE__*/React.createElement("td", {
200
- key: (0, _GenerateKey.generateKey)()
201
- }, typeof cell === 'string' ? /*#__PURE__*/React.createElement(_Typography.default, {
202
- fontSize: "xxs",
203
- fontWeight: "500"
204
- }, cell) : cell);
205
- }), !!rowMenuActions && /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(_FocusLock.default, {
206
- isLocked: isMenuOpen.rowId === row.key && isMenuOpen.state
207
- }, /*#__PURE__*/React.createElement(_styles.MenuItemWrapper, null, /*#__PURE__*/React.createElement(_styles.VerticalPointsButton, {
208
- onClick: function onClick() {
209
- return setIsMenuOpen({
210
- state: isMenuOpen.rowId === row.key ? !isMenuOpen.state : true,
211
- rowId: row.key
212
- });
213
- }
214
- }, /*#__PURE__*/React.createElement(_Icon.default, {
215
- name: "more-vertical",
216
- color: colorMode === 'dark' ? 'neutral.white' : 'neutral.black'
217
- })), /*#__PURE__*/React.createElement(_MenuItem.MenuItem, {
218
- onClickOutside: function onClickOutside() {
219
- if (isMenuOpen.rowId === row.key) {
220
- setIsMenuOpen({
221
- state: false,
222
- rowId: ''
223
- });
224
- }
225
- },
226
- isOpen: isMenuOpen.rowId === row.key && isMenuOpen.state,
227
- items: rowMenuActions,
228
- top: 45
229
- })))));
230
- })));
140
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledTable, _objectSpread(_objectSpread({}, rest), {}, {
141
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
142
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
143
+ children: [selectedRows.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
144
+ colSpan: header.length + 1,
145
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SelectedHeader, {
146
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ActionsButton, {
147
+ onClick: function onClick() {
148
+ return toggleSelectAll();
149
+ },
150
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxInput.default, {
151
+ isInderteminate: selectedRows.length > 0 && !allSelected,
152
+ defaultIsChecked: allSelected || selectedRows.length > 0,
153
+ onChangeValue: function onChangeValue(checked) {
154
+ if (!checked && selectedRows.length > 0) {
155
+ setSelectedRows([]);
156
+ setAllSelected(false);
157
+ }
158
+ }
159
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
160
+ fontSize: "xs",
161
+ fontWeight: "500",
162
+ children: [selectedRows.length, " ", selectedRows.length > 1 ? 'selecionados' : 'selecionado']
163
+ })]
164
+ }), !!primaryActions && primaryActions.map(function (action) {
165
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ActionsButton, {
166
+ onClick: function onClick() {
167
+ return action.handler(selectedRows, allSelected);
168
+ },
169
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
170
+ fontSize: "xs",
171
+ fontWeight: "500",
172
+ children: action.label
173
+ })
174
+ }, (0, _GenerateKey.generateKey)());
175
+ }), !!secondaryActions && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ActionsButton, {
176
+ onClick: function onClick() {
177
+ return setOpenSelectDropDownMenu(!openSelectDropDownMenu);
178
+ },
179
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
180
+ fontSize: "xs",
181
+ fontWeight: "500",
182
+ children: ["Mais ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
183
+ name: "chevron-down"
184
+ })]
185
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.MenuItemWrapper, {
186
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.MenuItem, {
187
+ isOpen: openSelectDropDownMenu,
188
+ items: secondaryActions,
189
+ onClickOutside: function onClickOutside() {
190
+ return setOpenSelectDropDownMenu(false);
191
+ },
192
+ top: 25,
193
+ right: -30
194
+ })
195
+ })]
196
+ })]
197
+ })
198
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
199
+ children: [selectable && /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
200
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxInput.default, {
201
+ onChangeValue: function onChangeValue() {
202
+ return toggleSelectAll();
203
+ }
204
+ })
205
+ }), header.map(function (label) {
206
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
207
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
208
+ fontSize: "xxs",
209
+ fontWeight: "600",
210
+ children: label
211
+ })
212
+ }, (0, _GenerateKey.generateKey)());
213
+ })]
214
+ }), !!rowMenuActions && /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {})]
215
+ })
216
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("tbody", {
217
+ children: rowsWithKey.map(function (row) {
218
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
219
+ tabIndex: selectable ? 0 : undefined,
220
+ "data-selected": selectedRows.includes(row.key),
221
+ children: [selectable && /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
222
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxInput.default, {
223
+ defaultIsChecked: selectedRows.includes(row.key),
224
+ onChangeValue: function onChangeValue(checked) {
225
+ return rowCheckboxHandler(row.key, checked);
226
+ }
227
+ })
228
+ }), row.item.map(function (cell) {
229
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
230
+ children: typeof cell === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
231
+ fontSize: "xxs",
232
+ fontWeight: "500",
233
+ children: cell
234
+ }) : cell
235
+ }, (0, _GenerateKey.generateKey)());
236
+ }), !!rowMenuActions && /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
237
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusLock.default, {
238
+ isLocked: isMenuOpen.rowId === row.key && isMenuOpen.state,
239
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.MenuItemWrapper, {
240
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.VerticalPointsButton, {
241
+ onClick: function onClick() {
242
+ return setIsMenuOpen({
243
+ state: isMenuOpen.rowId === row.key ? !isMenuOpen.state : true,
244
+ rowId: row.key
245
+ });
246
+ },
247
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
248
+ name: "more-vertical",
249
+ color: colorMode === 'dark' ? 'neutral.white' : 'neutral.black'
250
+ })
251
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.MenuItem, {
252
+ onClickOutside: function onClickOutside() {
253
+ if (isMenuOpen.rowId === row.key) {
254
+ setIsMenuOpen({
255
+ state: false,
256
+ rowId: ''
257
+ });
258
+ }
259
+ },
260
+ isOpen: isMenuOpen.rowId === row.key && isMenuOpen.state,
261
+ items: rowMenuActions,
262
+ top: 45
263
+ })]
264
+ })
265
+ })
266
+ })]
267
+ }, row.key);
268
+ })
269
+ })]
270
+ }));
231
271
  }
@@ -8,6 +8,8 @@ require("@testing-library/jest-dom/extend-expect");
8
8
 
9
9
  var _ = require(".");
10
10
 
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+
11
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
14
 
13
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; }
@@ -15,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
17
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
16
18
 
17
19
  var setup = function setup(props) {
18
- var utils = (0, _testUtils.render)( /*#__PURE__*/React.createElement(_.Table, props));
20
+ var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Table, _objectSpread({}, props)));
19
21
  return _objectSpread({}, utils);
20
22
  };
21
23
 
@@ -9,6 +9,14 @@ var _react = require("react");
9
9
 
10
10
  var _ = require(".");
11
11
 
12
+ var _jsxRuntime = require("react/jsx-runtime");
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
21
 
14
22
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -34,29 +42,35 @@ var TabsExample = function TabsExample(_ref) {
34
42
  (0, _react.useEffect)(function () {
35
43
  setCurrentTab(props.value);
36
44
  }, [props.value]);
37
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_.Tabs, _extends({}, props, {
38
- onChangeTab: function onChangeTab(value) {
39
- return setCurrentTab(value);
40
- }
41
- }), /*#__PURE__*/React.createElement(_.Tab, {
42
- value: 1,
43
- label: "Item 1"
44
- }), /*#__PURE__*/React.createElement(_.Tab, {
45
- value: 2,
46
- label: "Item 2"
47
- }), /*#__PURE__*/React.createElement(_.Tab, {
48
- value: 3,
49
- label: "Item 3"
50
- })), /*#__PURE__*/React.createElement(_.TabPanel, {
51
- value: currentTab,
52
- index: 1
53
- }, "Item 1 content"), /*#__PURE__*/React.createElement(_.TabPanel, {
54
- value: currentTab,
55
- index: 2
56
- }, "Item 2 content"), /*#__PURE__*/React.createElement(_.TabPanel, {
57
- value: currentTab,
58
- index: 3
59
- }, "Item 3 content"));
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.Tabs, _objectSpread(_objectSpread({}, props), {}, {
47
+ onChangeTab: function onChangeTab(value) {
48
+ return setCurrentTab(value);
49
+ },
50
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Tab, {
51
+ value: 1,
52
+ label: "Item 1"
53
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Tab, {
54
+ value: 2,
55
+ label: "Item 2"
56
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Tab, {
57
+ value: 3,
58
+ label: "Item 3"
59
+ })]
60
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TabPanel, {
61
+ value: currentTab,
62
+ index: 1,
63
+ children: "Item 1 content"
64
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TabPanel, {
65
+ value: currentTab,
66
+ index: 2,
67
+ children: "Item 2 content"
68
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TabPanel, {
69
+ value: currentTab,
70
+ index: 3,
71
+ children: "Item 3 content"
72
+ })]
73
+ });
60
74
  };
61
75
 
62
76
  exports.TabsExample = TabsExample;
@@ -11,6 +11,8 @@ var _Tabs = require("./Tabs");
11
11
 
12
12
  var _styles = require("../styles");
13
13
 
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+
14
16
  var Tab = function Tab(_ref) {
15
17
  var label = _ref.label,
16
18
  value = _ref.value,
@@ -28,7 +30,7 @@ var Tab = function Tab(_ref) {
28
30
  textColor = _useContext.textColor,
29
31
  isLoading = _useContext.isLoading;
30
32
 
31
- return /*#__PURE__*/React.createElement(_styles.TabButton, {
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabButton, {
32
34
  id: "simple-tab-".concat(value),
33
35
  type: "button",
34
36
  role: "tab",
@@ -41,8 +43,15 @@ var Tab = function Tab(_ref) {
41
43
  disabled: disabled || isLoading,
42
44
  fullWidth: fullWidth,
43
45
  indicatorColor: indicatorColor,
44
- textColor: textColor
45
- }, isLoading ? /*#__PURE__*/React.createElement(_styles.TabLoadingSkeleton, null) : /*#__PURE__*/React.createElement(React.Fragment, null, iconPosition === 'left' && icon && /*#__PURE__*/React.createElement(_styles.TabButtonIcon, null, icon), label, iconPosition === 'right' && icon && /*#__PURE__*/React.createElement(_styles.TabButtonIcon, null, icon)));
46
+ textColor: textColor,
47
+ children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabLoadingSkeleton, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
48
+ children: [iconPosition === 'left' && icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabButtonIcon, {
49
+ children: icon
50
+ }), label, iconPosition === 'right' && icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabButtonIcon, {
51
+ children: icon
52
+ })]
53
+ })
54
+ });
46
55
  };
47
56
 
48
57
  exports.Tab = Tab;
@@ -7,16 +7,21 @@ exports.TabPanel = void 0;
7
7
 
8
8
  var _styles = require("../styles");
9
9
 
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+
10
12
  var TabPanel = function TabPanel(_ref) {
11
13
  var children = _ref.children,
12
14
  index = _ref.index,
13
15
  value = _ref.value;
14
- return /*#__PURE__*/React.createElement(_styles.TabPanelContainer, {
16
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabPanelContainer, {
15
17
  id: "simple-tabpanel-".concat(index),
16
18
  hidden: Number(value) !== Number(index),
17
19
  role: "tabpanel",
18
- "aria-labelledby": "simple-tabpanel-".concat(index)
19
- }, Number(value) === Number(index) && /*#__PURE__*/React.createElement(_styles.TabPanelWrapper, null, children));
20
+ "aria-labelledby": "simple-tabpanel-".concat(index),
21
+ children: Number(value) === Number(index) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabPanelWrapper, {
22
+ children: children
23
+ })
24
+ });
20
25
  };
21
26
 
22
27
  exports.TabPanel = TabPanel;
@@ -11,11 +11,17 @@ 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 = ["children", "direction", "centered", "onChangeTab", "value", "fullWidth", "indicatorColor", "textColor", "isLoading"];
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
18
- 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
+ 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; }
19
25
 
20
26
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
27
 
@@ -90,30 +96,34 @@ var Tabs = function Tabs(_ref) {
90
96
  setIndicatorLeft(activeTabRef.current.offsetLeft);
91
97
  }
92
98
  }, [value]);
93
- return /*#__PURE__*/React.createElement(_styles.TabsContainer, {
94
- indicatorColor: indicatorColor
95
- }, /*#__PURE__*/React.createElement(_Flex.default, _extends({
96
- direction: direction || 'row',
97
- justifyContent: centered ? 'center' : 'flex-start',
98
- role: "tablist"
99
- }, rest), /*#__PURE__*/React.createElement(TabsContext.Provider, {
100
- value: {
101
- activeTabRef: activeTabRef,
102
- activeTab: activeTab,
103
- changeTab: handleChangeTab,
104
- textColor: textColor,
99
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.TabsContainer, {
100
+ indicatorColor: indicatorColor,
101
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Flex.default, _objectSpread(_objectSpread({
102
+ direction: direction || 'row',
103
+ justifyContent: centered ? 'center' : 'flex-start',
104
+ role: "tablist"
105
+ }, rest), {}, {
106
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TabsContext.Provider, {
107
+ value: {
108
+ activeTabRef: activeTabRef,
109
+ activeTab: activeTab,
110
+ changeTab: handleChangeTab,
111
+ textColor: textColor,
112
+ indicatorColor: indicatorColor,
113
+ indicatorWidth: indicatorWidth,
114
+ indicatorLeft: indicatorLeft,
115
+ fullWidth: fullWidth,
116
+ isLoading: isLoading
117
+ },
118
+ children: children
119
+ })
120
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabIndicator, {
121
+ isLoading: isLoading,
105
122
  indicatorColor: indicatorColor,
106
123
  indicatorWidth: indicatorWidth,
107
- indicatorLeft: indicatorLeft,
108
- fullWidth: fullWidth,
109
- isLoading: isLoading
110
- }
111
- }, children)), /*#__PURE__*/React.createElement(_styles.TabIndicator, {
112
- isLoading: isLoading,
113
- indicatorColor: indicatorColor,
114
- indicatorWidth: indicatorWidth,
115
- indicatorLeft: indicatorLeft
116
- }));
124
+ indicatorLeft: indicatorLeft
125
+ })]
126
+ });
117
127
  };
118
128
 
119
129
  exports.Tabs = Tabs;