@cashub/ui 0.48.13 → 0.48.14

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 +41 -25
  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 +13 -21
  32. package/chart/DoughnutChart.js +34 -20
  33. package/chart/LineChart.js +13 -21
  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 +56 -33
  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
@@ -13,14 +13,7 @@ var _utils = require("@cashub/utils");
13
13
  var _hooks = require("./hooks");
14
14
  var _pad = _interopRequireDefault(require("./utils/pad"));
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
17
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
19
- 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; }
20
- 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; }
21
- 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; }
22
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
23
- 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); }
24
17
  const LENGTH = 2;
25
18
  const PAD_STRING = '0';
26
19
  const TimePicker = _ref => {
@@ -46,7 +39,7 @@ const TimePicker = _ref => {
46
39
  });
47
40
  (0, _react.useEffect)(() => {
48
41
  if (typeof onChange === 'function' && time.hour && time.minute && time.second) {
49
- onChange("".concat(time.hour, ":").concat(time.minute, ":").concat(time.second));
42
+ onChange(`${time.hour}:${time.minute}:${time.second}`);
50
43
  }
51
44
  }, [onChange, time.hour, time.minute, time.second]);
52
45
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
@@ -99,7 +92,9 @@ const Hour = _ref2 => {
99
92
  onKeyUp: handleKeyUp,
100
93
  onBlur: event => {
101
94
  setTime(previous => {
102
- const newState = _objectSpread({}, previous);
95
+ const newState = {
96
+ ...previous
97
+ };
103
98
  newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
104
99
  return newState;
105
100
  });
@@ -123,7 +118,7 @@ const Minute = _ref3 => {
123
118
  const NAME = 'minute';
124
119
  const MIN = 0;
125
120
  const MAX = 59;
126
- const [minuteId] = (0, _react.useState)((0, _lodash.default)("".concat(NAME, "-")));
121
+ const [minuteId] = (0, _react.useState)((0, _lodash.default)(`${NAME}-`));
127
122
  const increase = (0, _hooks.useIncrease)(MIN, MAX, setTime, {
128
123
  name: NAME,
129
124
  length: LENGTH,
@@ -151,7 +146,9 @@ const Minute = _ref3 => {
151
146
  onKeyUp: handleKeyUp,
152
147
  onBlur: event => {
153
148
  setTime(previous => {
154
- const newState = _objectSpread({}, previous);
149
+ const newState = {
150
+ ...previous
151
+ };
155
152
  newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
156
153
  return newState;
157
154
  });
@@ -176,7 +173,7 @@ const Second = _ref4 => {
176
173
  const NAME = 'second';
177
174
  const MIN = 0;
178
175
  const MAX = 59;
179
- const [secondId] = (0, _react.useState)((0, _lodash.default)("".concat(NAME, "-")));
176
+ const [secondId] = (0, _react.useState)((0, _lodash.default)(`${NAME}-`));
180
177
  const increase = (0, _hooks.useIncrease)(MIN, MAX, setTime, {
181
178
  name: NAME,
182
179
  length: LENGTH,
@@ -204,7 +201,9 @@ const Second = _ref4 => {
204
201
  onKeyUp: handleKeyUp,
205
202
  onBlur: event => {
206
203
  setTime(previous => {
207
- const newState = _objectSpread({}, previous);
204
+ const newState = {
205
+ ...previous
206
+ };
208
207
  newState[NAME] = (0, _pad.default)(event.target.value, LENGTH, PAD_STRING);
209
208
  return newState;
210
209
  });
@@ -233,14 +232,18 @@ const useKeyUp = (increase, decrease, min, max, setState, name) => {
233
232
  break;
234
233
  case _utils.KEY_CODE.HOME:
235
234
  setState(previous => {
236
- const newState = _objectSpread({}, previous);
235
+ const newState = {
236
+ ...previous
237
+ };
237
238
  newState[name] = (0, _pad.default)(min, LENGTH, PAD_STRING);
238
239
  return newState;
239
240
  });
240
241
  break;
241
242
  case _utils.KEY_CODE.END:
242
243
  setState(previous => {
243
- const newState = _objectSpread({}, previous);
244
+ const newState = {
245
+ ...previous
246
+ };
244
247
  newState[name] = (0, _pad.default)(max, LENGTH, PAD_STRING);
245
248
  return newState;
246
249
  });
@@ -250,13 +253,65 @@ const useKeyUp = (increase, decrease, min, max, setState, name) => {
250
253
  }
251
254
  }, [increase, decrease, min, max, setState, name]);
252
255
  };
253
- const Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
254
- const Label = _styledComponents.default.label(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n color: var(--font-on-background);\n font-size: var(--font-body1);\n margin-right: 12px;\n"])));
255
- const Section = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-flex;\n height: 36px;\n width: 56px;\n padding: calc(var(--spacing-xs) / 2) var(--spacing-xs);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-s);\n background: transparent;\n color: var(--font-on-background);\n"])));
256
- const Input = _styledComponents.default.input(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: calc(100% - 4px - 12px);\n border: none;\n background: transparent;\n color: inherit;\n\n &:focus {\n outline: none;\n }\n"])));
256
+ const Container = _styledComponents.default.div`
257
+ display: flex;
258
+ align-items: center;
259
+ justify-content: center;
260
+ `;
261
+ const Label = _styledComponents.default.label`
262
+ display: inline-block;
263
+ color: var(--font-on-background);
264
+ font-size: var(--font-body1);
265
+ margin-right: 12px;
266
+ `;
267
+ const Section = _styledComponents.default.div`
268
+ display: inline-flex;
269
+ height: 36px;
270
+ width: 56px;
271
+ padding: calc(var(--spacing-xs) / 2) var(--spacing-xs);
272
+ border: var(--border-width) solid var(--border-color);
273
+ border-radius: var(--border-radius-s);
274
+ background: transparent;
275
+ color: var(--font-on-background);
276
+ `;
277
+ const Input = _styledComponents.default.input`
278
+ width: calc(100% - 4px - 12px);
279
+ border: none;
280
+ background: transparent;
281
+ color: inherit;
282
+
283
+ &:focus {
284
+ outline: none;
285
+ }
286
+ `;
257
287
  const StepperButton = _styledComponents.default.div.attrs(() => ({
258
288
  role: 'button'
259
- }))(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 12px;\n height: 12px;\n\n > svg {\n width: 100%;\n height: 100%;\n vertical-align: top;\n }\n\n &:first-child {\n margin-bottom: 2px;\n }\n\n &:hover {\n color: var(--color-primary);\n }\n"])));
260
- const Stepper = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: calc(var(--spacing-xs) / 2);\n"])));
261
- const Delimiter = _styledComponents.default.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: inline-block;\n color: var(--font-on-background);\n font-size: var(--font-body1);\n width: 12px;\n text-align: center;\n"])));
289
+ }))`
290
+ width: 12px;
291
+ height: 12px;
292
+
293
+ > svg {
294
+ width: 100%;
295
+ height: 100%;
296
+ vertical-align: top;
297
+ }
298
+
299
+ &:first-child {
300
+ margin-bottom: 2px;
301
+ }
302
+
303
+ &:hover {
304
+ color: var(--color-primary);
305
+ }
306
+ `;
307
+ const Stepper = _styledComponents.default.div`
308
+ margin-left: calc(var(--spacing-xs) / 2);
309
+ `;
310
+ const Delimiter = _styledComponents.default.span`
311
+ display: inline-block;
312
+ color: var(--font-on-background);
313
+ font-size: var(--font-body1);
314
+ width: 12px;
315
+ text-align: center;
316
+ `;
262
317
  var _default = exports.default = TimePicker;
@@ -6,9 +6,59 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _styledComponents = require("styled-components");
8
8
  var _scrollbar = _interopRequireDefault(require("../styles/mixin/scrollbar"));
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
  // integrate rc-time-picker component
13
- const TimePickerStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .rc-time-picker-panel-narrow {\n max-width: none;\n }\n\n .rc-time-picker-panel {\n .rc-time-picker-panel-inner {\n background: transparent;\n border: none;\n box-shadow: none;\n\n .rc-time-picker-panel-input-wrap {\n display: none;\n }\n\n .rc-time-picker-panel-combobox {\n height: 144px;\n border: var(--border-width) solid var(--border-color);\n color: var(--font-on-background);\n box-shadow: var(--box-shadow);\n border-radius: var(--border-radius);\n background: var(--color-background2);\n\n .rc-time-picker-panel-select {\n font-size: var(--font-body1);\n \n ", "\n\n li {\n &:hover {\n background: var(--color-hover);\n }\n \n &.rc-time-picker-panel-select-option-selected {\n background: var(--color-hover);\n }\n }\n\n &:first-child {\n border-top-left-radius: var(--border-radius);\n border-bottom-left-radius: var(--border-radius);\n }\n }\n }\n }\n\n &.rc-time-picker-panel-placement-bottomLeft {\n .rc-time-picker-panel-inner {\n padding-top: calc(36px + var(--spacing-xs));\n }\n }\n }\n"])), _scrollbar.default);
11
+ const TimePickerStyle = (0, _styledComponents.createGlobalStyle)`
12
+ .rc-time-picker-panel-narrow {
13
+ max-width: none;
14
+ }
15
+
16
+ .rc-time-picker-panel {
17
+ .rc-time-picker-panel-inner {
18
+ background: transparent;
19
+ border: none;
20
+ box-shadow: none;
21
+
22
+ .rc-time-picker-panel-input-wrap {
23
+ display: none;
24
+ }
25
+
26
+ .rc-time-picker-panel-combobox {
27
+ height: 144px;
28
+ border: var(--border-width) solid var(--border-color);
29
+ color: var(--font-on-background);
30
+ box-shadow: var(--box-shadow);
31
+ border-radius: var(--border-radius);
32
+ background: var(--color-background2);
33
+
34
+ .rc-time-picker-panel-select {
35
+ font-size: var(--font-body1);
36
+
37
+ ${_scrollbar.default}
38
+
39
+ li {
40
+ &:hover {
41
+ background: var(--color-hover);
42
+ }
43
+
44
+ &.rc-time-picker-panel-select-option-selected {
45
+ background: var(--color-hover);
46
+ }
47
+ }
48
+
49
+ &:first-child {
50
+ border-top-left-radius: var(--border-radius);
51
+ border-bottom-left-radius: var(--border-radius);
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ &.rc-time-picker-panel-placement-bottomLeft {
58
+ .rc-time-picker-panel-inner {
59
+ padding-top: calc(36px + var(--spacing-xs));
60
+ }
61
+ }
62
+ }
63
+ `;
14
64
  var _default = exports.default = TimePickerStyle;
@@ -13,16 +13,9 @@ var _pad = _interopRequireDefault(require("./utils/pad"));
13
13
  var _form = require("../form");
14
14
  var _scrollbar = _interopRequireDefault(require("../styles/mixin/scrollbar"));
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
17
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
17
  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
18
  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
19
  const LENGTH = 2;
27
20
  const PAD_STRING = '0';
28
21
  const HOUR_OPTIONS = (0, _utils.generateRange)(0, 23).map(value => {
@@ -75,12 +68,13 @@ const TimePickerV2 = _ref => {
75
68
  update();
76
69
  };
77
70
  const handleChange = (type, value) => {
78
- const next = _objectSpread(_objectSpread({}, time), {}, {
71
+ const next = {
72
+ ...time,
79
73
  [type]: value
80
- });
74
+ };
81
75
  setTime(next);
82
76
  if (typeof onSelect === 'function' && next.hour && next.minute && next.second) {
83
- onSelect("".concat(next.hour, ":").concat(next.minute, ":").concat(next.second));
77
+ onSelect(`${next.hour}:${next.minute}:${next.second}`);
84
78
  }
85
79
  };
86
80
 
@@ -111,12 +105,12 @@ const TimePickerV2 = _ref => {
111
105
  type: "text",
112
106
  readOnly: true,
113
107
  onClick: handleToggle,
114
- value: time.hour && time.minute && time.second ? "".concat(time.hour, ":").concat(time.minute, ":").concat(time.second) : ''
115
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Panel, _objectSpread(_objectSpread({
108
+ value: time.hour && time.minute && time.second ? `${time.hour}:${time.minute}:${time.second}` : ''
109
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Panel, {
116
110
  ref: setPopperElement,
117
111
  $display: display,
118
- style: styles.popper
119
- }, attributes.popper), {}, {
112
+ style: styles.popper,
113
+ ...attributes.popper,
120
114
  placement: state && state.placement,
121
115
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Picker, {
122
116
  children: HOUR_OPTIONS.map(option => {
@@ -155,21 +149,60 @@ const TimePickerV2 = _ref => {
155
149
  }, option);
156
150
  })
157
151
  })]
158
- }))]
152
+ })]
159
153
  })
160
154
  });
161
155
  };
162
- const Panel = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n visibility: ", ";\n width: 100%;\n max-width: 360px;\n background: var(--color-background1);\n color: var(--font-on-background);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius);\n box-shadow: var(--box-shadow);\n z-index: 85;\n"])), _ref2 => {
156
+ const Panel = _styledComponents.default.div`
157
+ display: flex;
158
+ visibility: ${_ref2 => {
163
159
  let {
164
160
  $display
165
161
  } = _ref2;
166
162
  return $display ? 'visible' : 'hidden';
167
- });
168
- const Picker = _styledComponents.default.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n text-align: center;\n max-height: 144px;\n overflow-y: auto;\n\n ", "\n\n &:first-child {\n border-top-left-radius: var(--border-radius);\n border-bottom-left-radius: var(--border-radius);\n }\n\n &:not(:last-child) {\n border-right: var(--border-width) solid var(--border-color);\n }\n"])), _scrollbar.default);
169
- const Option = _styledComponents.default.li(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: var(--spacing-xs) 0;\n background: var(--color-background1);\n transition: background 0.3s;\n\n &:hover {\n background: var(--color-hover);\n }\n\n ", "\n"])), _ref3 => {
163
+ }};
164
+ width: 100%;
165
+ max-width: 360px;
166
+ background: var(--color-background1);
167
+ color: var(--font-on-background);
168
+ border: var(--border-width) solid var(--border-color);
169
+ border-radius: var(--border-radius);
170
+ box-shadow: var(--box-shadow);
171
+ z-index: 85;
172
+ `;
173
+ const Picker = _styledComponents.default.ul`
174
+ flex: 1;
175
+ text-align: center;
176
+ max-height: 144px;
177
+ overflow-y: auto;
178
+
179
+ ${_scrollbar.default}
180
+
181
+ &:first-child {
182
+ border-top-left-radius: var(--border-radius);
183
+ border-bottom-left-radius: var(--border-radius);
184
+ }
185
+
186
+ &:not(:last-child) {
187
+ border-right: var(--border-width) solid var(--border-color);
188
+ }
189
+ `;
190
+ const Option = _styledComponents.default.li`
191
+ padding: var(--spacing-xs) 0;
192
+ background: var(--color-background1);
193
+ transition: background 0.3s;
194
+
195
+ &:hover {
196
+ background: var(--color-hover);
197
+ }
198
+
199
+ ${_ref3 => {
170
200
  let {
171
201
  selected
172
202
  } = _ref3;
173
- return selected && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: var(--color-hover);\n "])));
174
- });
203
+ return selected && (0, _styledComponents.css)`
204
+ background: var(--color-hover);
205
+ `;
206
+ }}
207
+ `;
175
208
  var _default = exports.default = TimePickerV2;
@@ -12,11 +12,9 @@ var _utils = require("@cashub/utils");
12
12
  var _DateTimePickerContext = _interopRequireDefault(require("../subComponent/DateTimePickerContext"));
13
13
  var _constant = require("../provider/constant");
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
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); }
18
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; }
19
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
20
18
  const Month = _ref => {
21
19
  let {
22
20
  expand,
@@ -134,44 +132,123 @@ const Month = _ref => {
134
132
  })]
135
133
  });
136
134
  };
137
- const Header = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-content: center;\n position: relative;\n\n > div {\n width: 72px;\n line-height: 36px;\n text-align: center;\n }\n\n &::before {\n content: '';\n border-bottom: var(--border-width) solid var(--border-color);\n position: absolute;\n width: 300px;\n bottom: 0;\n z-index: 1;\n right: -16px;\n }\n"])));
138
- const IconButton = _styledComponents.default.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n background: var(--color-background1);\n border: none;\n color: var(--font-on-background);\n padding: 0;\n transition: 0.3s;\n\n &:hover {\n color: var(--color-primary);\n }\n\n ", "\n\n ", "\n"])), _ref2 => {
135
+ const Header = _styledComponents.default.div`
136
+ display: flex;
137
+ justify-content: center;
138
+ align-content: center;
139
+ position: relative;
140
+
141
+ > div {
142
+ width: 72px;
143
+ line-height: 36px;
144
+ text-align: center;
145
+ }
146
+
147
+ &::before {
148
+ content: '';
149
+ border-bottom: var(--border-width) solid var(--border-color);
150
+ position: absolute;
151
+ width: 300px;
152
+ bottom: 0;
153
+ z-index: 1;
154
+ right: -16px;
155
+ }
156
+ `;
157
+ const IconButton = _styledComponents.default.button`
158
+ width: 36px;
159
+ height: 36px;
160
+ background: var(--color-background1);
161
+ border: none;
162
+ color: var(--font-on-background);
163
+ padding: 0;
164
+ transition: 0.3s;
165
+
166
+ &:hover {
167
+ color: var(--color-primary);
168
+ }
169
+
170
+ ${_ref2 => {
139
171
  let {
140
172
  disabled
141
173
  } = _ref2;
142
- return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n\n &:hover {\n color: var(--font-on-background);\n }\n "])));
143
- }, _ref3 => {
174
+ return disabled && (0, _styledComponents.css)`
175
+ opacity: 0.5;
176
+
177
+ &:hover {
178
+ color: var(--font-on-background);
179
+ }
180
+ `;
181
+ }}
182
+
183
+ ${_ref3 => {
144
184
  let {
145
185
  right,
146
186
  $rotate
147
187
  } = _ref3;
148
- return right && "\n position: absolute;\n right: 0;\n ".concat($rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
149
- });
150
- const Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex-wrap: wrap;\n height: 0;\n width: 100%;\n display: ", ";\n\n ", "\n transition: .3s;\n\n transition: 0.3s;\n"])), _ref4 => {
188
+ return right && `
189
+ position: absolute;
190
+ right: 0;
191
+ ${$rotate && (0, _styledComponents.css)`
192
+ transform: rotate(180deg);
193
+ `}
194
+ `;
195
+ }}
196
+ `;
197
+ const Body = _styledComponents.default.div`
198
+ flex-wrap: wrap;
199
+ height: 0;
200
+ width: 100%;
201
+ display: ${_ref4 => {
151
202
  let {
152
203
  expand
153
204
  } = _ref4;
154
205
  return expand ? 'flex' : 'none';
155
- }, _ref5 => {
206
+ }};
207
+
208
+ ${_ref5 => {
156
209
  let {
157
210
  fixedYear
158
211
  } = _ref5;
159
- return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), fixedYear ? '192' : '144');
160
- });
161
- const Item = _styledComponents.default.button(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: calc(100% / 3);\n height: 36px;\n line-height: 36px;\n text-align: center;\n border-radius: var(--border-radius-s);\n padding: 0;\n border: none;\n color: var(--font-on-background);\n background: var(--color-background1);\n\n &:hover {\n ", "\n }\n\n ", "\n\n ", "\n"])), _ref6 => {
212
+ return (0, _styledComponents.css)`
213
+ min-height: ${fixedYear ? '192' : '144'}px;
214
+ `;
215
+ }}
216
+ transition: .3s;
217
+
218
+ transition: 0.3s;
219
+ `;
220
+ const Item = _styledComponents.default.button`
221
+ width: calc(100% / 3);
222
+ height: 36px;
223
+ line-height: 36px;
224
+ text-align: center;
225
+ border-radius: var(--border-radius-s);
226
+ padding: 0;
227
+ border: none;
228
+ color: var(--font-on-background);
229
+ background: var(--color-background1);
230
+
231
+ &:hover {
232
+ ${_ref6 => {
162
233
  let {
163
234
  disabled
164
235
  } = _ref6;
165
236
  return !disabled && 'background: var(--color-primary)';
166
- }, _ref7 => {
237
+ }}
238
+ }
239
+
240
+ ${_ref7 => {
167
241
  let {
168
242
  disabled
169
243
  } = _ref7;
170
244
  return disabled && 'color: var(--font-on-mute)';
171
- }, _ref8 => {
245
+ }}
246
+
247
+ ${_ref8 => {
172
248
  let {
173
249
  selected
174
250
  } = _ref8;
175
251
  return selected && 'background: var(--color-hover)';
176
- });
252
+ }}
253
+ `;
177
254
  var _default = exports.default = Month;
@@ -12,11 +12,9 @@ var _utils = require("@cashub/utils");
12
12
  var _DateTimePickerContext = _interopRequireDefault(require("../subComponent/DateTimePickerContext"));
13
13
  var _scrollbar = _interopRequireDefault(require("../../styles/mixin/scrollbar"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
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); }
18
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; }
19
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
20
18
  const Year = _ref => {
21
19
  let {
22
20
  expand,
@@ -95,7 +93,7 @@ const Year = _ref => {
95
93
  }
96
94
  }, [fixedYear, selectedDate]);
97
95
  const scroll = (0, _react.useCallback)(() => {
98
- if (bodyRef !== null && bodyRef !== void 0 && bodyRef.current && selectedYearRef !== null && selectedYearRef !== void 0 && selectedYearRef.current) {
96
+ if (bodyRef?.current && selectedYearRef?.current) {
99
97
  const body = bodyRef.current;
100
98
  if (body.scrollTop + body.clientHeight >= body.scrollHeight - 90) {
101
99
  body.removeEventListener('scroll', scroll);
@@ -131,7 +129,7 @@ const Year = _ref => {
131
129
  bodyRef.current.addEventListener('scroll', scroll);
132
130
  }, [scroll]);
133
131
  (0, _react.useEffect)(() => {
134
- if (expand && bodyRef !== null && bodyRef !== void 0 && bodyRef.current && selectedYearRef !== null && selectedYearRef !== void 0 && selectedYearRef.current) {
132
+ if (expand && bodyRef?.current && selectedYearRef?.current) {
135
133
  bodyRef.current.scrollTo({
136
134
  top: selectedYearRef.current.offsetTop - bodyRef.current.offsetTop
137
135
  });
@@ -163,44 +161,124 @@ const Year = _ref => {
163
161
  })]
164
162
  });
165
163
  };
166
- const Header = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-content: center;\n position: relative;\n\n > div {\n width: 72px;\n line-height: 36px;\n text-align: center;\n }\n\n &::before {\n content: '';\n border-bottom: var(--border-width) solid var(--border-color);\n position: absolute;\n width: 300px;\n bottom: 0;\n z-index: 1;\n right: -16px;\n }\n"])));
167
- const IconButton = _styledComponents.default.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n height: 36px;\n background: var(--color-background1);\n border: none;\n color: var(--font-on-background);\n padding: 0;\n transition: 0.3s;\n\n &:hover {\n color: var(--color-primary);\n }\n\n ", "\n\n ", "\n"])), _ref2 => {
164
+ const Header = _styledComponents.default.div`
165
+ display: flex;
166
+ justify-content: center;
167
+ align-content: center;
168
+ position: relative;
169
+
170
+ > div {
171
+ width: 72px;
172
+ line-height: 36px;
173
+ text-align: center;
174
+ }
175
+
176
+ &::before {
177
+ content: '';
178
+ border-bottom: var(--border-width) solid var(--border-color);
179
+ position: absolute;
180
+ width: 300px;
181
+ bottom: 0;
182
+ z-index: 1;
183
+ right: -16px;
184
+ }
185
+ `;
186
+ const IconButton = _styledComponents.default.button`
187
+ width: 36px;
188
+ height: 36px;
189
+ background: var(--color-background1);
190
+ border: none;
191
+ color: var(--font-on-background);
192
+ padding: 0;
193
+ transition: 0.3s;
194
+
195
+ &:hover {
196
+ color: var(--color-primary);
197
+ }
198
+
199
+ ${_ref2 => {
168
200
  let {
169
201
  disabled
170
202
  } = _ref2;
171
- return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n\n &:hover {\n color: var(--font-on-background);\n }\n "])));
172
- }, _ref3 => {
203
+ return disabled && (0, _styledComponents.css)`
204
+ opacity: 0.5;
205
+
206
+ &:hover {
207
+ color: var(--font-on-background);
208
+ }
209
+ `;
210
+ }}
211
+
212
+ ${_ref3 => {
173
213
  let {
174
214
  right,
175
215
  $rotate
176
216
  } = _ref3;
177
- return right && "\n position: absolute;\n right: 0;\n ".concat($rotate && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transform: rotate(180deg);\n "]))), "\n ");
178
- });
179
- const Body = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n flex-wrap: wrap;\n height: 0;\n width: 100%;\n display: ", ";\n transition: 0.3s;\n overflow-y: scroll;\n gap: 12px 0;\n ", "\n\n ", "\n"])), _ref4 => {
217
+ return right && `
218
+ position: absolute;
219
+ right: 0;
220
+ ${$rotate && (0, _styledComponents.css)`
221
+ transform: rotate(180deg);
222
+ `}
223
+ `;
224
+ }}
225
+ `;
226
+ const Body = _styledComponents.default.div`
227
+ flex-wrap: wrap;
228
+ height: 0;
229
+ width: 100%;
230
+ display: ${_ref4 => {
180
231
  let {
181
232
  expand
182
233
  } = _ref4;
183
234
  return expand ? 'flex' : 'none';
184
- }, _scrollbar.default, _ref5 => {
235
+ }};
236
+ transition: 0.3s;
237
+ overflow-y: scroll;
238
+ gap: 12px 0;
239
+ ${_scrollbar.default}
240
+
241
+ ${_ref5 => {
185
242
  let {
186
243
  fixedYear
187
244
  } = _ref5;
188
- return (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n height: ", "px};\n "])), fixedYear ? '144' : '192');
189
- });
190
- const Item = _styledComponents.default.button(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: calc(100% / 3);\n height: 36px;\n line-height: 36px;\n text-align: center;\n border-radius: var(--border-radius-s);\n padding: 0;\n border: none;\n color: var(--font-on-background);\n background: var(--color-background1);\n\n &:hover {\n ", "\n }\n\n ", "\n\n ", "\n"])), _ref6 => {
245
+ return (0, _styledComponents.css)`
246
+ height: ${fixedYear ? '144' : '192'}px};
247
+ `;
248
+ }}
249
+ `;
250
+ const Item = _styledComponents.default.button`
251
+ width: calc(100% / 3);
252
+ height: 36px;
253
+ line-height: 36px;
254
+ text-align: center;
255
+ border-radius: var(--border-radius-s);
256
+ padding: 0;
257
+ border: none;
258
+ color: var(--font-on-background);
259
+ background: var(--color-background1);
260
+
261
+ &:hover {
262
+ ${_ref6 => {
191
263
  let {
192
264
  disabled
193
265
  } = _ref6;
194
266
  return !disabled && 'background: var(--color-primary);';
195
- }, _ref7 => {
267
+ }}
268
+ }
269
+
270
+ ${_ref7 => {
196
271
  let {
197
272
  disabled
198
273
  } = _ref7;
199
274
  return disabled && 'color: var(--font-on-mute)';
200
- }, _ref8 => {
275
+ }}
276
+
277
+ ${_ref8 => {
201
278
  let {
202
279
  selected
203
280
  } = _ref8;
204
281
  return selected && 'background: var(--color-hover)';
205
- });
282
+ }}
283
+ `;
206
284
  var _default = exports.default = Year;