@blocklet/payment-react 1.14.21 → 1.14.22

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 (136) hide show
  1. package/es/checkout/donate.d.ts +2 -1
  2. package/es/checkout/donate.js +9 -10
  3. package/es/checkout/form.d.ts +1 -1
  4. package/es/checkout/form.js +23 -1
  5. package/es/checkout/table.d.ts +1 -1
  6. package/es/checkout/table.js +8 -1
  7. package/es/components/blockchain/tx.js +2 -1
  8. package/es/components/country-select.d.ts +16 -0
  9. package/es/components/country-select.js +82 -0
  10. package/es/components/input.d.ts +21 -21
  11. package/es/components/input.js +43 -42
  12. package/es/components/livemode.js +1 -0
  13. package/es/components/pricing-table.js +0 -2
  14. package/es/components/status.js +2 -3
  15. package/es/components/table.d.ts +2 -0
  16. package/es/components/table.js +186 -0
  17. package/es/contexts/payment.d.ts +2 -0
  18. package/es/contexts/payment.js +5 -2
  19. package/es/history/invoice/list.d.ts +3 -1
  20. package/es/history/invoice/list.js +215 -48
  21. package/es/hooks/mobile.d.ts +4 -0
  22. package/es/hooks/mobile.js +10 -0
  23. package/es/index.d.ts +5 -1
  24. package/es/index.js +7 -1
  25. package/es/libs/util.d.ts +15 -2
  26. package/es/libs/util.js +92 -28
  27. package/es/locales/en.js +22 -7
  28. package/es/locales/index.d.ts +0 -1
  29. package/es/locales/index.js +10 -1
  30. package/es/locales/zh.js +21 -6
  31. package/es/payment/error.js +2 -2
  32. package/es/payment/footer.js +1 -1
  33. package/es/payment/form/address.d.ts +9 -2
  34. package/es/payment/form/address.js +69 -69
  35. package/es/payment/form/currency.js +39 -25
  36. package/es/payment/form/index.d.ts +1 -1
  37. package/es/payment/form/index.js +83 -81
  38. package/es/payment/form/phone.js +15 -51
  39. package/es/payment/index.d.ts +1 -10
  40. package/es/payment/index.js +274 -219
  41. package/es/payment/product-card.js +4 -4
  42. package/es/payment/product-donation.js +7 -2
  43. package/es/payment/product-item.d.ts +2 -2
  44. package/es/payment/product-item.js +120 -81
  45. package/es/payment/summary.js +188 -118
  46. package/es/theme/index.css +240 -0
  47. package/es/theme/index.d.ts +9 -0
  48. package/es/theme/index.js +243 -0
  49. package/es/theme/typography.d.ts +2 -0
  50. package/es/theme/typography.js +53 -0
  51. package/es/types/index.d.ts +11 -0
  52. package/lib/checkout/donate.d.ts +2 -1
  53. package/lib/checkout/donate.js +14 -2
  54. package/lib/checkout/form.d.ts +1 -1
  55. package/lib/checkout/form.js +22 -1
  56. package/lib/checkout/table.d.ts +1 -1
  57. package/lib/checkout/table.js +14 -1
  58. package/lib/components/blockchain/tx.js +4 -1
  59. package/lib/components/country-select.d.ts +16 -0
  60. package/lib/components/country-select.js +115 -0
  61. package/lib/components/input.d.ts +21 -21
  62. package/lib/components/input.js +21 -12
  63. package/lib/components/livemode.js +1 -0
  64. package/lib/components/pricing-table.js +0 -2
  65. package/lib/components/status.js +2 -3
  66. package/lib/components/table.d.ts +2 -0
  67. package/lib/components/table.js +220 -0
  68. package/lib/contexts/payment.d.ts +2 -0
  69. package/lib/contexts/payment.js +4 -1
  70. package/lib/history/invoice/list.d.ts +3 -1
  71. package/lib/history/invoice/list.js +290 -62
  72. package/lib/hooks/mobile.d.ts +4 -0
  73. package/lib/hooks/mobile.js +17 -0
  74. package/lib/index.d.ts +5 -1
  75. package/lib/index.js +36 -0
  76. package/lib/libs/util.d.ts +15 -2
  77. package/lib/libs/util.js +115 -37
  78. package/lib/locales/en.js +22 -7
  79. package/lib/locales/index.d.ts +0 -1
  80. package/lib/locales/index.js +14 -3
  81. package/lib/locales/zh.js +21 -6
  82. package/lib/payment/error.js +5 -1
  83. package/lib/payment/footer.js +1 -1
  84. package/lib/payment/form/address.d.ts +9 -2
  85. package/lib/payment/form/address.js +67 -59
  86. package/lib/payment/form/currency.js +31 -24
  87. package/lib/payment/form/index.d.ts +1 -1
  88. package/lib/payment/form/index.js +92 -93
  89. package/lib/payment/form/phone.js +11 -59
  90. package/lib/payment/index.d.ts +1 -10
  91. package/lib/payment/index.js +291 -219
  92. package/lib/payment/product-card.js +5 -4
  93. package/lib/payment/product-donation.js +9 -2
  94. package/lib/payment/product-item.d.ts +2 -2
  95. package/lib/payment/product-item.js +38 -19
  96. package/lib/payment/summary.js +219 -127
  97. package/lib/theme/index.css +240 -0
  98. package/lib/theme/index.d.ts +9 -0
  99. package/lib/theme/index.js +259 -0
  100. package/lib/theme/typography.d.ts +2 -0
  101. package/lib/theme/typography.js +59 -0
  102. package/lib/types/index.d.ts +11 -0
  103. package/package.json +14 -11
  104. package/src/checkout/donate.tsx +16 -10
  105. package/src/checkout/form.tsx +23 -0
  106. package/src/checkout/table.tsx +13 -1
  107. package/src/components/blockchain/tx.tsx +2 -1
  108. package/src/components/country-select.tsx +93 -0
  109. package/src/components/input.tsx +49 -46
  110. package/src/components/livemode.tsx +1 -0
  111. package/src/components/pricing-table.tsx +0 -2
  112. package/src/components/status.tsx +1 -2
  113. package/src/components/table.tsx +200 -0
  114. package/src/contexts/payment.tsx +6 -1
  115. package/src/history/invoice/list.tsx +254 -49
  116. package/src/hooks/mobile.ts +13 -0
  117. package/src/index.ts +7 -0
  118. package/src/libs/util.ts +120 -31
  119. package/src/locales/en.tsx +18 -4
  120. package/src/locales/index.tsx +10 -3
  121. package/src/locales/zh.tsx +17 -3
  122. package/src/payment/error.tsx +2 -2
  123. package/src/payment/footer.tsx +1 -1
  124. package/src/payment/form/address.tsx +56 -47
  125. package/src/payment/form/currency.tsx +29 -23
  126. package/src/payment/form/index.tsx +89 -76
  127. package/src/payment/form/phone.tsx +14 -51
  128. package/src/payment/index.tsx +294 -242
  129. package/src/payment/product-card.tsx +4 -4
  130. package/src/payment/product-donation.tsx +7 -3
  131. package/src/payment/product-item.tsx +49 -20
  132. package/src/payment/summary.tsx +191 -108
  133. package/src/theme/index.css +240 -0
  134. package/src/theme/index.tsx +250 -0
  135. package/src/theme/typography.ts +56 -0
  136. package/src/types/index.ts +12 -0
@@ -0,0 +1,240 @@
1
+ :root {
2
+ /* Light Theme */
3
+ /* Color */
4
+ --backgrounds-bg-base: #ffffff;
5
+ --backgrounds-bg-base-hover: #f9fafb;
6
+ --backgrounds-bg-base-pressed: #f3f4f6;
7
+ --backgrounds-bg-component: #f1f3f5;
8
+ --backgrounds-bg-component-hover: #e5e7eb;
9
+ --backgrounds-bg-disabled: #f3f4f6;
10
+ --backgrounds-bg-field: #f9fafb;
11
+ --backgrounds-bg-field-hover: #f3f4f6;
12
+ --backgrounds-bg-glass: #ffffffb8;
13
+ --backgrounds-bg-highlight: #eff6ff;
14
+ --backgrounds-bg-highlight-hover: #dbeafe;
15
+ --backgrounds-bg-interactive: #3b82f6;
16
+ --backgrounds-bg-interactive-hover: #2563eb;
17
+ --backgrounds-bg-overlay: #03071266;
18
+ --backgrounds-bg-subtle: #f9fafb;
19
+ --backgrounds-bg-subtle-hover: #f3f4f6;
20
+ --backgrounds-bg-subtle-pressed: #e5e7eb;
21
+ --backgrounds-bg-switch-off: #e5e7eb;
22
+ --backgrounds-bg-switch-off-hover: #d1d5db;
23
+ --buttons-button-danger: #e11d48;
24
+ --buttons-button-danger-hover: #be123c;
25
+ --buttons-button-danger-pressed: #9f1239;
26
+ --buttons-button-inverted: #030712;
27
+ --buttons-button-inverted-hover: #111827;
28
+ --buttons-button-inverted-pressed: #1f2937;
29
+ --buttons-button-neutral: #ffffff;
30
+ --buttons-button-neutral-hover: #f3f4f6;
31
+ --buttons-button-neutral-pressed: #e5e7eb;
32
+ --buttons-button-transparent: #ffffff00;
33
+ --buttons-button-transparent-hover: #f3f4f6;
34
+ --buttons-button-transparent-pressed: #e5e7eb;
35
+ --foregrounds-fg-base: #030712;
36
+ --foregrounds-fg-danger: #e11d48;
37
+ --foregrounds-fg-disabled: #d1d5db;
38
+ --foregrounds-fg-interactive: #3b82f6;
39
+ --foregrounds-fg-interactive-hover: #2563eb;
40
+ --foregrounds-fg-muted: #9ca3af;
41
+ --foregrounds-fg-on-color: #ffffff;
42
+ --foregrounds-fg-on-inverted: #ffffff;
43
+ --foregrounds-fg-subtle: #4b5563;
44
+ --others-spacer: #ffffff00;
45
+ --shadows-card-hover-1: #03071214;
46
+ --shadows-card-hover-2: #03071214;
47
+ --shadows-card-hover-3: #0307121a;
48
+ --shadows-card-rest-1: #03071214;
49
+ --shadows-card-rest-2: #03071214;
50
+ --shadows-card-rest-3: #0307120a;
51
+ --shadows-danger-1: #e11d48;
52
+ --shadows-error-2: #e11d4826;
53
+ --shadows-flyout-1: #03071214;
54
+ --shadows-flyout-2: #03071214;
55
+ --shadows-interactive-with-active-1: #3b82f6;
56
+ --shadows-interactive-with-active-2: #3b82f633;
57
+ --shadows-interactive-with-shadow-1: #1e3a8a80;
58
+ --shadows-interactive-with-shadow-2: #3b82f6;
59
+ --shadows-modal-1: #ffffff;
60
+ --shadows-modal-2: #e5e7eb66;
61
+ --shadows-modal-3: #03071214;
62
+ --shadows-modal-4: #03071214;
63
+ --shadows-modal-5: #03071214;
64
+ --shadows-switch-background-1: #0307120a;
65
+ --shadows-switch-background-2: #0307120a;
66
+ --shadows-switch-background-3: #0307120f;
67
+ --shadows-switch-background-4: #03071205;
68
+ --shadows-switch-background-5: #0307120a;
69
+ --shadows-switch-handle-1: #ffffff;
70
+ --shadows-switch-handle-2: #ffffff;
71
+ --shadows-switch-handle-3: #03071205;
72
+ --shadows-switch-handle-4: #03071205;
73
+ --shadows-switch-handle-5: #0307120a;
74
+ --shadows-switch-handle-6: #0307121f;
75
+ --shadows-switch-handle-7: #03071214;
76
+ --shadows-tooltip-1: #03071214;
77
+ --shadows-tooltip-2: #03071214;
78
+ --stroke-border-base: #eff1f5;
79
+ --stroke-border-error: #e11d48;
80
+ --stroke-border-interactive: #3b82f6;
81
+ --stroke-border-loud: #030712;
82
+ --stroke-border-strong: #d1d5db;
83
+ --stroke-sep: #eff1f5;
84
+ --tags-tag-blue-bg: #dbeafe;
85
+ --tags-tag-blue-bg-hover: #bfdbfe;
86
+ --tags-tag-blue-border: #bfdbfe;
87
+ --tags-tag-blue-icon: #2563eb;
88
+ --tags-tag-blue-text: #1d4ed8;
89
+ --tags-tag-green-bg: #d1fae5;
90
+ --tags-tag-green-bg-hover: #a7f3d0;
91
+ --tags-tag-green-border: #a7f3d0;
92
+ --tags-tag-green-icon: #059669;
93
+ --tags-tag-green-text: #047857;
94
+ --tags-tag-neutral-bg: #f3f4f6;
95
+ --tags-tag-neutral-bg-hover: #e5e7eb;
96
+ --tags-tag-neutral-border: #e5e7eb;
97
+ --tags-tag-neutral-icon: #6b7280;
98
+ --tags-tag-neutral-text: #4b5563;
99
+ --tags-tag-orange-bg: #fef4c7;
100
+ --tags-tag-orange-bg-hover: #fde68a;
101
+ --tags-tag-orange-border: #fde68a;
102
+ --tags-tag-orange-icon: #d97706;
103
+ --tags-tag-orange-text: #b45309;
104
+ --tags-tag-purple-bg: #ede9fe;
105
+ --tags-tag-purple-bg-hover: #ddd6fe;
106
+ --tags-tag-purple-border: #ddd6fe;
107
+ --tags-tag-purple-icon: #7c3aed;
108
+ --tags-tag-purple-text: #6d28d9;
109
+ --tags-tag-red-bg: #ffe4e6;
110
+ --tags-tag-red-bg-hover: #fecdd3;
111
+ --tags-tag-red-border: #fecdd3;
112
+ --tags-tag-red-icon: #e11d48;
113
+ --tags-tag-red-text: #be123c;
114
+ /* Number */
115
+ --radius-s: 0.25rem;
116
+ --radius-m: 0.5rem;
117
+ --radius-l: 0.75rem;
118
+ --radius-round: 624.9375rem;
119
+ --stroke-button-secondary-border: #e5e7eb;
120
+ }
121
+ [data-theme='dark'] {
122
+ /* Dark Theme */
123
+ /* Color */
124
+ --backgrounds-bg-base: #1b1b1f;
125
+ --backgrounds-bg-base-hover: #27282d;
126
+ --backgrounds-bg-base-pressed: #2e3035;
127
+ --backgrounds-bg-component: #27282d;
128
+ --backgrounds-bg-component-hover: #27282d;
129
+ --backgrounds-bg-disabled: #27282d;
130
+ --backgrounds-bg-field: #27282d;
131
+ --backgrounds-bg-field-hover: #2e3035;
132
+ --backgrounds-bg-glass: #1b1b1fb8;
133
+ --backgrounds-bg-highlight: #172554;
134
+ --backgrounds-bg-highlight-hover: #1e3a8a;
135
+ --backgrounds-bg-interactive: #60a5fa;
136
+ --backgrounds-bg-interactive-hover: #60a5fa;
137
+ --backgrounds-bg-overlay: #18181ab2;
138
+ --backgrounds-bg-subtle: #18181a;
139
+ --backgrounds-bg-subtle-hover: #1b1b1f;
140
+ --backgrounds-bg-subtle-pressed: #27282d;
141
+ --backgrounds-bg-switch-off: #35373c;
142
+ --backgrounds-bg-switch-off-hover: #464b50;
143
+ --buttons-button-danger: #9f1239;
144
+ --buttons-button-danger-hover: #be123c;
145
+ --buttons-button-danger-pressed: #e11d48;
146
+ --buttons-button-inverted: #edeef0;
147
+ --buttons-button-inverted-hover: #ffffff;
148
+ --buttons-button-inverted-pressed: #edeef0;
149
+ --buttons-button-neutral: #27282d;
150
+ --buttons-button-neutral-hover: #35373c;
151
+ --buttons-button-neutral-pressed: #3c3f44;
152
+ --buttons-button-transparent: #ffffff00;
153
+ --buttons-button-transparent-hover: #27282d;
154
+ --buttons-button-transparent-pressed: #2e3035;
155
+ --foregrounds-fg-base: #edeef0;
156
+ --foregrounds-fg-danger: #fb7185;
157
+ --foregrounds-fg-disabled: #3c3f44;
158
+ --foregrounds-fg-interactive: #60a5fa;
159
+ --foregrounds-fg-interactive-hover: #3b82f6;
160
+ --foregrounds-fg-muted: #696e77;
161
+ --foregrounds-fg-on-color: #ffffff;
162
+ --foregrounds-fg-on-inverted: #0a0a0a;
163
+ --foregrounds-fg-subtle: #adb1b8;
164
+ --others-spacer: #ffffff;
165
+ --shadows-card-hover-1: #ffffff1a;
166
+ --shadows-card-hover-2: #ffffff29;
167
+ --shadows-card-hover-3: #00000066;
168
+ --shadows-card-rest-1: #ffffff1a;
169
+ --shadows-card-rest-2: #ffffff29;
170
+ --shadows-card-rest-3: #00000066;
171
+ --shadows-danger-1: #f43f5e1a;
172
+ --shadows-error-2: #e11d4840;
173
+ --shadows-flyout-1: #ffffff1a;
174
+ --shadows-flyout-2: #00000052;
175
+ --shadows-interactive-with-active-1: #60a5fa;
176
+ --shadows-interactive-with-active-2: #3b82f640;
177
+ --shadows-interactive-with-shadow-1: #dbeafe80;
178
+ --shadows-interactive-with-shadow-2: #60a5fa;
179
+ --shadows-modal-1: #171717;
180
+ --shadows-modal-2: #2e303566;
181
+ --shadows-modal-3: #ffffff1a;
182
+ --shadows-modal-4: #00000052;
183
+ --shadows-modal-5: #00000052;
184
+ --shadows-switch-background-1: #0000001a;
185
+ --shadows-switch-background-2: #0000001a;
186
+ --shadows-switch-background-3: #ffffff29;
187
+ --shadows-switch-background-4: #0000001a;
188
+ --shadows-switch-background-5: #00000033;
189
+ --shadows-switch-handle-1: #ffffff;
190
+ --shadows-switch-handle-2: #ffffff;
191
+ --shadows-switch-handle-3: #00000029;
192
+ --shadows-switch-handle-4: #0000001a;
193
+ --shadows-switch-handle-5: #0000001a;
194
+ --shadows-switch-handle-6: #0000001a;
195
+ --shadows-switch-handle-7: #0000001a;
196
+ --shadows-tooltip-1: #ffffff1a;
197
+ --shadows-tooltip-2: #00000052;
198
+ --stroke-border-base: #2e3035;
199
+ --stroke-border-error: #f43f5e;
200
+ --stroke-border-interactive: #60a5fa;
201
+ --stroke-border-loud: #edeef0;
202
+ --stroke-border-strong: #35373c;
203
+ --stroke-sep: #2e3035;
204
+ --tags-tag-blue-bg: #172554;
205
+ --tags-tag-blue-bg-hover: #1e2a8a;
206
+ --tags-tag-blue-border: #1e3a8a;
207
+ --tags-tag-blue-icon: #1d4ed8;
208
+ --tags-tag-blue-text: #3b82f6;
209
+ --tags-tag-green-bg: #022c22;
210
+ --tags-tag-green-bg-hover: #064e3b;
211
+ --tags-tag-green-border: #064e3b;
212
+ --tags-tag-green-icon: #047857;
213
+ --tags-tag-green-text: #10b981;
214
+ --tags-tag-neutral-bg: #2e3035;
215
+ --tags-tag-neutral-bg-hover: #35373c;
216
+ --tags-tag-neutral-border: #3c3f44;
217
+ --tags-tag-neutral-icon: #7d828a;
218
+ --tags-tag-neutral-text: #adb1b8;
219
+ --tags-tag-orange-bg: #451a03;
220
+ --tags-tag-orange-bg-hover: #78350f;
221
+ --tags-tag-orange-border: #78350f;
222
+ --tags-tag-orange-icon: #b45309;
223
+ --tags-tag-orange-text: #f59e0b;
224
+ --tags-tag-purple-bg: #2e1064;
225
+ --tags-tag-purple-bg-hover: #4c1d95;
226
+ --tags-tag-purple-border: #3c3f44;
227
+ --tags-tag-purple-icon: #6d28d9;
228
+ --tags-tag-purple-text: #8b5cf6;
229
+ --tags-tag-red-bg: #4c0519;
230
+ --tags-tag-red-bg-hover: #881337;
231
+ --tags-tag-red-border: #881337;
232
+ --tags-tag-red-icon: #f43f5e;
233
+ --tags-tag-red-text: #ff6369;
234
+ /* number */
235
+ --radius-s: 0.25rem;
236
+ --radius-m: 0.5rem;
237
+ --radius-l: 0.75rem;
238
+ --radius-round: 624.9375rem;
239
+ --stroke-button-secondary-border: #27282d;
240
+ }
@@ -0,0 +1,9 @@
1
+ import { type ThemeOptions } from '@mui/material/styles';
2
+ import React from 'react';
3
+ import { typography } from './typography';
4
+ import './index.css';
5
+ export { typography };
6
+ export declare const themeOverrides: Partial<ThemeOptions>;
7
+ export declare function PaymentThemeProvider({ children }: {
8
+ children: React.ReactNode;
9
+ }): JSX.Element;
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PaymentThemeProvider = PaymentThemeProvider;
7
+ exports.themeOverrides = void 0;
8
+ Object.defineProperty(exports, "typography", {
9
+ enumerable: true,
10
+ get: function () {
11
+ return _typography.typography;
12
+ }
13
+ });
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ var _styles = require("@mui/material/styles");
16
+ var _Theme = require("@arcblock/ux/lib/Theme");
17
+ var _material = require("@mui/material");
18
+ var _typography = require("./typography");
19
+ require("./index.css");
20
+ const themeOverrides = exports.themeOverrides = {
21
+ shape: {
22
+ borderRadius: 8
23
+ },
24
+ components: {
25
+ MuiOutlinedInput: {
26
+ styleOverrides: {
27
+ root: {
28
+ borderRadius: "var(--radius-m, 8px)",
29
+ backgroundColor: "var(--backgrounds-bg-field)",
30
+ "&.Mui-disabled": {
31
+ backgroundColor: "var(--backgrounds-bg-disabled)"
32
+ },
33
+ ".MuiOutlinedInput-notchedOutline": {
34
+ borderColor: "var(--stroke-border-base, #EFF1F5)"
35
+ },
36
+ ".MuiInputBase-input": {
37
+ fontSize: "14px",
38
+ minHeight: "1.65em",
39
+ lineHeight: "1.65em"
40
+ }
41
+ }
42
+ }
43
+ },
44
+ MuiButton: {
45
+ defaultProps: {
46
+ size: "small"
47
+ },
48
+ styleOverrides: {
49
+ root: {
50
+ fontSize: "1rem",
51
+ fontWeight: 500,
52
+ textTransform: "none"
53
+ },
54
+ containedPrimary: {
55
+ backgroundColor: "var(--buttons-button-inverted, #010714)",
56
+ color: "var(--foregrounds-fg-on-color, #fff)",
57
+ "&:hover": {
58
+ backgroundColor: "var(--buttons-button-inverted-hover, #1f2937)"
59
+ }
60
+ },
61
+ outlinedPrimary: {
62
+ color: "var(--foregrounds-fg-base, #010714)",
63
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)",
64
+ "&:hover": {
65
+ backgroundColor: "var(--buttons-button-neutral-hover, #F3F4F6)",
66
+ borderColor: "var(--stroke-button-secondary-border, #E5E7EB)"
67
+ }
68
+ },
69
+ sizeSmall: {
70
+ height: 32
71
+ }
72
+ }
73
+ },
74
+ MuiIconButton: {
75
+ defaultProps: {
76
+ size: "small"
77
+ },
78
+ styleOverrides: {
79
+ root: {
80
+ textTransform: "none"
81
+ },
82
+ colorPrimary: {
83
+ backgroundColor: "#fff"
84
+ }
85
+ }
86
+ },
87
+ MuiToggleButton: {
88
+ styleOverrides: {
89
+ root: {
90
+ textTransform: "none"
91
+ }
92
+ }
93
+ },
94
+ MuiTab: {
95
+ styleOverrides: {
96
+ root: {
97
+ textTransform: "none"
98
+ }
99
+ }
100
+ },
101
+ MuiTooltip: {
102
+ defaultProps: {
103
+ enterTouchDelay: 3e3,
104
+ leaveTouchDelay: 100
105
+ }
106
+ },
107
+ MuiPopover: {
108
+ styleOverrides: {
109
+ paper: ({
110
+ theme
111
+ }) => ({
112
+ border: `1px solid ${theme.palette.divider}`,
113
+ boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"
114
+ })
115
+ }
116
+ },
117
+ MuiCssBaseline: {
118
+ styleOverrides: {
119
+ ".base-card": {
120
+ padding: "20px",
121
+ borderRadius: "var(--radius-l)",
122
+ background: "var(--backgrounds-bg-base)",
123
+ boxShadow: "0px 0px 0px 1px var(--shadows-card-rest-1, rgba(2, 7, 19, 0.08)), 0px 1px 2px -1px var(--shadows-card-rest-2, rgba(2, 7, 19, 0.08)), 0px 2px 4px 0px var(--shadows-card-rest-3, rgba(2, 7, 19, 0.04))"
124
+ },
125
+ ".base-label": {
126
+ color: "var(--foregrounds-fg-base, #010714)",
127
+ fontSize: "16px",
128
+ fontWeight: "500",
129
+ lineHeight: "24px"
130
+ },
131
+ a: {
132
+ textDecoration: "none !important"
133
+ }
134
+ }
135
+ },
136
+ // MuiButtonBase: {
137
+ // styleOverrides: {
138
+ // }
139
+ // },
140
+ MuiRadio: {
141
+ styleOverrides: {
142
+ root: {
143
+ color: "var(--stroke-border-base, #EFF1F5)",
144
+ "&:hover": {
145
+ background: "none"
146
+ },
147
+ "&.Mui-checked": {
148
+ color: "var(--foregrounds-fg-interactive, #0086FF)"
149
+ }
150
+ }
151
+ }
152
+ },
153
+ MuiCheckbox: {
154
+ styleOverrides: {
155
+ root: {
156
+ color: "var(--backgrounds-bg-interactive, #0086FF)",
157
+ "&.Mui-checked": {
158
+ color: "var(--foregrounds-fg-interactive, #0086FF)"
159
+ }
160
+ }
161
+ }
162
+ },
163
+ MuiDivider: {
164
+ styleOverrides: {
165
+ root: {
166
+ borderColor: "var(--stroke-border-base, #EFF1F5)"
167
+ }
168
+ }
169
+ },
170
+ MuiInputBase: {
171
+ defaultProps: {
172
+ size: "small"
173
+ },
174
+ styleOverrides: {
175
+ root: () => ({
176
+ fontSize: "0.875rem",
177
+ backgroundColor: "var(--backgrounds-bg-field, #F9FAFB)"
178
+ })
179
+ }
180
+ },
181
+ MuiInputLabel: {
182
+ defaultProps: {
183
+ size: "small"
184
+ },
185
+ styleOverrides: {
186
+ root: () => ({
187
+ fontSize: "0.875rem"
188
+ })
189
+ }
190
+ },
191
+ MuiChip: {
192
+ styleOverrides: {
193
+ root: {
194
+ borderRadius: "var(--radius-S, 4px)",
195
+ border: "1px solid transparent",
196
+ "&.MuiChip-filledSuccess": {
197
+ color: "var(--tags-tag-green-text, #007C52)",
198
+ backgroundColor: "var(--tags-tag-green-bg, #B7FEE3)",
199
+ borderColor: "var(--tags-tag-green-border, #63F9CB)"
200
+ },
201
+ "&.MuiChip-filledDefault": {
202
+ color: "var(--tags-tag-neutral-text, #007C52)",
203
+ backgroundColor: "var(--tags-tag-neutral-bg, #B7FEE3)",
204
+ borderColor: "var(--tags-tag-neutral-border, #E5E7EB)"
205
+ },
206
+ "&.MuiChip-filledSecondary": {
207
+ color: "var(--tags-tag-purple-text, #8118EB)",
208
+ backgroundColor: " var(--tags-tag-purple-bg, #EFE9FF)",
209
+ borderColor: "var(--tags-tag-purple-border, #E1D6FF)"
210
+ },
211
+ "&.MuiChip-filledError": {
212
+ color: "var(--tags-tag-red-text, #E40031)",
213
+ backgroundColor: "var(--tags-tag-red-bg, #FFE2E6)",
214
+ borderColor: "var(--tags-tag-red-border, #FFC8D3)"
215
+ },
216
+ "&.MuiChip-filledWarning": {
217
+ color: "var(--tags-tag-orange-text, #D24000)",
218
+ backgroundColor: "var(--tags-tag-orange-bg, #FFF4BC)",
219
+ borderColor: "var(--tags-tag-orange-border, #FFE467)"
220
+ },
221
+ "&.MuiChip-filledPrimary,&.MuiChip-filledInfo": {
222
+ color: "var(--tags-tag-blue-text, #0051E9)",
223
+ backgroundColor: "var(--tags-tag-blue-bg, #D2ECFF)",
224
+ borderColor: "var(--tags-tag-blue-border, #AFDDFF)"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ };
231
+ function PaymentThemeProvider({
232
+ children
233
+ }) {
234
+ const theme = (0, _styles.useTheme)();
235
+ const rootStyle = getComputedStyle(document.documentElement);
236
+ const merged = (0, _Theme.create)({
237
+ ...theme,
238
+ typography: _typography.typography,
239
+ palette: {
240
+ primary: {
241
+ main: rootStyle.getPropertyValue("--foregrounds-fg-base").trim() || "#030712"
242
+ },
243
+ text: {
244
+ primary: rootStyle.getPropertyValue("--foregrounds-fg-base").trim() || "#030712",
245
+ secondary: rootStyle.getPropertyValue("--foregrounds-fg-subtle").trim() || "#4b5563",
246
+ lighter: rootStyle.getPropertyValue("--foregrounds-fg-muted").trim() || "#9ca3af",
247
+ link: rootStyle.getPropertyValue("--foregrounds-fg-interactive").trim() || "#0086FF"
248
+ },
249
+ error: {
250
+ main: rootStyle.getPropertyValue("--foregrounds-fg-danger").trim() || "#FF003B"
251
+ }
252
+ },
253
+ ...themeOverrides
254
+ });
255
+ return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
256
+ theme: merged,
257
+ children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CssBaseline, {}), children]
258
+ });
259
+ }
@@ -0,0 +1,2 @@
1
+ import type { TypographyOptions } from '@mui/material/styles/createTypography';
2
+ export declare const typography: TypographyOptions;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.typography = void 0;
7
+ const typography = exports.typography = {
8
+ h1: {
9
+ fontSize: "1.875rem",
10
+ lineHeight: 1.2,
11
+ fontWeight: 800,
12
+ letterSpacing: "-.025em"
13
+ },
14
+ h2: {
15
+ fontSize: "1.5rem",
16
+ lineHeight: 1.3333333,
17
+ fontWeight: 700,
18
+ letterSpacing: "-.025em"
19
+ },
20
+ h3: {
21
+ fontSize: "1.25rem",
22
+ lineHeight: 1.4,
23
+ fontWeight: 600,
24
+ letterSpacing: "-.025em"
25
+ },
26
+ h4: {
27
+ fontSize: "1.125rem",
28
+ lineHeight: 1.5,
29
+ fontWeight: 600
30
+ },
31
+ h5: {
32
+ fontSize: "1rem",
33
+ lineHeight: 1.75,
34
+ fontWeight: 400
35
+ },
36
+ h6: {
37
+ fontSize: "1rem",
38
+ lineHeight: 1.75,
39
+ fontWeight: 400
40
+ },
41
+ subtitle1: {
42
+ fontSize: "1rem",
43
+ lineHeight: 1.75,
44
+ fontWeight: 400
45
+ },
46
+ subtitle2: {
47
+ fontSize: "1rem",
48
+ lineHeight: 1.75,
49
+ fontWeight: 400
50
+ },
51
+ body1: {
52
+ fontSize: "1rem",
53
+ lineHeight: 1.75
54
+ },
55
+ fontWeightLight: 300,
56
+ fontWeightRegular: 400,
57
+ fontWeightMedium: 500,
58
+ fontWeightBold: 700
59
+ };
@@ -29,6 +29,7 @@ export type CheckoutProps = Partial<CheckoutCallbacks> & {
29
29
  extraParams?: Record<string, any>;
30
30
  action?: string;
31
31
  mode?: LiteralUnion<'standalone' | 'inline' | 'popup' | 'inline-minimal' | 'popup-minimal', string>;
32
+ customTheme?: boolean;
32
33
  };
33
34
  export type CheckoutCallbacks = {
34
35
  onPaid: (res: CheckoutContext) => void;
@@ -42,3 +43,13 @@ export type PricingRenderProps = {
42
43
  quantity: string;
43
44
  totalAmount: string;
44
45
  };
46
+ export type ActionProps = {
47
+ [key: string]: {
48
+ color?: string;
49
+ variant?: string;
50
+ sx?: {
51
+ [key: string]: any;
52
+ };
53
+ text?: string;
54
+ };
55
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.14.21",
3
+ "version": "1.14.22",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -18,7 +18,7 @@
18
18
  "scripts": {
19
19
  "lint": "tsc --noEmit && eslint src tests --ext js --ext jsx --ext ts --ext tsx",
20
20
  "lint:fix": "npm run lint -- --fix",
21
- "build": "tsc --noEmit && unbuild && node tools/auto-exports.js",
21
+ "build": "tsc --noEmit && unbuild && node tools/auto-exports.js && npm run cpfiles",
22
22
  "watch": "CONSOLA_LEVEL=1 nodemon -e .jsx,.js,.ts,.tsx -w src -x 'yalc publish --push'",
23
23
  "precommit": "CI=1 npm run lint",
24
24
  "prepush": "CI=1 npm run lint",
@@ -26,7 +26,8 @@
26
26
  "test": "node tools/jest.js",
27
27
  "coverage": "npm run test -- --coverage",
28
28
  "storybook": "storybook dev -p 6006",
29
- "build-storybook": "storybook build"
29
+ "build-storybook": "storybook build",
30
+ "cpfiles": "copyfiles -u 1 './src/**/*.css' lib/ && copyfiles -u 1 './src/**/*.css' es/"
30
31
  },
31
32
  "bugs": {
32
33
  "url": "https://github.com/blocklet/payment-kit/issues"
@@ -52,15 +53,16 @@
52
53
  }
53
54
  },
54
55
  "dependencies": {
55
- "@arcblock/did-connect": "^2.10.11",
56
- "@arcblock/ux": "^2.10.11",
57
- "@arcblock/ws": "^1.18.127",
56
+ "@arcblock/did-connect": "^2.10.16",
57
+ "@arcblock/ux": "^2.10.16",
58
+ "@arcblock/ws": "^1.18.128",
59
+ "@blocklet/ui-react": "^2.10.16",
58
60
  "@mui/icons-material": "^5.16.6",
59
61
  "@mui/lab": "^5.0.0-alpha.173",
60
62
  "@mui/material": "^5.16.6",
61
63
  "@mui/styles": "^5.16.6",
62
64
  "@mui/system": "^5.16.6",
63
- "@ocap/util": "^1.18.127",
65
+ "@ocap/util": "^1.18.128",
64
66
  "@stripe/react-stripe-js": "^2.7.3",
65
67
  "@stripe/stripe-js": "^2.4.0",
66
68
  "@vitejs/plugin-legacy": "^5.4.1",
@@ -91,7 +93,7 @@
91
93
  "@babel/core": "^7.25.2",
92
94
  "@babel/preset-env": "^7.25.2",
93
95
  "@babel/preset-react": "^7.24.7",
94
- "@blocklet/payment-types": "1.14.21",
96
+ "@blocklet/payment-types": "1.14.22",
95
97
  "@storybook/addon-essentials": "^7.6.20",
96
98
  "@storybook/addon-interactions": "^7.6.20",
97
99
  "@storybook/addon-links": "^7.6.20",
@@ -103,14 +105,15 @@
103
105
  "@types/react": "^18.3.3",
104
106
  "@types/react-dom": "^18.3.0",
105
107
  "@vitejs/plugin-legacy": "^5.4.1",
108
+ "copyfiles": "^2.4.1",
106
109
  "eslint": "^8.57.0",
107
110
  "glob": "^10.4.5",
108
111
  "import-sort-style-module": "^6.0.0",
109
112
  "jest": "^29.7.0",
110
113
  "prettier": "^3.3.3",
111
114
  "prettier-plugin-import-sort": "^0.0.7",
112
- "react": "^18.3.1",
113
- "react-dom": "^18.3.1",
115
+ "react": "18.2.0",
116
+ "react-dom": "18.2.0",
114
117
  "rollup-plugin-node-builtins": "^2.1.2",
115
118
  "storybook": "^7.6.20",
116
119
  "ts-jest": "^29.2.3",
@@ -120,5 +123,5 @@
120
123
  "vite-plugin-babel": "^1.2.0",
121
124
  "vite-plugin-node-polyfills": "^0.21.0"
122
125
  },
123
- "gitHead": "48565120b3bdaf21533fe73626db725330c0f374"
126
+ "gitHead": "1fabd8f359e12e8ac68b20bd2d0d04b7928d16f3"
124
127
  }