@pisti-paypiller/react 0.0.0-stage → 0.7.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 (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +159 -2
  3. package/dist/api-keys.d.ts +8 -0
  4. package/dist/api-keys.d.ts.map +1 -0
  5. package/dist/api-keys.js +54 -0
  6. package/dist/api-keys.js.map +1 -0
  7. package/dist/async-state.d.ts +14 -0
  8. package/dist/async-state.d.ts.map +1 -0
  9. package/dist/async-state.js +81 -0
  10. package/dist/async-state.js.map +1 -0
  11. package/dist/auth.d.ts +23 -0
  12. package/dist/auth.d.ts.map +1 -0
  13. package/dist/auth.js +297 -0
  14. package/dist/auth.js.map +1 -0
  15. package/dist/client.d.ts +152 -0
  16. package/dist/client.d.ts.map +1 -0
  17. package/dist/client.js +633 -0
  18. package/dist/client.js.map +1 -0
  19. package/dist/context.d.ts +94 -0
  20. package/dist/context.d.ts.map +1 -0
  21. package/dist/context.js +145 -0
  22. package/dist/context.js.map +1 -0
  23. package/dist/index.d.ts +15 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +9 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/organizations.d.ts +16 -0
  28. package/dist/organizations.d.ts.map +1 -0
  29. package/dist/organizations.js +169 -0
  30. package/dist/organizations.js.map +1 -0
  31. package/dist/resources.d.ts +204 -0
  32. package/dist/resources.d.ts.map +1 -0
  33. package/dist/resources.js +129 -0
  34. package/dist/resources.js.map +1 -0
  35. package/dist/reverification.d.ts +5 -0
  36. package/dist/reverification.d.ts.map +1 -0
  37. package/dist/reverification.js +54 -0
  38. package/dist/reverification.js.map +1 -0
  39. package/dist/types.d.ts +118 -0
  40. package/dist/types.d.ts.map +1 -0
  41. package/dist/types.js +2 -0
  42. package/dist/types.js.map +1 -0
  43. package/dist/ui.d.ts +72 -0
  44. package/dist/ui.d.ts.map +1 -0
  45. package/dist/ui.js +125 -0
  46. package/dist/ui.js.map +1 -0
  47. package/dist/user-profile.d.ts +6 -0
  48. package/dist/user-profile.d.ts.map +1 -0
  49. package/dist/user-profile.js +219 -0
  50. package/dist/user-profile.js.map +1 -0
  51. package/package.json +48 -4
  52. package/styles.css +517 -0
package/styles.css ADDED
@@ -0,0 +1,517 @@
1
+ .pisti-ui {
2
+ --pisti-surface: var(--pisti-color-background, var(--card, #fff));
3
+ --pisti-text: var(--pisti-color-text, var(--foreground, #18181b));
4
+ --pisti-muted: var(--pisti-color-muted, var(--muted-foreground, #62626d));
5
+ --pisti-border: var(--pisti-color-border, var(--border, #dedee4));
6
+ --pisti-accent: var(--pisti-brand, #1d1d1a);
7
+ --pisti-accent-text: var(--pisti-brand-text, #fafaf7);
8
+ --pisti-radius: 0.5rem;
9
+ color: var(--pisti-text);
10
+ font: inherit;
11
+ font-family: var(--pisti-font, inherit);
12
+ line-height: 1.5;
13
+ max-width: 52rem;
14
+ min-width: 0;
15
+ text-align: start;
16
+ }
17
+ .pisti-ui *,
18
+ .pisti-ui *::before,
19
+ .pisti-ui *::after {
20
+ box-sizing: border-box;
21
+ }
22
+ .pisti-ui h1,
23
+ .pisti-ui h2,
24
+ .pisti-ui h3,
25
+ .pisti-ui h4 {
26
+ line-height: 1.25;
27
+ margin: 0 0 0.75rem;
28
+ }
29
+ .pisti-ui h1 {
30
+ font-size: 1.5rem;
31
+ letter-spacing: -0.025em;
32
+ }
33
+ .pisti-ui h2 {
34
+ font-size: 1.125rem;
35
+ }
36
+ .pisti-ui h3 {
37
+ font-size: 1rem;
38
+ }
39
+ .pisti-ui p {
40
+ margin: 0.5rem 0 1rem;
41
+ }
42
+ .pisti-ui input,
43
+ .pisti-ui select,
44
+ .pisti-ui button {
45
+ font: inherit;
46
+ }
47
+ .pisti-ui input:not([type="checkbox"]),
48
+ .pisti-ui select {
49
+ width: 100%;
50
+ min-height: 2.65rem;
51
+ padding: 0.6rem 0.75rem;
52
+ border: 1px solid var(--pisti-border);
53
+ border-radius: var(--pisti-radius);
54
+ background: var(--pisti-surface);
55
+ color: var(--pisti-text);
56
+ }
57
+ .pisti-ui input[type="checkbox"] {
58
+ width: 1rem;
59
+ height: 1rem;
60
+ accent-color: var(--pisti-accent);
61
+ }
62
+ .pisti-ui label {
63
+ display: grid;
64
+ gap: 0.4rem;
65
+ font-size: 0.875rem;
66
+ font-weight: 500;
67
+ }
68
+ .pisti-ui button {
69
+ display: inline-flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ gap: 0.4rem;
73
+ min-height: 2.5rem;
74
+ padding: 0.5rem 0.85rem;
75
+ border: 1px solid transparent;
76
+ border-radius: var(--pisti-radius);
77
+ background: var(--pisti-accent);
78
+ color: var(--pisti-accent-text);
79
+ cursor: pointer;
80
+ font-weight: 500;
81
+ }
82
+ .pisti-ui .pisti-secondary {
83
+ background: var(--pisti-surface);
84
+ color: var(--pisti-text);
85
+ border-color: var(--pisti-border);
86
+ }
87
+ .pisti-ui .pisti-danger {
88
+ background: #b42332;
89
+ color: #fff;
90
+ }
91
+ .pisti-ui button:disabled,
92
+ .pisti-ui fieldset:disabled {
93
+ opacity: 0.65;
94
+ cursor: default;
95
+ }
96
+ .pisti-ui :focus-visible {
97
+ outline: 3px solid var(--pisti-accent);
98
+ outline-offset: 3px;
99
+ }
100
+ .pisti-ui a {
101
+ color: var(--pisti-accent);
102
+ text-underline-offset: 0.2em;
103
+ }
104
+ .pisti-ui .pisti-muted {
105
+ color: var(--pisti-muted);
106
+ font-size: 0.875rem;
107
+ font-weight: 400;
108
+ }
109
+ .pisti-form {
110
+ margin: 1.25rem 0;
111
+ }
112
+ .pisti-form fieldset {
113
+ display: grid;
114
+ gap: 1rem;
115
+ min-width: 0;
116
+ margin: 0;
117
+ padding: 0;
118
+ border: 0;
119
+ }
120
+ .pisti-form legend {
121
+ margin-bottom: 1rem;
122
+ font-weight: 600;
123
+ }
124
+ .pisti-form button {
125
+ justify-self: start;
126
+ }
127
+ .pisti-grid {
128
+ display: grid;
129
+ grid-template-columns: repeat(2, minmax(0, 1fr));
130
+ gap: 1rem;
131
+ }
132
+ .pisti-actions {
133
+ display: flex;
134
+ flex-wrap: wrap;
135
+ gap: 0.75rem;
136
+ align-items: center;
137
+ }
138
+ .pisti-navigation {
139
+ display: flex;
140
+ flex-wrap: wrap;
141
+ gap: 0.5rem;
142
+ padding: 1.25rem 0;
143
+ margin-bottom: 1.5rem;
144
+ border-bottom: 1px solid var(--pisti-border);
145
+ }
146
+ .pisti-navigation [aria-current="page"] {
147
+ border-color: var(--pisti-accent);
148
+ color: var(--pisti-accent);
149
+ }
150
+ .pisti-section {
151
+ padding-top: 1.5rem;
152
+ margin-top: 1.5rem;
153
+ border-top: 1px solid var(--pisti-border);
154
+ }
155
+ .pisti-ui details > summary {
156
+ cursor: pointer;
157
+ font-weight: 600;
158
+ }
159
+ .pisti-ui details[open] > summary {
160
+ margin-bottom: 1rem;
161
+ }
162
+ .pisti-notice {
163
+ padding: 1rem;
164
+ margin: 1rem 0;
165
+ border: 1px solid var(--pisti-border);
166
+ border-radius: 0.65rem;
167
+ overflow-wrap: anywhere;
168
+ }
169
+ .pisti-error {
170
+ border-color: #dc6270;
171
+ }
172
+ .pisti-error button {
173
+ margin-inline-start: 0.75rem;
174
+ }
175
+ .pisti-ui pre {
176
+ font-size: 0.875rem;
177
+ overflow-x: auto;
178
+ }
179
+ .pisti-list {
180
+ list-style: none;
181
+ padding: 0;
182
+ margin: 1rem 0;
183
+ }
184
+ .pisti-list > li {
185
+ display: flex;
186
+ gap: 1rem;
187
+ justify-content: space-between;
188
+ align-items: center;
189
+ padding: 1rem 0;
190
+ border-bottom: 1px solid var(--pisti-border);
191
+ overflow-wrap: anywhere;
192
+ }
193
+ .pisti-list p {
194
+ margin-bottom: 0;
195
+ }
196
+ .pisti-list select {
197
+ width: auto;
198
+ }
199
+ .pisti-sr-only {
200
+ position: absolute;
201
+ width: 1px;
202
+ height: 1px;
203
+ padding: 0;
204
+ margin: -1px;
205
+ overflow: hidden;
206
+ clip-path: inset(50%);
207
+ white-space: nowrap;
208
+ }
209
+ .pisti-user-button {
210
+ position: relative;
211
+ width: fit-content;
212
+ }
213
+ .pisti-menu {
214
+ position: absolute;
215
+ inset-inline-end: 0;
216
+ z-index: 20;
217
+ display: grid;
218
+ gap: 0.75rem;
219
+ min-width: 15rem;
220
+ max-width: min(22rem, 90vw);
221
+ padding: 1rem;
222
+ border: 1px solid var(--pisti-border);
223
+ border-radius: 0.75rem;
224
+ background: var(--pisti-surface);
225
+ box-shadow: 0 12px 32px #0002;
226
+ }
227
+ .pisti-menu p {
228
+ overflow-wrap: anywhere;
229
+ }
230
+ @media (prefers-color-scheme: dark) {
231
+ .pisti-ui {
232
+ --pisti-surface: var(--pisti-color-background, var(--card, #19191e));
233
+ --pisti-text: var(--pisti-color-text, var(--foreground, #f4f4f5));
234
+ --pisti-muted: var(--pisti-color-muted, var(--muted-foreground, #aaaab4));
235
+ --pisti-border: var(--pisti-color-border, var(--border, #393940));
236
+ --pisti-accent: var(--pisti-brand, #ecece5);
237
+ --pisti-accent-text: var(--pisti-brand-text, #141513);
238
+ }
239
+ }
240
+ .dark .pisti-ui,
241
+ .pisti-ui[data-theme="dark"] {
242
+ --pisti-surface: var(--pisti-color-background, var(--card, #19191e));
243
+ --pisti-text: var(--pisti-color-text, var(--foreground, #f4f4f5));
244
+ --pisti-muted: var(--pisti-color-muted, var(--muted-foreground, #aaaab4));
245
+ --pisti-border: var(--pisti-color-border, var(--border, #393940));
246
+ --pisti-accent: var(--pisti-brand, #ecece5);
247
+ --pisti-accent-text: var(--pisti-brand-text, #141513);
248
+ }
249
+ .light .pisti-ui,
250
+ .pisti-ui[data-theme="light"] {
251
+ --pisti-surface: var(--pisti-color-background, var(--card, #fff));
252
+ --pisti-text: var(--pisti-color-text, var(--foreground, #18181b));
253
+ --pisti-muted: var(--pisti-color-muted, var(--muted-foreground, #62626d));
254
+ --pisti-border: var(--pisti-color-border, var(--border, #dedee4));
255
+ --pisti-accent: var(--pisti-brand, #1d1d1a);
256
+ --pisti-accent-text: var(--pisti-brand-text, #fafaf7);
257
+ }
258
+ @media (max-width: 35rem) {
259
+ .pisti-grid {
260
+ grid-template-columns: 1fr;
261
+ }
262
+ .pisti-list > li {
263
+ align-items: start;
264
+ flex-direction: column;
265
+ }
266
+ }
267
+ @media (prefers-reduced-motion: reduce) {
268
+ .pisti-ui *,
269
+ .pisti-ui *::before,
270
+ .pisti-ui *::after {
271
+ scroll-behavior: auto;
272
+ animation: none;
273
+ transition: none;
274
+ }
275
+ }
276
+
277
+ .pisti-reverification {
278
+ width: min(28rem, calc(100vw - 2rem));
279
+ max-height: 90vh;
280
+ overflow: auto;
281
+ padding: 1.5rem;
282
+ border: 1px solid var(--pisti-border);
283
+ border-radius: 1rem;
284
+ background: var(--pisti-surface);
285
+ }
286
+ .pisti-reverification::backdrop {
287
+ background: #0008;
288
+ }
289
+
290
+ /* Sign-in and sign-up cards */
291
+ .pisti-card {
292
+ width: min(25rem, 100%);
293
+ margin-inline: auto;
294
+ padding: 2rem 2rem 1.25rem;
295
+ border: 1px solid var(--pisti-border);
296
+ border-radius: calc(var(--pisti-radius) * 1.5);
297
+ background: var(--pisti-surface);
298
+ box-shadow:
299
+ 0 1px 2px rgb(0 0 0 / 0.04),
300
+ 0 12px 32px -16px rgb(0 0 0 / 0.18);
301
+ }
302
+ .pisti-card-header h1 {
303
+ margin: 0;
304
+ font-size: 1.2rem;
305
+ letter-spacing: -0.015em;
306
+ }
307
+ .pisti-card-header p {
308
+ margin: 0.35rem 0 0;
309
+ }
310
+ .pisti-card .pisti-form {
311
+ display: grid;
312
+ gap: 1rem;
313
+ margin: 1.5rem 0 0;
314
+ }
315
+ .pisti-card .pisti-form > button,
316
+ .pisti-card > button {
317
+ width: 100%;
318
+ justify-self: stretch;
319
+ }
320
+ .pisti-card-footer {
321
+ margin: 1.5rem -2rem 0;
322
+ padding: 1rem 2rem 0;
323
+ border-top: 1px solid var(--pisti-border);
324
+ color: var(--pisti-muted);
325
+ font-size: 0.875rem;
326
+ text-align: center;
327
+ }
328
+ .pisti-secured {
329
+ margin: 1rem 0 0 !important;
330
+ color: var(--pisti-muted);
331
+ font-size: 0.7rem;
332
+ text-align: center;
333
+ }
334
+ .pisti-field {
335
+ display: grid;
336
+ gap: 0.4rem;
337
+ }
338
+ .pisti-field-label {
339
+ display: flex;
340
+ justify-content: space-between;
341
+ align-items: baseline;
342
+ gap: 0.5rem;
343
+ }
344
+ .pisti-hint {
345
+ font-size: 0.75rem !important;
346
+ }
347
+ .pisti-ui input.pisti-code {
348
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
349
+ font-size: 1.15rem;
350
+ letter-spacing: 0.4em;
351
+ text-align: center;
352
+ }
353
+ .pisti-ui .pisti-link {
354
+ min-height: 0;
355
+ padding: 0;
356
+ border: 0;
357
+ background: none;
358
+ color: var(--pisti-text);
359
+ font-weight: 500;
360
+ text-decoration: underline;
361
+ text-decoration-color: var(--pisti-border);
362
+ text-underline-offset: 0.25em;
363
+ }
364
+ .pisti-ui .pisti-link:hover {
365
+ text-decoration-color: currentColor;
366
+ }
367
+ .pisti-ui .pisti-small {
368
+ color: var(--pisti-muted);
369
+ font-size: 0.75rem;
370
+ }
371
+ .pisti-row {
372
+ display: flex;
373
+ flex-wrap: wrap;
374
+ justify-content: space-between;
375
+ gap: 0.75rem;
376
+ margin-top: 1rem;
377
+ font-size: 0.875rem;
378
+ }
379
+ .pisti-pair {
380
+ display: grid;
381
+ grid-template-columns: 1fr 1fr;
382
+ gap: 0.75rem;
383
+ }
384
+ .pisti-codes {
385
+ display: grid;
386
+ grid-template-columns: 1fr 1fr;
387
+ gap: 0.35rem 1.25rem;
388
+ margin: 1.25rem 0;
389
+ padding: 0.85rem 1rem;
390
+ border-radius: var(--pisti-radius);
391
+ background: color-mix(in srgb, var(--pisti-border) 35%, transparent);
392
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
393
+ font-size: 0.8rem;
394
+ list-style: none;
395
+ }
396
+ .pisti-setup {
397
+ display: grid;
398
+ gap: 0.5rem;
399
+ margin-top: 1.25rem;
400
+ }
401
+ .pisti-setup code {
402
+ padding: 0.5rem 0.75rem;
403
+ border-radius: var(--pisti-radius);
404
+ background: color-mix(in srgb, var(--pisti-border) 35%, transparent);
405
+ font-size: 0.8rem;
406
+ overflow-wrap: anywhere;
407
+ }
408
+ .pisti-card .pisti-notice {
409
+ margin: 0;
410
+ padding: 0.65rem 0.8rem;
411
+ font-size: 0.875rem;
412
+ }
413
+ .pisti-modal {
414
+ max-width: calc(100vw - 2rem);
415
+ max-height: calc(100vh - 2rem);
416
+ padding: 0;
417
+ border: 0;
418
+ background: transparent;
419
+ overflow: visible;
420
+ }
421
+ .pisti-modal::backdrop {
422
+ background: rgb(0 0 0 / 0.45);
423
+ }
424
+ .pisti-modal-panel {
425
+ position: relative;
426
+ width: min(52rem, calc(100vw - 2rem));
427
+ max-height: calc(100vh - 2rem);
428
+ overflow: auto;
429
+ padding: 1.5rem;
430
+ border-radius: calc(var(--pisti-radius) * 1.5);
431
+ background: var(--pisti-surface, #fff);
432
+ }
433
+ .pisti-modal-close {
434
+ position: absolute;
435
+ top: 1rem;
436
+ right: 1.25rem;
437
+ }
438
+ .pisti-user-button > summary {
439
+ display: flex;
440
+ align-items: center;
441
+ gap: 0.5rem;
442
+ cursor: pointer;
443
+ list-style: none;
444
+ }
445
+ .pisti-avatar {
446
+ display: grid;
447
+ place-items: center;
448
+ width: 2.25rem;
449
+ height: 2.25rem;
450
+ overflow: hidden;
451
+ border-radius: 999px;
452
+ background: var(--pisti-accent);
453
+ color: var(--pisti-accent-text);
454
+ font-size: 0.8rem;
455
+ font-weight: 600;
456
+ }
457
+ .pisti-user-name {
458
+ font-size: 0.875rem;
459
+ font-weight: 500;
460
+ }
461
+ .pisti-user-button > summary::-webkit-details-marker {
462
+ display: none;
463
+ }
464
+ .pisti-avatar img {
465
+ width: 100%;
466
+ height: 100%;
467
+ object-fit: cover;
468
+ }
469
+ .pisti-user-button[open] > summary {
470
+ margin-bottom: 0;
471
+ }
472
+ .pisti-menu {
473
+ top: calc(100% + 0.5rem);
474
+ gap: 0.25rem;
475
+ padding: 0.5rem;
476
+ }
477
+ .pisti-menu-identity {
478
+ display: grid;
479
+ gap: 0.1rem;
480
+ padding: 0.5rem 0.6rem 0.65rem;
481
+ margin-bottom: 0.25rem;
482
+ border-bottom: 1px solid var(--pisti-border);
483
+ font-size: 0.875rem;
484
+ overflow-wrap: anywhere;
485
+ }
486
+ .pisti-ui .pisti-menu-item {
487
+ justify-content: flex-start;
488
+ width: 100%;
489
+ min-height: 2.1rem;
490
+ background: transparent;
491
+ color: var(--pisti-text);
492
+ font-size: 0.875rem;
493
+ }
494
+ .pisti-ui .pisti-menu-item:hover {
495
+ background: color-mix(in srgb, var(--pisti-border) 45%, transparent);
496
+ }
497
+ @media (max-width: 30rem) {
498
+ .pisti-card {
499
+ padding: 1.5rem 1.25rem 1rem;
500
+ }
501
+ .pisti-card-footer {
502
+ margin-inline: -1.25rem;
503
+ }
504
+ .pisti-pair {
505
+ grid-template-columns: 1fr;
506
+ }
507
+ }
508
+
509
+ .pisti-secret {
510
+ display: block;
511
+ overflow-wrap: anywhere;
512
+ padding: 0.5rem 0.625rem;
513
+ border: 1px solid var(--pisti-border);
514
+ border-radius: calc(var(--pisti-radius) * 0.75);
515
+ font-size: 0.8125rem;
516
+ user-select: all;
517
+ }