@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,22 @@
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 FormItem = _styledComponents.default.div`
10
+ margin-bottom: var(--spacing);
11
+
12
+ ${_ref => {
13
+ let {
14
+ alignCenter
15
+ } = _ref;
16
+ return alignCenter && `
17
+ display: flex;
18
+ align-items: center;
19
+ `;
20
+ }}
21
+ `;
22
+ var _default = exports.default = FormItem;
package/form/Input.js ADDED
@@ -0,0 +1,66 @@
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 _inputPlaceholder = _interopRequireDefault(require("../styles/mixin/inputPlaceholder"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const Input = _styledComponents.default.input`
11
+ display: block;
12
+ width: 100%;
13
+ height: 36px;
14
+ border: var(--border-width) solid var(--border-color);
15
+ padding: 10px var(--spacing-s);
16
+ border-radius: var(--border-radius-l);
17
+ background: transparent;
18
+ color: var(--font-on-background);
19
+ transition: 0.3s;
20
+ overflow: hidden;
21
+ white-space: nowrap;
22
+ text-overflow: ellipsis;
23
+
24
+ &:focus {
25
+ border: var(--border-width) solid var(--color-primary);
26
+ outline: none;
27
+ }
28
+
29
+ &:disabled {
30
+ cursor: not-allowed;
31
+ opacity: 0.5;
32
+ }
33
+
34
+ ${(0, _inputPlaceholder.default)`
35
+ color: var(--font-on-mute);
36
+ `}
37
+
38
+ ${_ref => {
39
+ let {
40
+ hidden
41
+ } = _ref;
42
+ return hidden && 'display: none;';
43
+ }}
44
+
45
+ ${_ref2 => {
46
+ let {
47
+ borderRadiusS
48
+ } = _ref2;
49
+ return borderRadiusS && 'border-radius: var(--border-radius-s);';
50
+ }}
51
+
52
+ ${_ref3 => {
53
+ let {
54
+ alignCenter
55
+ } = _ref3;
56
+ return alignCenter && 'text-align: center;';
57
+ }}
58
+
59
+ ${_ref4 => {
60
+ let {
61
+ autoWidth
62
+ } = _ref4;
63
+ return autoWidth && 'width: auto;';
64
+ }};
65
+ `;
66
+ var _default = exports.default = Input;
package/form/Label.js ADDED
@@ -0,0 +1,61 @@
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 Label = _styledComponents.default.label`
10
+ display: inline-block;
11
+ color: var(--font-on-background);
12
+ font-size: var(--font-body1);
13
+ word-break: break-word;
14
+ white-space: pre-wrap;
15
+ margin-bottom: var(--spacing-xs);
16
+
17
+ ${_ref => {
18
+ let {
19
+ required
20
+ } = _ref;
21
+ return required && `&:after {
22
+ content: ' *';
23
+ color: var(--color-danger);
24
+ }
25
+ `;
26
+ }}
27
+
28
+ ${_ref2 => {
29
+ let {
30
+ noMarginBottom
31
+ } = _ref2;
32
+ return noMarginBottom && 'margin-bottom: 0;';
33
+ }}
34
+
35
+ ${_ref3 => {
36
+ let {
37
+ noBreakWord
38
+ } = _ref3;
39
+ return noBreakWord && 'word-break: keep-all;';
40
+ }}
41
+
42
+ /* use float to make element align to right */
43
+ /* use text-align to make all text(multiple line) align to right */
44
+ ${_ref4 => {
45
+ let {
46
+ alignRight
47
+ } = _ref4;
48
+ return alignRight && `
49
+ text-align: right;
50
+ float: right;
51
+ `;
52
+ }}
53
+
54
+ ${_ref5 => {
55
+ let {
56
+ disabled
57
+ } = _ref5;
58
+ return disabled && 'opacity: 0.5;';
59
+ }}
60
+ `;
61
+ var _default = exports.default = Label;
@@ -0,0 +1,21 @@
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 MutedText = _styledComponents.default.span`
10
+ display: block;
11
+ font-size: var(--font-caption);
12
+ color: var(--font-on-mute);
13
+ text-align: ${_ref => {
14
+ let {
15
+ alignRight
16
+ } = _ref;
17
+ return alignRight ? 'right' : 'left';
18
+ }};
19
+ margin-top: var(--spacing-xs);
20
+ `;
21
+ var _default = exports.default = MutedText;
@@ -0,0 +1,47 @@
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 _Input = _interopRequireDefault(require("./Input"));
10
+ var _button = require("../button");
11
+ var _bi = require("react-icons/bi");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const PasswordInput = _ref => {
15
+ let {
16
+ ...props
17
+ } = _ref;
18
+ const [type, setType] = (0, _react.useState)('password');
19
+ const toggleType = () => {
20
+ setType(type === 'password' ? 'text' : 'password');
21
+ };
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
23
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
24
+ ...props,
25
+ type: type
26
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_button.IconButton, {
27
+ size: "small",
28
+ onClick: toggleType,
29
+ children: [type === 'password' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bi.BiHide, {}), type === 'text' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bi.BiShow, {})]
30
+ })]
31
+ });
32
+ };
33
+ const Container = _styledComponents.default.div`
34
+ position: relative;
35
+
36
+ ${_Input.default} {
37
+ padding-right: 40px;
38
+ }
39
+
40
+ ${_button.IconButton} {
41
+ position: absolute;
42
+ top: 50%;
43
+ transform: translateY(-50%);
44
+ right: 0.5rem;
45
+ }
46
+ `;
47
+ var _default = exports.default = PasswordInput;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ var _Input = _interopRequireDefault(require("./Input"));
9
+ var _Label = _interopRequireDefault(require("./Label"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ 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); }
13
+ 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; }
14
+ const RadioButton = _ref => {
15
+ let {
16
+ htmlFor,
17
+ value,
18
+ text,
19
+ disabled,
20
+ checked,
21
+ onChange,
22
+ noMarginBottom
23
+ } = _ref;
24
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledLabel, {
25
+ htmlFor: htmlFor,
26
+ disabled: disabled,
27
+ noMarginBottom: noMarginBottom,
28
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCheckbox, {
29
+ onChange: () => {
30
+ onChange(value);
31
+ },
32
+ checked: checked,
33
+ type: "checkbox",
34
+ id: htmlFor,
35
+ disabled: disabled
36
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
37
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Unchecked, {}), text]
38
+ })]
39
+ });
40
+ };
41
+ const StyledCheckbox = (0, _styledComponents.default)(_Input.default)`
42
+ display: none;
43
+
44
+ &:checked + span {
45
+ > div {
46
+ &:before {
47
+ display: block;
48
+ }
49
+ }
50
+ }
51
+ `;
52
+ const StyledLabel = (0, _styledComponents.default)(_Label.default)`
53
+ margin-right: var(--spacing-xs);
54
+
55
+ > span {
56
+ ${_ref2 => {
57
+ let {
58
+ disabled
59
+ } = _ref2;
60
+ return disabled && (0, _styledComponents.css)`
61
+ opacity: 0.5;
62
+ `;
63
+ }}
64
+ display: flex;
65
+ align-items: center;
66
+
67
+ > div {
68
+ margin-right: var(--spacing-xs);
69
+ border-radius: var(--border-radius-round);
70
+
71
+ width: 24px;
72
+ height: 24px;
73
+
74
+ &:before {
75
+ display: none;
76
+ }
77
+ }
78
+ }
79
+
80
+ ${_ref3 => {
81
+ let {
82
+ noMarginBottom
83
+ } = _ref3;
84
+ return noMarginBottom && 'margin-bottom: 0;';
85
+ }}
86
+ `;
87
+ const Unchecked = _styledComponents.default.div`
88
+ border: var(--border-width) solid var(--border-color);
89
+ position: relative;
90
+
91
+ &:before {
92
+ content: '';
93
+ background: var(--color-primary);
94
+ width: 16px;
95
+ height: 16px;
96
+ position: absolute;
97
+ border-radius: var(--border-radius-round);
98
+ top: 50%;
99
+ left: 50%;
100
+ transform: translate(-50%, -50%);
101
+ }
102
+ `;
103
+ var _default = exports.default = RadioButton;
@@ -0,0 +1,181 @@
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 _fa = require("react-icons/fa");
9
+ var _react = require("react");
10
+ var _Checkbox = _interopRequireDefault(require("./Checkbox"));
11
+ var _md = require("react-icons/md");
12
+ var _inputPlaceholder = _interopRequireDefault(require("../styles/mixin/inputPlaceholder"));
13
+ var _scrollbar = _interopRequireDefault(require("../styles/mixin/scrollbar"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+ const SearchSelect = _ref => {
17
+ let {
18
+ keyword,
19
+ onSearch,
20
+ onSearchReset,
21
+ onToggleOptions,
22
+ options,
23
+ placeholder = 'Search',
24
+ setKeyword,
25
+ status = 'idle'
26
+ } = _ref;
27
+ const containerRef = (0, _react.useRef)();
28
+ const [showDropdown, setShowDropdown] = (0, _react.useState)(false);
29
+ const [dropdownWidth, setDropdownWidth] = (0, _react.useState)(0);
30
+ const handleSearch = event => {
31
+ if (event) {
32
+ onSearch(event.target.value);
33
+ setKeyword(event.target.value);
34
+ } else {
35
+ onSearch(keyword);
36
+ }
37
+ };
38
+ const handleSearchReset = () => {
39
+ setKeyword('');
40
+ onSearchReset();
41
+ };
42
+
43
+ // close dropdown when click outside of the component
44
+ (0, _react.useEffect)(() => {
45
+ if (!containerRef.current || !showDropdown) return;
46
+ const handleClick = event => {
47
+ if (!containerRef.current?.contains(event.target)) {
48
+ setShowDropdown(false);
49
+ }
50
+ };
51
+ document.addEventListener('click', handleClick);
52
+ return () => document.removeEventListener('click', handleClick);
53
+ }, [showDropdown]);
54
+
55
+ // close dropdown when no options
56
+ (0, _react.useEffect)(() => {
57
+ setShowDropdown(options.length > 0);
58
+ }, [options.length]);
59
+
60
+ // align container width to dropdown
61
+ (0, _react.useEffect)(() => {
62
+ if (!containerRef.current) return;
63
+ const observer = new ResizeObserver(entries => {
64
+ const newWidth = entries[0].contentRect.width;
65
+ setDropdownWidth(newWidth);
66
+ });
67
+ observer.observe(containerRef.current);
68
+ return () => observer.disconnect();
69
+ }, []);
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
71
+ ref: containerRef,
72
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(InputWrapper, {
73
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaSearch, {
74
+ onClick: () => {
75
+ if (keyword.trim()) {
76
+ handleSearch();
77
+ }
78
+ }
79
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Input, {
80
+ type: "text",
81
+ placeholder: placeholder,
82
+ onChange: handleSearch,
83
+ onFocus: () => setShowDropdown(options.length > 0),
84
+ value: keyword
85
+ }), onSearchReset && /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdClose, {
86
+ onClick: handleSearchReset,
87
+ style: {
88
+ visibility: status === 'empty' ? 'visible' : 'hidden'
89
+ }
90
+ })]
91
+ }), (showDropdown || status === 'empty') && /*#__PURE__*/(0, _jsxRuntime.jsxs)(Dropdown, {
92
+ style: {
93
+ width: dropdownWidth
94
+ },
95
+ children: [onSearchReset && status === 'empty' && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
96
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, {
97
+ children: "Data Not Found"
98
+ })
99
+ }), status !== 'empty' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
100
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(OptionList, {
101
+ children: options.map((option, index) => {
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
103
+ onClick: () => onToggleOptions(index),
104
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, {
105
+ checked: option.checked,
106
+ htmlFor: option.text,
107
+ noMargin: true,
108
+ onChange: () => onToggleOptions(index),
109
+ text: option.text
110
+ })
111
+ }, index);
112
+ })
113
+ })
114
+ })]
115
+ })]
116
+ });
117
+ };
118
+ const Container = _styledComponents.default.div`
119
+ position: relative;
120
+ min-width: 160px;
121
+ max-width: 320px;
122
+ `;
123
+ const InputWrapper = _styledComponents.default.div`
124
+ display: flex;
125
+ align-items: center;
126
+ height: 36px;
127
+ background: var(--color-background2);
128
+ border-radius: var(--border-radius-l);
129
+ padding: var(--spacing-s);
130
+ margin: 0;
131
+ gap: var(--spacing-xs);
132
+
133
+ > svg {
134
+ color: var(--font-on-mute);
135
+ }
136
+ `;
137
+ const Input = _styledComponents.default.input`
138
+ background: transparent;
139
+ border: none;
140
+ font-size: var(--font-body1);
141
+ color: var(--font-on-background);
142
+ outline: none;
143
+ flex:1;
144
+ min-width: 0;
145
+
146
+ ${(0, _inputPlaceholder.default)`
147
+ color: var(--font-on-mute);
148
+ `}
149
+ `;
150
+ const Dropdown = _styledComponents.default.div`
151
+ position: absolute;
152
+ inset: 44px auto auto 0px;
153
+ background: var(--color-background1);
154
+ color: var(--font-on-background);
155
+ border: var(--border-width) solid var(--border-color);
156
+ border-radius: var(--border-radius);
157
+ box-shadow: var(--box-shadow);
158
+ z-index: 1;
159
+ padding: var(--spacing-xs) 0;
160
+ overflow-y: auto;
161
+ max-height: min(320px, ((50vh - 36px) - 20px) - 36px);
162
+ ${_scrollbar.default}
163
+ `;
164
+ const OptionList = _styledComponents.default.div``;
165
+ const Option = _styledComponents.default.div`
166
+ padding: 12px var(--spacing-s);
167
+ cursor: pointer;
168
+
169
+ &:hover {
170
+ background: var(--color-hover);
171
+ }
172
+ `;
173
+ const MessageWrapper = _styledComponents.default.div`
174
+ width: 100%;
175
+ text-align: center;
176
+ `;
177
+ const Message = _styledComponents.default.p`
178
+ margin: 0;
179
+ padding: 12px var(--spacing-s);
180
+ `;
181
+ var _default = exports.default = SearchSelect;
@@ -0,0 +1,98 @@
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 _fa = require("react-icons/fa");
10
+ var _md = require("react-icons/md");
11
+ var _inputPlaceholder = _interopRequireDefault(require("../styles/mixin/inputPlaceholder"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const Searchbox = _ref => {
15
+ let {
16
+ onSearch,
17
+ autoFocus = false,
18
+ ...props
19
+ } = _ref;
20
+ const [keyword, setKeyword] = (0, _react.useState)('');
21
+ const handleSearch = keyword => {
22
+ if (onSearch) onSearch(keyword);
23
+ };
24
+ const handleKeyup = event => {
25
+ if (event.keyCode === 108 || event.keyCode === 13) {
26
+ handleSearch(keyword);
27
+ }
28
+ };
29
+ const handleClear = () => {
30
+ setKeyword('');
31
+ handleSearch('');
32
+ };
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
34
+ ...props,
35
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaSearch, {
36
+ onClick: () => {
37
+ handleSearch(keyword);
38
+ },
39
+ role: "button",
40
+ "aria-label": "search button"
41
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Input, {
42
+ type: "text",
43
+ placeholder: "Search",
44
+ autocomplete: "false",
45
+ value: keyword,
46
+ onChange: event => setKeyword(event.target.value),
47
+ onKeyUp: handleKeyup,
48
+ autoFocus: autoFocus
49
+ }), keyword && /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdClose, {
50
+ onClick: handleClear,
51
+ role: "button",
52
+ "aria-label": "clear button"
53
+ })]
54
+ });
55
+ };
56
+ const Wrapper = _styledComponents.default.div`
57
+ display: flex;
58
+ align-items: center;
59
+ position: relative;
60
+ height: 36px;
61
+ background: var(--color-background1);
62
+ border-radius: var(--border-radius-l);
63
+ padding: 0 calc(var(--spacing-s) + var(--font-body1) + var(--spacing-xs)) 0
64
+ var(--spacing-s);
65
+
66
+ > svg {
67
+ font-size: var(--font-body1);
68
+ color: var(--font-on-mute);
69
+
70
+ &:first-child {
71
+ margin-right: var(--spacing-xs);
72
+ }
73
+
74
+ &:last-child {
75
+ position: absolute;
76
+ right: var(--spacing-s);
77
+ }
78
+ }
79
+
80
+ ${_ref2 => {
81
+ let {
82
+ border
83
+ } = _ref2;
84
+ return border && 'border: var(--border-width) solid var(--border-color);';
85
+ }}
86
+ `;
87
+ const Input = _styledComponents.default.input`
88
+ background: transparent;
89
+ border: none;
90
+ font-size: var(--font-body1);
91
+ color: var(--font-on-background);
92
+ outline: none;
93
+
94
+ ${(0, _inputPlaceholder.default)`
95
+ color: var(--font-on-mute);
96
+ `}
97
+ `;
98
+ var _default = exports.default = Searchbox;
package/form/Slider.js ADDED
@@ -0,0 +1,46 @@
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 _jsxRuntime = require("react/jsx-runtime");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const Slider = props => {
11
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(RangeInput, {
12
+ ...props
13
+ });
14
+ };
15
+ const RangeInput = _styledComponents.default.input.attrs(() => ({
16
+ type: 'range'
17
+ }))`
18
+ appearance: none;
19
+ width: 100%;
20
+ height: 8px;
21
+ border-radius: var(--border-radius);
22
+ background: var(--color-grey);
23
+
24
+ ${_ref => {
25
+ let {
26
+ autoWidth
27
+ } = _ref;
28
+ return autoWidth && 'width: auto;';
29
+ }};
30
+
31
+ &::-webkit-slider-thumb {
32
+ -webkit-appearance: none;
33
+ width: 16px;
34
+ height: 16px;
35
+ border-radius: var(--border-radius-round);
36
+ background: var(--color-primary);
37
+ }
38
+
39
+ &::-moz-range-thumb {
40
+ width: 16px;
41
+ height: 16px;
42
+ border-radius: var(--border-radius-round);
43
+ background: var(--color-primary);
44
+ }
45
+ `;
46
+ var _default = exports.default = Slider;