@rqdhw3n/react-auth-flow 1.0.5 → 1.0.6
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.
- package/README.md +371 -173
- package/dist/index.cjs.js +779 -210
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +126 -65
- package/dist/index.es.js +744 -175
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +209 -47
- package/package.json +24 -20
package/dist/style.css
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
.rq-auth-
|
|
2
|
-
.rq-auth-container * {
|
|
3
|
-
box-sizing: border-box;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.rq-auth-container {
|
|
1
|
+
.rq-auth-theme {
|
|
7
2
|
--rq-auth-primary: #2563eb;
|
|
8
3
|
--rq-auth-primary-hover: #1d4ed8;
|
|
9
|
-
--rq-auth-
|
|
10
|
-
--rq-auth-
|
|
11
|
-
--rq-auth-
|
|
4
|
+
--rq-auth-radius: 14px;
|
|
5
|
+
--rq-auth-font-family: inherit;
|
|
6
|
+
--rq-auth-primary-soft: color-mix(
|
|
7
|
+
in srgb,
|
|
8
|
+
var(--rq-auth-primary) 18%,
|
|
9
|
+
transparent
|
|
10
|
+
);
|
|
11
|
+
--rq-auth-border: #d8e1ee;
|
|
12
|
+
--rq-auth-border-strong: #b8c5d9;
|
|
12
13
|
--rq-auth-text: #0f172a;
|
|
13
14
|
--rq-auth-muted: #64748b;
|
|
14
15
|
--rq-auth-surface: #ffffff;
|
|
@@ -20,11 +21,31 @@
|
|
|
20
21
|
--rq-auth-success: #047857;
|
|
21
22
|
--rq-auth-success-border: #a7f3d0;
|
|
22
23
|
--rq-auth-success-bg: #ecfdf5;
|
|
23
|
-
|
|
24
|
+
font-family: var(--rq-auth-font-family);
|
|
25
|
+
color: var(--rq-auth-text);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.rq-auth-theme,
|
|
29
|
+
.rq-auth-theme * {
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.rq-auth-shell {
|
|
34
|
+
min-height: 100%;
|
|
35
|
+
display: grid;
|
|
36
|
+
place-items: center;
|
|
37
|
+
padding: clamp(1rem, 3vw, 2rem);
|
|
38
|
+
background:
|
|
39
|
+
radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 30%),
|
|
40
|
+
linear-gradient(180deg, #f5f8ff 0%, #edf3fb 100%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rq-auth-card,
|
|
44
|
+
.rq-auth-container {
|
|
45
|
+
width: min(100%, 30rem);
|
|
24
46
|
margin: 0 auto;
|
|
25
|
-
padding: clamp(1.25rem, 3vw, 2rem);
|
|
26
47
|
border: 1px solid var(--rq-auth-border);
|
|
27
|
-
border-radius:
|
|
48
|
+
border-radius: calc(var(--rq-auth-radius) + 6px);
|
|
28
49
|
background:
|
|
29
50
|
radial-gradient(circle at top, rgba(96, 165, 250, 0.14), transparent 34%),
|
|
30
51
|
linear-gradient(180deg, var(--rq-auth-surface) 0%, var(--rq-auth-surface-alt) 100%);
|
|
@@ -34,6 +55,39 @@
|
|
|
34
55
|
color: var(--rq-auth-text);
|
|
35
56
|
}
|
|
36
57
|
|
|
58
|
+
.rq-auth-card {
|
|
59
|
+
padding: clamp(1.5rem, 4vw, 2.5rem);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.rq-auth-container {
|
|
63
|
+
padding: clamp(1.25rem, 3vw, 2rem);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.rq-auth-card .rq-auth-container {
|
|
67
|
+
width: 100%;
|
|
68
|
+
padding: 0;
|
|
69
|
+
border: 0;
|
|
70
|
+
border-radius: 0;
|
|
71
|
+
background: transparent;
|
|
72
|
+
box-shadow: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.rq-auth-brand,
|
|
76
|
+
.rq-auth-footer {
|
|
77
|
+
display: flex;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.rq-auth-brand {
|
|
82
|
+
margin-bottom: 1.25rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.rq-auth-footer {
|
|
86
|
+
margin-top: 1.25rem;
|
|
87
|
+
color: var(--rq-auth-muted);
|
|
88
|
+
font-size: 0.94rem;
|
|
89
|
+
}
|
|
90
|
+
|
|
37
91
|
.rq-auth-header {
|
|
38
92
|
margin-bottom: 1.5rem;
|
|
39
93
|
}
|
|
@@ -42,14 +96,14 @@
|
|
|
42
96
|
margin: 0;
|
|
43
97
|
font-size: clamp(1.625rem, 4vw, 2rem);
|
|
44
98
|
font-weight: 700;
|
|
45
|
-
line-height: 1.
|
|
46
|
-
letter-spacing: -0.
|
|
99
|
+
line-height: 1.12;
|
|
100
|
+
letter-spacing: -0.03em;
|
|
47
101
|
color: var(--rq-auth-text);
|
|
48
102
|
}
|
|
49
103
|
|
|
50
104
|
.rq-auth-subtitle {
|
|
51
105
|
margin: 0.5rem 0 0;
|
|
52
|
-
font-size: 0.
|
|
106
|
+
font-size: 0.96rem;
|
|
53
107
|
line-height: 1.6;
|
|
54
108
|
color: var(--rq-auth-muted);
|
|
55
109
|
}
|
|
@@ -71,41 +125,48 @@
|
|
|
71
125
|
color: var(--rq-auth-text);
|
|
72
126
|
}
|
|
73
127
|
|
|
74
|
-
.rq-auth-input
|
|
128
|
+
.rq-auth-input,
|
|
129
|
+
.rq-auth-otp-input {
|
|
75
130
|
width: 100%;
|
|
76
131
|
min-width: 0;
|
|
77
|
-
padding: 0.9rem 1rem;
|
|
78
132
|
border: 1px solid var(--rq-auth-border);
|
|
79
|
-
border-radius:
|
|
133
|
+
border-radius: var(--rq-auth-radius);
|
|
80
134
|
background: rgba(255, 255, 255, 0.92);
|
|
81
135
|
color: var(--rq-auth-text);
|
|
82
136
|
font: inherit;
|
|
83
137
|
line-height: 1.5;
|
|
84
138
|
outline: none;
|
|
85
139
|
transition:
|
|
86
|
-
border-color 0.
|
|
87
|
-
box-shadow 0.
|
|
88
|
-
background-color 0.
|
|
89
|
-
transform 0.
|
|
140
|
+
border-color 0.18s ease,
|
|
141
|
+
box-shadow 0.18s ease,
|
|
142
|
+
background-color 0.18s ease,
|
|
143
|
+
transform 0.18s ease;
|
|
90
144
|
box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
|
|
91
145
|
}
|
|
92
146
|
|
|
147
|
+
.rq-auth-input {
|
|
148
|
+
padding: 0.9rem 1rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
93
151
|
.rq-auth-input::placeholder {
|
|
94
152
|
color: #94a3b8;
|
|
95
153
|
}
|
|
96
154
|
|
|
97
|
-
.rq-auth-input:hover
|
|
155
|
+
.rq-auth-input:hover,
|
|
156
|
+
.rq-auth-otp-input:hover {
|
|
98
157
|
border-color: var(--rq-auth-border-strong);
|
|
99
158
|
}
|
|
100
159
|
|
|
101
|
-
.rq-auth-input:focus
|
|
160
|
+
.rq-auth-input:focus,
|
|
161
|
+
.rq-auth-otp-input:focus {
|
|
102
162
|
border-color: var(--rq-auth-primary);
|
|
103
163
|
box-shadow:
|
|
104
164
|
0 0 0 4px var(--rq-auth-primary-soft),
|
|
105
165
|
inset 0 1px 2px rgba(15, 23, 42, 0.03);
|
|
106
166
|
}
|
|
107
167
|
|
|
108
|
-
.rq-auth-input:disabled
|
|
168
|
+
.rq-auth-input:disabled,
|
|
169
|
+
.rq-auth-otp-input:disabled {
|
|
109
170
|
cursor: not-allowed;
|
|
110
171
|
background: var(--rq-auth-disabled);
|
|
111
172
|
color: #94a3b8;
|
|
@@ -113,37 +174,64 @@
|
|
|
113
174
|
|
|
114
175
|
.rq-auth-checkbox {
|
|
115
176
|
display: flex;
|
|
116
|
-
align-items:
|
|
177
|
+
align-items: center;
|
|
117
178
|
gap: 0.75rem;
|
|
118
|
-
font-size: 0.94rem;
|
|
119
|
-
line-height: 1.5;
|
|
120
179
|
color: var(--rq-auth-muted);
|
|
180
|
+
font-size: 0.94rem;
|
|
181
|
+
line-height: 1.45;
|
|
121
182
|
}
|
|
122
183
|
|
|
123
184
|
.rq-auth-checkbox-input {
|
|
185
|
+
appearance: none;
|
|
124
186
|
width: 1.05rem;
|
|
125
187
|
height: 1.05rem;
|
|
126
|
-
margin: 0
|
|
188
|
+
margin: 0;
|
|
189
|
+
border: 1px solid var(--rq-auth-border-strong);
|
|
127
190
|
border-radius: 0.35rem;
|
|
128
|
-
|
|
191
|
+
background: #ffffff;
|
|
192
|
+
display: grid;
|
|
193
|
+
place-items: center;
|
|
129
194
|
flex: 0 0 auto;
|
|
195
|
+
transition:
|
|
196
|
+
border-color 0.18s ease,
|
|
197
|
+
background-color 0.18s ease,
|
|
198
|
+
box-shadow 0.18s ease;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.rq-auth-checkbox-input::after {
|
|
202
|
+
content: "";
|
|
203
|
+
width: 0.55rem;
|
|
204
|
+
height: 0.55rem;
|
|
205
|
+
border-radius: 0.12rem;
|
|
206
|
+
transform: scale(0);
|
|
207
|
+
transition: transform 0.14s ease;
|
|
208
|
+
background: #ffffff;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.rq-auth-checkbox-input:checked {
|
|
212
|
+
border-color: var(--rq-auth-primary);
|
|
213
|
+
background: var(--rq-auth-primary);
|
|
214
|
+
box-shadow: 0 0 0 4px var(--rq-auth-primary-soft);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.rq-auth-checkbox-input:checked::after {
|
|
218
|
+
transform: scale(1);
|
|
130
219
|
}
|
|
131
220
|
|
|
132
221
|
.rq-auth-checkbox-input:disabled {
|
|
133
222
|
cursor: not-allowed;
|
|
223
|
+
opacity: 0.7;
|
|
134
224
|
}
|
|
135
225
|
|
|
136
226
|
.rq-auth-checkbox-label {
|
|
137
227
|
color: var(--rq-auth-muted);
|
|
138
228
|
}
|
|
139
229
|
|
|
140
|
-
.rq-auth-button
|
|
230
|
+
.rq-auth-button,
|
|
231
|
+
.rq-auth-social-button {
|
|
141
232
|
width: 100%;
|
|
142
233
|
border: 0;
|
|
143
|
-
border-radius:
|
|
144
|
-
padding: 0.95rem 1.15rem;
|
|
145
|
-
background: linear-gradient(180deg, #3b82f6 0%, var(--rq-auth-primary) 100%);
|
|
146
|
-
color: #ffffff;
|
|
234
|
+
border-radius: var(--rq-auth-radius);
|
|
147
235
|
font: inherit;
|
|
148
236
|
font-size: 0.98rem;
|
|
149
237
|
font-weight: 600;
|
|
@@ -151,27 +239,42 @@
|
|
|
151
239
|
cursor: pointer;
|
|
152
240
|
transition:
|
|
153
241
|
background 0.2s ease,
|
|
242
|
+
border-color 0.2s ease,
|
|
154
243
|
box-shadow 0.2s ease,
|
|
155
244
|
transform 0.2s ease,
|
|
156
245
|
opacity 0.2s ease;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.rq-auth-button {
|
|
249
|
+
padding: 0.95rem 1.15rem;
|
|
250
|
+
background: linear-gradient(
|
|
251
|
+
180deg,
|
|
252
|
+
color-mix(in srgb, var(--rq-auth-primary) 88%, #ffffff) 0%,
|
|
253
|
+
var(--rq-auth-primary) 100%
|
|
254
|
+
);
|
|
255
|
+
color: #ffffff;
|
|
157
256
|
box-shadow:
|
|
158
|
-
0 14px 28px
|
|
257
|
+
0 14px 28px color-mix(in srgb, var(--rq-auth-primary) 24%, transparent),
|
|
159
258
|
inset 0 1px 0 rgba(255, 255, 255, 0.18);
|
|
160
259
|
}
|
|
161
260
|
|
|
162
261
|
.rq-auth-button:hover:not(:disabled) {
|
|
163
|
-
background: linear-gradient(
|
|
262
|
+
background: linear-gradient(
|
|
263
|
+
180deg,
|
|
264
|
+
color-mix(in srgb, var(--rq-auth-primary-hover) 82%, #ffffff) 0%,
|
|
265
|
+
var(--rq-auth-primary-hover) 100%
|
|
266
|
+
);
|
|
164
267
|
transform: translateY(-1px);
|
|
165
268
|
}
|
|
166
269
|
|
|
167
|
-
.rq-auth-button:focus-visible
|
|
270
|
+
.rq-auth-button:focus-visible,
|
|
271
|
+
.rq-auth-social-button:focus-visible {
|
|
168
272
|
outline: none;
|
|
169
|
-
box-shadow:
|
|
170
|
-
0 0 0 4px var(--rq-auth-primary-soft),
|
|
171
|
-
0 14px 28px rgba(37, 99, 235, 0.22);
|
|
273
|
+
box-shadow: 0 0 0 4px var(--rq-auth-primary-soft);
|
|
172
274
|
}
|
|
173
275
|
|
|
174
|
-
.rq-auth-button:disabled
|
|
276
|
+
.rq-auth-button:disabled,
|
|
277
|
+
.rq-auth-social-button:disabled {
|
|
175
278
|
cursor: not-allowed;
|
|
176
279
|
opacity: 0.68;
|
|
177
280
|
transform: none;
|
|
@@ -199,7 +302,7 @@
|
|
|
199
302
|
.auth-loading,
|
|
200
303
|
.auth-forbidden {
|
|
201
304
|
padding: 0.95rem 1rem;
|
|
202
|
-
border-radius:
|
|
305
|
+
border-radius: calc(var(--rq-auth-radius) - 2px);
|
|
203
306
|
border: 1px solid transparent;
|
|
204
307
|
font-size: 0.94rem;
|
|
205
308
|
line-height: 1.55;
|
|
@@ -229,6 +332,49 @@
|
|
|
229
332
|
color: var(--rq-auth-error);
|
|
230
333
|
}
|
|
231
334
|
|
|
335
|
+
.rq-auth-otp-group {
|
|
336
|
+
display: grid;
|
|
337
|
+
grid-template-columns: repeat(var(--rq-auth-otp-columns, 6), minmax(0, 1fr));
|
|
338
|
+
gap: 0.75rem;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.rq-auth-otp-input {
|
|
342
|
+
padding: 0.9rem 0.5rem;
|
|
343
|
+
text-align: center;
|
|
344
|
+
font-size: 1.125rem;
|
|
345
|
+
font-weight: 700;
|
|
346
|
+
letter-spacing: 0.08em;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.rq-auth-social-button {
|
|
350
|
+
padding: 0.9rem 1rem;
|
|
351
|
+
display: inline-flex;
|
|
352
|
+
align-items: center;
|
|
353
|
+
justify-content: center;
|
|
354
|
+
gap: 0.75rem;
|
|
355
|
+
border: 1px solid var(--rq-auth-border);
|
|
356
|
+
background: rgba(255, 255, 255, 0.9);
|
|
357
|
+
color: var(--rq-auth-text);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.rq-auth-social-button:hover:not(:disabled) {
|
|
361
|
+
border-color: var(--rq-auth-border-strong);
|
|
362
|
+
background: #ffffff;
|
|
363
|
+
transform: translateY(-1px);
|
|
364
|
+
box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.rq-auth-social-icon {
|
|
368
|
+
min-width: 1.5rem;
|
|
369
|
+
display: inline-flex;
|
|
370
|
+
justify-content: center;
|
|
371
|
+
font-weight: 700;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.rq-auth-social-label {
|
|
375
|
+
white-space: nowrap;
|
|
376
|
+
}
|
|
377
|
+
|
|
232
378
|
@keyframes rq-auth-spin {
|
|
233
379
|
to {
|
|
234
380
|
transform: rotate(360deg);
|
|
@@ -236,18 +382,34 @@
|
|
|
236
382
|
}
|
|
237
383
|
|
|
238
384
|
@media (max-width: 640px) {
|
|
385
|
+
.rq-auth-shell {
|
|
386
|
+
padding: 0.875rem;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.rq-auth-card,
|
|
239
390
|
.rq-auth-container {
|
|
240
391
|
width: 100%;
|
|
392
|
+
border-radius: calc(var(--rq-auth-radius) + 2px);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.rq-auth-card {
|
|
396
|
+
padding: 1.125rem;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.rq-auth-container {
|
|
241
400
|
padding: 1.125rem;
|
|
242
|
-
border-radius: 1.25rem;
|
|
243
401
|
}
|
|
244
402
|
|
|
245
403
|
.rq-auth-form {
|
|
246
404
|
gap: 0.9rem;
|
|
247
405
|
}
|
|
248
406
|
|
|
249
|
-
.rq-auth-
|
|
250
|
-
|
|
251
|
-
|
|
407
|
+
.rq-auth-otp-group {
|
|
408
|
+
gap: 0.5rem;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.rq-auth-otp-input {
|
|
412
|
+
padding-inline: 0.25rem;
|
|
413
|
+
font-size: 1rem;
|
|
252
414
|
}
|
|
253
415
|
}
|
package/package.json
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rqdhw3n/react-auth-flow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A reusable authentication flow package for React applications",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs.js",
|
|
7
|
-
"module": "./dist/index.es.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
6
|
+
"main": "./dist/index.cjs.js",
|
|
7
|
+
"module": "./dist/index.es.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"style": "./dist/style.css",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.es.js",
|
|
14
|
+
"require": "./dist/index.cjs.js"
|
|
14
15
|
},
|
|
15
16
|
"./style.css": "./dist/style.css"
|
|
16
17
|
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"**/*.css"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "vite",
|
|
26
|
+
"build": "vite build",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"lint": "eslint src --ext ts,tsx",
|
|
29
|
+
"test": "vitest",
|
|
30
|
+
"prepublishOnly": "npm run typecheck && npm run build"
|
|
31
|
+
},
|
|
28
32
|
"keywords": [
|
|
29
33
|
"react",
|
|
30
34
|
"authentication",
|