@blocklet/payment-react 1.18.56 → 1.19.1

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 (251) hide show
  1. package/es/checkout/donate.d.ts +1 -15
  2. package/es/checkout/donate.js +301 -189
  3. package/es/checkout/form.d.ts +1 -15
  4. package/es/checkout/form.js +5 -13
  5. package/es/checkout/table.js +3 -3
  6. package/es/components/blockchain/gas.d.ts +1 -5
  7. package/es/components/blockchain/gas.js +10 -2
  8. package/es/components/blockchain/tx.d.ts +1 -8
  9. package/es/components/blockchain/tx.js +29 -10
  10. package/es/components/confirm.d.ts +1 -10
  11. package/es/components/confirm.js +4 -10
  12. package/es/components/country-select.d.ts +3 -2
  13. package/es/components/country-select.js +375 -352
  14. package/es/components/date-range-picker.d.ts +13 -0
  15. package/es/components/date-range-picker.js +279 -0
  16. package/es/components/input.d.ts +14 -20
  17. package/es/components/input.js +51 -44
  18. package/es/components/label.d.ts +7 -0
  19. package/es/components/label.js +49 -0
  20. package/es/components/lazy-loader.js +1 -2
  21. package/es/components/link.d.ts +2 -9
  22. package/es/components/link.js +9 -6
  23. package/es/components/livemode.d.ts +2 -8
  24. package/es/components/livemode.js +1 -5
  25. package/es/components/loading-button.d.ts +6 -1
  26. package/es/components/loading-button.js +56 -66
  27. package/es/components/over-due-invoice-payment.d.ts +0 -18
  28. package/es/components/over-due-invoice-payment.js +138 -95
  29. package/es/components/payment-beneficiaries.d.ts +2 -7
  30. package/es/components/payment-beneficiaries.js +86 -40
  31. package/es/components/pricing-item.d.ts +0 -5
  32. package/es/components/pricing-item.js +1 -4
  33. package/es/components/pricing-table.d.ts +2 -10
  34. package/es/components/pricing-table.js +8 -7
  35. package/es/components/resume-subscription.d.ts +0 -10
  36. package/es/components/resume-subscription.js +42 -21
  37. package/es/components/truncated-text.d.ts +2 -9
  38. package/es/components/truncated-text.js +0 -5
  39. package/es/contexts/donate.d.ts +0 -7
  40. package/es/contexts/donate.js +10 -8
  41. package/es/contexts/payment.d.ts +1 -4
  42. package/es/contexts/payment.js +7 -2
  43. package/es/history/credit/grants-list.d.ts +14 -0
  44. package/es/history/credit/grants-list.js +215 -0
  45. package/es/history/credit/transactions-list.d.ts +13 -0
  46. package/es/history/credit/transactions-list.js +255 -0
  47. package/es/history/invoice/list.d.ts +2 -18
  48. package/es/history/invoice/list.js +172 -74
  49. package/es/history/payment/list.js +115 -38
  50. package/es/hooks/keyboard.d.ts +1 -1
  51. package/es/hooks/keyboard.js +2 -4
  52. package/es/index.d.ts +5 -1
  53. package/es/index.js +10 -1
  54. package/es/libs/cached-request.js +2 -4
  55. package/es/libs/phone-validator.js +1 -2
  56. package/es/libs/util.d.ts +2 -0
  57. package/es/libs/util.js +14 -4
  58. package/es/libs/validator.js +2 -4
  59. package/es/locales/en.js +20 -2
  60. package/es/locales/zh.js +20 -2
  61. package/es/payment/amount.d.ts +2 -7
  62. package/es/payment/amount.js +1 -5
  63. package/es/payment/donation-form.d.ts +2 -10
  64. package/es/payment/donation-form.js +196 -160
  65. package/es/payment/error.d.ts +2 -8
  66. package/es/payment/error.js +40 -20
  67. package/es/payment/footer.d.ts +2 -3
  68. package/es/payment/footer.js +19 -6
  69. package/es/payment/form/addon.js +14 -4
  70. package/es/payment/form/address.d.ts +2 -9
  71. package/es/payment/form/address.js +3 -6
  72. package/es/payment/form/currency.js +45 -25
  73. package/es/payment/form/index.d.ts +2 -8
  74. package/es/payment/form/index.js +151 -71
  75. package/es/payment/form/phone.js +2 -4
  76. package/es/payment/form/stripe/form.d.ts +2 -8
  77. package/es/payment/form/stripe/form.js +1 -3
  78. package/es/payment/header.js +38 -16
  79. package/es/payment/index.d.ts +2 -9
  80. package/es/payment/index.js +23 -17
  81. package/es/payment/product-card.d.ts +2 -11
  82. package/es/payment/product-card.js +84 -50
  83. package/es/payment/product-donation.js +175 -114
  84. package/es/payment/product-item.d.ts +9 -9
  85. package/es/payment/product-item.js +320 -145
  86. package/es/payment/product-skeleton.js +2 -2
  87. package/es/payment/skeleton/donation.js +27 -7
  88. package/es/payment/skeleton/overview.js +22 -2
  89. package/es/payment/skeleton/payment.js +33 -5
  90. package/es/payment/success.d.ts +2 -9
  91. package/es/payment/success.js +41 -14
  92. package/es/payment/summary.d.ts +4 -17
  93. package/es/payment/summary.js +193 -111
  94. package/es/theme/index.d.ts +0 -5
  95. package/es/theme/index.js +2 -5
  96. package/es/theme/typography.d.ts +2 -2
  97. package/lib/checkout/donate.d.ts +1 -15
  98. package/lib/checkout/donate.js +75 -54
  99. package/lib/checkout/form.d.ts +1 -15
  100. package/lib/checkout/form.js +7 -15
  101. package/lib/checkout/table.js +4 -4
  102. package/lib/components/blockchain/gas.d.ts +1 -5
  103. package/lib/components/blockchain/gas.js +3 -2
  104. package/lib/components/blockchain/tx.d.ts +1 -8
  105. package/lib/components/blockchain/tx.js +15 -10
  106. package/lib/components/confirm.d.ts +1 -10
  107. package/lib/components/confirm.js +5 -11
  108. package/lib/components/country-select.d.ts +3 -2
  109. package/lib/components/country-select.js +23 -22
  110. package/lib/components/date-range-picker.d.ts +13 -0
  111. package/lib/components/date-range-picker.js +329 -0
  112. package/lib/components/input.d.ts +14 -20
  113. package/lib/components/input.js +28 -27
  114. package/lib/components/label.d.ts +7 -0
  115. package/lib/components/label.js +60 -0
  116. package/lib/components/lazy-loader.js +1 -1
  117. package/lib/components/link.d.ts +2 -9
  118. package/lib/components/link.js +3 -8
  119. package/lib/components/livemode.d.ts +2 -8
  120. package/lib/components/livemode.js +3 -7
  121. package/lib/components/loading-button.d.ts +6 -1
  122. package/lib/components/loading-button.js +9 -17
  123. package/lib/components/over-due-invoice-payment.d.ts +0 -18
  124. package/lib/components/over-due-invoice-payment.js +31 -33
  125. package/lib/components/payment-beneficiaries.d.ts +2 -7
  126. package/lib/components/payment-beneficiaries.js +12 -11
  127. package/lib/components/pricing-item.d.ts +0 -5
  128. package/lib/components/pricing-item.js +2 -5
  129. package/lib/components/pricing-table.d.ts +2 -10
  130. package/lib/components/pricing-table.js +5 -11
  131. package/lib/components/resume-subscription.d.ts +0 -10
  132. package/lib/components/resume-subscription.js +16 -16
  133. package/lib/components/table.js +1 -1
  134. package/lib/components/truncated-text.d.ts +2 -9
  135. package/lib/components/truncated-text.js +1 -6
  136. package/lib/contexts/donate.d.ts +0 -7
  137. package/lib/contexts/donate.js +4 -7
  138. package/lib/contexts/payment.d.ts +1 -4
  139. package/lib/contexts/payment.js +4 -7
  140. package/lib/history/credit/grants-list.d.ts +14 -0
  141. package/lib/history/credit/grants-list.js +277 -0
  142. package/lib/history/credit/transactions-list.d.ts +13 -0
  143. package/lib/history/credit/transactions-list.js +301 -0
  144. package/lib/history/invoice/list.d.ts +2 -18
  145. package/lib/history/invoice/list.js +73 -37
  146. package/lib/history/payment/list.js +30 -16
  147. package/lib/hooks/keyboard.d.ts +1 -1
  148. package/lib/hooks/mobile.js +1 -1
  149. package/lib/hooks/subscription.js +1 -1
  150. package/lib/index.d.ts +5 -1
  151. package/lib/index.js +41 -2
  152. package/lib/libs/api.js +1 -1
  153. package/lib/libs/dayjs.js +1 -1
  154. package/lib/libs/phone-validator.js +0 -2
  155. package/lib/libs/theme.js +1 -1
  156. package/lib/libs/util.d.ts +2 -0
  157. package/lib/libs/util.js +15 -1
  158. package/lib/libs/validator.js +1 -1
  159. package/lib/locales/en.js +21 -3
  160. package/lib/locales/index.js +1 -1
  161. package/lib/locales/zh.js +21 -3
  162. package/lib/payment/amount.d.ts +2 -7
  163. package/lib/payment/amount.js +2 -6
  164. package/lib/payment/donation-form.d.ts +2 -10
  165. package/lib/payment/donation-form.js +33 -38
  166. package/lib/payment/error.d.ts +2 -8
  167. package/lib/payment/error.js +11 -13
  168. package/lib/payment/footer.d.ts +2 -3
  169. package/lib/payment/footer.js +5 -5
  170. package/lib/payment/form/addon.js +5 -3
  171. package/lib/payment/form/address.d.ts +2 -9
  172. package/lib/payment/form/address.js +5 -8
  173. package/lib/payment/form/currency.js +3 -3
  174. package/lib/payment/form/index.d.ts +2 -8
  175. package/lib/payment/form/index.js +64 -21
  176. package/lib/payment/form/phone.js +1 -1
  177. package/lib/payment/form/stripe/form.d.ts +2 -8
  178. package/lib/payment/form/stripe/form.js +3 -6
  179. package/lib/payment/header.js +8 -4
  180. package/lib/payment/index.d.ts +2 -9
  181. package/lib/payment/index.js +27 -18
  182. package/lib/payment/product-card.d.ts +2 -11
  183. package/lib/payment/product-card.js +13 -20
  184. package/lib/payment/product-donation.js +71 -66
  185. package/lib/payment/product-item.d.ts +9 -9
  186. package/lib/payment/product-item.js +168 -29
  187. package/lib/payment/product-skeleton.js +2 -2
  188. package/lib/payment/skeleton/donation.js +8 -4
  189. package/lib/payment/skeleton/overview.js +6 -2
  190. package/lib/payment/skeleton/payment.js +9 -3
  191. package/lib/payment/success.d.ts +2 -9
  192. package/lib/payment/success.js +12 -15
  193. package/lib/payment/summary.d.ts +4 -17
  194. package/lib/payment/summary.js +53 -45
  195. package/lib/theme/index.d.ts +0 -5
  196. package/lib/theme/index.js +2 -5
  197. package/lib/theme/typography.d.ts +2 -2
  198. package/package.json +40 -40
  199. package/src/checkout/donate.tsx +103 -35
  200. package/src/checkout/form.tsx +5 -14
  201. package/src/checkout/table.tsx +3 -3
  202. package/src/components/blockchain/gas.tsx +5 -3
  203. package/src/components/blockchain/tx.tsx +19 -11
  204. package/src/components/confirm.tsx +4 -11
  205. package/src/components/country-select.tsx +391 -378
  206. package/src/components/date-range-picker.tsx +310 -0
  207. package/src/components/input.tsx +61 -46
  208. package/src/components/label.tsx +58 -0
  209. package/src/components/link.tsx +9 -7
  210. package/src/components/livemode.tsx +2 -6
  211. package/src/components/loading-button.tsx +63 -76
  212. package/src/components/over-due-invoice-payment.tsx +43 -28
  213. package/src/components/payment-beneficiaries.tsx +33 -14
  214. package/src/components/pricing-item.tsx +1 -4
  215. package/src/components/pricing-table.tsx +8 -8
  216. package/src/components/resume-subscription.tsx +20 -14
  217. package/src/components/table.tsx +2 -2
  218. package/src/components/truncated-text.tsx +0 -6
  219. package/src/contexts/donate.tsx +6 -7
  220. package/src/contexts/payment.tsx +7 -3
  221. package/src/history/credit/grants-list.tsx +276 -0
  222. package/src/history/credit/transactions-list.tsx +317 -0
  223. package/src/history/invoice/list.tsx +92 -36
  224. package/src/history/payment/list.tsx +53 -16
  225. package/src/hooks/keyboard.ts +1 -1
  226. package/src/index.ts +9 -0
  227. package/src/libs/util.ts +14 -0
  228. package/src/locales/en.tsx +20 -0
  229. package/src/locales/zh.tsx +19 -0
  230. package/src/payment/amount.tsx +1 -6
  231. package/src/payment/donation-form.tsx +47 -29
  232. package/src/payment/error.tsx +16 -8
  233. package/src/payment/footer.tsx +11 -3
  234. package/src/payment/form/addon.tsx +6 -1
  235. package/src/payment/form/address.tsx +3 -7
  236. package/src/payment/form/currency.tsx +12 -2
  237. package/src/payment/form/index.tsx +121 -45
  238. package/src/payment/form/stripe/form.tsx +1 -5
  239. package/src/payment/header.tsx +14 -2
  240. package/src/payment/index.tsx +27 -22
  241. package/src/payment/product-card.tsx +41 -18
  242. package/src/payment/product-donation.tsx +85 -47
  243. package/src/payment/product-item.tsx +198 -28
  244. package/src/payment/product-skeleton.tsx +3 -2
  245. package/src/payment/skeleton/donation.tsx +12 -2
  246. package/src/payment/skeleton/overview.tsx +12 -2
  247. package/src/payment/skeleton/payment.tsx +16 -3
  248. package/src/payment/success.tsx +26 -15
  249. package/src/payment/summary.tsx +87 -44
  250. package/src/theme/index.tsx +5 -8
  251. package/src/theme/typography.ts +2 -2
@@ -22,7 +22,7 @@ var _payment = require("../contexts/payment");
22
22
  var _livemode = _interopRequireDefault(require("../components/livemode"));
23
23
  var _mobile = require("../hooks/mobile");
24
24
  var _donate = require("../contexts/donate");
25
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
26
26
  const donationCache = {};
27
27
  const createOrUpdateDonation = (settings, livemode = true) => {
28
28
  const donationKey = `${settings.target}-${livemode}`;
@@ -98,9 +98,9 @@ function DonateDetails({
98
98
  },
99
99
  children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
100
100
  direction: "row",
101
- alignItems: "center",
102
101
  spacing: 0.5,
103
102
  sx: {
103
+ alignItems: "center",
104
104
  flex: 3,
105
105
  overflow: "hidden"
106
106
  },
@@ -143,10 +143,10 @@ function DonateDetails({
143
143
  })]
144
144
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
145
145
  direction: "row",
146
- alignItems: "center",
147
- justifyContent: "flex-end",
148
146
  spacing: 0.5,
149
147
  sx: {
148
+ alignItems: "center",
149
+ justifyContent: "flex-end",
150
150
  flex: 1
151
151
  },
152
152
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Avatar, {
@@ -184,9 +184,11 @@ function SupporterAvatar({
184
184
  const customersNum = customers.length;
185
185
  if (customersNum === 0) return null;
186
186
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
187
- flexDirection: "row",
188
- justifyContent: "center",
189
- alignItems: "center",
187
+ sx: {
188
+ flexDirection: "row",
189
+ justifyContent: "center",
190
+ alignItems: "center"
191
+ },
190
192
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
191
193
  max: 5,
192
194
  sx: {
@@ -262,12 +264,14 @@ function SupporterTable({
262
264
  const customersNum = customers.length;
263
265
  if (customersNum === 0) return null;
264
266
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
265
- display: "flex",
266
- flexDirection: "column",
267
- alignItems: "center",
268
- gap: {
269
- xs: 0.5,
270
- sm: 1
267
+ sx: {
268
+ display: "flex",
269
+ flexDirection: "column",
270
+ alignItems: "center",
271
+ gap: {
272
+ xs: 0.5,
273
+ sm: 1
274
+ }
271
275
  },
272
276
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(SupporterAvatar, {
273
277
  supporters,
@@ -294,16 +298,20 @@ function SupporterSimple({
294
298
  const customers = (0, _uniqBy.default)(supporters, "customer_id");
295
299
  const customersNum = customers.length;
296
300
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
297
- display: "flex",
298
- flexDirection: "column",
299
- alignItems: "center",
300
- gap: {
301
- xs: 0.5,
302
- sm: 1
301
+ sx: {
302
+ display: "flex",
303
+ flexDirection: "column",
304
+ alignItems: "center",
305
+ gap: {
306
+ xs: 0.5,
307
+ sm: 1
308
+ }
303
309
  },
304
310
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
305
311
  component: "p",
306
- color: "text.secondary",
312
+ sx: {
313
+ color: "text.secondary"
314
+ },
307
315
  children: customersNum === 0 ? /* @__PURE__ */(0, _jsxRuntime.jsx)("span", {
308
316
  style: emojiFont,
309
317
  children: t("payment.checkout.donation.empty")
@@ -485,8 +493,10 @@ function CheckoutDonateInner({
485
493
  onClick: handlePopoverOpen,
486
494
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
487
495
  direction: "row",
488
- alignItems: "center",
489
496
  spacing: 0.5,
497
+ sx: {
498
+ alignItems: "center"
499
+ },
490
500
  children: [donateSettings.appearance.button.icon, typeof donateSettings.appearance.button.text === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
491
501
  sx: {
492
502
  whiteSpace: "nowrap"
@@ -527,17 +537,21 @@ function CheckoutDonateInner({
527
537
  },
528
538
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {})
529
539
  }), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
530
- display: "flex",
531
- alignItems: "center",
532
- flexDirection: "column",
533
- gap: 2,
540
+ sx: {
541
+ display: "flex",
542
+ alignItems: "center",
543
+ flexDirection: "column",
544
+ gap: 2
545
+ },
534
546
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
535
547
  ...inlineOptions.button,
536
548
  onClick: () => startDonate(),
537
549
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
538
550
  direction: "row",
539
- alignItems: "center",
540
551
  spacing: 0.5,
552
+ sx: {
553
+ alignItems: "center"
554
+ },
541
555
  children: [inlineOptions?.button?.icon, typeof inlineText === "string" ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
542
556
  sx: {
543
557
  whiteSpace: "nowrap"
@@ -554,17 +568,17 @@ function CheckoutDonateInner({
554
568
  });
555
569
  const defaultRender = /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
556
570
  sx: {
571
+ display: "flex",
572
+ flexDirection: "column",
573
+ alignItems: "center",
574
+ gap: {
575
+ xs: 1,
576
+ sm: 2
577
+ },
557
578
  width: "100%",
558
579
  minWidth: 300,
559
580
  maxWidth: 720
560
581
  },
561
- display: "flex",
562
- flexDirection: "column",
563
- alignItems: "center",
564
- gap: {
565
- xs: 1,
566
- sm: 2
567
- },
568
582
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
569
583
  size: donateSettings.appearance?.button?.size || "medium",
570
584
  color: donateSettings.appearance?.button?.color || "primary",
@@ -581,8 +595,10 @@ function CheckoutDonateInner({
581
595
  onClick: () => startDonate(),
582
596
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
583
597
  direction: "row",
584
- alignItems: "center",
585
598
  spacing: 0.5,
599
+ sx: {
600
+ alignItems: "center"
601
+ },
586
602
  children: [donateSettings.appearance.button.icon && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
587
603
  sx: {
588
604
  mr: 0.5,
@@ -622,9 +638,11 @@ function CheckoutDonateInner({
622
638
  children: [renderInnerView(), donation.data && /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.default, {
623
639
  open: state.open,
624
640
  title: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
625
- display: "flex",
626
- alignItems: "center",
627
- gap: 0.5,
641
+ sx: {
642
+ display: "flex",
643
+ alignItems: "center",
644
+ gap: 0.5
645
+ },
628
646
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
629
647
  variant: "h3",
630
648
  sx: {
@@ -658,10 +676,10 @@ function CheckoutDonateInner({
658
676
  }),
659
677
  maxWidth: "md",
660
678
  toolbar: isMobile ? null : /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
661
- display: "flex",
662
- alignItems: "center",
663
- gap: 1,
664
679
  sx: {
680
+ display: "flex",
681
+ alignItems: "center",
682
+ gap: 1,
665
683
  color: "text.secondary"
666
684
  },
667
685
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.AvatarGroup, {
@@ -749,11 +767,25 @@ function CheckoutDonateInner({
749
767
  })]
750
768
  });
751
769
  }
752
- function CheckoutDonate(props) {
770
+ function CheckoutDonate(rawProps) {
771
+ const props = Object.assign({
772
+ theme: "default",
773
+ livemode: void 0,
774
+ inlineOptions: {
775
+ button: {
776
+ text: "Tip"
777
+ }
778
+ },
779
+ timeout: 5e3,
780
+ mode: "default"
781
+ }, rawProps);
753
782
  const {
754
783
  livemode
755
784
  } = (0, _payment.usePaymentContext)();
756
- const content = /* @__PURE__ */(0, _jsxRuntime.jsx)(CheckoutDonateInner, {
785
+ const content =
786
+ // eslint-disable-next-line react/prop-types
787
+ /* @__PURE__ */
788
+ (0, _jsxRuntime.jsx)(CheckoutDonateInner, {
757
789
  ...props,
758
790
  livemode: props.livemode === void 0 ? livemode : props.livemode
759
791
  });
@@ -769,15 +801,4 @@ function CheckoutDonate(props) {
769
801
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_theme.PaymentThemeProvider, {
770
802
  children: content
771
803
  });
772
- }
773
- CheckoutDonate.defaultProps = {
774
- theme: "default",
775
- livemode: void 0,
776
- timeout: 5e3,
777
- mode: "default",
778
- inlineOptions: {
779
- button: {
780
- text: "Tip"
781
- }
782
- }
783
- };
804
+ }
@@ -1,16 +1,2 @@
1
1
  import type { CheckoutProps } from '../types';
2
- declare function CheckoutForm({ id, mode, onPaid, onError, onChange, goBack, extraParams, action, theme, formType, ...restProps }: CheckoutProps): import("react").JSX.Element;
3
- declare namespace CheckoutForm {
4
- var defaultProps: {
5
- onPaid: any;
6
- onError: {
7
- (...data: any[]): void;
8
- (message?: any, ...optionalParams: any[]): void;
9
- };
10
- mode: string;
11
- action: string;
12
- extraParams: {};
13
- formType: string;
14
- };
15
- }
16
- export default CheckoutForm;
2
+ export default function CheckoutForm({ id, mode, onPaid, onError, onChange, goBack, extraParams, action, theme, formType, ...restProps }: CheckoutProps): import("react").JSX.Element;
@@ -14,7 +14,7 @@ var _util = require("../libs/util");
14
14
  var _payment = _interopRequireDefault(require("../payment"));
15
15
  var _theme = require("../theme");
16
16
  var _donationForm = _interopRequireDefault(require("../payment/donation-form"));
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
18
  const promises = {};
19
19
  const startFromPaymentLink = (id, params) => {
20
20
  if (!promises[id]) {
@@ -34,13 +34,13 @@ const fetchCheckoutSession = async id => {
34
34
  };
35
35
  function CheckoutForm({
36
36
  id,
37
- mode,
38
- onPaid,
39
- onError,
37
+ mode = "inline",
38
+ onPaid = _noop.default,
39
+ onError = console.error,
40
40
  onChange,
41
41
  goBack,
42
- extraParams,
43
- action,
42
+ extraParams = {},
43
+ action = "",
44
44
  theme = "default",
45
45
  formType = "payment",
46
46
  ...restProps
@@ -119,12 +119,4 @@ function CheckoutForm({
119
119
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_theme.PaymentThemeProvider, {
120
120
  children: Checkout
121
121
  });
122
- }
123
- CheckoutForm.defaultProps = {
124
- onPaid: _noop.default,
125
- onError: console.error,
126
- mode: "inline",
127
- action: "",
128
- extraParams: {},
129
- formType: "payment"
130
- };
122
+ }
@@ -18,7 +18,7 @@ var _util = require("../libs/util");
18
18
  var _form = _interopRequireDefault(require("./form"));
19
19
  var _theme = require("../theme");
20
20
  var _truncatedText = _interopRequireDefault(require("../components/truncated-text"));
21
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
22
  const fetchData = async id => {
23
23
  const {
24
24
  data
@@ -103,8 +103,8 @@ function CheckoutTableInner({
103
103
  if (mode === "standalone") {
104
104
  return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
105
105
  direction: "column",
106
- alignItems: "center",
107
106
  sx: {
107
+ alignItems: "center",
108
108
  overflow: {
109
109
  xs: "auto",
110
110
  md: "hidden"
@@ -140,9 +140,9 @@ function CheckoutTableInner({
140
140
  ml: 0
141
141
  }
142
142
  }), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
143
- color: "text.primary",
144
- fontWeight: 600,
145
143
  sx: {
144
+ color: "text.primary",
145
+ fontWeight: 600,
146
146
  lineHeight: "32px",
147
147
  fontSize: "24px"
148
148
  },
@@ -1,9 +1,5 @@
1
1
  import type { PaymentDetails, TPaymentMethod } from '@blocklet/payment-types';
2
- declare function TxGas(props: {
2
+ export default function TxGas(props: {
3
3
  details: PaymentDetails;
4
4
  method: TPaymentMethod;
5
5
  }): import("react").JSX.Element;
6
- declare namespace TxGas {
7
- var defaultProps: {};
8
- }
9
- export default TxGas;
@@ -10,7 +10,6 @@ var _material = require("@mui/material");
10
10
  var _util = require("@ocap/util");
11
11
  var _payment = require("../../contexts/payment");
12
12
  var _util2 = require("../../libs/util");
13
- TxGas.defaultProps = {};
14
13
  function TxGas(props) {
15
14
  const {
16
15
  t
@@ -31,7 +30,9 @@ function TxGas(props) {
31
30
  }
32
31
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
33
32
  component: "small",
34
- color: "text.secondary",
33
+ sx: {
34
+ color: "text.secondary"
35
+ },
35
36
  children: t("common.none")
36
37
  });
37
38
  }
@@ -1,14 +1,7 @@
1
1
  import type { PaymentDetails, TPaymentMethod } from '@blocklet/payment-types';
2
- declare function TxLink(props: {
2
+ export default function TxLink({ details, method, mode, align, }: {
3
3
  details: PaymentDetails;
4
4
  method: TPaymentMethod;
5
5
  mode?: 'customer' | 'dashboard';
6
6
  align?: 'left' | 'right';
7
7
  }): import("react").JSX.Element;
8
- declare namespace TxLink {
9
- var defaultProps: {
10
- mode: string;
11
- align: string;
12
- };
13
- }
14
- export default TxLink;
@@ -10,25 +10,28 @@ var _iconsMaterial = require("@mui/icons-material");
10
10
  var _material = require("@mui/material");
11
11
  var _system = require("@mui/system");
12
12
  var _util = require("../../libs/util");
13
- TxLink.defaultProps = {
14
- mode: "dashboard",
15
- align: "left"
16
- };
17
- function TxLink(props) {
13
+ function TxLink({
14
+ details,
15
+ method,
16
+ mode = "dashboard",
17
+ align = "left"
18
+ }) {
18
19
  const {
19
20
  t
20
21
  } = (0, _context.useLocaleContext)();
21
- if (!props.details || props.mode === "customer" && props.method.type === "stripe") {
22
+ if (!details || mode === "customer" && method.type === "stripe") {
22
23
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
23
24
  component: "small",
24
- color: "text.secondary",
25
+ sx: {
26
+ color: "text.secondary"
27
+ },
25
28
  children: t("common.none")
26
29
  });
27
30
  }
28
31
  const {
29
32
  text,
30
33
  link
31
- } = (0, _util.getTxLink)(props.method, props.details);
34
+ } = (0, _util.getTxLink)(method, details);
32
35
  if (link && text) {
33
36
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Link, {
34
37
  href: link,
@@ -37,7 +40,7 @@ function TxLink(props) {
37
40
  children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(Root, {
38
41
  direction: "row",
39
42
  alignItems: "center",
40
- justifyContent: props.align === "left" ? "flex-start" : "flex-end",
43
+ justifyContent: align === "left" ? "flex-start" : "flex-end",
41
44
  sx: {
42
45
  color: "text.link"
43
46
  },
@@ -56,7 +59,9 @@ function TxLink(props) {
56
59
  }
57
60
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
58
61
  component: "small",
59
- color: "text.secondary",
62
+ sx: {
63
+ color: "text.secondary"
64
+ },
60
65
  children: t("common.none")
61
66
  });
62
67
  }
@@ -1,5 +1,5 @@
1
1
  import type { EventHandler } from 'react';
2
- declare function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, color, cancel, loading, }: {
2
+ export default function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, color, cancel, loading, }: {
3
3
  onConfirm: EventHandler<any>;
4
4
  onCancel: EventHandler<any>;
5
5
  title: string | React.ReactNode;
@@ -9,12 +9,3 @@ declare function ConfirmDialog({ onConfirm, onCancel, title, message, confirm, c
9
9
  cancel?: boolean | string | React.ReactNode;
10
10
  loading?: boolean;
11
11
  }): import("react").JSX.Element;
12
- declare namespace ConfirmDialog {
13
- var defaultProps: {
14
- loading: boolean;
15
- confirm: string;
16
- cancel: string;
17
- color: string;
18
- };
19
- }
20
- export default ConfirmDialog;
@@ -13,10 +13,10 @@ function ConfirmDialog({
13
13
  onCancel,
14
14
  title,
15
15
  message,
16
- confirm,
17
- color,
18
- cancel,
19
- loading
16
+ confirm = "",
17
+ color = "error",
18
+ cancel = "",
19
+ loading = false
20
20
  }) {
21
21
  const {
22
22
  t
@@ -47,10 +47,4 @@ function ConfirmDialog({
47
47
  children: message
48
48
  })
49
49
  });
50
- }
51
- ConfirmDialog.defaultProps = {
52
- loading: false,
53
- confirm: "",
54
- cancel: "",
55
- color: "error"
56
- };
50
+ }
@@ -7,5 +7,6 @@ export type CountrySelectProps = {
7
7
  sx?: SxProps;
8
8
  showDialCode?: boolean;
9
9
  };
10
- declare const CountrySelect: import("react").ForwardRefExoticComponent<CountrySelectProps & import("react").RefAttributes<HTMLDivElement>>;
11
- export default CountrySelect;
10
+ export default function CountrySelect({ ref, value, onChange, name, sx, showDialCode, }: CountrySelectProps & {
11
+ ref?: React.RefObject<HTMLDivElement | null>;
12
+ }): import("react").JSX.Element;
@@ -3,28 +3,32 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
6
+ module.exports = CountrySelect;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _react = require("react");
9
9
  var _material = require("@mui/material");
10
10
  var _reactHookForm = require("react-hook-form");
11
11
  var _reactInternationalPhone = require("react-international-phone");
12
12
  var _mobile = require("../hooks/mobile");
13
- const Transition = (0, _react.forwardRef)(function Transition2(props, ref) {
13
+ function Transition({
14
+ ref,
15
+ ...props
16
+ }) {
14
17
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Slide, {
15
18
  direction: "up",
16
19
  ref,
17
20
  timeout: 200,
18
21
  ...props
19
22
  });
20
- });
21
- const CountrySelect = (0, _react.forwardRef)(({
23
+ }
24
+ function CountrySelect({
25
+ ref = void 0,
22
26
  value,
23
27
  onChange,
24
28
  name,
25
- sx,
29
+ sx = {},
26
30
  showDialCode = false
27
- }, ref) => {
31
+ }) {
28
32
  const {
29
33
  setValue
30
34
  } = (0, _reactHookForm.useFormContext)();
@@ -237,16 +241,18 @@ const CountrySelect = (0, _react.forwardRef)(({
237
241
  children: parsed.name
238
242
  }), showDialCode && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
239
243
  sx: {
244
+ color: "text.secondary",
240
245
  ml: 1
241
246
  },
242
- color: "text.secondary",
243
247
  children: `+${parsed.dialCode}`
244
248
  })]
245
249
  }, parsed.iso2);
246
250
  }) : /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.MenuItem, {
247
251
  disabled: true,
248
252
  children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
249
- color: "text.secondary",
253
+ sx: {
254
+ color: "text.secondary"
255
+ },
250
256
  children: "No countries found"
251
257
  })
252
258
  })
@@ -313,11 +319,11 @@ const CountrySelect = (0, _react.forwardRef)(({
313
319
  setValue(name, e.target.value);
314
320
  },
315
321
  renderValue: code => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
316
- display: "flex",
317
- alignItems: "center",
318
- flexWrap: "nowrap",
319
- gap: 0.5,
320
322
  sx: {
323
+ display: "flex",
324
+ alignItems: "center",
325
+ flexWrap: "nowrap",
326
+ gap: 0.5,
321
327
  cursor: "pointer"
322
328
  },
323
329
  children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_reactInternationalPhone.FlagEmoji, {
@@ -339,11 +345,11 @@ const CountrySelect = (0, _react.forwardRef)(({
339
345
  },
340
346
  children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
341
347
  onClick: () => setOpen(true),
342
- display: "flex",
343
- alignItems: "center",
344
- flexWrap: "nowrap",
345
- gap: 0.5,
346
348
  sx: {
349
+ display: "flex",
350
+ alignItems: "center",
351
+ flexWrap: "nowrap",
352
+ gap: 0.5,
347
353
  cursor: "pointer",
348
354
  padding: "8px",
349
355
  paddingRight: "24px",
@@ -421,9 +427,4 @@ const CountrySelect = (0, _react.forwardRef)(({
421
427
  })]
422
428
  })]
423
429
  });
424
- });
425
- CountrySelect.defaultProps = {
426
- sx: {},
427
- showDialCode: false
428
- };
429
- module.exports = CountrySelect;
430
+ }
@@ -0,0 +1,13 @@
1
+ export interface DateRangeValue {
2
+ start: number | undefined;
3
+ end: number | undefined;
4
+ }
5
+ export interface DateRangePickerProps {
6
+ value: DateRangeValue;
7
+ onChange: (value: DateRangeValue) => void;
8
+ label?: string;
9
+ size?: 'small' | 'medium';
10
+ fullWidth?: boolean;
11
+ disabled?: boolean;
12
+ }
13
+ export default function DateRangePicker({ value, onChange, label, size, fullWidth, disabled, }: DateRangePickerProps): import("react").JSX.Element;