@cashub/ui-elv 1.0.2 → 1.0.3

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 (309) hide show
  1. package/datetimePicker/index.js +2 -37
  2. package/esm/Tab/Tab.js +21 -0
  3. package/esm/Tab/TabList.js +160 -0
  4. package/esm/Tab/TabPanel.js +42 -0
  5. package/esm/Tab/TabTab.js +98 -0
  6. package/esm/Tab/index.js +23 -0
  7. package/esm/Tab/subComponent/TabContext.js +3 -0
  8. package/esm/Tab/subComponent/TabListV2.js +18 -0
  9. package/esm/Tab/subComponent/TabPanelV2.js +45 -0
  10. package/esm/Tab/subComponent/TabTabV2.js +56 -0
  11. package/esm/VerticalTab/TabList.js +20 -0
  12. package/esm/VerticalTab/TabPanel.js +45 -0
  13. package/esm/VerticalTab/TabTab.js +63 -0
  14. package/esm/VerticalTab/VerticalTab.js +34 -0
  15. package/esm/VerticalTab/index.js +9 -0
  16. package/esm/VerticalTab/subComponent/TabContext.js +3 -0
  17. package/esm/alert/Alert.js +22 -0
  18. package/esm/alert/index.js +1 -0
  19. package/esm/animate/Collapse.js +65 -0
  20. package/esm/animate/Loader.js +51 -0
  21. package/esm/animate/NumberCounter.js +45 -0
  22. package/esm/animate/PulseRing.js +26 -0
  23. package/esm/animate/Spinner.js +11 -0
  24. package/esm/animate/index.js +5 -0
  25. package/esm/assets/css/autocomplete.css +16 -0
  26. package/esm/assets/css/font.css +4 -0
  27. package/esm/assets/css/global.css +2 -0
  28. package/esm/assets/font/helvetica/Helvetica.ttf +0 -0
  29. package/esm/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
  30. package/esm/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
  31. package/esm/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
  32. package/esm/assets/icons/app-management.png +0 -0
  33. package/esm/assets/icons/burger-black.png +0 -0
  34. package/esm/assets/icons/burger-white.png +0 -0
  35. package/esm/assets/icons/burger.png +0 -0
  36. package/esm/assets/icons/file.svg +1 -0
  37. package/esm/assets/icons/map_icon1.png +0 -0
  38. package/esm/assets/icons/map_icon4.png +0 -0
  39. package/esm/assets/images/bg-aside.png +0 -0
  40. package/esm/assets/images/bg-chart-circle.png +0 -0
  41. package/esm/assets/images/bg-chart-triangle.png +0 -0
  42. package/esm/assets/images/cashub-logo-only.png +0 -0
  43. package/esm/assets/images/default-user.jpg +0 -0
  44. package/esm/assets/images/logo-cashub.png +0 -0
  45. package/esm/assets/images/map.png +0 -0
  46. package/esm/assets/images/qrcode.png +0 -0
  47. package/esm/backdrop/BaseBackdrop.js +11 -0
  48. package/esm/backdrop/LoadingBackdrop.js +10 -0
  49. package/esm/backdrop/ModalBackdrop.js +8 -0
  50. package/esm/backdrop/index.js +3 -0
  51. package/esm/badge/Badge.js +19 -0
  52. package/esm/badge/BadgeDot.js +11 -0
  53. package/esm/badge/BadgeFill.js +42 -0
  54. package/esm/badge/BadgeFillTriangle.js +138 -0
  55. package/esm/badge/BadgeWithText.js +24 -0
  56. package/esm/badge/index.js +5 -0
  57. package/esm/billing/BarChart.js +45 -0
  58. package/esm/billing/Grid.js +38 -0
  59. package/esm/billing/Header2.js +19 -0
  60. package/esm/billing/Header3.js +31 -0
  61. package/esm/billing/Paragraph.js +27 -0
  62. package/esm/billing/ParagraphGroup.js +16 -0
  63. package/esm/billing/ParagraphText.js +20 -0
  64. package/esm/billing/Section.js +44 -0
  65. package/esm/billing/SectionBody.js +11 -0
  66. package/esm/billing/SectionHeader.js +20 -0
  67. package/esm/billing/__stories__/BarChart.stories.js_bak +46 -0
  68. package/esm/billing/__stories__/Grid.stories.js_bak +57 -0
  69. package/esm/billing/__stories__/Header2.stories.js_bak +62 -0
  70. package/esm/billing/__stories__/Header3.stories.js_bak +69 -0
  71. package/esm/billing/__stories__/Paragraph.stories.js_bak +84 -0
  72. package/esm/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
  73. package/esm/billing/__stories__/ParagraphText.stories.js_bak +64 -0
  74. package/esm/billing/__stories__/Section.stories.js_bak +115 -0
  75. package/esm/billing/__stories__/SectionBody.stories.js_bak +62 -0
  76. package/esm/billing/__stories__/SectionHeader.stories.js-bak +68 -0
  77. package/esm/breadcrumb/Breadcrumb.js +71 -0
  78. package/esm/breadcrumb/index.js +1 -0
  79. package/esm/button/Button.js +145 -0
  80. package/esm/button/ButtonGroup.js +54 -0
  81. package/esm/button/IconButton.js +64 -0
  82. package/esm/button/ScrollToTopButton.js +47 -0
  83. package/esm/button/index.js +4 -0
  84. package/esm/callout/Callout.js +45 -0
  85. package/esm/callout/index.js +1 -0
  86. package/esm/chart/BarChart.js +147 -0
  87. package/esm/chart/DoughnutChart.js +110 -0
  88. package/esm/chart/LineChart.js +140 -0
  89. package/esm/chart/SingleBarChart.js +35 -0
  90. package/esm/chart/index.js +5 -0
  91. package/esm/chart/utils/centerTextPlugin.js +56 -0
  92. package/esm/chart/utils/customTooltip.js +84 -0
  93. package/esm/chart/utils/customTooltipLifecyclePlugin.js +16 -0
  94. package/esm/chart/utils/htmlLegendPlugin.js +83 -0
  95. package/esm/chart/utils/index.js +3 -0
  96. package/esm/chart/utils/padEmptyChartBar.js +47 -0
  97. package/esm/chart/utils/tooltipElement.js +17 -0
  98. package/esm/chart/utils/xAxisLabelTooltipPlugin.js +101 -0
  99. package/esm/chart/utils/yAxisTopTitlePlugin.js +43 -0
  100. package/esm/container/FlexContainer.js +33 -0
  101. package/esm/container/index.js +1 -0
  102. package/esm/cropper/Cropper.js +47 -0
  103. package/esm/cropper/CropperModalHandler.js +34 -0
  104. package/esm/cropper/index.js +2 -0
  105. package/esm/cropper/subComponent/CropImageModal.js +72 -0
  106. package/{datetimePicker/DatetimePicker.js → esm/datetimePicker/DatetimePickerV3.js} +63 -31
  107. package/esm/datetimePicker/TimeInput.js +49 -0
  108. package/esm/datetimePicker/TimePickerStyle.js +58 -0
  109. package/esm/datetimePicker/TimePickerV2.js +199 -0
  110. package/esm/datetimePicker/accordion/Month.js +245 -0
  111. package/esm/datetimePicker/accordion/Year.js +275 -0
  112. package/esm/datetimePicker/index.js +4 -0
  113. package/esm/datetimePicker/provider/constant.js +38 -0
  114. package/esm/datetimePicker/subComponent/DateTimePickerContext.js +3 -0
  115. package/esm/datetimePicker/utils/GMTDate.js +9 -0
  116. package/esm/datetimePicker/utils/pad.js +7 -0
  117. package/esm/datetimePicker/utils/toUTC0.js +7 -0
  118. package/esm/descriptionList/DescriptionDetail.js +21 -0
  119. package/esm/descriptionList/DescriptionList.js +18 -0
  120. package/esm/descriptionList/DescriptionTerm.js +7 -0
  121. package/esm/descriptionList/index.js +3 -0
  122. package/esm/divider/Divider.js +24 -0
  123. package/esm/divider/index.js +1 -0
  124. package/esm/dropdown/Dropdown.js +48 -0
  125. package/esm/dropdown/DropdownButtonOption.js +36 -0
  126. package/esm/dropdown/DropdownContent.js +83 -0
  127. package/esm/dropdown/DropdownDivOption.js +19 -0
  128. package/esm/dropdown/DropdownItem.js +19 -0
  129. package/esm/dropdown/DropdownLinkOption.js +17 -0
  130. package/esm/dropdown/DropdownToggle.js +31 -0
  131. package/esm/dropdown/index.js +11 -0
  132. package/esm/dropdown/subComponent/DropdownContext.js +3 -0
  133. package/esm/dropzone/FileDropzone.js +472 -0
  134. package/esm/dropzone/ImageDropzone.js +327 -0
  135. package/esm/dropzone/index.js +2 -0
  136. package/esm/dropzone/subComponent/Message.js +19 -0
  137. package/esm/figure/IconFigure.js +35 -0
  138. package/esm/figure/ImageFigure.js +31 -0
  139. package/esm/figure/index.js +2 -0
  140. package/esm/file/HiddenFileInput.js +8 -0
  141. package/esm/file/index.js +1 -0
  142. package/esm/form/Checkbox.js +157 -0
  143. package/esm/form/Fieldset.js +11 -0
  144. package/esm/form/FormItem.js +15 -0
  145. package/esm/form/Input.js +59 -0
  146. package/esm/form/Label.js +54 -0
  147. package/esm/form/MutedText.js +14 -0
  148. package/esm/form/PasswordInput.js +40 -0
  149. package/esm/form/RadioButton.js +94 -0
  150. package/esm/form/SearchSelect.js +174 -0
  151. package/esm/form/Searchbox.js +91 -0
  152. package/esm/form/Slider.js +39 -0
  153. package/esm/form/SwitchButton.js +97 -0
  154. package/esm/form/Textarea.js +34 -0
  155. package/esm/form/TreeView.js +66 -0
  156. package/esm/form/index.js +14 -0
  157. package/esm/grid/Column.js +39 -0
  158. package/esm/grid/Grid.js +28 -0
  159. package/esm/grid/index.js +2 -0
  160. package/esm/heading/Heading1.js +14 -0
  161. package/esm/heading/Heading2.js +21 -0
  162. package/esm/heading/Heading3.js +42 -0
  163. package/esm/heading/index.js +3 -0
  164. package/esm/helmet/Helmet.js +17 -0
  165. package/esm/helmet/index.js +2 -0
  166. package/esm/iconbox/ApplicationIconBox.js +74 -0
  167. package/esm/iconbox/IconBox.js +60 -0
  168. package/esm/iconbox/IconBoxV2.js +63 -0
  169. package/esm/iconbox/index.js +3 -0
  170. package/esm/iconbox/subComponent/IconBoxFigure.js +43 -0
  171. package/esm/iconbox/subComponent/IconBoxImage.js +35 -0
  172. package/esm/image/ImageFluid.js +10 -0
  173. package/esm/image/UploadImage.js +243 -0
  174. package/esm/image/index.js +2 -0
  175. package/esm/index.js +47 -0
  176. package/esm/keyframe/Pulse.js +15 -0
  177. package/esm/keyframe/Spin.js +7 -0
  178. package/esm/layout/Aside.js +39 -0
  179. package/esm/layout/AsideHeader.jsx +27 -0
  180. package/esm/layout/Backdrop.js +16 -0
  181. package/esm/layout/Container.js +30 -0
  182. package/esm/layout/Footer.js +36 -0
  183. package/esm/layout/Header.jsx +55 -0
  184. package/esm/layout/Layout.jsx +84 -0
  185. package/esm/layout/Logo.jsx +17 -0
  186. package/esm/layout/MenuIcon.jsx +27 -0
  187. package/esm/layout/Sidebar.jsx +271 -0
  188. package/esm/layout/index.js +1 -0
  189. package/esm/link/LinkSpan.js +62 -0
  190. package/esm/link/index.js +1 -0
  191. package/esm/map/GoogleMap.js +439 -0
  192. package/esm/map/GoogleReverseGeolocation.js +193 -0
  193. package/esm/map/LeafletMap.js +224 -0
  194. package/esm/map/LeafletReverseGeolocation.js +94 -0
  195. package/esm/map/index.js +4 -0
  196. package/esm/map/subComponent/BasicLeafletMap.js +27 -0
  197. package/esm/map/subComponent/GoogleMapContainer.js +22 -0
  198. package/esm/map/subComponent/GoogleMapPopup.js +103 -0
  199. package/esm/map/subComponent/GoogleMapWrapper.js +34 -0
  200. package/esm/map/subComponent/LeafletDrawControl.js +116 -0
  201. package/esm/map/subComponent/LeafletMapContainer.js +166 -0
  202. package/esm/map/subComponent/MapSearchBoxControl.js +47 -0
  203. package/esm/modal/StateModal.js +169 -0
  204. package/esm/modal/TitleModal.js +241 -0
  205. package/esm/modal/index.js +2 -0
  206. package/esm/page/Disclaimer.js +121 -0
  207. package/esm/page/index.js +1 -0
  208. package/esm/paginate/Paginate.js +129 -0
  209. package/esm/paginate/index.js +1 -0
  210. package/esm/popover/Popover.js +82 -0
  211. package/esm/popover/index.js +1 -0
  212. package/esm/qrcode/QRCode.js +51 -0
  213. package/esm/qrcode/QRCodeContainter.js +27 -0
  214. package/esm/qrcode/index.js +2 -0
  215. package/esm/ribbon/Ribbon.js +35 -0
  216. package/esm/ribbon/index.js +1 -0
  217. package/esm/section/Section.js +126 -0
  218. package/esm/section/SectionBody.js +43 -0
  219. package/esm/section/SectionHeader.js +61 -0
  220. package/esm/section/SectionToolbar.js +11 -0
  221. package/esm/section/SectionToolbarItem.js +10 -0
  222. package/esm/section/index.js +5 -0
  223. package/esm/select/InputSelect.js +263 -0
  224. package/esm/select/Select.js +811 -0
  225. package/esm/select/index.js +2 -0
  226. package/esm/select/subComponent/Checkbox.js +40 -0
  227. package/esm/select/subComponent/Footer.js +6 -0
  228. package/esm/select/subComponent/ListBox.js +23 -0
  229. package/esm/select/subComponent/Option.js +37 -0
  230. package/esm/select/subComponent/OptionGroup.js +16 -0
  231. package/esm/select/subComponent/Options.js +25 -0
  232. package/esm/select/subComponent/SearchBox.js +51 -0
  233. package/esm/select/subComponent/SelectedMultipleCount.js +32 -0
  234. package/esm/select/subComponent/SelectedMultipleTags.js +47 -0
  235. package/esm/select/subComponent/SelectedMultipleText.js +63 -0
  236. package/esm/select/subComponent/SelectedSingle.js +10 -0
  237. package/esm/styles/GlobalStyle.js +328 -0
  238. package/esm/styles/config/breakpoint.style.js +7 -0
  239. package/esm/styles/config/header.style.js +4 -0
  240. package/esm/styles/config/sidebar.style.js +11 -0
  241. package/esm/styles/index.js +2 -0
  242. package/esm/styles/mixin/backgroundColor.js +38 -0
  243. package/esm/styles/mixin/borderColor.js +31 -0
  244. package/esm/styles/mixin/color.js +31 -0
  245. package/esm/styles/mixin/colorOnBackground.js +31 -0
  246. package/esm/styles/mixin/inputPlaceholder.js +24 -0
  247. package/esm/styles/mixin/media.js +15 -0
  248. package/esm/styles/mixin/rounded.js +24 -0
  249. package/esm/styles/mixin/scrollbar.js +26 -0
  250. package/esm/styles/theme/dark.theme.js +91 -0
  251. package/esm/styles/theme/light.theme.js +91 -0
  252. package/esm/styles/theme/white.theme.js +91 -0
  253. package/esm/styles/themes.js +9 -0
  254. package/esm/table/GridTable.js +329 -0
  255. package/esm/table/ImageBox.js +38 -0
  256. package/esm/table/InfiniteGridTable.js +396 -0
  257. package/esm/table/PermissionTable.js +57 -0
  258. package/esm/table/SimpleGridTable.js +136 -0
  259. package/esm/table/Table.js +559 -0
  260. package/esm/table/__mock__/columns.js +64 -0
  261. package/esm/table/__mock__/data.js +530 -0
  262. package/esm/table/hooks/index.js +2 -0
  263. package/esm/table/hooks/useCalculateDataRange.js +22 -0
  264. package/esm/table/hooks/useGenerateSort.js +32 -0
  265. package/esm/table/index.js +6 -0
  266. package/esm/table/subComponent/BaseTableHeadCell.js +54 -0
  267. package/esm/table/subComponent/GridTableFooter.js +17 -0
  268. package/esm/table/subComponent/GridTableHeadCell.js +13 -0
  269. package/esm/table/subComponent/Resizer.js +70 -0
  270. package/esm/table/subComponent/TableFooter.js +24 -0
  271. package/esm/table/subComponent/TableFooterInfo.js +6 -0
  272. package/esm/table/subComponent/TableFooterPager.js +26 -0
  273. package/esm/table/subComponent/TableHeadCell.js +12 -0
  274. package/esm/table/subComponent/TableSort.js +31 -0
  275. package/esm/tagify/TagifyStyle.js +54 -0
  276. package/esm/tagify/Tags.js +49 -0
  277. package/esm/tagify/index.js +3 -0
  278. package/esm/tagify/templates/getCreateButtonTemplate.js +12 -0
  279. package/esm/text/Paragraph.js +79 -0
  280. package/esm/text/index.js +1 -0
  281. package/esm/timeline/Timeline.js +132 -0
  282. package/esm/timeline/index.js +1 -0
  283. package/esm/toast/CustomToastContainer.js +38 -0
  284. package/esm/toast/MessageContainer.js +44 -0
  285. package/esm/toast/index.js +3 -0
  286. package/esm/toast/show.js +29 -0
  287. package/esm/toast/style.css +1 -0
  288. package/esm/tooltip/Tooltip.js +133 -0
  289. package/esm/tooltip/index.js +1 -0
  290. package/esm/treeView/TreeViewV2.js +32 -0
  291. package/esm/treeView/TreeflexStyle.js +43 -0
  292. package/esm/treeView/index.js +2 -0
  293. package/esm/wizard/Wizard.js +244 -0
  294. package/esm/wizard/index.js +1 -0
  295. package/index.js +0 -12
  296. package/layout/Sidebar.jsx +1 -1
  297. package/package.json +5 -4
  298. package/datetimePicker/DatePicker.js +0 -363
  299. package/datetimePicker/DatePickerV2.js +0 -407
  300. package/datetimePicker/DatetimePickerV2.js +0 -395
  301. package/datetimePicker/TimePicker.js +0 -317
  302. package/datetimePicker/hooks/index.js +0 -27
  303. package/datetimePicker/hooks/useChangeNumber.js +0 -42
  304. package/datetimePicker/hooks/useDecrease.js +0 -38
  305. package/datetimePicker/hooks/useIncrease.js +0 -38
  306. package/datetimePicker/subComponent/Accordion.js +0 -373
  307. package/datetimePicker/subComponent/CustomTimeInput.js +0 -47
  308. package/jsoneditor/JsonEditor.js +0 -142
  309. package/jsoneditor/index.js +0 -13
@@ -0,0 +1,133 @@
1
+ import { useState, cloneElement, forwardRef, useMemo, useCallback } from 'react';
2
+ import styled from 'styled-components';
3
+ import OutsideClickHandler from 'react-outside-click-handler';
4
+ import { useForkRef, useCustomPopper } from '@cashub/hooks';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const Tooltip = /*#__PURE__*/forwardRef((_ref, ref) => {
7
+ let {
8
+ children,
9
+ id,
10
+ title,
11
+ showArrow = false,
12
+ mode = 'hover',
13
+ fixed,
14
+ inline,
15
+ disabled,
16
+ placement
17
+ } = _ref;
18
+ const [display, setDisplay] = useState(false);
19
+ const [targetElement, setTargetElement] = useState(null);
20
+ const [tooltipElement, setTooltipElement] = useState(null);
21
+ const [arrowElement, setArrowElement] = useState(null);
22
+ const ownRef = useForkRef(setTargetElement, ref);
23
+ const {
24
+ styles,
25
+ attributes,
26
+ update
27
+ } = useCustomPopper(targetElement, tooltipElement, {
28
+ strategy: fixed ? 'fixed' : 'absolute',
29
+ arrowElement,
30
+ ...(placement && {
31
+ placement
32
+ })
33
+ });
34
+ const handleOpen = useCallback(() => {
35
+ setDisplay(true);
36
+ update();
37
+ }, [update]);
38
+ const handleClose = useCallback(() => {
39
+ setDisplay(false);
40
+ update();
41
+ }, [update]);
42
+ const toggle = useCallback(() => {
43
+ setDisplay(display => !display);
44
+ update();
45
+ }, [update]);
46
+ const wraperProps = useMemo(() => {
47
+ if (disabled) return;
48
+ if (mode === 'click') {
49
+ return {
50
+ onClick: toggle
51
+ };
52
+ }
53
+ return {
54
+ // mode ==="hover"
55
+ onClick: handleClose,
56
+ onMouseOver: handleOpen,
57
+ onMouseLeave: handleClose
58
+ };
59
+ }, [mode, handleClose, handleOpen, toggle, disabled]);
60
+ const childrenProps = {
61
+ ...children.props,
62
+ ref: ownRef
63
+ };
64
+ return /*#__PURE__*/_jsx(OutsideClickHandler, {
65
+ onOutsideClick: handleClose,
66
+ display: inline ? 'inline-block' : 'block',
67
+ children: /*#__PURE__*/_jsxs("div", {
68
+ ...wraperProps,
69
+ "data-testid": "tooltipWrapper",
70
+ children: [/*#__PURE__*/cloneElement(children, childrenProps), /*#__PURE__*/_jsxs(TooltipTooltip, {
71
+ id: id,
72
+ $display: display,
73
+ ref: setTooltipElement,
74
+ style: styles.popper,
75
+ ...attributes.popper,
76
+ role: "tooltip",
77
+ children: [title, /*#__PURE__*/_jsx(TooltipArrow, {
78
+ "data-testid": "tooltipArrow",
79
+ ref: setArrowElement,
80
+ style: styles.arrow,
81
+ $display: showArrow
82
+ })]
83
+ })]
84
+ })
85
+ });
86
+ });
87
+ Tooltip.displayName = 'Tooltip';
88
+ const TooltipTooltip = styled.div`
89
+ white-space: pre-line;
90
+ display: ${_ref2 => {
91
+ let {
92
+ $display
93
+ } = _ref2;
94
+ return $display ? 'block' : 'none';
95
+ }};
96
+ border: 1px solid var(--border-color);
97
+ color: var(--font-on-background);
98
+ background: var(--color-background2);
99
+ box-shadow: var(--box-shadow);
100
+ border-radius: calc(var(--border-radius) / 2);
101
+ padding: var(--spacing-xs);
102
+ z-index: 80;
103
+ text-align: left;
104
+ font-size: var(--font-body1);
105
+ font-weight: var(--font-normal);
106
+ line-height: 1.5;
107
+ word-break: break-word;
108
+ max-width: 50vw;
109
+ `;
110
+ const TooltipArrow = styled.div`
111
+ display: ${_ref3 => {
112
+ let {
113
+ $display
114
+ } = _ref3;
115
+ return $display ? 'block' : 'none';
116
+ }};
117
+ top: -0.5rem;
118
+ left: 0;
119
+ width: 1rem;
120
+ height: 1rem;
121
+
122
+ &::before {
123
+ position: absolute;
124
+ display: block;
125
+ content: '';
126
+ border-color: transparent;
127
+ border-style: solid;
128
+ top: 0;
129
+ border-width: 0 0.5rem 0.5rem 0.5rem;
130
+ border-bottom-color: var(--border-color);
131
+ }
132
+ `;
133
+ export default Tooltip;
@@ -0,0 +1 @@
1
+ export { default as Tooltip } from './Tooltip';
@@ -0,0 +1,32 @@
1
+ import 'treeflex/dist/css/treeflex.css';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ const TreeViewV2 = _ref => {
4
+ let {
5
+ rootName,
6
+ children
7
+ } = _ref;
8
+ const generateTree = children => {
9
+ return /*#__PURE__*/_jsx("ul", {
10
+ children: children.map(child => {
11
+ return /*#__PURE__*/_jsxs("li", {
12
+ children: [/*#__PURE__*/_jsx("span", {
13
+ className: `tf-nc ${child.primary ? 'primary' : ''}`,
14
+ children: child.name
15
+ }), child.children.length > 0 && generateTree(child.children)]
16
+ }, child.id);
17
+ })
18
+ });
19
+ };
20
+ return /*#__PURE__*/_jsx("div", {
21
+ className: "tf-tree",
22
+ children: /*#__PURE__*/_jsx("ul", {
23
+ children: /*#__PURE__*/_jsxs("li", {
24
+ children: [/*#__PURE__*/_jsx("span", {
25
+ className: "tf-nc",
26
+ children: rootName
27
+ }), generateTree(children)]
28
+ })
29
+ })
30
+ });
31
+ };
32
+ export default TreeViewV2;
@@ -0,0 +1,43 @@
1
+ import { createGlobalStyle } from 'styled-components';
2
+ import scrollbar from '../styles/mixin/scrollbar';
3
+
4
+ // integrate treeflex component
5
+ const TreeflexStyle = createGlobalStyle`
6
+ .tf-tree {
7
+ text-align: center;
8
+ color: var(--font-on-background);
9
+
10
+ .tf-nc {
11
+ border: var(--border-width) solid var(--border-color);
12
+ border-radius: 8px;
13
+ min-width: 120px;
14
+
15
+ &.primary {
16
+ border-color: var(--color-primary);
17
+ font-weight: var(--font-bold);
18
+ }
19
+ }
20
+
21
+ ${scrollbar}
22
+ }
23
+
24
+ .tf-tree ul {
25
+ margin-bottom: 2em;
26
+ }
27
+
28
+ .tf-tree li ul {
29
+ margin-bottom: 0;
30
+ }
31
+
32
+ .tf-tree li li:before {
33
+ border: var(--border-width) solid var(--border-color);
34
+ }
35
+
36
+ .tf-tree .tf-nc:after,
37
+ .tf-tree .tf-nc:before,
38
+ .tf-tree .tf-node-content:after,
39
+ .tf-tree .tf-node-content:before {
40
+ border: var(--border-width) solid var(--border-color);
41
+ }
42
+ `;
43
+ export default TreeflexStyle;
@@ -0,0 +1,2 @@
1
+ export { default as TreeViewV2 } from './TreeViewV2';
2
+ export { default as TreeflexStyle } from './TreeflexStyle';
@@ -0,0 +1,244 @@
1
+ import { useState, Children, cloneElement, useCallback, useMemo, useEffect } from 'react';
2
+ import { FaCaretRight } from 'react-icons/fa/index.esm';
3
+ import styled from 'styled-components';
4
+ import { isReactComponent } from '@cashub/utils';
5
+ import media from '../styles/mixin/media';
6
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
+ const Wizard = props => {
8
+ const {
9
+ navNames = [],
10
+ defaultStep = 1,
11
+ children,
12
+ beforeNext,
13
+ beforePrevious,
14
+ clickableSteps = true
15
+ } = props;
16
+ const [currentStep, setCurrentStep] = useState(defaultStep);
17
+ const goToStep = useCallback(async step => {
18
+ if (step > currentStep) {
19
+ if (!beforeNext) {
20
+ setCurrentStep(step);
21
+ } else {
22
+ beforeNext({
23
+ current: currentStep,
24
+ next: step
25
+ }).then(() => {
26
+ setCurrentStep(step);
27
+ }).catch(error => {});
28
+ }
29
+ }
30
+ if (step < currentStep) {
31
+ if (!beforePrevious) {
32
+ setCurrentStep(step);
33
+ } else {
34
+ beforePrevious({
35
+ current: currentStep
36
+ }).then(() => {
37
+ setCurrentStep(step);
38
+ }).catch(error => {});
39
+ }
40
+ }
41
+ }, [currentStep, beforeNext, beforePrevious]);
42
+ const nextStep = useCallback(() => {
43
+ let next = currentStep + 1;
44
+ if (next > navNames.length) {
45
+ next = navNames.length;
46
+ }
47
+ if (!beforeNext) {
48
+ setCurrentStep(next);
49
+ } else {
50
+ beforeNext({
51
+ current: currentStep
52
+ }).then(() => {
53
+ setCurrentStep(next);
54
+ }).catch(error => {});
55
+ }
56
+ }, [navNames.length, beforeNext, currentStep]);
57
+ const previousStep = useCallback(() => {
58
+ let previous = currentStep - 1;
59
+ if (previous < 1) {
60
+ previous = 1;
61
+ }
62
+ if (!beforePrevious) {
63
+ setCurrentStep(previous);
64
+ } else {
65
+ beforePrevious({
66
+ current: currentStep
67
+ }).then(() => {
68
+ setCurrentStep(previous);
69
+ }).catch(error => {});
70
+ }
71
+ }, [beforePrevious, currentStep]);
72
+ const isLastStep = useCallback(() => {
73
+ return currentStep === navNames.length;
74
+ }, [currentStep, navNames.length]);
75
+ const api = useMemo(() => {
76
+ return {
77
+ goToStep,
78
+ nextStep,
79
+ previousStep,
80
+ isLastStep
81
+ };
82
+ }, [goToStep, isLastStep, nextStep, previousStep]);
83
+ const childrenWithProps = useMemo(() => {
84
+ const validChildren = Children.toArray(children).filter(child => !!child);
85
+ return Children.map(validChildren, (child, index) => {
86
+ if (!child) return null;
87
+ const className = index + 1 === currentStep && 'active';
88
+ return /*#__PURE__*/_jsx(Step, {
89
+ className: className,
90
+ "data-testid": "step",
91
+ children: isReactComponent(child) ? /*#__PURE__*/cloneElement(child, api) : child
92
+ });
93
+ });
94
+ }, [api, children, currentStep]);
95
+ useEffect(() => {
96
+ setCurrentStep(defaultStep);
97
+ }, [defaultStep]);
98
+ return /*#__PURE__*/_jsxs(_Fragment, {
99
+ children: [/*#__PURE__*/_jsx(Nav, {
100
+ children: navNames.map((name, index, arr) => {
101
+ const step = index + 1;
102
+ const arrow = step === currentStep && step !== arr.length ? 'arrow' : undefined;
103
+ let className = '';
104
+ if (step === currentStep) {
105
+ className += 'current';
106
+ } else if (step < currentStep) {
107
+ className += 'done';
108
+ }
109
+ return /*#__PURE__*/_jsx(NavItem, {
110
+ className: className,
111
+ onClick: () => clickableSteps === true && goToStep(step),
112
+ children: /*#__PURE__*/_jsxs(NavTitle, {
113
+ children: [/*#__PURE__*/_jsx("span", {
114
+ children: step
115
+ }), /*#__PURE__*/_jsx("p", {
116
+ children: name
117
+ }), /*#__PURE__*/_jsx("span", {
118
+ className: arrow,
119
+ children: /*#__PURE__*/_jsx(FaCaretRight, {})
120
+ })]
121
+ })
122
+ }, step);
123
+ })
124
+ }), /*#__PURE__*/_jsx("div", {
125
+ children: childrenWithProps
126
+ })]
127
+ });
128
+ };
129
+ const Nav = styled.ul`
130
+ display: flex;
131
+ background: var(--color-background2);
132
+ border-radius: var(--border-radius-l);
133
+ margin-bottom: var(--spacing);
134
+
135
+ ${media.mobile`
136
+ display: block;
137
+ `}
138
+ `;
139
+ const NavItem = styled.li`
140
+ color: var(--font-on-mute);
141
+ font-size: var(--font-body1);
142
+ font-weight: var(--font-bold);
143
+ padding: 0 var(--spacing-xs);
144
+ width: 100%;
145
+ height: 36px;
146
+ line-height: 36px;
147
+ transition: 0.3s;
148
+ overflow: hidden;
149
+ flex: 1;
150
+ cursor: pointer;
151
+
152
+ &:hover {
153
+ color: var(--font-on-background);
154
+
155
+ > div > span:first-of-type {
156
+ color: var(--font-on-primary);
157
+ background: var(--font-on-background);
158
+ }
159
+ }
160
+
161
+ &.current,
162
+ &.done {
163
+ background: var(--color-primary);
164
+ color: var(--font-on-primary);
165
+
166
+ > div > span:first-of-type {
167
+ color: var(--color-primary);
168
+ background: var(--font-on-primary);
169
+ }
170
+ }
171
+
172
+ &.current {
173
+ background: var(--color-primary);
174
+ color: var(--font-on-primary);
175
+ border-radius: 0 var(--border-radius-l) var(--border-radius-l) 0;
176
+
177
+ &:first-child {
178
+ border-radius: var(--border-radius-l);
179
+ }
180
+
181
+ ${media.mobile`
182
+ border-radius: 0 0 var(--border-radius) var(--border-radius);
183
+ `}
184
+ }
185
+
186
+ &.done {
187
+ background: var(--color-primary);
188
+ color: var(--font-on-primary);
189
+
190
+ &:first-child {
191
+ border-radius: var(--border-radius-l) 0 0 var(--border-radius-l);
192
+
193
+ ${media.mobile`
194
+ border-radius: var(--border-radius) var(--border-radius) 0 0;
195
+ `}
196
+ }
197
+ }
198
+ `;
199
+ const NavTitle = styled.div`
200
+ display: flex;
201
+ align-items: center;
202
+
203
+ > span:first-of-type {
204
+ display: flex;
205
+ align-items: center;
206
+ justify-content: center;
207
+ margin-right: var(--spacing-xs);
208
+ color: var(--font-on-mute);
209
+ flex: 0 0;
210
+ flex-basis: 24px;
211
+ width: 24px;
212
+ height: 24px;
213
+ border-radius: var(--border-radius-l);
214
+ background: var(--font-on-mute);
215
+ }
216
+
217
+ > p {
218
+ margin-right: auto;
219
+ white-space: nowrap;
220
+ overflow: hidden;
221
+ text-overflow: ellipsis;
222
+ }
223
+
224
+ > span:last-of-type {
225
+ display: none;
226
+
227
+ &.arrow {
228
+ display: flex;
229
+ align-self: center;
230
+ }
231
+
232
+ ${media.mobile`
233
+ transform: rotate(90deg);
234
+ `}
235
+ }
236
+ `;
237
+ const Step = styled.div`
238
+ display: none;
239
+
240
+ &.active {
241
+ display: block;
242
+ }
243
+ `;
244
+ export default Wizard;
@@ -0,0 +1 @@
1
+ export { default as Wizard } from './Wizard';
package/index.js CHANGED
@@ -309,18 +309,6 @@ Object.keys(_image).forEach(function (key) {
309
309
  }
310
310
  });
311
311
  });
312
- var _jsoneditor = require("./jsoneditor");
313
- Object.keys(_jsoneditor).forEach(function (key) {
314
- if (key === "default" || key === "__esModule") return;
315
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
316
- if (key in exports && exports[key] === _jsoneditor[key]) return;
317
- Object.defineProperty(exports, key, {
318
- enumerable: true,
319
- get: function () {
320
- return _jsoneditor[key];
321
- }
322
- });
323
- });
324
312
  var _layout = require("./layout");
325
313
  Object.keys(_layout).forEach(function (key) {
326
314
  if (key === "default" || key === "__esModule") return;
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState, useRef } from 'react';
2
- import { FaCaretRight } from 'react-icons/fa';
2
+ import { FaCaretRight } from 'react-icons/fa/index.esm';
3
3
  import { Link, useLocation } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import styled, { css } from 'styled-components';
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@cashub/ui-elv",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "author": "CasHUB Team",
6
6
  "description": "CasHUB UI components library (Elavon)",
7
7
  "main": "index.js",
8
+ "module": "esm/index.js",
9
+ "sideEffects": [
10
+ "**/*.css"
11
+ ],
8
12
  "keywords": [
9
13
  "CasHUB"
10
14
  ],
@@ -17,11 +21,8 @@
17
21
  "@monaco-editor/react": "^4.6.0",
18
22
  "@popperjs/core": "^2.11.5",
19
23
  "@yaireo/tagify": "^4.12.0",
20
- "brace": "^0.11.1",
21
24
  "chart.js": "^3.8.0",
22
25
  "cropperjs": "^1.5.12",
23
- "jsoneditor": "^9.8.0",
24
- "jsoneditor-react": "^3.1.2",
25
26
  "leaflet": "^1.7.1",
26
27
  "leaflet-draw": "^1.0.4",
27
28
  "lodash.uniqueid": "^4.0.1",