@mainmoneyapp/js-checkout 0.0.0-stage → 0.1.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.
@@ -0,0 +1,516 @@
1
+ .mm-checkout {
2
+ --mm-color-primary: #ff3366;
3
+ --mm-color-secondary: #5f5e5e;
4
+ --mm-color-accent: #b90040;
5
+ --mm-color-background: #f8f9fb;
6
+ font-family: Inter, system-ui, sans-serif;
7
+ color: #191c1e;
8
+ background: var(--mm-color-background);
9
+ border-radius: 16px;
10
+ padding: 1.5rem;
11
+ max-width: 28rem;
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ .mm-checkout *,
16
+ .mm-checkout *::before,
17
+ .mm-checkout *::after {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ .mm-field {
22
+ display: flex;
23
+ flex-direction: column;
24
+ gap: 0.35rem;
25
+ margin-bottom: 1rem;
26
+ }
27
+
28
+ .mm-label {
29
+ font-size: 0.875rem;
30
+ color: var(--mm-color-secondary);
31
+ }
32
+
33
+ .mm-input,
34
+ .mm-select {
35
+ border: 1px solid #e0e3e5;
36
+ border-radius: 8px;
37
+ padding: 0.65rem 0.75rem;
38
+ font-size: 1rem;
39
+ background: #fff;
40
+ }
41
+
42
+ .mm-input:disabled {
43
+ background: #eef0f2;
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ .mm-phone {
48
+ display: flex;
49
+ gap: 0.5rem;
50
+ }
51
+
52
+ .mm-phone-prefix {
53
+ flex: 0 0 4.5rem;
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ border: 1px solid #e0e3e5;
58
+ border-radius: 8px;
59
+ background: #fff;
60
+ color: var(--mm-color-secondary);
61
+ }
62
+
63
+ .mm-amount-row {
64
+ display: flex;
65
+ gap: 0.5rem;
66
+ }
67
+
68
+ .mm-amount-row .mm-input {
69
+ flex: 1 1 auto;
70
+ min-width: 0;
71
+ }
72
+
73
+ .mm-currency-suffix {
74
+ flex: 0 0 5rem;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ border: 1px solid #e0e3e5;
79
+ border-radius: 8px;
80
+ background: #fff;
81
+ color: var(--mm-color-secondary);
82
+ font-size: 0.875rem;
83
+ font-weight: 600;
84
+ padding: 0.65rem 0.5rem;
85
+ }
86
+
87
+ .mm-currency-suffix.mm-select {
88
+ cursor: pointer;
89
+ }
90
+
91
+ .mm-provider {
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: space-between;
95
+ border: 1px solid #e0e3e5;
96
+ border-radius: 8px;
97
+ padding: 0.75rem;
98
+ margin-bottom: 0.5rem;
99
+ cursor: pointer;
100
+ background: #fff;
101
+ }
102
+
103
+ .mm-provider.is-selected,
104
+ .mm-provider.is-highlighted {
105
+ border-color: var(--mm-color-primary);
106
+ box-shadow: 0 0 0 1px var(--mm-color-primary);
107
+ }
108
+
109
+ .mm-badge {
110
+ font-size: 0.75rem;
111
+ color: var(--mm-color-primary);
112
+ font-weight: 600;
113
+ }
114
+
115
+ .mm-overview-row {
116
+ display: flex;
117
+ justify-content: space-between;
118
+ gap: 1rem;
119
+ padding: 0.5rem 0;
120
+ border-bottom: 1px solid #e0e3e5;
121
+ font-size: 0.9375rem;
122
+ }
123
+
124
+ .mm-actions {
125
+ display: flex;
126
+ gap: 0.75rem;
127
+ margin-top: 1rem;
128
+ }
129
+
130
+ .mm-button {
131
+ flex: 1;
132
+ border: none;
133
+ border-radius: 8px;
134
+ padding: 0.75rem 1rem;
135
+ font-size: 1rem;
136
+ cursor: pointer;
137
+ }
138
+
139
+ .mm-button-primary {
140
+ background: var(--mm-color-primary);
141
+ color: #fff;
142
+ }
143
+
144
+ .mm-button-secondary {
145
+ background: #eef0f2;
146
+ color: #191c1e;
147
+ }
148
+
149
+ .mm-error {
150
+ margin-top: 1rem;
151
+ color: var(--mm-color-accent);
152
+ font-size: 0.875rem;
153
+ }
154
+
155
+ .mm-confirm {
156
+ text-align: center;
157
+ padding: 2rem 0;
158
+ }
159
+
160
+ .mm-spinner {
161
+ position: relative;
162
+ width: 4rem;
163
+ height: 4rem;
164
+ margin: 0 auto 1rem;
165
+ }
166
+
167
+ .mm-spinner-curve {
168
+ position: absolute;
169
+ inset: 0;
170
+ border: 3px solid transparent;
171
+ border-top-color: var(--mm-color-primary);
172
+ border-radius: 50%;
173
+ animation: mm-spin 1s linear infinite;
174
+ }
175
+
176
+ .mm-spinner-curve:last-child {
177
+ animation-delay: 0.15s;
178
+ border-top-color: var(--mm-color-accent);
179
+ }
180
+
181
+ .mm-spinner-logo {
182
+ position: absolute;
183
+ inset: 25%;
184
+ width: 50%;
185
+ height: 50%;
186
+ object-fit: contain;
187
+ }
188
+
189
+ @keyframes mm-spin {
190
+ to {
191
+ transform: rotate(360deg);
192
+ }
193
+ }
194
+
195
+ /* ---------- Single-form checkout (deposits) ---------- */
196
+
197
+ .mm-checkout-form {
198
+ --mm-color-ink: #170f2e;
199
+ --mm-color-line: #cfd2d6;
200
+ --mm-color-muted: #8b8f96;
201
+ background: #fff;
202
+ max-width: 32rem;
203
+ padding: 1rem 1.25rem 1.25rem;
204
+ }
205
+
206
+ .mm-form button,
207
+ .mm-form input,
208
+ .mm-form select {
209
+ font: inherit;
210
+ }
211
+
212
+ .mm-header {
213
+ display: flex;
214
+ align-items: center;
215
+ justify-content: space-between;
216
+ gap: 1rem;
217
+ font-size: 0.9rem;
218
+ color: var(--mm-color-muted);
219
+ }
220
+
221
+ .mm-language {
222
+ display: flex;
223
+ align-items: center;
224
+ gap: 0.6rem;
225
+ }
226
+
227
+ .mm-language-option {
228
+ border: none;
229
+ background: none;
230
+ padding: 0;
231
+ cursor: pointer;
232
+ color: var(--mm-color-muted);
233
+ font-weight: 600;
234
+ }
235
+
236
+ .mm-language-option.is-active {
237
+ color: var(--mm-color-ink);
238
+ }
239
+
240
+ .mm-powered {
241
+ display: flex;
242
+ align-items: center;
243
+ gap: 0.4rem;
244
+ color: var(--mm-color-ink);
245
+ font-weight: 600;
246
+ }
247
+
248
+ .mm-powered-logo {
249
+ width: 1.5rem;
250
+ height: 1.5rem;
251
+ object-fit: contain;
252
+ }
253
+
254
+ .mm-powered-brand {
255
+ font-size: 1.1rem;
256
+ }
257
+
258
+ .mm-form-body {
259
+ margin-top: 2.5rem;
260
+ }
261
+
262
+ .mm-title {
263
+ margin: 0 0 0.5rem;
264
+ font-size: 1.75rem;
265
+ line-height: 1.2;
266
+ color: var(--mm-color-ink);
267
+ }
268
+
269
+ .mm-subtitle {
270
+ margin: 0 0 1.25rem;
271
+ color: var(--mm-color-muted);
272
+ font-size: 0.95rem;
273
+ }
274
+
275
+ .mm-tabs {
276
+ display: flex;
277
+ gap: 0.75rem;
278
+ margin-bottom: 1.25rem;
279
+ }
280
+
281
+ .mm-tab {
282
+ flex: 1 1 0;
283
+ min-width: 0;
284
+ border: none;
285
+ border-radius: 999px;
286
+ padding: 0.85rem 0.5rem;
287
+ background: #ececf1;
288
+ color: #3a3a46;
289
+ font-weight: 600;
290
+ cursor: pointer;
291
+ white-space: nowrap;
292
+ overflow: hidden;
293
+ text-overflow: ellipsis;
294
+ }
295
+
296
+ .mm-tab.is-active {
297
+ background: var(--mm-color-ink);
298
+ color: #fff;
299
+ }
300
+
301
+ .mm-pane {
302
+ display: flex;
303
+ flex-direction: column;
304
+ gap: 0.35rem;
305
+ }
306
+
307
+ .mm-floating {
308
+ margin-bottom: 0.75rem;
309
+ }
310
+
311
+ .mm-floating-box {
312
+ position: relative;
313
+ border: 1px solid var(--mm-color-line);
314
+ border-radius: 1.25rem;
315
+ padding: 1.1rem 1rem 0.7rem;
316
+ background: #fafafa;
317
+ }
318
+
319
+ .mm-floating-box:focus-within {
320
+ border-color: var(--mm-color-primary);
321
+ box-shadow: 0 0 0 1px var(--mm-color-primary);
322
+ }
323
+
324
+ .mm-floating-label {
325
+ position: absolute;
326
+ top: -0.55rem;
327
+ left: 0.9rem;
328
+ padding: 0 0.4rem;
329
+ background: #fff;
330
+ color: var(--mm-color-muted);
331
+ font-size: 0.65rem;
332
+ letter-spacing: 0.04em;
333
+ text-transform: uppercase;
334
+ }
335
+
336
+ .mm-input-bare {
337
+ width: 100%;
338
+ border: none;
339
+ outline: none;
340
+ background: transparent;
341
+ padding: 0.3rem 0;
342
+ font-size: 1rem;
343
+ color: var(--mm-color-ink);
344
+ }
345
+
346
+ .mm-hint {
347
+ margin: 0.4rem 0 0;
348
+ font-size: 0.8rem;
349
+ color: var(--mm-color-muted);
350
+ }
351
+
352
+ .mm-phone-row,
353
+ .mm-amount-row {
354
+ display: flex;
355
+ align-items: center;
356
+ gap: 0.5rem;
357
+ }
358
+
359
+ .mm-flag {
360
+ display: inline-flex;
361
+ align-items: center;
362
+ font-size: 1.25rem;
363
+ line-height: 1;
364
+ }
365
+
366
+ .mm-flag-image {
367
+ width: 1.5rem;
368
+ height: 1rem;
369
+ object-fit: cover;
370
+ border-radius: 2px;
371
+ }
372
+
373
+ .mm-dial {
374
+ border: none;
375
+ outline: none;
376
+ background: transparent;
377
+ color: var(--mm-color-ink);
378
+ cursor: pointer;
379
+ padding: 0.3rem 0;
380
+ }
381
+
382
+ .mm-phone-divider {
383
+ align-self: stretch;
384
+ width: 1px;
385
+ background: var(--mm-color-line);
386
+ }
387
+
388
+ .mm-fee-box {
389
+ margin: 0.75rem 0 1rem;
390
+ padding: 1.1rem 1.1rem 0.9rem;
391
+ border: 1px solid var(--mm-color-line);
392
+ border-radius: 1.25rem;
393
+ background: #f2f2f2;
394
+ font-size: 0.95rem;
395
+ }
396
+
397
+ .mm-fee-row {
398
+ display: flex;
399
+ justify-content: space-between;
400
+ gap: 1rem;
401
+ padding: 0.3rem 0;
402
+ }
403
+
404
+ .mm-fee-total {
405
+ margin-top: 0.4rem;
406
+ padding-top: 0.6rem;
407
+ border-top: 1px solid #9a9a9a;
408
+ font-weight: 700;
409
+ }
410
+
411
+ .mm-providers {
412
+ display: grid;
413
+ grid-template-columns: repeat(4, minmax(0, 1fr));
414
+ gap: 0.6rem;
415
+ margin-bottom: 1.1rem;
416
+ }
417
+
418
+ .mm-providers .mm-hint {
419
+ grid-column: 1 / -1;
420
+ }
421
+
422
+ .mm-provider-chip {
423
+ display: flex;
424
+ align-items: center;
425
+ justify-content: center;
426
+ min-height: 3.4rem;
427
+ padding: 0.4rem;
428
+ border: 1px solid #e3e5e8;
429
+ border-radius: 0.9rem;
430
+ background: #fff;
431
+ color: var(--mm-color-ink);
432
+ font-size: 0.75rem;
433
+ cursor: pointer;
434
+ }
435
+
436
+ .mm-provider-chip img {
437
+ max-width: 100%;
438
+ max-height: 2.2rem;
439
+ object-fit: contain;
440
+ }
441
+
442
+ .mm-provider-chip.is-selected {
443
+ border-color: var(--mm-color-primary);
444
+ box-shadow: 0 0 0 1px var(--mm-color-primary);
445
+ }
446
+
447
+ .mm-pay {
448
+ width: 100%;
449
+ border: none;
450
+ border-radius: 999px;
451
+ padding: 1rem;
452
+ background: var(--mm-color-ink);
453
+ color: #fff;
454
+ font-size: 1.05rem;
455
+ font-weight: 700;
456
+ cursor: pointer;
457
+ }
458
+
459
+ .mm-pay:disabled {
460
+ background: #8f8a99;
461
+ cursor: not-allowed;
462
+ }
463
+
464
+ .mm-placeholder {
465
+ align-items: center;
466
+ justify-content: center;
467
+ min-height: 12rem;
468
+ margin-bottom: 1rem;
469
+ padding: 1.5rem;
470
+ border: 1px dashed var(--mm-color-line);
471
+ border-radius: 1.25rem;
472
+ color: var(--mm-color-muted);
473
+ text-align: center;
474
+ }
475
+
476
+ .mm-qr-frame {
477
+ width: 7rem;
478
+ height: 7rem;
479
+ margin-bottom: 0.75rem;
480
+ border: 2px dashed var(--mm-color-line);
481
+ border-radius: 0.75rem;
482
+ }
483
+
484
+ .mm-footer {
485
+ margin-top: 1.25rem;
486
+ text-align: center;
487
+ font-size: 0.8rem;
488
+ color: var(--mm-color-muted);
489
+ }
490
+
491
+ .mm-footer-links {
492
+ display: flex;
493
+ flex-wrap: wrap;
494
+ justify-content: center;
495
+ gap: 0.5rem 1.25rem;
496
+ margin-top: 0.5rem;
497
+ }
498
+
499
+ .mm-footer-links a {
500
+ color: var(--mm-color-muted);
501
+ text-decoration: none;
502
+ }
503
+
504
+ .mm-footer-links a:hover {
505
+ text-decoration: underline;
506
+ }
507
+
508
+ @media (max-width: 26rem) {
509
+ .mm-providers {
510
+ grid-template-columns: repeat(2, minmax(0, 1fr));
511
+ }
512
+
513
+ .mm-title {
514
+ font-size: 1.5rem;
515
+ }
516
+ }
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@mainmoneyapp/js-checkout",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Checkout wizard for the MainMoney JS/TS frontend SDK",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "MainMoney SARL",
8
+ "homepage": "https://github.com/MainMoney-Inc/mm_aggr_js_sdk",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/MainMoney-Inc/mm_aggr_js_sdk.git",
12
+ "directory": "packages/checkout"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/MainMoney-Inc/mm_aggr_js_sdk/issues"
16
+ },
17
+ "keywords": ["mainmoney", "checkout", "payments"],
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ },
25
+ "./styles.css": "./dist/styles.css"
26
+ },
27
+ "files": ["dist", "LICENSE", "README.md"],
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "scripts": {
32
+ "build": "tsup src/index.ts --format esm --dts --clean && cp src/styles.css dist/styles.css && mkdir -p dist/assets && cp src/assets/main_money_square.png dist/assets/",
33
+ "typecheck": "tsc --noEmit -p tsconfig.json"
34
+ },
35
+ "dependencies": {
36
+ "@mainmoneyapp/js-core": "0.1.1",
37
+ "@mainmoneyapp/js-http": "0.1.1"
38
+ }
39
+ }