@cashub/ui-elv 1.0.0

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 (304) hide show
  1. package/Tab/Tab.js +28 -0
  2. package/Tab/TabList.js +167 -0
  3. package/Tab/TabPanel.js +49 -0
  4. package/Tab/TabTab.js +105 -0
  5. package/Tab/index.js +30 -0
  6. package/Tab/subComponent/TabContext.js +9 -0
  7. package/Tab/subComponent/TabListV2.js +25 -0
  8. package/Tab/subComponent/TabPanelV2.js +52 -0
  9. package/Tab/subComponent/TabTabV2.js +63 -0
  10. package/VerticalTab/TabList.js +27 -0
  11. package/VerticalTab/TabPanel.js +52 -0
  12. package/VerticalTab/TabTab.js +70 -0
  13. package/VerticalTab/VerticalTab.js +41 -0
  14. package/VerticalTab/index.js +16 -0
  15. package/VerticalTab/subComponent/TabContext.js +9 -0
  16. package/alert/Alert.js +29 -0
  17. package/alert/index.js +13 -0
  18. package/animate/Collapse.js +71 -0
  19. package/animate/Loader.js +58 -0
  20. package/animate/NumberCounter.js +51 -0
  21. package/animate/PulseRing.js +35 -0
  22. package/animate/Spinner.js +18 -0
  23. package/animate/index.js +41 -0
  24. package/assets/css/autocomplete.css +16 -0
  25. package/assets/css/font.css +4 -0
  26. package/assets/css/global.css +2 -0
  27. package/assets/font/helvetica/Helvetica.ttf +0 -0
  28. package/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
  29. package/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
  30. package/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
  31. package/assets/icons/app-management.png +0 -0
  32. package/assets/icons/burger-black.png +0 -0
  33. package/assets/icons/burger-white.png +0 -0
  34. package/assets/icons/burger.png +0 -0
  35. package/assets/icons/file.svg +1 -0
  36. package/assets/icons/map_icon1.png +0 -0
  37. package/assets/icons/map_icon4.png +0 -0
  38. package/assets/images/bg-aside.png +0 -0
  39. package/assets/images/bg-chart-circle.png +0 -0
  40. package/assets/images/bg-chart-triangle.png +0 -0
  41. package/assets/images/cashub-logo-only.png +0 -0
  42. package/assets/images/default-user.jpg +0 -0
  43. package/assets/images/logo-cashub.png +0 -0
  44. package/assets/images/map.png +0 -0
  45. package/assets/images/qrcode.png +0 -0
  46. package/backdrop/BaseBackdrop.js +18 -0
  47. package/backdrop/LoadingBackdrop.js +17 -0
  48. package/backdrop/ModalBackdrop.js +15 -0
  49. package/backdrop/index.js +27 -0
  50. package/badge/Badge.js +26 -0
  51. package/badge/BadgeDot.js +18 -0
  52. package/badge/BadgeFill.js +49 -0
  53. package/badge/BadgeFillTriangle.js +147 -0
  54. package/badge/BadgeWithText.js +31 -0
  55. package/badge/index.js +41 -0
  56. package/billing/BarChart.js +51 -0
  57. package/billing/Grid.js +45 -0
  58. package/billing/Header2.js +25 -0
  59. package/billing/Header3.js +37 -0
  60. package/billing/Paragraph.js +33 -0
  61. package/billing/ParagraphGroup.js +22 -0
  62. package/billing/ParagraphText.js +26 -0
  63. package/billing/Section.js +50 -0
  64. package/billing/SectionBody.js +17 -0
  65. package/billing/SectionHeader.js +26 -0
  66. package/billing/__stories__/BarChart.stories.js_bak +46 -0
  67. package/billing/__stories__/Grid.stories.js_bak +57 -0
  68. package/billing/__stories__/Header2.stories.js_bak +62 -0
  69. package/billing/__stories__/Header3.stories.js_bak +69 -0
  70. package/billing/__stories__/Paragraph.stories.js_bak +84 -0
  71. package/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
  72. package/billing/__stories__/ParagraphText.stories.js_bak +64 -0
  73. package/billing/__stories__/Section.stories.js_bak +115 -0
  74. package/billing/__stories__/SectionBody.stories.js_bak +62 -0
  75. package/billing/__stories__/SectionHeader.stories.js-bak +68 -0
  76. package/breadcrumb/Breadcrumb.js +78 -0
  77. package/breadcrumb/index.js +13 -0
  78. package/button/Button.js +154 -0
  79. package/button/ButtonGroup.js +61 -0
  80. package/button/IconButton.js +72 -0
  81. package/button/ScrollToTopButton.js +54 -0
  82. package/button/index.js +34 -0
  83. package/callout/Callout.js +52 -0
  84. package/callout/index.js +13 -0
  85. package/chart/BarChart.js +148 -0
  86. package/chart/DoughnutChart.js +118 -0
  87. package/chart/LineChart.js +146 -0
  88. package/chart/SingleBarChart.js +42 -0
  89. package/chart/index.js +52 -0
  90. package/chart/utils/centerTextPlugin.js +62 -0
  91. package/chart/utils/customTooltip.js +94 -0
  92. package/chart/utils/htmlLegendPlugin.js +89 -0
  93. package/chart/utils/index.js +27 -0
  94. package/chart/utils/padEmptyChartBar.js +53 -0
  95. package/chart/utils/yAxisTopTitlePlugin.js +49 -0
  96. package/container/FlexContainer.js +40 -0
  97. package/container/index.js +13 -0
  98. package/cropper/Cropper.js +54 -0
  99. package/cropper/CropperModalHandler.js +41 -0
  100. package/cropper/index.js +20 -0
  101. package/cropper/subComponent/CropImageModal.js +79 -0
  102. package/datetimePicker/DatePicker.js +363 -0
  103. package/datetimePicker/DatePickerV2.js +407 -0
  104. package/datetimePicker/DatetimePicker.js +240 -0
  105. package/datetimePicker/DatetimePickerV2.js +395 -0
  106. package/datetimePicker/DatetimePickerV3.js +279 -0
  107. package/datetimePicker/TimeInput.js +56 -0
  108. package/datetimePicker/TimePicker.js +317 -0
  109. package/datetimePicker/TimePickerStyle.js +64 -0
  110. package/datetimePicker/TimePickerV2.js +208 -0
  111. package/datetimePicker/accordion/Month.js +254 -0
  112. package/datetimePicker/accordion/Year.js +284 -0
  113. package/datetimePicker/hooks/index.js +27 -0
  114. package/datetimePicker/hooks/useChangeNumber.js +42 -0
  115. package/datetimePicker/hooks/useDecrease.js +38 -0
  116. package/datetimePicker/hooks/useIncrease.js +38 -0
  117. package/datetimePicker/index.js +69 -0
  118. package/datetimePicker/provider/constant.js +43 -0
  119. package/datetimePicker/subComponent/Accordion.js +373 -0
  120. package/datetimePicker/subComponent/CustomTimeInput.js +47 -0
  121. package/datetimePicker/subComponent/DateTimePickerContext.js +9 -0
  122. package/datetimePicker/utils/GMTDate.js +15 -0
  123. package/datetimePicker/utils/pad.js +13 -0
  124. package/datetimePicker/utils/toUTC0.js +13 -0
  125. package/descriptionList/DescriptionDetail.js +28 -0
  126. package/descriptionList/DescriptionList.js +25 -0
  127. package/descriptionList/DescriptionTerm.js +14 -0
  128. package/descriptionList/index.js +27 -0
  129. package/divider/Divider.js +31 -0
  130. package/divider/index.js +13 -0
  131. package/dropdown/Dropdown.js +55 -0
  132. package/dropdown/DropdownButtonOption.js +43 -0
  133. package/dropdown/DropdownContent.js +90 -0
  134. package/dropdown/DropdownDivOption.js +26 -0
  135. package/dropdown/DropdownItem.js +26 -0
  136. package/dropdown/DropdownLinkOption.js +24 -0
  137. package/dropdown/DropdownToggle.js +38 -0
  138. package/dropdown/index.js +42 -0
  139. package/dropdown/subComponent/DropdownContext.js +9 -0
  140. package/dropzone/FileDropzone.js +479 -0
  141. package/dropzone/ImageDropzone.js +334 -0
  142. package/dropzone/index.js +20 -0
  143. package/dropzone/subComponent/Message.js +26 -0
  144. package/figure/IconFigure.js +42 -0
  145. package/figure/ImageFigure.js +38 -0
  146. package/figure/index.js +20 -0
  147. package/file/HiddenFileInput.js +15 -0
  148. package/file/index.js +13 -0
  149. package/form/Checkbox.js +166 -0
  150. package/form/Fieldset.js +18 -0
  151. package/form/FormItem.js +22 -0
  152. package/form/Input.js +66 -0
  153. package/form/Label.js +61 -0
  154. package/form/MutedText.js +21 -0
  155. package/form/PasswordInput.js +47 -0
  156. package/form/RadioButton.js +103 -0
  157. package/form/SearchSelect.js +181 -0
  158. package/form/Searchbox.js +98 -0
  159. package/form/Slider.js +46 -0
  160. package/form/SwitchButton.js +105 -0
  161. package/form/Textarea.js +41 -0
  162. package/form/TreeView.js +73 -0
  163. package/form/index.js +104 -0
  164. package/grid/Column.js +46 -0
  165. package/grid/Grid.js +35 -0
  166. package/grid/index.js +20 -0
  167. package/heading/Heading1.js +21 -0
  168. package/heading/Heading2.js +28 -0
  169. package/heading/Heading3.js +49 -0
  170. package/heading/index.js +27 -0
  171. package/helmet/Helmet.js +23 -0
  172. package/helmet/index.js +20 -0
  173. package/iconbox/ApplicationIconBox.js +81 -0
  174. package/iconbox/IconBox.js +67 -0
  175. package/iconbox/IconBoxV2.js +72 -0
  176. package/iconbox/index.js +27 -0
  177. package/iconbox/subComponent/IconBoxFigure.js +50 -0
  178. package/iconbox/subComponent/IconBoxImage.js +42 -0
  179. package/image/ImageFluid.js +17 -0
  180. package/image/UploadImage.js +250 -0
  181. package/image/index.js +20 -0
  182. package/index.js +568 -0
  183. package/jsoneditor/JsonEditor.js +142 -0
  184. package/jsoneditor/index.js +13 -0
  185. package/keyframe/Pulse.js +21 -0
  186. package/keyframe/Spin.js +13 -0
  187. package/layout/Aside.js +48 -0
  188. package/layout/AsideHeader.jsx +27 -0
  189. package/layout/Backdrop.js +23 -0
  190. package/layout/Container.js +39 -0
  191. package/layout/Footer.js +45 -0
  192. package/layout/Header.jsx +55 -0
  193. package/layout/Layout.jsx +84 -0
  194. package/layout/Logo.jsx +17 -0
  195. package/layout/MenuIcon.jsx +27 -0
  196. package/layout/Sidebar.jsx +271 -0
  197. package/layout/index.js +13 -0
  198. package/link/LinkSpan.js +69 -0
  199. package/link/index.js +13 -0
  200. package/map/GoogleMap.js +448 -0
  201. package/map/GoogleReverseGeolocation.js +200 -0
  202. package/map/LeafletMap.js +231 -0
  203. package/map/LeafletReverseGeolocation.js +101 -0
  204. package/map/index.js +34 -0
  205. package/map/subComponent/BasicLeafletMap.js +34 -0
  206. package/map/subComponent/GoogleMapContainer.js +29 -0
  207. package/map/subComponent/GoogleMapPopup.js +109 -0
  208. package/map/subComponent/GoogleMapWrapper.js +40 -0
  209. package/map/subComponent/LeafletDrawControl.js +127 -0
  210. package/map/subComponent/LeafletMapContainer.js +173 -0
  211. package/map/subComponent/MapSearchBoxControl.js +54 -0
  212. package/modal/StateModal.js +178 -0
  213. package/modal/TitleModal.js +250 -0
  214. package/modal/index.js +20 -0
  215. package/package.json +54 -0
  216. package/page/Disclaimer.js +128 -0
  217. package/page/index.js +13 -0
  218. package/paginate/Paginate.js +137 -0
  219. package/paginate/index.js +13 -0
  220. package/popover/Popover.js +91 -0
  221. package/popover/index.js +13 -0
  222. package/qrcode/QRCode.js +58 -0
  223. package/qrcode/QRCodeContainter.js +34 -0
  224. package/qrcode/index.js +20 -0
  225. package/ribbon/Ribbon.js +42 -0
  226. package/ribbon/index.js +13 -0
  227. package/section/Section.js +133 -0
  228. package/section/SectionBody.js +52 -0
  229. package/section/SectionHeader.js +70 -0
  230. package/section/SectionToolbar.js +18 -0
  231. package/section/SectionToolbarItem.js +17 -0
  232. package/section/index.js +41 -0
  233. package/select/InputSelect.js +270 -0
  234. package/select/Select.js +818 -0
  235. package/select/index.js +20 -0
  236. package/select/subComponent/Checkbox.js +48 -0
  237. package/select/subComponent/Footer.js +13 -0
  238. package/select/subComponent/ListBox.js +30 -0
  239. package/select/subComponent/Option.js +45 -0
  240. package/select/subComponent/OptionGroup.js +23 -0
  241. package/select/subComponent/Options.js +32 -0
  242. package/select/subComponent/SearchBox.js +58 -0
  243. package/select/subComponent/SelectedMultipleCount.js +39 -0
  244. package/select/subComponent/SelectedMultipleTags.js +54 -0
  245. package/select/subComponent/SelectedMultipleText.js +70 -0
  246. package/select/subComponent/SelectedSingle.js +17 -0
  247. package/styles/GlobalStyle.js +334 -0
  248. package/styles/config/breakpoint.style.js +13 -0
  249. package/styles/config/header.style.js +10 -0
  250. package/styles/config/sidebar.style.js +17 -0
  251. package/styles/index.js +20 -0
  252. package/styles/mixin/backgroundColor.js +44 -0
  253. package/styles/mixin/borderColor.js +37 -0
  254. package/styles/mixin/color.js +37 -0
  255. package/styles/mixin/colorOnBackground.js +37 -0
  256. package/styles/mixin/inputPlaceholder.js +30 -0
  257. package/styles/mixin/media.js +21 -0
  258. package/styles/mixin/rounded.js +30 -0
  259. package/styles/mixin/scrollbar.js +32 -0
  260. package/styles/theme/dark.theme.js +97 -0
  261. package/styles/theme/light.theme.js +97 -0
  262. package/styles/theme/white.theme.js +97 -0
  263. package/styles/themes.js +16 -0
  264. package/table/GridTable.js +336 -0
  265. package/table/ImageBox.js +45 -0
  266. package/table/InfiniteGridTable.js +403 -0
  267. package/table/PermissionTable.js +64 -0
  268. package/table/SimpleGridTable.js +143 -0
  269. package/table/Table.js +568 -0
  270. package/table/__mock__/columns.js +70 -0
  271. package/table/__mock__/data.js +536 -0
  272. package/table/hooks/index.js +20 -0
  273. package/table/hooks/useCalculateDataRange.js +28 -0
  274. package/table/hooks/useGenerateSort.js +39 -0
  275. package/table/index.js +48 -0
  276. package/table/subComponent/BaseTableHeadCell.js +62 -0
  277. package/table/subComponent/GridTableFooter.js +24 -0
  278. package/table/subComponent/GridTableHeadCell.js +20 -0
  279. package/table/subComponent/Resizer.js +77 -0
  280. package/table/subComponent/TableFooter.js +31 -0
  281. package/table/subComponent/TableFooterInfo.js +13 -0
  282. package/table/subComponent/TableFooterPager.js +33 -0
  283. package/table/subComponent/TableHeadCell.js +19 -0
  284. package/table/subComponent/TableSort.js +38 -0
  285. package/tagify/TagifyStyle.js +60 -0
  286. package/tagify/Tags.js +56 -0
  287. package/tagify/index.js +27 -0
  288. package/tagify/templates/getCreateButtonTemplate.js +18 -0
  289. package/text/Paragraph.js +86 -0
  290. package/text/index.js +13 -0
  291. package/timeline/Timeline.js +139 -0
  292. package/timeline/index.js +13 -0
  293. package/toast/CustomToastContainer.js +45 -0
  294. package/toast/MessageContainer.js +51 -0
  295. package/toast/index.js +36 -0
  296. package/toast/show.js +39 -0
  297. package/toast/style.css +1 -0
  298. package/tooltip/Tooltip.js +140 -0
  299. package/tooltip/index.js +13 -0
  300. package/treeView/TreeViewV2.js +38 -0
  301. package/treeView/TreeflexStyle.js +49 -0
  302. package/treeView/index.js +20 -0
  303. package/wizard/Wizard.js +251 -0
  304. package/wizard/index.js +13 -0
@@ -0,0 +1,334 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ var _fi = require("react-icons/fi");
10
+ var _md = require("react-icons/md");
11
+ var _utils = require("@cashub/utils");
12
+ var _HiddenFileInput = _interopRequireDefault(require("../file/HiddenFileInput"));
13
+ var _Message = _interopRequireDefault(require("./subComponent/Message"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const ImageDropzone = _ref => {
17
+ let {
18
+ width = 180,
19
+ height = 320,
20
+ fixedSize = true,
21
+ maxFiles,
22
+ message,
23
+ accept,
24
+ disabled,
25
+ onAddedFile,
26
+ onRemovedFile,
27
+ setDropzoneFunc,
28
+ cropper,
29
+ onBlur
30
+ } = _ref;
31
+ const inputRef = (0, _react.useRef)(null);
32
+ const [files, setFiles] = (0, _react.useState)([]);
33
+ const [dragging, setDragging] = (0, _react.useState)(false);
34
+ const [addedFiles, setAddedFiles] = (0, _react.useState)([]);
35
+ const [focus, setFocus] = (0, _react.useState)(false);
36
+ const handleClick = () => {
37
+ if (disabled || files.length >= maxFiles) return;
38
+ setFocus(false);
39
+ inputRef.current.click();
40
+ };
41
+ const handleDragEnter = event => {
42
+ event.preventDefault();
43
+ event.stopPropagation();
44
+ if (!disabled && files.length < maxFiles) setDragging(true);
45
+ };
46
+ const handleDragOver = event => {
47
+ event.preventDefault();
48
+ event.stopPropagation();
49
+ if (!disabled && files.length < maxFiles) setDragging(true);
50
+ };
51
+ const handleDragLeave = event => {
52
+ event.preventDefault();
53
+ event.stopPropagation();
54
+ setDragging(false);
55
+ };
56
+ const handleDrop = event => {
57
+ event.preventDefault();
58
+ event.stopPropagation();
59
+ if (!disabled && files.length < maxFiles) {
60
+ setDragging(false);
61
+ const {
62
+ dataTransfer
63
+ } = event;
64
+ const {
65
+ files: [...newFiles]
66
+ } = dataTransfer;
67
+ if (files.length + newFiles.length > maxFiles) {
68
+ newFiles.splice(maxFiles - files.length);
69
+ }
70
+ for (let index = 0; index < newFiles.length; index += 1) {
71
+ newFiles[index].url = URL.createObjectURL(newFiles[index]);
72
+ }
73
+ setFiles([...files, ...newFiles]);
74
+ setAddedFiles(newFiles);
75
+ }
76
+ };
77
+ const handleAddFiles = (0, _react.useCallback)(newFiles => {
78
+ setFiles(previous => {
79
+ if (previous.length + newFiles.length > maxFiles) {
80
+ newFiles.splice(maxFiles - previous.length);
81
+ }
82
+ return [...previous, ...newFiles];
83
+ });
84
+ for (let index = 0; index < newFiles.length; index += 1) {
85
+ newFiles[index].url = URL.createObjectURL(newFiles[index]);
86
+ }
87
+ setAddedFiles(newFiles);
88
+ }, [maxFiles]);
89
+ const handleRemoveFile = (0, _react.useCallback)((event, index) => {
90
+ if (event) {
91
+ event.stopPropagation();
92
+ }
93
+ setFiles(previous => {
94
+ const newFiles = [...previous];
95
+ newFiles.splice(index, 1);
96
+ return newFiles;
97
+ });
98
+ if (onRemovedFile) onRemovedFile(index);
99
+ }, [onRemovedFile]);
100
+ const handleChangeFile = (0, _react.useCallback)(event => {
101
+ const {
102
+ files
103
+ } = event.target;
104
+ const newFiles = [];
105
+ for (let index = 0; index < files.length; index += 1) {
106
+ newFiles.push(files[index]);
107
+ }
108
+ handleAddFiles(newFiles);
109
+ inputRef.current.value = '';
110
+ }, [handleAddFiles]);
111
+ const handleCrop = (0, _react.useCallback)((event, index, file) => {
112
+ event.stopPropagation();
113
+ setFocus(false);
114
+ cropper.handler({
115
+ file,
116
+ src: file.url,
117
+ width,
118
+ height,
119
+ cropBoxResizable: cropper.cropBoxResizable ? cropper.cropBoxResizable : false,
120
+ onCrop: croppedSrc => {
121
+ const croppedImageFile = (0, _utils.dataURLtoFile)(croppedSrc, file.name);
122
+ croppedImageFile.url = croppedSrc;
123
+ cropper.onCrop(index, croppedImageFile);
124
+ setFiles(previousFiles => {
125
+ const newFiles = [...previousFiles];
126
+ newFiles[index] = croppedImageFile;
127
+ return newFiles;
128
+ });
129
+ }
130
+ });
131
+ }, [width, height, cropper]);
132
+ const previewItem = () => {
133
+ return files.map((file, index) => {
134
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Image, {
135
+ width: width,
136
+ height: height,
137
+ fixedSize: fixedSize,
138
+ onClick: event => {
139
+ event.stopPropagation();
140
+ },
141
+ children: [!disabled && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ButtonGroup, {
142
+ children: [cropper && /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
143
+ title: "Crop",
144
+ onClick: event => handleCrop(event, index, file),
145
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdCrop, {})
146
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Button, {
147
+ danger: true,
148
+ title: "Remove",
149
+ onClick: event => handleRemoveFile(event, index),
150
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fi.FiX, {})
151
+ })]
152
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
153
+ crossOrigin: "anonymous",
154
+ src: file.url,
155
+ alt: file.name
156
+ })]
157
+ }, index);
158
+ });
159
+ };
160
+ const addFiles = (0, _react.useCallback)(files => {
161
+ handleAddFiles(files);
162
+ }, [handleAddFiles]);
163
+ const remove = (0, _react.useCallback)(index => {
164
+ handleRemoveFile(null, index);
165
+ }, [handleRemoveFile]);
166
+ const handleBlur = () => {
167
+ if (focus) {
168
+ if (onBlur) {
169
+ onBlur();
170
+ }
171
+ setFocus(false);
172
+ }
173
+ };
174
+ (0, _react.useEffect)(() => {
175
+ if (addedFiles.length > 0 && onAddedFile) {
176
+ const startIndex = files.length - addedFiles.length;
177
+ addedFiles.forEach((file, index) => {
178
+ onAddedFile(file, startIndex + index);
179
+ });
180
+ setAddedFiles([]);
181
+ }
182
+ }, [addedFiles, onAddedFile, files]);
183
+ (0, _react.useEffect)(() => {
184
+ setDropzoneFunc({
185
+ addFiles,
186
+ remove
187
+ });
188
+ }, [setDropzoneFunc, addFiles, remove]);
189
+ const messageItem = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Message.default, {
190
+ dragging: dragging,
191
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_fi.FiUpload, {
192
+ role: "img",
193
+ "aria-hidden": "true",
194
+ "data-icon": "upload"
195
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
196
+ children: message
197
+ })]
198
+ });
199
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
200
+ tabIndex: "-1",
201
+ disabled: disabled,
202
+ dragging: dragging,
203
+ onClick: handleClick,
204
+ onDragEnter: handleDragEnter,
205
+ onDragLeave: handleDragLeave,
206
+ onDragOver: handleDragOver,
207
+ onDrop: handleDrop,
208
+ reachedLimit: files.length >= maxFiles,
209
+ onBlur: handleBlur,
210
+ onFocus: () => {
211
+ setFocus(true);
212
+ },
213
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HiddenFileInput.default, {
214
+ disabled: disabled,
215
+ multiple: true,
216
+ ref: inputRef,
217
+ accept: accept,
218
+ onChange: handleChangeFile
219
+ }), files.length === 0 ? messageItem : previewItem()]
220
+ });
221
+ };
222
+ const Wrapper = _styledComponents.default.div`
223
+ min-height: 200px;
224
+ border: 4px dashed var(--border-color);
225
+ border-radius: var(--border-radius-l);
226
+ color: var(--font-on-background);
227
+ display: flex;
228
+ flex-wrap: wrap;
229
+ justify-content: center;
230
+ align-items: center;
231
+ padding: var(--spacing-xs);
232
+ cursor: pointer;
233
+
234
+ ${_ref2 => {
235
+ let {
236
+ reachedLimit
237
+ } = _ref2;
238
+ return reachedLimit && 'cursor:default;';
239
+ }};
240
+
241
+ ${_ref3 => {
242
+ let {
243
+ disabled
244
+ } = _ref3;
245
+ return disabled && 'cursor:not-allowed; opacity: 0.5;';
246
+ }};
247
+
248
+ ${_ref4 => {
249
+ let {
250
+ dragging
251
+ } = _ref4;
252
+ return dragging && 'border-color: var(--color-primary);';
253
+ }};
254
+
255
+ &:focus {
256
+ border-color: var(--color-primary);
257
+ }
258
+ `;
259
+ const Image = _styledComponents.default.figure`
260
+ position: relative;
261
+ margin: var(--spacing-xs);
262
+
263
+ ${_ref5 => {
264
+ let {
265
+ width,
266
+ height,
267
+ fixedSize
268
+ } = _ref5;
269
+ if (fixedSize) {
270
+ return `
271
+ width: ${width}px;
272
+ height: ${height}px;
273
+ `;
274
+ }
275
+ if (width < height) {
276
+ return `
277
+ width: ${width}px;
278
+ max-width: ${width}px;
279
+ max-height: ${height}px;
280
+ `;
281
+ }
282
+ if (height < width) {
283
+ return `
284
+ height: ${height}px;
285
+ max-width: ${width}px;
286
+ max-height: ${height}px;
287
+ `;
288
+ }
289
+ }}
290
+
291
+ > img {
292
+ width: 100%;
293
+ height: 100%;
294
+ border-radius: var(--border-radius);
295
+ }
296
+ `;
297
+ const ButtonGroup = _styledComponents.default.div`
298
+ position: absolute;
299
+ right: calc(var(--spacing-xs) * -1);
300
+ top: calc(var(--spacing-xs) * -1);
301
+ `;
302
+ const Button = _styledComponents.default.div.attrs(() => ({
303
+ role: 'button'
304
+ }))`
305
+ display: inline-block;
306
+ width: 32px;
307
+ height: 32px;
308
+ color: var(--color-white);
309
+ background: var(--color-primary);
310
+ border-radius: var(--border-radius-round);
311
+ cursor: pointer;
312
+
313
+ > svg {
314
+ color: var(--color-white);
315
+ margin: 0 auto;
316
+ position: relative;
317
+ top: 50%;
318
+ transform: translateY(-50%);
319
+ margin: 0 auto;
320
+ display: block;
321
+ }
322
+
323
+ &:not(:first-child) {
324
+ margin-left: var(--spacing-xs);
325
+ }
326
+
327
+ ${_ref6 => {
328
+ let {
329
+ danger
330
+ } = _ref6;
331
+ return danger && 'background: var(--color-danger);';
332
+ }}
333
+ `;
334
+ var _default = exports.default = ImageDropzone;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "FileDropzone", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _FileDropzone.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ImageDropzone", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _ImageDropzone.default;
16
+ }
17
+ });
18
+ var _FileDropzone = _interopRequireDefault(require("./FileDropzone"));
19
+ var _ImageDropzone = _interopRequireDefault(require("./ImageDropzone"));
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const Message = _styledComponents.default.div.attrs(() => ({
10
+ 'data-testid': 'message-container'
11
+ }))`
12
+ text-align: center;
13
+
14
+ > svg {
15
+ margin-bottom: var(--spacing-s);
16
+ font-size: var(--font-h2);
17
+ }
18
+
19
+ ${_ref => {
20
+ let {
21
+ dragging
22
+ } = _ref;
23
+ return dragging ? 'opacity: 0.5' : '';
24
+ }};
25
+ `;
26
+ var _default = exports.default = Message;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const IconFigure = _styledComponents.default.figure.attrs(_ref => {
10
+ let {
11
+ size
12
+ } = _ref;
13
+ return {
14
+ size: size || 'medium'
15
+ };
16
+ })`
17
+ ${_ref2 => {
18
+ let {
19
+ size
20
+ } = _ref2;
21
+ switch (size) {
22
+ case 'small':
23
+ return `
24
+ width: 16px;
25
+ height: 16px;
26
+ `;
27
+ case 'medium':
28
+ return `
29
+ width: 24px;
30
+ height: 24px;
31
+ `;
32
+ case 'large':
33
+ return `
34
+ width: 32px;
35
+ height: 32px;
36
+ `;
37
+ default:
38
+ break;
39
+ }
40
+ }}
41
+ `;
42
+ var _default = exports.default = IconFigure;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _rounded = _interopRequireDefault(require("../styles/mixin/rounded"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const ImageFigure = _styledComponents.default.figure.attrs(() => ({
11
+ rounded: true
12
+ }))`
13
+ width: 160px;
14
+ height: 160px;
15
+ border: 4px dashed var(--border-color);
16
+ padding: var(--spacing-xs);
17
+ margin-left: var(--spacing);
18
+
19
+ ${_ref => {
20
+ let {
21
+ small
22
+ } = _ref;
23
+ return small && `
24
+ width: 40px;
25
+ height: 40px;
26
+ `;
27
+ }}
28
+
29
+ ${_rounded.default}
30
+
31
+ ${_ref2 => {
32
+ let {
33
+ noBorder
34
+ } = _ref2;
35
+ return noBorder && 'border: none;';
36
+ }}
37
+ `;
38
+ var _default = exports.default = ImageFigure;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "IconFigure", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _IconFigure.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ImageFigure", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _ImageFigure.default;
16
+ }
17
+ });
18
+ var _IconFigure = _interopRequireDefault(require("./IconFigure"));
19
+ var _ImageFigure = _interopRequireDefault(require("./ImageFigure"));
20
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const HiddenFileInput = _styledComponents.default.input.attrs(() => ({
10
+ 'data-testid': 'hiddenFileInput',
11
+ type: 'file'
12
+ }))`
13
+ display: none;
14
+ `;
15
+ var _default = exports.default = HiddenFileInput;
package/file/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "HiddenFileInput", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _HiddenFileInput.default;
10
+ }
11
+ });
12
+ var _HiddenFileInput = _interopRequireDefault(require("./HiddenFileInput"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+ var _Input = _interopRequireDefault(require("./Input"));
10
+ var _Label = _interopRequireDefault(require("./Label"));
11
+ var _md = require("react-icons/md");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ const Checkbox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
17
+ let {
18
+ htmlFor,
19
+ text,
20
+ disabled,
21
+ checked,
22
+ indeterminate,
23
+ onChange,
24
+ noMargin,
25
+ fontSizeBig,
26
+ marginRight,
27
+ variant = 'square'
28
+ } = _ref;
29
+ const inputRef = (0, _react.useRef)(null);
30
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledLabel, {
31
+ htmlFor: htmlFor,
32
+ disabled: disabled,
33
+ ref: ref,
34
+ noMargin: noMargin,
35
+ fontSizeBig: fontSizeBig,
36
+ marginRight: marginRight,
37
+ variant: variant,
38
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCheckbox, {
39
+ ref: inputRef,
40
+ checked: checked,
41
+ "aria-checked": indeterminate ? 'mixed' : checked,
42
+ type: "checkbox",
43
+ id: htmlFor,
44
+ disabled: disabled,
45
+ onChange: onChange,
46
+ fontSizeBig: fontSizeBig
47
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
48
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Unchecked, {
49
+ variant: variant
50
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Checked, {
51
+ variant: variant,
52
+ children: indeterminate ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdRemove, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdDone, {})
53
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Text, {
54
+ children: text
55
+ })]
56
+ })]
57
+ });
58
+ });
59
+ const StyledCheckbox = (0, _styledComponents.default)(_Input.default)`
60
+ display: none;
61
+
62
+ &:checked + span {
63
+ > div:last-of-type {
64
+ display: block;
65
+ color: var(--color-primary);
66
+ }
67
+
68
+ > div:first-of-type {
69
+ display: none;
70
+ }
71
+ }
72
+ `;
73
+ const StyledLabel = (0, _styledComponents.default)(_Label.default)`
74
+ display: inline-block;
75
+ cursor: pointer;
76
+ vertical-align: middle;
77
+
78
+ ${_ref2 => {
79
+ let {
80
+ marginRight
81
+ } = _ref2;
82
+ return marginRight && (0, _styledComponents.css)`
83
+ margin-right: var(--spacing-l);
84
+ `;
85
+ }}
86
+
87
+ > span {
88
+ ${_ref3 => {
89
+ let {
90
+ disabled
91
+ } = _ref3;
92
+ return disabled && (0, _styledComponents.css)`
93
+ opacity: 0.5;
94
+ cursor: not-allowed;
95
+ `;
96
+ }}
97
+
98
+ display: flex;
99
+ align-items: center;
100
+
101
+ > div {
102
+ margin-right: var(--spacing-xs);
103
+ width: 24px;
104
+ height: 24px;
105
+ border-radius: ${_ref4 => {
106
+ let {
107
+ variant
108
+ } = _ref4;
109
+ return variant === 'circle' ? '50%' : '4px';
110
+ }};
111
+ }
112
+
113
+ > div:last-of-type {
114
+ display: none;
115
+ }
116
+ }
117
+
118
+ ${_ref5 => {
119
+ let {
120
+ fontSizeBig
121
+ } = _ref5;
122
+ return fontSizeBig && 'font-size: var(--font-h3);';
123
+ }}
124
+
125
+ ${_ref6 => {
126
+ let {
127
+ noMargin
128
+ } = _ref6;
129
+ return noMargin && 'margin: 0;';
130
+ }}
131
+ `;
132
+ const Unchecked = _styledComponents.default.div`
133
+ flex: 0 0 auto;
134
+ border: var(--border-width) solid var(--border-color);
135
+ border-radius: ${_ref7 => {
136
+ let {
137
+ variant
138
+ } = _ref7;
139
+ return variant === 'circle' ? '50%' : '4px';
140
+ }};
141
+ `;
142
+ const Checked = _styledComponents.default.div`
143
+ flex: 0 0 auto;
144
+ border: var(--border-width) solid var(--color-primary);
145
+ background: var(--color-primary);
146
+ position: relative;
147
+ border-radius: ${_ref8 => {
148
+ let {
149
+ variant
150
+ } = _ref8;
151
+ return variant === 'circle' ? '50%' : '4px';
152
+ }};
153
+
154
+ > svg {
155
+ position: absolute;
156
+ color: var(--font-on-primary);
157
+ font-size: var(--font-h3);
158
+ top: 50%;
159
+ left: 50%;
160
+ transform: translate(-50%, -50%);
161
+ }
162
+ `;
163
+ const Text = _styledComponents.default.p`
164
+ word-break: break-all;
165
+ `;
166
+ var _default = exports.default = Checkbox;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ const Fieldset = _styledComponents.default.fieldset`
10
+ border: var(--border-width) solid var(--border-color);
11
+ border-radius: var(--border-radius-s);
12
+ padding: var(--spacing-s);
13
+
14
+ &[disabled] {
15
+ border-color: var(--border-color-transparent);
16
+ }
17
+ `;
18
+ var _default = exports.default = Fieldset;