@cashub/ui 0.48.3 → 0.48.4

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 (177) hide show
  1. package/Tab/TabList.js +38 -26
  2. package/Tab/TabPanel.js +13 -20
  3. package/Tab/TabTab.js +36 -24
  4. package/Tab/index.js +3 -6
  5. package/Tab/subComponent/TabListV2.js +11 -18
  6. package/Tab/subComponent/TabPanelV2.js +16 -20
  7. package/Tab/subComponent/TabTabV2.js +33 -21
  8. package/VerticalTab/TabList.js +13 -18
  9. package/VerticalTab/TabPanel.js +16 -20
  10. package/VerticalTab/TabTab.js +40 -21
  11. package/VerticalTab/VerticalTab.js +8 -4
  12. package/alert/Alert.js +12 -5
  13. package/animate/Collapse.js +5 -7
  14. package/animate/Loader.js +18 -7
  15. package/animate/PulseRing.js +18 -5
  16. package/animate/Spinner.js +8 -3
  17. package/backdrop/BaseBackdrop.js +9 -3
  18. package/backdrop/LoadingBackdrop.js +7 -3
  19. package/backdrop/ModalBackdrop.js +5 -3
  20. package/badge/Badge.js +15 -3
  21. package/badge/BadgeDot.js +8 -3
  22. package/badge/BadgeFill.js +24 -6
  23. package/badge/BadgeWithText.js +13 -3
  24. package/billing/BarChart.js +1 -1
  25. package/breadcrumb/Breadcrumb.js +42 -3
  26. package/button/Button.js +88 -20
  27. package/button/ButtonGroup.js +33 -9
  28. package/button/IconButton.js +37 -10
  29. package/button/ScrollToTopButton.js +12 -4
  30. package/callout/Callout.js +37 -8
  31. package/chart/BarChart.js +16 -19
  32. package/chart/DoughnutChart.js +34 -20
  33. package/chart/LineChart.js +11 -18
  34. package/chart/SingleBarChart.js +22 -5
  35. package/chart/utils/centerTextPlugin.js +2 -2
  36. package/chart/utils/customTooltip.js +8 -8
  37. package/chart/utils/htmlLegendPlugin.js +1 -1
  38. package/chart/utils/yAxisTopTitlePlugin.js +1 -1
  39. package/container/FlexContainer.js +15 -7
  40. package/cropper/Cropper.js +1 -2
  41. package/datetimePicker/DatePicker.js +80 -26
  42. package/datetimePicker/DatePickerV2.js +95 -36
  43. package/datetimePicker/DatetimePicker.js +174 -11
  44. package/datetimePicker/DatetimePickerV2.js +87 -33
  45. package/datetimePicker/DatetimePickerV3.js +174 -11
  46. package/datetimePicker/TimeInput.js +35 -10
  47. package/datetimePicker/TimePicker.js +77 -22
  48. package/datetimePicker/TimePickerStyle.js +53 -3
  49. package/datetimePicker/TimePickerV2.js +54 -21
  50. package/datetimePicker/accordion/Month.js +93 -16
  51. package/datetimePicker/accordion/Year.js +96 -18
  52. package/datetimePicker/hooks/useChangeNumber.js +3 -6
  53. package/datetimePicker/hooks/useDecrease.js +3 -6
  54. package/datetimePicker/hooks/useIncrease.js +3 -6
  55. package/datetimePicker/subComponent/Accordion.js +101 -20
  56. package/descriptionList/DescriptionDetail.js +15 -4
  57. package/descriptionList/DescriptionList.js +12 -4
  58. package/descriptionList/DescriptionTerm.js +5 -3
  59. package/divider/Divider.js +15 -6
  60. package/dropdown/DropdownButtonOption.js +22 -6
  61. package/dropdown/DropdownContent.js +29 -15
  62. package/dropdown/DropdownDivOption.js +17 -3
  63. package/dropdown/DropdownLinkOption.js +14 -3
  64. package/dropdown/DropdownToggle.js +7 -15
  65. package/dropzone/FileDropzone.js +121 -22
  66. package/dropzone/ImageDropzone.js +83 -14
  67. package/dropzone/subComponent/Message.js +11 -4
  68. package/figure/IconFigure.js +16 -7
  69. package/figure/ImageFigure.js +19 -6
  70. package/file/HiddenFileInput.js +3 -3
  71. package/form/Checkbox.js +74 -13
  72. package/form/Fieldset.js +9 -3
  73. package/form/FormItem.js +10 -5
  74. package/form/Input.js +40 -7
  75. package/form/Label.js +34 -10
  76. package/form/MutedText.js +8 -4
  77. package/form/PasswordInput.js +20 -13
  78. package/form/RadioButton.js +55 -8
  79. package/form/SearchSelect.js +64 -12
  80. package/form/Searchbox.js +45 -19
  81. package/form/Slider.js +28 -10
  82. package/form/SwitchButton.js +48 -14
  83. package/form/Textarea.js +30 -3
  84. package/form/TreeView.js +13 -6
  85. package/grid/Column.js +23 -10
  86. package/grid/Grid.js +14 -6
  87. package/heading/Heading1.js +8 -4
  88. package/heading/Heading2.js +11 -5
  89. package/heading/Heading3.js +20 -8
  90. package/iconbox/ApplicationIconBox.js +48 -12
  91. package/iconbox/IconBox.js +31 -7
  92. package/iconbox/IconBoxV2.js +33 -8
  93. package/iconbox/subComponent/IconBoxFigure.js +17 -9
  94. package/iconbox/subComponent/IconBoxImage.js +21 -8
  95. package/image/ImageFluid.js +7 -3
  96. package/image/UploadImage.js +66 -18
  97. package/jsoneditor/JsonEditor.js +121 -15
  98. package/keyframe/Pulse.js +13 -3
  99. package/keyframe/Spin.js +5 -3
  100. package/layout/Aside.js +30 -5
  101. package/layout/Backdrop.js +8 -4
  102. package/layout/Container.js +21 -5
  103. package/layout/Footer.js +26 -7
  104. package/link/LinkSpan.js +37 -19
  105. package/map/GoogleMap.js +3 -7
  106. package/map/GoogleReverseGeolocation.js +6 -3
  107. package/map/LeafletMap.js +2 -2
  108. package/map/subComponent/GoogleMapContainer.js +16 -4
  109. package/map/subComponent/GoogleMapPopup.js +7 -10
  110. package/map/subComponent/GoogleMapWrapper.js +8 -15
  111. package/map/subComponent/LeafletDrawControl.js +9 -7
  112. package/map/subComponent/LeafletMapContainer.js +159 -4
  113. package/modal/StateModal.js +49 -28
  114. package/modal/TitleModal.js +70 -29
  115. package/package.json +1 -1
  116. package/page/Disclaimer.js +119 -3
  117. package/paginate/Paginate.js +54 -12
  118. package/popover/Popover.js +30 -25
  119. package/qrcode/QRCode.js +20 -6
  120. package/qrcode/QRCodeContainter.js +12 -4
  121. package/ribbon/Ribbon.js +29 -4
  122. package/section/Section.js +68 -20
  123. package/section/SectionBody.js +29 -8
  124. package/section/SectionHeader.js +36 -11
  125. package/section/SectionToolbar.js +9 -3
  126. package/section/SectionToolbarItem.js +8 -3
  127. package/select/InputSelect.js +16 -23
  128. package/select/Select.js +112 -43
  129. package/select/subComponent/Checkbox.js +24 -5
  130. package/select/subComponent/Footer.js +4 -3
  131. package/select/subComponent/ListBox.js +12 -5
  132. package/select/subComponent/Option.js +27 -7
  133. package/select/subComponent/OptionGroup.js +13 -3
  134. package/select/subComponent/Options.js +18 -5
  135. package/select/subComponent/SearchBox.js +34 -12
  136. package/select/subComponent/SelectedMultipleTags.js +21 -3
  137. package/select/subComponent/SelectedMultipleText.js +20 -4
  138. package/select/subComponent/SelectedSingle.js +7 -3
  139. package/styles/GlobalStyle.js +156 -45
  140. package/styles/mixin/backgroundColor.js +16 -8
  141. package/styles/mixin/borderColor.js +13 -7
  142. package/styles/mixin/color.js +13 -7
  143. package/styles/mixin/colorOnBackground.js +13 -7
  144. package/styles/mixin/inputPlaceholder.js +20 -3
  145. package/styles/mixin/media.js +5 -3
  146. package/styles/mixin/rounded.js +10 -6
  147. package/styles/mixin/scrollbar.js +13 -3
  148. package/styles/theme/dark.theme.js +15 -14
  149. package/styles/theme/light.theme.js +15 -14
  150. package/styles/theme/white.theme.js +15 -14
  151. package/table/GridTable.js +71 -33
  152. package/table/ImageBox.js +15 -5
  153. package/table/InfiniteGridTable.js +92 -46
  154. package/table/PermissionTable.js +32 -10
  155. package/table/SimpleGridTable.js +52 -17
  156. package/table/Table.js +198 -48
  157. package/table/__mock__/columns.js +1 -1
  158. package/table/subComponent/BaseTableHeadCell.js +37 -8
  159. package/table/subComponent/GridTableFooter.js +10 -4
  160. package/table/subComponent/GridTableHeadCell.js +6 -4
  161. package/table/subComponent/Resizer.js +19 -4
  162. package/table/subComponent/TableFooter.js +15 -6
  163. package/table/subComponent/TableFooterInfo.js +4 -3
  164. package/table/subComponent/TableFooterPager.js +19 -6
  165. package/table/subComponent/TableHeadCell.js +9 -3
  166. package/table/subComponent/TableSort.js +17 -7
  167. package/tagify/TagifyStyle.js +49 -3
  168. package/tagify/Tags.js +37 -21
  169. package/tagify/templates/getCreateButtonTemplate.js +5 -2
  170. package/text/Paragraph.js +50 -12
  171. package/timeline/Timeline.js +94 -17
  172. package/toast/CustomToastContainer.js +35 -3
  173. package/toast/MessageContainer.js +22 -4
  174. package/tooltip/Tooltip.js +47 -19
  175. package/treeView/TreeViewV2.js +1 -1
  176. package/treeView/TreeflexStyle.js +38 -3
  177. package/wizard/Wizard.js +115 -6
@@ -5,33 +5,57 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
11
- const ButtonGroup = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > button:not(:first-child),\n *:not(:first-child) {\n margin-left: var(--spacing-s);\n }\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), _ref => {
9
+ const ButtonGroup = _styledComponents.default.div`
10
+ display: flex;
11
+ align-items: center;
12
+
13
+ > button:not(:first-child),
14
+ *:not(:first-child) {
15
+ margin-left: var(--spacing-s);
16
+ }
17
+
18
+ ${_ref => {
12
19
  let {
13
20
  alignCenter
14
21
  } = _ref;
15
22
  return alignCenter && 'justify-content: center;';
16
- }, _ref2 => {
23
+ }}
24
+
25
+ ${_ref2 => {
17
26
  let {
18
27
  alignRight
19
28
  } = _ref2;
20
29
  return alignRight && 'justify-content: flex-end;';
21
- }, _ref3 => {
30
+ }}
31
+
32
+ ${_ref3 => {
22
33
  let {
23
34
  marginBottom
24
35
  } = _ref3;
25
36
  return marginBottom && 'margin-bottom: var(--spacing);';
26
- }, _ref4 => {
37
+ }}
38
+
39
+ ${_ref4 => {
27
40
  let {
28
41
  vertical
29
42
  } = _ref4;
30
- return vertical && "\n flex-direction: column;\n\n > button,\n > * {\n margin-left: 0 !important;\n margin-bottom: var(--spacing-s);\n }\n ";
31
- }, _ref5 => {
43
+ return vertical && `
44
+ flex-direction: column;
45
+
46
+ > button,
47
+ > * {
48
+ margin-left: 0 !important;
49
+ margin-bottom: var(--spacing-s);
50
+ }
51
+ `;
52
+ }}
53
+
54
+ ${_ref5 => {
32
55
  let {
33
56
  height100
34
57
  } = _ref5;
35
58
  return height100 && 'height: 100%;';
36
- });
59
+ }}
60
+ `;
37
61
  var _default = exports.default = ButtonGroup;
@@ -5,41 +5,68 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
- var _templateObject, _templateObject2;
9
8
  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); }
10
9
  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; }
11
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
12
10
  const IconButton = _styledComponents.default.div.attrs(() => ({
13
11
  role: 'button'
14
- }))(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 40px;\n height: 40px;\n transition: 0.3s;\n position: relative;\n border-radius: var(--border-radius-l);\n color: ", ";\n cursor: ", ";\n margin: auto;\n\n ", "\n\n &:hover {\n ", "\n }\n\n > svg {\n font-size: 1.5rem;\n\n ", "\n\n ", "\n }\n"])), _ref => {
12
+ }))`
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ width: 40px;
17
+ height: 40px;
18
+ transition: 0.3s;
19
+ position: relative;
20
+ border-radius: var(--border-radius-l);
21
+ color: ${_ref => {
15
22
  let {
16
23
  disabled
17
24
  } = _ref;
18
25
  return disabled ? 'var(--color-grey)' : 'var(--font-on-background)';
19
- }, _ref2 => {
26
+ }};
27
+ cursor: ${_ref2 => {
20
28
  let {
21
29
  disabled
22
30
  } = _ref2;
23
31
  return disabled ? 'no-drop' : 'pointer';
24
- }, _ref3 => {
32
+ }};
33
+ margin: auto;
34
+
35
+ ${_ref3 => {
25
36
  let {
26
37
  size
27
38
  } = _ref3;
28
- return size === 'small' && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 32px;\n height: 32px;\n "])));
29
- }, _ref4 => {
39
+ return size === 'small' && (0, _styledComponents.css)`
40
+ width: 32px;
41
+ height: 32px;
42
+ `;
43
+ }}
44
+
45
+ &:hover {
46
+ ${_ref4 => {
30
47
  let {
31
48
  disabled
32
49
  } = _ref4;
33
50
  return !disabled && 'background: var(--color-hover)';
34
- }, _ref5 => {
51
+ }}
52
+ }
53
+
54
+ > svg {
55
+ font-size: 1.5rem;
56
+
57
+ ${_ref5 => {
35
58
  let {
36
59
  size
37
60
  } = _ref5;
38
61
  return size === 'small' && 'font-size: 1rem;';
39
- }, _ref6 => {
62
+ }}
63
+
64
+ ${_ref6 => {
40
65
  let {
41
66
  size
42
67
  } = _ref6;
43
68
  return size === 'large' && 'font-size: 2rem;';
44
- });
69
+ }}
70
+ }
71
+ `;
45
72
  var _default = exports.default = IconButton;
@@ -9,9 +9,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
  var _md = require("react-icons/md");
10
10
  var _Button = _interopRequireDefault(require("./Button"));
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
- var _templateObject;
13
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
15
13
  const ScrollToTopButton = () => {
16
14
  const [$display, setDisplay] = (0, _react.useState)(false);
17
15
  const toggleVisible = () => {
@@ -37,10 +35,20 @@ const ScrollToTopButton = () => {
37
35
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_md.MdOutlineArrowBackIosNew, {})
38
36
  });
39
37
  };
40
- const StyledScrollToTopButton = (0, _styledComponents.default)(_Button.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: fixed;\n bottom: var(--spacing);\n right: var(--spacing);\n display: ", ";\n z-index: 30;\n\n > svg {\n transform: rotate(90deg);\n }\n"])), _ref => {
38
+ const StyledScrollToTopButton = (0, _styledComponents.default)(_Button.default)`
39
+ position: fixed;
40
+ bottom: var(--spacing);
41
+ right: var(--spacing);
42
+ display: ${_ref => {
41
43
  let {
42
44
  $display
43
45
  } = _ref;
44
46
  return $display ? 'flex' : 'none';
45
- });
47
+ }};
48
+ z-index: 30;
49
+
50
+ > svg {
51
+ transform: rotate(90deg);
52
+ }
53
+ `;
46
54
  var _default = exports.default = ScrollToTopButton;
@@ -5,15 +5,44 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
11
- const Callout = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: var(--spacing);\n border-radius: var(--border-radius);\n background: var(--color-background3);\n margin-bottom: var(--spacing);\n"])));
12
- const Body = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
13
- const Content = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 2;\n"])));
14
- const Title = _styledComponents.default.h3(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: var(--font-h3);\n font-weight: 500;\n color: var(--font-on-background);\n margin-bottom: var(--border-radius);\n"])));
15
- const Description = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: var(--font-body1);\n line-height: 1.5;\n color: var(--font-on-mute);\n padding-right: var(--spacing);\n font-weight: 400;\n\n &:last-child {\n margin-bottom: 0;\n }\n"])));
16
- const Action = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n justify-content: center;\n"])));
9
+ const Callout = _styledComponents.default.div`
10
+ padding: var(--spacing);
11
+ border-radius: var(--border-radius);
12
+ background: var(--color-background3);
13
+ margin-bottom: var(--spacing);
14
+ `;
15
+ const Body = _styledComponents.default.div`
16
+ display: flex;
17
+ align-items: center;
18
+ `;
19
+ const Content = _styledComponents.default.div`
20
+ flex: 2;
21
+ `;
22
+ const Title = _styledComponents.default.h3`
23
+ font-size: var(--font-h3);
24
+ font-weight: 500;
25
+ color: var(--font-on-background);
26
+ margin-bottom: var(--border-radius);
27
+ `;
28
+ const Description = _styledComponents.default.p`
29
+ font-size: var(--font-body1);
30
+ line-height: 1.5;
31
+ color: var(--font-on-mute);
32
+ padding-right: var(--spacing);
33
+ font-weight: 400;
34
+
35
+ &:last-child {
36
+ margin-bottom: 0;
37
+ }
38
+ `;
39
+ const Action = _styledComponents.default.div`
40
+ flex: 1;
41
+ display: flex;
42
+ flex-direction: column;
43
+ align-items: flex-end;
44
+ justify-content: center;
45
+ `;
17
46
  var _default = exports.default = Object.assign(Callout, {
18
47
  Body,
19
48
  Content,
package/chart/BarChart.js CHANGED
@@ -10,22 +10,14 @@ var _reactChartjs = require("react-chartjs-2");
10
10
  var _customTooltip = _interopRequireDefault(require("./utils/customTooltip"));
11
11
  var _padEmptyChartBar = _interopRequireDefault(require("./utils/padEmptyChartBar"));
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- const _excluded = ["height", "data", "options"];
14
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
21
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
22
14
  const BarChart = _ref => {
23
15
  let {
24
- height = 300,
25
- data,
26
- options = {}
27
- } = _ref,
28
- props = _objectWithoutProperties(_ref, _excluded);
16
+ height = 300,
17
+ data,
18
+ options = {},
19
+ ...props
20
+ } = _ref;
29
21
  const theme = (0, _react.useContext)(_styledComponents.ThemeContext);
30
22
 
31
23
  // fix: read value from theme
@@ -34,13 +26,17 @@ const BarChart = _ref => {
34
26
  _reactChartjs.defaults.color = theme.fontOnBg;
35
27
  _reactChartjs.defaults.plugins.tooltip.external = (0, _customTooltip.default)(theme);
36
28
  const customOptions = (0, _react.useMemo)(() => {
29
+ const {
30
+ tooltips = {}
31
+ } = options;
37
32
  return {
38
33
  onlyFirstTooltips: options.onlyFirstTooltips === undefined ? true : options.onlyFirstTooltips,
39
34
  maxBarNumber: options.maxBarNumber === undefined ? 5 : options.maxBarNumber,
40
35
  stacked: options.stacked === undefined ? true : options.stacked,
41
36
  suggestedMax: options.suggestedMax === undefined ? 10 : options.suggestedMax,
42
37
  showLegend: options.showLegend === undefined ? false : options.showLegend,
43
- rotateLabel: options.rotateLabel === undefined ? true : options.rotateLabel
38
+ rotateLabel: options.rotateLabel === undefined ? true : options.rotateLabel,
39
+ tooltipLabelPostfix: tooltips.labelPostfix || ''
44
40
  };
45
41
  }, [options]);
46
42
  const defaultOptions = (0, _react.useMemo)(() => {
@@ -71,7 +67,7 @@ const BarChart = _ref => {
71
67
  if (context.dataset.customLabel) {
72
68
  return context.dataset.customLabel[context.dataIndex].toString();
73
69
  }
74
- return label.toString();
70
+ return `${label.toString()}${customOptions.tooltipLabelPostfix}`;
75
71
  },
76
72
  labelTextColor(context) {
77
73
  const {
@@ -99,7 +95,7 @@ const BarChart = _ref => {
99
95
  minRotation: customOptions.rotateLabel ? 15 : 0,
100
96
  callback(value) {
101
97
  const label = this.getLabelForValue(value);
102
- return label && label.length > 11 ? "".concat(label.substr(0, 11), "...") : label;
98
+ return label && label.length > 11 ? `${label.substr(0, 11)}...` : label;
103
99
  }
104
100
  }
105
101
  },
@@ -122,11 +118,12 @@ const BarChart = _ref => {
122
118
  }
123
119
  };
124
120
  }, [customOptions, theme.fontOnPrimary]);
125
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Bar, _objectSpread({
121
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Bar, {
126
122
  height: height,
127
123
  data: data,
128
124
  options: defaultOptions,
129
- plugins: [_padEmptyChartBar.default]
130
- }, props));
125
+ plugins: [_padEmptyChartBar.default],
126
+ ...props
127
+ });
131
128
  };
132
129
  var _default = exports.default = BarChart;
@@ -12,27 +12,17 @@ var _htmlLegendPlugin = _interopRequireDefault(require("./utils/htmlLegendPlugin
12
12
  var _customTooltip = _interopRequireDefault(require("./utils/customTooltip"));
13
13
  var _centerTextPlugin = _interopRequireDefault(require("./utils/centerTextPlugin"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- var _templateObject;
16
- const _excluded = ["height", "data", "showCenterText", "centerTextTitle"];
17
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
16
  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); }
19
17
  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; }
20
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
21
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
22
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
23
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
24
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
25
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
26
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
27
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
28
18
  const DoughnutChart = _ref => {
29
19
  let {
30
- height = 300,
31
- data,
32
- showCenterText = false,
33
- centerTextTitle
34
- } = _ref,
35
- props = _objectWithoutProperties(_ref, _excluded);
20
+ height = 300,
21
+ data,
22
+ showCenterText = false,
23
+ centerTextTitle,
24
+ ...props
25
+ } = _ref;
36
26
  const [legendContainerId] = (0, _react.useState)((0, _lodash.default)('legend-container-'));
37
27
  const theme = (0, _react.useContext)(_styledComponents.ThemeContext);
38
28
 
@@ -89,16 +79,40 @@ const DoughnutChart = _ref => {
89
79
  }, [legendContainerId, theme.fontOnPrimary, showCenterText, centerTextTitle]);
90
80
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
91
81
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
92
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Doughnut, _objectSpread({
82
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Doughnut, {
93
83
  height: height,
94
84
  data: data,
95
85
  options: defaultOptions,
96
- plugins: [_htmlLegendPlugin.default, _centerTextPlugin.default]
97
- }, props))
86
+ plugins: [_htmlLegendPlugin.default, _centerTextPlugin.default],
87
+ ...props
88
+ })
98
89
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(LegendWrapper, {
99
90
  id: legendContainerId
100
91
  })]
101
92
  });
102
93
  };
103
- const LegendWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .custom-legend-tooltip {\n position: relative;\n }\n\n .custom-legend-tooltip:hover::after {\n content: attr(data-tooltip);\n position: absolute;\n top: calc(1rem + var(--spacing-xs));\n left: 50%;\n transform: translateX(-50%);\n border: 1px solid var(--border-color);\n color: var(--font-on-background);\n background: var(--color-background2);\n box-shadow: var(--box-shadow);\n border-radius: calc(var(--border-radius) / 2);\n padding: var(--spacing-xs);\n font-size: var(--font-body1);\n font-weight: var(--font-normal);\n text-align: center;\n width: max-content;\n max-width: 50vw;\n }\n"])));
94
+ const LegendWrapper = _styledComponents.default.div`
95
+ .custom-legend-tooltip {
96
+ position: relative;
97
+ }
98
+
99
+ .custom-legend-tooltip:hover::after {
100
+ content: attr(data-tooltip);
101
+ position: absolute;
102
+ top: calc(1rem + var(--spacing-xs));
103
+ left: 50%;
104
+ transform: translateX(-50%);
105
+ border: 1px solid var(--border-color);
106
+ color: var(--font-on-background);
107
+ background: var(--color-background2);
108
+ box-shadow: var(--box-shadow);
109
+ border-radius: calc(var(--border-radius) / 2);
110
+ padding: var(--spacing-xs);
111
+ font-size: var(--font-body1);
112
+ font-weight: var(--font-normal);
113
+ text-align: center;
114
+ width: max-content;
115
+ max-width: 50vw;
116
+ }
117
+ `;
104
118
  var _default = exports.default = DoughnutChart;
@@ -10,22 +10,14 @@ var _reactChartjs = require("react-chartjs-2");
10
10
  var _customTooltip = _interopRequireDefault(require("./utils/customTooltip"));
11
11
  var _yAxisTopTitlePlugin = _interopRequireDefault(require("./utils/yAxisTopTitlePlugin"));
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- const _excluded = ["height", "data", "options"];
14
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
19
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
21
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
22
14
  const LineChart = _ref => {
23
15
  let {
24
- height = 300,
25
- data,
26
- options = {}
27
- } = _ref,
28
- props = _objectWithoutProperties(_ref, _excluded);
16
+ height = 300,
17
+ data,
18
+ options = {},
19
+ ...props
20
+ } = _ref;
29
21
  const theme = (0, _react.useContext)(_styledComponents.ThemeContext);
30
22
 
31
23
  // fix: read value from theme
@@ -70,11 +62,11 @@ const LineChart = _ref => {
70
62
  callbacks: {
71
63
  title(context) {
72
64
  const content = context[0] ? context[0].label.match(/(.{1,20})/g) : '';
73
- return "".concat(customOptions.tooltipTitlePrefix).concat(content);
65
+ return `${customOptions.tooltipTitlePrefix}${content}`;
74
66
  },
75
67
  label(context) {
76
68
  const content = context.dataset.data[context.dataIndex].toString();
77
- return "".concat(customOptions.tooltipLabelPrefix).concat(content).concat(customOptions.tooltipLabelPostfix);
69
+ return `${customOptions.tooltipLabelPrefix}${content}${customOptions.tooltipLabelPostfix}`;
78
70
  },
79
71
  labelColor(context) {
80
72
  const {
@@ -134,11 +126,12 @@ const LineChart = _ref => {
134
126
  }
135
127
  };
136
128
  }, [customOptions, theme.fontOnPrimary]);
137
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Line, _objectSpread({
129
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Line, {
138
130
  height: height,
139
131
  data: data,
140
132
  options: defaultOptions,
141
- plugins: [_yAxisTopTitlePlugin.default]
142
- }, props));
133
+ plugins: [_yAxisTopTitlePlugin.default],
134
+ ...props
135
+ });
143
136
  };
144
137
  var _default = exports.default = LineChart;
@@ -6,20 +6,37 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
8
  var _backgroundColor = _interopRequireDefault(require("../styles/mixin/backgroundColor"));
9
- var _templateObject;
10
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
12
10
  const SingleBarChart = _styledComponents.default.div.attrs(() => ({
13
11
  primary: true
14
- }))(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 1rem;\n border-radius: var(--border-radius);\n background: var(--color-background3);\n\n &::before {\n position: absolute;\n content: '';\n width: ", "%;\n border-radius: var(--border-radius);\n top: 0;\n bottom: 0;\n\n ", "\n }\n\n ", "\n"])), _ref => {
12
+ }))`
13
+ position: relative;
14
+ width: 100%;
15
+ height: 1rem;
16
+ border-radius: var(--border-radius);
17
+ background: var(--color-background3);
18
+
19
+ &::before {
20
+ position: absolute;
21
+ content: '';
22
+ width: ${_ref => {
15
23
  let {
16
24
  percentage
17
25
  } = _ref;
18
26
  return percentage;
19
- }, _backgroundColor.default, _ref2 => {
27
+ }}%;
28
+ border-radius: var(--border-radius);
29
+ top: 0;
30
+ bottom: 0;
31
+
32
+ ${_backgroundColor.default}
33
+ }
34
+
35
+ ${_ref2 => {
20
36
  let {
21
37
  marginTop
22
38
  } = _ref2;
23
39
  return marginTop && 'margin-top: var(--spacing-s)';
24
- });
40
+ }}
41
+ `;
25
42
  var _default = exports.default = SingleBarChart;
@@ -48,13 +48,13 @@ const centerTextPlugin = {
48
48
  title
49
49
  } = config;
50
50
  if (title) {
51
- ctx.font = "bold ".concat(size, "px ").concat(family);
51
+ ctx.font = `bold ${size}px ${family}`;
52
52
  ctx.fillText(title, centerX, centerY - offset);
53
53
  }
54
54
  const total = data.datasets[0].data.reduce((total, current) => {
55
55
  return total + current;
56
56
  }, 0);
57
- ctx.font = "".concat(size, "px ").concat(family);
57
+ ctx.font = `${size}px ${family}`;
58
58
  ctx.fillText(total.toLocaleString(), centerX, centerY + (title ? offset : 0));
59
59
  ctx.restore();
60
60
  }
@@ -41,16 +41,16 @@ const customTooltip = theme => {
41
41
  });
42
42
  let innerHtml = '<thead>';
43
43
  titleLines.forEach(title => {
44
- innerHtml += "<tr><th>".concat(title, "</th></tr>");
44
+ innerHtml += `<tr><th>${title}</th></tr>`;
45
45
  });
46
46
  innerHtml += '</thead><tbody>';
47
47
  bodyLines.forEach(body => {
48
48
  if (Array.isArray(body)) {
49
49
  body.forEach(line => {
50
- innerHtml += "<tr><td>".concat(line, "</td></tr>");
50
+ innerHtml += `<tr><td>${line}</td></tr>`;
51
51
  });
52
52
  } else {
53
- innerHtml += "<tr><td>".concat(body, "</td></tr>");
53
+ innerHtml += `<tr><td>${body}</td></tr>`;
54
54
  }
55
55
  });
56
56
  innerHtml += '</tbody>';
@@ -71,23 +71,23 @@ const customTooltip = theme => {
71
71
  tooltipEl.style.background = tooltipModel.labelColors[0].backgroundColor;
72
72
  tooltipEl.style.borderRadius = theme.borderRadius;
73
73
  tooltipEl.style.textAlign = 'center';
74
- tooltipEl.style.padding = "".concat(theme.spacerXS, " ").concat(theme.spacerS);
74
+ tooltipEl.style.padding = `${theme.spacerXS} ${theme.spacerS}`;
75
75
  tooltipEl.style.pointerEvents = 'none';
76
76
 
77
77
  // determine position is left or right
78
78
  if (tooltipModel.caretX + tooltipEl.offsetWidth <= this._chart.width) {
79
79
  tooltipEl.style.borderTopLeftRadius = 0;
80
- tooltipEl.style.left = "".concat(position.left + window.pageXOffset + tooltipModel.caretX + 8, "px");
80
+ tooltipEl.style.left = `${position.left + window.pageXOffset + tooltipModel.caretX + 8}px`;
81
81
  } else {
82
82
  tooltipEl.style.borderTopRightRadius = 0;
83
- tooltipEl.style.left = "".concat(position.left + window.pageXOffset + tooltipModel.caretX - tooltipModel.width - 16 * 2, "px");
83
+ tooltipEl.style.left = `${position.left + window.pageXOffset + tooltipModel.caretX - tooltipModel.width - 16 * 2}px`;
84
84
  }
85
85
 
86
86
  // determine position is top or bottom
87
87
  if (tooltipModel.caretY + tooltipEl.offsetHeight <= this._chart.height) {
88
- tooltipEl.style.top = "".concat(position.top + window.pageYOffset + tooltipModel.caretY + 8, "px");
88
+ tooltipEl.style.top = `${position.top + window.pageYOffset + tooltipModel.caretY + 8}px`;
89
89
  } else {
90
- tooltipEl.style.top = "".concat(position.top + window.pageYOffset + tooltipModel.caretY - tooltipModel.width - 16 * 2, "px");
90
+ tooltipEl.style.top = `${position.top + window.pageYOffset + tooltipModel.caretY - tooltipModel.width - 16 * 2}px`;
91
91
  }
92
92
  };
93
93
  };
@@ -49,7 +49,7 @@ const htmlLegendPlugin = {
49
49
  const boxSpan = document.createElement('span');
50
50
  boxSpan.style.background = item.fillStyle;
51
51
  boxSpan.style.borderColor = item.strokeStyle;
52
- boxSpan.style.borderWidth = "".concat(item.lineWidth, "px");
52
+ boxSpan.style.borderWidth = `${item.lineWidth}px`;
53
53
  boxSpan.style.borderStyle = 'solid';
54
54
  boxSpan.style.display = 'inline-block';
55
55
  boxSpan.style.height = '16px';
@@ -36,7 +36,7 @@ const yAxisTopTitlePlugin = {
36
36
  family,
37
37
  size
38
38
  } = font;
39
- ctx.font = "bold ".concat(size, "px ").concat(family);
39
+ ctx.font = `bold ${size}px ${family}`;
40
40
  ctx.fillStyle = color;
41
41
  ctx.textAlign = 'left';
42
42
  ctx.textBaseline = 'middle';
@@ -5,28 +5,36 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
11
- const FlexContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n\n ", ";\n\n ", ";\n\n ", "\n\n ", "\n"])), _ref => {
9
+ const FlexContainer = _styledComponents.default.div`
10
+ display: flex;
11
+
12
+ ${_ref => {
12
13
  let {
13
14
  marginBottom
14
15
  } = _ref;
15
16
  return marginBottom && 'margin-bottom: var(--spacing-l)';
16
- }, _ref2 => {
17
+ }};
18
+
19
+ ${_ref2 => {
17
20
  let {
18
21
  wrap
19
22
  } = _ref2;
20
23
  return wrap && 'flex-wrap: wrap';
21
- }, _ref3 => {
24
+ }};
25
+
26
+ ${_ref3 => {
22
27
  let {
23
28
  alignCenter
24
29
  } = _ref3;
25
30
  return alignCenter && 'align-items: center;';
26
- }, _ref4 => {
31
+ }}
32
+
33
+ ${_ref4 => {
27
34
  let {
28
35
  spaceBetween
29
36
  } = _ref4;
30
37
  return spaceBetween && 'justify-content: space-between;';
31
- });
38
+ }}
39
+ `;
32
40
  var _default = exports.default = FlexContainer;
@@ -39,8 +39,7 @@ const CropperWrapper = _ref => {
39
39
  }
40
40
  }
41
41
  return () => {
42
- var _node$cropper;
43
- node === null || node === void 0 || (_node$cropper = node.cropper) === null || _node$cropper === void 0 || _node$cropper.destroy();
42
+ node?.cropper?.destroy();
44
43
  };
45
44
  }, [onInitialized, dragMode, width, height, cropBoxResizable]);
46
45
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {