@cashub/ui 0.20.0 → 0.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/Tab/Tab.js +9 -13
  2. package/Tab/TabList.js +14 -32
  3. package/Tab/TabPanel.js +21 -58
  4. package/Tab/TabTab.js +20 -40
  5. package/Tab/index.js +2 -10
  6. package/Tab/subComponent/TabContext.js +2 -5
  7. package/animate/Collapse.js +26 -53
  8. package/animate/Loader.js +21 -26
  9. package/animate/NumberCounter.js +22 -44
  10. package/animate/PulseRing.js +9 -21
  11. package/animate/Spinner.js +2 -10
  12. package/animate/index.js +5 -11
  13. package/assets/css/autocomplete.css +16 -16
  14. package/assets/css/font.css +4 -4
  15. package/assets/css/global.css +3 -3
  16. package/assets/css/normalize.css +386 -386
  17. package/backdrop/BaseBackdrop.js +2 -9
  18. package/backdrop/LoadingBackdrop.js +2 -9
  19. package/backdrop/ModalBackdrop.js +2 -9
  20. package/backdrop/index.js +3 -7
  21. package/badge/Badge.js +2 -11
  22. package/badge/BadgeDot.js +2 -10
  23. package/badge/BadgeFill.js +15 -20
  24. package/badge/BadgeWithText.js +6 -13
  25. package/badge/index.js +4 -9
  26. package/billing/BarChart.js +10 -17
  27. package/billing/Grid.js +11 -15
  28. package/billing/Header2.js +6 -9
  29. package/billing/Header3.js +9 -16
  30. package/billing/Paragraph.js +8 -14
  31. package/billing/ParagraphGroup.js +6 -9
  32. package/billing/ParagraphText.js +7 -12
  33. package/billing/Section.js +13 -23
  34. package/billing/SectionBody.js +5 -8
  35. package/billing/SectionHeader.js +7 -12
  36. package/breadcrumb/Breadcrumb.js +11 -21
  37. package/breadcrumb/index.js +1 -3
  38. package/button/Button.js +41 -38
  39. package/button/ButtonGroup.js +21 -18
  40. package/button/IconButton.js +29 -29
  41. package/button/ScrollToTopButton.js +12 -39
  42. package/button/index.js +4 -9
  43. package/callout/Callout.js +13 -26
  44. package/callout/index.js +1 -3
  45. package/chart/BarChart.js +28 -53
  46. package/chart/DoughnutChart.js +23 -62
  47. package/chart/LineChart.js +33 -55
  48. package/chart/SingleBarChart.js +11 -17
  49. package/chart/index.js +5 -12
  50. package/chart/utils/customTooltip.js +26 -43
  51. package/chart/utils/htmlLegendPlugin.js +24 -30
  52. package/chart/utils/index.js +3 -7
  53. package/chart/utils/padEmptyChartBar.js +24 -22
  54. package/container/FlexContainer.js +9 -12
  55. package/container/index.js +1 -3
  56. package/cropper/Cropper.js +21 -34
  57. package/cropper/CropperModalHandler.js +15 -21
  58. package/cropper/index.js +2 -5
  59. package/cropper/subComponent/CropImageModal.js +23 -58
  60. package/datetimePicker/DatePicker.js +103 -217
  61. package/datetimePicker/DatePickerV2.js +116 -221
  62. package/datetimePicker/DatetimePicker.js +27 -48
  63. package/datetimePicker/DatetimePickerV2.js +115 -231
  64. package/datetimePicker/TimeInput.js +9 -22
  65. package/datetimePicker/TimePicker.js +94 -151
  66. package/datetimePicker/TimePickerStyle.js +14 -0
  67. package/datetimePicker/accordion/Month.js +70 -90
  68. package/datetimePicker/accordion/Year.js +91 -135
  69. package/datetimePicker/hooks/index.js +3 -7
  70. package/datetimePicker/hooks/useChangeNumber.js +14 -27
  71. package/datetimePicker/hooks/useDecrease.js +19 -35
  72. package/datetimePicker/hooks/useIncrease.js +19 -35
  73. package/datetimePicker/index.js +13 -13
  74. package/datetimePicker/provider/constant.js +2 -3
  75. package/datetimePicker/subComponent/Accordion.js +108 -158
  76. package/datetimePicker/subComponent/CustomTimeInput.js +18 -48
  77. package/datetimePicker/subComponent/DateTimePickerContext.js +2 -5
  78. package/datetimePicker/utils/GMTDate.js +3 -7
  79. package/datetimePicker/utils/pad.js +2 -6
  80. package/datetimePicker/utils/toUTC0.js +3 -6
  81. package/descriptionList/DescriptionDetail.js +5 -10
  82. package/descriptionList/DescriptionList.js +5 -10
  83. package/descriptionList/DescriptionTerm.js +2 -9
  84. package/descriptionList/index.js +3 -7
  85. package/divider/Divider.js +9 -12
  86. package/divider/index.js +1 -3
  87. package/dropdown/Dropdown.js +28 -65
  88. package/dropdown/DropdownButtonOption.js +2 -9
  89. package/dropdown/DropdownContent.js +33 -64
  90. package/dropdown/DropdownDivOption.js +2 -9
  91. package/dropdown/DropdownItem.js +10 -16
  92. package/dropdown/DropdownLinkOption.js +2 -9
  93. package/dropdown/DropdownToggle.js +18 -38
  94. package/dropdown/index.js +6 -17
  95. package/dropdown/subComponent/DropdownContext.js +2 -5
  96. package/dropzone/FileDropzone.js +148 -302
  97. package/dropzone/ImageDropzone.js +96 -171
  98. package/dropzone/index.js +2 -5
  99. package/dropzone/subComponent/Message.js +7 -14
  100. package/figure/IconFigure.js +9 -16
  101. package/figure/ImageFigure.js +11 -17
  102. package/figure/index.js +2 -5
  103. package/file/HiddenFileInput.js +5 -14
  104. package/file/index.js +1 -3
  105. package/form/Checkbox.js +34 -43
  106. package/form/FormItem.js +2 -9
  107. package/form/Input.js +13 -15
  108. package/form/Label.js +10 -13
  109. package/form/MutedText.js +5 -10
  110. package/form/RadioButton.js +20 -32
  111. package/form/Searchbox.js +21 -65
  112. package/form/Slider.js +14 -0
  113. package/form/SwitchButton.js +34 -39
  114. package/form/Textarea.js +2 -11
  115. package/form/index.js +9 -19
  116. package/grid/Column.js +17 -17
  117. package/grid/Grid.js +13 -14
  118. package/grid/index.js +2 -5
  119. package/heading/Heading1.js +5 -10
  120. package/heading/Heading2.js +9 -12
  121. package/heading/Heading3.js +21 -18
  122. package/heading/index.js +3 -7
  123. package/helmet/Helmet.js +6 -9
  124. package/helmet/index.js +2 -5
  125. package/iconbox/ApplicationIconBox.js +25 -31
  126. package/iconbox/IconBox.js +11 -24
  127. package/iconbox/IconBoxV2.js +14 -26
  128. package/iconbox/index.js +3 -7
  129. package/iconbox/subComponent/IconBoxFigure.js +25 -20
  130. package/iconbox/subComponent/IconBoxImage.js +15 -18
  131. package/image/ImageFluid.js +2 -10
  132. package/image/UploadImage.js +65 -113
  133. package/image/index.js +2 -5
  134. package/index.js +44 -130
  135. package/jsoneditor/JsonEditor.js +10 -32
  136. package/jsoneditor/index.js +1 -3
  137. package/keyframe/Pulse.js +2 -7
  138. package/keyframe/Spin.js +2 -7
  139. package/link/LinkSpan.js +22 -35
  140. package/link/index.js +1 -3
  141. package/map/GoogleMap.js +122 -175
  142. package/map/GoogleReverseGeolocation.js +79 -186
  143. package/map/LeafletMap.js +78 -132
  144. package/map/LeafletReverseGeolocation.js +49 -121
  145. package/map/index.js +4 -9
  146. package/map/subComponent/BasicLeafletMap.js +8 -14
  147. package/map/subComponent/GoogleMapContainer.js +5 -10
  148. package/map/subComponent/GoogleMapPopup.js +66 -123
  149. package/map/subComponent/GoogleMapWrapper.js +13 -32
  150. package/map/subComponent/GoogleMarkerSpiderfier.js +14 -24
  151. package/map/subComponent/LeafletDrawControl.js +47 -84
  152. package/map/subComponent/LeafletMapContainer.js +5 -10
  153. package/map/subComponent/MapSearchBoxControl.js +24 -70
  154. package/modal/StateModal.js +41 -100
  155. package/modal/TitleModal.js +89 -190
  156. package/modal/index.js +2 -5
  157. package/package.json +1 -1
  158. package/paginate/Paginate.js +40 -54
  159. package/paginate/index.js +1 -3
  160. package/popover/Popover.js +39 -87
  161. package/popover/index.js +1 -3
  162. package/qrcode/QRCode.js +10 -23
  163. package/qrcode/QRCodeContainter.js +8 -16
  164. package/qrcode/index.js +2 -5
  165. package/ribbon/Ribbon.js +4 -15
  166. package/ribbon/index.js +1 -3
  167. package/section/Section.js +57 -39
  168. package/section/SectionBody.js +15 -22
  169. package/section/SectionHeader.js +27 -27
  170. package/section/SectionToolbar.js +2 -9
  171. package/section/SectionToolbarItem.js +2 -9
  172. package/section/index.js +5 -11
  173. package/select/InputSelect.js +103 -215
  174. package/select/Select.js +204 -362
  175. package/select/index.js +2 -5
  176. package/select/subComponent/ListBox.js +9 -12
  177. package/select/subComponent/Option.js +8 -16
  178. package/select/subComponent/OptionGroup.js +2 -9
  179. package/select/subComponent/Options.js +5 -11
  180. package/select/subComponent/SearchBox.js +9 -29
  181. package/select/subComponent/SelectedMultiple.js +8 -16
  182. package/select/subComponent/SelectedSingle.js +2 -9
  183. package/styles/GlobalStyle.js +169 -91
  184. package/styles/config/breakpoint.style.js +2 -3
  185. package/styles/config/header.style.js +2 -3
  186. package/styles/config/sidebar.style.js +2 -3
  187. package/styles/index.js +2 -5
  188. package/styles/mixin/backgroundColor.js +17 -14
  189. package/styles/mixin/borderColor.js +17 -14
  190. package/styles/mixin/color.js +17 -14
  191. package/styles/mixin/colorOnBackground.js +17 -14
  192. package/styles/mixin/inputPlaceholder.js +3 -9
  193. package/styles/mixin/media.js +3 -11
  194. package/styles/mixin/rounded.js +13 -12
  195. package/styles/mixin/scrollbar.js +7 -13
  196. package/styles/theme/dark.theme.js +20 -20
  197. package/styles/theme/light.theme.js +20 -20
  198. package/styles/theme/white.theme.js +20 -20
  199. package/styles/themes.js +2 -8
  200. package/table/GridTable.js +105 -143
  201. package/table/ImageBox.js +8 -18
  202. package/table/PermissionTable.js +25 -25
  203. package/table/Table.js +137 -153
  204. package/table/__mock__/columns.js +2 -3
  205. package/table/__mock__/data.js +2 -3
  206. package/table/hooks/index.js +2 -5
  207. package/table/hooks/useCalculateDataRange.js +9 -36
  208. package/table/hooks/useGenerateSort.js +6 -17
  209. package/table/index.js +4 -9
  210. package/table/subComponent/BaseTableHeadCell.js +15 -21
  211. package/table/subComponent/GridTableFooter.js +5 -10
  212. package/table/subComponent/GridTableHeadCell.js +5 -10
  213. package/table/subComponent/Resizer.js +17 -44
  214. package/table/subComponent/TableFooter.js +5 -10
  215. package/table/subComponent/TableFooterInfo.js +2 -9
  216. package/table/subComponent/TableFooterPager.js +5 -12
  217. package/table/subComponent/TableHeadCell.js +2 -9
  218. package/table/subComponent/TableSort.js +13 -19
  219. package/tagify/TagifyStyle.js +14 -0
  220. package/tagify/Tags.js +15 -37
  221. package/tagify/index.js +8 -3
  222. package/text/Paragraph.js +25 -20
  223. package/text/index.js +1 -3
  224. package/timeline/Timeline.js +28 -37
  225. package/timeline/index.js +1 -3
  226. package/toast/CustomToastContainer.js +2 -9
  227. package/toast/MessageContainer.js +9 -18
  228. package/toast/index.js +3 -8
  229. package/toast/show.js +18 -28
  230. package/tooltip/Tooltip.js +48 -97
  231. package/tooltip/index.js +1 -3
  232. package/wizard/Wizard.js +63 -133
  233. package/wizard/index.js +1 -3
@@ -4,221 +4,151 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
11
-
12
9
  var _fi = require("react-icons/fi");
13
-
14
10
  var _md = require("react-icons/md");
15
-
16
11
  var _utils = require("@cashub/utils");
17
-
18
12
  var _HiddenFileInput = _interopRequireDefault(require("../file/HiddenFileInput"));
19
-
20
13
  var _Message = _interopRequireDefault(require("./subComponent/Message"));
21
-
22
14
  var _jsxRuntime = require("react/jsx-runtime");
23
-
24
15
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
29
-
30
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
31
-
32
- 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."); }
33
-
34
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
35
-
36
- function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
37
-
38
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
39
-
40
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
41
-
42
- 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."); }
43
-
44
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
45
-
46
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
47
-
48
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
49
-
50
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
-
52
- var ImageDropzone = function ImageDropzone(_ref) {
53
- var _ref$width = _ref.width,
54
- width = _ref$width === void 0 ? 180 : _ref$width,
55
- _ref$height = _ref.height,
56
- height = _ref$height === void 0 ? 320 : _ref$height,
57
- _ref$fixedSize = _ref.fixedSize,
58
- fixedSize = _ref$fixedSize === void 0 ? true : _ref$fixedSize,
59
- maxFiles = _ref.maxFiles,
60
- message = _ref.message,
61
- accept = _ref.accept,
62
- disabled = _ref.disabled,
63
- onAddedFile = _ref.onAddedFile,
64
- onRemovedFile = _ref.onRemovedFile,
65
- setDropzoneFunc = _ref.setDropzoneFunc,
66
- cropper = _ref.cropper,
67
- onBlur = _ref.onBlur;
68
- var inputRef = (0, _react.useRef)(null);
69
-
70
- var _useState = (0, _react.useState)([]),
71
- _useState2 = _slicedToArray(_useState, 2),
72
- files = _useState2[0],
73
- setFiles = _useState2[1];
74
-
75
- var _useState3 = (0, _react.useState)(false),
76
- _useState4 = _slicedToArray(_useState3, 2),
77
- dragging = _useState4[0],
78
- setDragging = _useState4[1];
79
-
80
- var _useState5 = (0, _react.useState)([]),
81
- _useState6 = _slicedToArray(_useState5, 2),
82
- addedFiles = _useState6[0],
83
- setAddedFiles = _useState6[1];
84
-
85
- var _useState7 = (0, _react.useState)(false),
86
- _useState8 = _slicedToArray(_useState7, 2),
87
- focus = _useState8[0],
88
- setFocus = _useState8[1];
89
-
90
- var handleClick = function handleClick() {
18
+ const ImageDropzone = _ref => {
19
+ let {
20
+ width = 180,
21
+ height = 320,
22
+ fixedSize = true,
23
+ maxFiles,
24
+ message,
25
+ accept,
26
+ disabled,
27
+ onAddedFile,
28
+ onRemovedFile,
29
+ setDropzoneFunc,
30
+ cropper,
31
+ onBlur
32
+ } = _ref;
33
+ const inputRef = (0, _react.useRef)(null);
34
+ const [files, setFiles] = (0, _react.useState)([]);
35
+ const [dragging, setDragging] = (0, _react.useState)(false);
36
+ const [addedFiles, setAddedFiles] = (0, _react.useState)([]);
37
+ const [focus, setFocus] = (0, _react.useState)(false);
38
+ const handleClick = () => {
91
39
  if (disabled || files.length >= maxFiles) return;
92
40
  setFocus(false);
93
41
  inputRef.current.click();
94
42
  };
95
-
96
- var handleDragEnter = function handleDragEnter(event) {
43
+ const handleDragEnter = event => {
97
44
  event.preventDefault();
98
45
  event.stopPropagation();
99
46
  if (!disabled && files.length < maxFiles) setDragging(true);
100
47
  };
101
-
102
- var handleDragOver = function handleDragOver(event) {
48
+ const handleDragOver = event => {
103
49
  event.preventDefault();
104
50
  event.stopPropagation();
105
51
  if (!disabled && files.length < maxFiles) setDragging(true);
106
52
  };
107
-
108
- var handleDragLeave = function handleDragLeave(event) {
53
+ const handleDragLeave = event => {
109
54
  event.preventDefault();
110
55
  event.stopPropagation();
111
56
  setDragging(false);
112
57
  };
113
-
114
- var handleDrop = function handleDrop(event) {
58
+ const handleDrop = event => {
115
59
  event.preventDefault();
116
60
  event.stopPropagation();
117
-
118
61
  if (!disabled && files.length < maxFiles) {
119
62
  setDragging(false);
120
- var dataTransfer = event.dataTransfer;
121
-
122
- var _dataTransfer$files = _toArray(dataTransfer.files),
123
- newFiles = _dataTransfer$files.slice(0);
124
-
63
+ const {
64
+ dataTransfer
65
+ } = event;
66
+ const {
67
+ files: [...newFiles]
68
+ } = dataTransfer;
125
69
  if (files.length + newFiles.length > maxFiles) {
126
70
  newFiles.splice(maxFiles - files.length);
127
71
  }
128
-
129
- for (var index = 0; index < newFiles.length; index += 1) {
72
+ for (let index = 0; index < newFiles.length; index += 1) {
130
73
  newFiles[index].url = URL.createObjectURL(newFiles[index]);
131
74
  }
132
-
133
- setFiles([].concat(_toConsumableArray(files), _toConsumableArray(newFiles)));
75
+ setFiles([...files, ...newFiles]);
134
76
  setAddedFiles(newFiles);
135
77
  }
136
78
  };
137
-
138
- var handleAddFiles = (0, _react.useCallback)(function (newFiles) {
139
- setFiles(function (previous) {
79
+ const handleAddFiles = (0, _react.useCallback)(newFiles => {
80
+ setFiles(previous => {
140
81
  if (previous.length + newFiles.length > maxFiles) {
141
82
  newFiles.splice(maxFiles - previous.length);
142
83
  }
143
-
144
- return [].concat(_toConsumableArray(previous), _toConsumableArray(newFiles));
84
+ return [...previous, ...newFiles];
145
85
  });
146
-
147
- for (var index = 0; index < newFiles.length; index += 1) {
86
+ for (let index = 0; index < newFiles.length; index += 1) {
148
87
  newFiles[index].url = URL.createObjectURL(newFiles[index]);
149
88
  }
150
-
151
89
  setAddedFiles(newFiles);
152
90
  }, [maxFiles]);
153
- var handleRemoveFile = (0, _react.useCallback)(function (event, index) {
91
+ const handleRemoveFile = (0, _react.useCallback)((event, index) => {
154
92
  if (event) {
155
93
  event.stopPropagation();
156
94
  }
157
-
158
- setFiles(function (previous) {
159
- var newFiles = _toConsumableArray(previous);
160
-
95
+ setFiles(previous => {
96
+ const newFiles = [...previous];
161
97
  newFiles.splice(index, 1);
162
98
  return newFiles;
163
99
  });
164
100
  if (onRemovedFile) onRemovedFile(index);
165
101
  }, [onRemovedFile]);
166
- var handleChangeFile = (0, _react.useCallback)(function (event) {
167
- var files = event.target.files;
168
- var newFiles = [];
169
-
170
- for (var index = 0; index < files.length; index += 1) {
102
+ const handleChangeFile = (0, _react.useCallback)(event => {
103
+ const {
104
+ files
105
+ } = event.target;
106
+ const newFiles = [];
107
+ for (let index = 0; index < files.length; index += 1) {
171
108
  newFiles.push(files[index]);
172
109
  }
173
-
174
110
  handleAddFiles(newFiles);
175
111
  inputRef.current.value = '';
176
112
  }, [handleAddFiles]);
177
- var handleCrop = (0, _react.useCallback)(function (event, index, file) {
113
+ const handleCrop = (0, _react.useCallback)((event, index, file) => {
178
114
  event.stopPropagation();
179
115
  setFocus(false);
180
116
  cropper.handler({
181
- file: file,
117
+ file,
182
118
  src: file.url,
183
- width: width,
184
- height: height,
119
+ width,
120
+ height,
185
121
  cropBoxResizable: cropper.cropBoxResizable ? cropper.cropBoxResizable : false,
186
- onCrop: function onCrop(croppedSrc) {
187
- var croppedImageFile = (0, _utils.dataURLtoFile)(croppedSrc, file.name);
122
+ onCrop: croppedSrc => {
123
+ const croppedImageFile = (0, _utils.dataURLtoFile)(croppedSrc, file.name);
188
124
  croppedImageFile.url = croppedSrc;
189
125
  cropper.onCrop(index, croppedImageFile);
190
- setFiles(function (previousFiles) {
191
- var newFiles = _toConsumableArray(previousFiles);
192
-
126
+ setFiles(previousFiles => {
127
+ const newFiles = [...previousFiles];
193
128
  newFiles[index] = croppedImageFile;
194
129
  return newFiles;
195
130
  });
196
131
  }
197
132
  });
198
133
  }, [width, height, cropper]);
199
-
200
- var previewItem = function previewItem() {
201
- return files.map(function (file, index) {
134
+ const previewItem = () => {
135
+ return files.map((file, index) => {
202
136
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Image, {
203
137
  width: width,
204
138
  height: height,
205
139
  fixedSize: fixedSize,
206
- onClick: function onClick(event) {
140
+ onClick: event => {
207
141
  event.stopPropagation();
208
142
  },
209
143
  children: [!disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ButtonGroup, {
210
144
  children: [cropper && /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
211
145
  title: "Crop",
212
- onClick: function onClick(event) {
213
- return handleCrop(event, index, file);
214
- },
146
+ onClick: event => handleCrop(event, index, file),
215
147
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdCrop, {})
216
148
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
217
149
  danger: true,
218
150
  title: "Remove",
219
- onClick: function onClick(event) {
220
- return handleRemoveFile(event, index);
221
- },
151
+ onClick: event => handleRemoveFile(event, index),
222
152
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fi.FiX, {})
223
153
  })]
224
154
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
@@ -229,40 +159,36 @@ var ImageDropzone = function ImageDropzone(_ref) {
229
159
  }, index);
230
160
  });
231
161
  };
232
-
233
- var addFiles = (0, _react.useCallback)(function (files) {
162
+ const addFiles = (0, _react.useCallback)(files => {
234
163
  handleAddFiles(files);
235
164
  }, [handleAddFiles]);
236
- var remove = (0, _react.useCallback)(function (index) {
165
+ const remove = (0, _react.useCallback)(index => {
237
166
  handleRemoveFile(null, index);
238
167
  }, [handleRemoveFile]);
239
-
240
- var handleBlur = function handleBlur() {
168
+ const handleBlur = () => {
241
169
  if (focus) {
242
170
  if (onBlur) {
243
171
  onBlur();
244
172
  }
245
-
246
173
  setFocus(false);
247
174
  }
248
175
  };
249
-
250
- (0, _react.useEffect)(function () {
176
+ (0, _react.useEffect)(() => {
251
177
  if (addedFiles.length > 0 && onAddedFile) {
252
- var startIndex = files.length - addedFiles.length;
253
- addedFiles.forEach(function (file, index) {
178
+ const startIndex = files.length - addedFiles.length;
179
+ addedFiles.forEach((file, index) => {
254
180
  onAddedFile(file, startIndex + index);
255
181
  });
256
182
  setAddedFiles([]);
257
183
  }
258
184
  }, [addedFiles, onAddedFile, files]);
259
- (0, _react.useEffect)(function () {
185
+ (0, _react.useEffect)(() => {
260
186
  setDropzoneFunc({
261
- addFiles: addFiles,
262
- remove: remove
187
+ addFiles,
188
+ remove
263
189
  });
264
190
  }, [setDropzoneFunc, addFiles, remove]);
265
- var messageItem = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Message.default, {
191
+ const messageItem = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Message.default, {
266
192
  dragging: dragging,
267
193
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_fi.FiUpload, {
268
194
  role: "img",
@@ -283,7 +209,7 @@ var ImageDropzone = function ImageDropzone(_ref) {
283
209
  onDrop: handleDrop,
284
210
  reachedLimit: files.length >= maxFiles,
285
211
  onBlur: handleBlur,
286
- onFocus: function onFocus() {
212
+ onFocus: () => {
287
213
  setFocus(true);
288
214
  },
289
215
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HiddenFileInput.default, {
@@ -295,46 +221,45 @@ var ImageDropzone = function ImageDropzone(_ref) {
295
221
  }), files.length === 0 ? messageItem : previewItem()]
296
222
  });
297
223
  };
298
-
299
- var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-height: 200px;\n border: 4px dashed var(--border-color);\n border-radius: var(--border-radius-l);\n color: var(--font-on-background);\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n padding: var(--spacing-xs);\n cursor: pointer;\n\n ", ";\n\n ", ";\n\n ", ";\n\n &:focus {\n border-color: var(--color-primary);\n }\n"])), function (_ref2) {
300
- var reachedLimit = _ref2.reachedLimit;
224
+ const Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-height: 200px;\n border: 4px dashed var(--border-color);\n border-radius: var(--border-radius-l);\n color: var(--font-on-background);\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n padding: var(--spacing-xs);\n cursor: pointer;\n\n ", ";\n\n ", ";\n\n ", ";\n\n &:focus {\n border-color: var(--color-primary);\n }\n"])), _ref2 => {
225
+ let {
226
+ reachedLimit
227
+ } = _ref2;
301
228
  return reachedLimit && 'cursor:default;';
302
- }, function (_ref3) {
303
- var disabled = _ref3.disabled;
229
+ }, _ref3 => {
230
+ let {
231
+ disabled
232
+ } = _ref3;
304
233
  return disabled && 'cursor:not-allowed; opacity: 0.5;';
305
- }, function (_ref4) {
306
- var dragging = _ref4.dragging;
234
+ }, _ref4 => {
235
+ let {
236
+ dragging
237
+ } = _ref4;
307
238
  return dragging && 'border-color: var(--color-primary);';
308
239
  });
309
-
310
- var Image = _styledComponents.default.figure(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n margin: var(--spacing-xs);\n\n ", "\n\n > img {\n width: 100%;\n height: 100%;\n border-radius: var(--border-radius);\n }\n"])), function (_ref5) {
311
- var width = _ref5.width,
312
- height = _ref5.height,
313
- fixedSize = _ref5.fixedSize;
314
-
240
+ const Image = _styledComponents.default.figure(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n margin: var(--spacing-xs);\n\n ", "\n\n > img {\n width: 100%;\n height: 100%;\n border-radius: var(--border-radius);\n }\n"])), _ref5 => {
241
+ let {
242
+ width,
243
+ height,
244
+ fixedSize
245
+ } = _ref5;
315
246
  if (fixedSize) {
316
247
  return "\n width: ".concat(width, "px;\n height: ").concat(height, "px;\n ");
317
248
  }
318
-
319
249
  if (width < height) {
320
250
  return "\n width: ".concat(width, "px;\n max-width: ").concat(width, "px;\n max-height: ").concat(height, "px;\n ");
321
251
  }
322
-
323
252
  if (height < width) {
324
253
  return "\n height: ".concat(height, "px;\n max-width: ").concat(width, "px;\n max-height: ").concat(height, "px;\n ");
325
254
  }
326
255
  });
327
-
328
- var ButtonGroup = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n right: calc(var(--spacing-xs) * -1);\n top: calc(var(--spacing-xs) * -1);\n"])));
329
-
330
- var Button = _styledComponents.default.div.attrs(function () {
331
- return {
332
- role: 'button'
333
- };
334
- })(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n width: 32px;\n height: 32px;\n color: var(--color-white);\n background: var(--color-primary);\n border-radius: var(--border-radius-round);\n cursor: pointer;\n\n > svg {\n color: var(--color-white);\n margin: 0 auto;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n margin: 0 auto;\n display: block;\n }\n\n &:not(:first-child) {\n margin-left: var(--spacing-xs);\n }\n\n ", "\n"])), function (_ref6) {
335
- var danger = _ref6.danger;
256
+ const ButtonGroup = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n right: calc(var(--spacing-xs) * -1);\n top: calc(var(--spacing-xs) * -1);\n"])));
257
+ const Button = _styledComponents.default.div.attrs(() => ({
258
+ role: 'button'
259
+ }))(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n width: 32px;\n height: 32px;\n color: var(--color-white);\n background: var(--color-primary);\n border-radius: var(--border-radius-round);\n cursor: pointer;\n\n > svg {\n color: var(--color-white);\n margin: 0 auto;\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n margin: 0 auto;\n display: block;\n }\n\n &:not(:first-child) {\n margin-left: var(--spacing-xs);\n }\n\n ", "\n"])), _ref6 => {
260
+ let {
261
+ danger
262
+ } = _ref6;
336
263
  return danger && 'background: var(--color-danger);';
337
264
  });
338
-
339
- var _default = ImageDropzone;
340
- exports.default = _default;
265
+ var _default = exports.default = ImageDropzone;
package/dropzone/index.js CHANGED
@@ -5,19 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "FileDropzone", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _FileDropzone.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "ImageDropzone", {
13
13
  enumerable: true,
14
- get: function get() {
14
+ get: function () {
15
15
  return _ImageDropzone.default;
16
16
  }
17
17
  });
18
-
19
18
  var _FileDropzone = _interopRequireDefault(require("./FileDropzone"));
20
-
21
19
  var _ImageDropzone = _interopRequireDefault(require("./ImageDropzone"));
22
-
23
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -4,23 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
-
10
8
  var _templateObject;
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
-
16
- var Message = _styledComponents.default.div.attrs(function () {
17
- return {
18
- 'data-testid': 'message-container'
19
- };
20
- })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: center;\n\n > svg {\n margin-bottom: var(--spacing-s);\n font-size: var(--font-h2);\n }\n\n ", ";\n"])), function (_ref) {
21
- var dragging = _ref.dragging;
11
+ const Message = _styledComponents.default.div.attrs(() => ({
12
+ 'data-testid': 'message-container'
13
+ }))(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: center;\n\n > svg {\n margin-bottom: var(--spacing-s);\n font-size: var(--font-h2);\n }\n\n ", ";\n"])), _ref => {
14
+ let {
15
+ dragging
16
+ } = _ref;
22
17
  return dragging ? 'opacity: 0.5' : '';
23
18
  });
24
-
25
- var _default = Message;
26
- exports.default = _default;
19
+ var _default = exports.default = Message;
@@ -4,37 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
-
10
8
  var _templateObject;
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
-
16
- var IconFigure = _styledComponents.default.figure.attrs(function (_ref) {
17
- var size = _ref.size;
11
+ const IconFigure = _styledComponents.default.figure.attrs(_ref => {
12
+ let {
13
+ size
14
+ } = _ref;
18
15
  return {
19
16
  size: size || 'medium'
20
17
  };
21
- })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref2) {
22
- var size = _ref2.size;
23
-
18
+ })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), _ref2 => {
19
+ let {
20
+ size
21
+ } = _ref2;
24
22
  switch (size) {
25
23
  case 'small':
26
24
  return "\n width: 16px;\n height: 16px;\n ";
27
-
28
25
  case 'medium':
29
26
  return "\n width: 24px;\n height: 24px;\n ";
30
-
31
27
  case 'large':
32
28
  return "\n width: 32px;\n height: 32px;\n ";
33
-
34
29
  default:
35
30
  break;
36
31
  }
37
32
  });
38
-
39
- var _default = IconFigure;
40
- exports.default = _default;
33
+ var _default = exports.default = IconFigure;
@@ -4,28 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
-
10
8
  var _rounded = _interopRequireDefault(require("../styles/mixin/rounded"));
11
-
12
9
  var _templateObject;
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
17
-
18
- var ImageFigure = _styledComponents.default.figure.attrs(function () {
19
- return {
20
- rounded: true
21
- };
22
- })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 160px;\n height: 160px;\n border: 4px dashed var(--border-color);\n padding: var(--spacing-xs);\n margin-left: var(--spacing);\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref) {
23
- var small = _ref.small;
12
+ const ImageFigure = _styledComponents.default.figure.attrs(() => ({
13
+ rounded: true
14
+ }))(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 160px;\n height: 160px;\n border: 4px dashed var(--border-color);\n padding: var(--spacing-xs);\n margin-left: var(--spacing);\n\n ", "\n\n ", "\n\n ", "\n"])), _ref => {
15
+ let {
16
+ small
17
+ } = _ref;
24
18
  return small && "\n width: 40px;\n height: 40px;\n ";
25
- }, _rounded.default, function (_ref2) {
26
- var noBorder = _ref2.noBorder;
19
+ }, _rounded.default, _ref2 => {
20
+ let {
21
+ noBorder
22
+ } = _ref2;
27
23
  return noBorder && 'border: none;';
28
24
  });
29
-
30
- var _default = ImageFigure;
31
- exports.default = _default;
25
+ var _default = exports.default = ImageFigure;
package/figure/index.js CHANGED
@@ -5,19 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "IconFigure", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _IconFigure.default;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "ImageFigure", {
13
13
  enumerable: true,
14
- get: function get() {
14
+ get: function () {
15
15
  return _ImageFigure.default;
16
16
  }
17
17
  });
18
-
19
18
  var _IconFigure = _interopRequireDefault(require("./IconFigure"));
20
-
21
19
  var _ImageFigure = _interopRequireDefault(require("./ImageFigure"));
22
-
23
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -4,21 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
-
10
8
  var _templateObject;
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
-
16
- var HiddenFileInput = _styledComponents.default.input.attrs(function () {
17
- return {
18
- 'data-testid': 'hiddenFileInput',
19
- type: 'file'
20
- };
21
- })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n"])));
22
-
23
- var _default = HiddenFileInput;
24
- exports.default = _default;
11
+ const HiddenFileInput = _styledComponents.default.input.attrs(() => ({
12
+ 'data-testid': 'hiddenFileInput',
13
+ type: 'file'
14
+ }))(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n"])));
15
+ var _default = exports.default = HiddenFileInput;
package/file/index.js CHANGED
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  Object.defineProperty(exports, "HiddenFileInput", {
7
7
  enumerable: true,
8
- get: function get() {
8
+ get: function () {
9
9
  return _HiddenFileInput.default;
10
10
  }
11
11
  });
12
-
13
12
  var _HiddenFileInput = _interopRequireDefault(require("./HiddenFileInput"));
14
-
15
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }