@rqdhw3n/react-auth-flow 1.0.4 → 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/dist/style.css ADDED
@@ -0,0 +1,415 @@
1
+ .rq-auth-theme {
2
+ --rq-auth-primary: #2563eb;
3
+ --rq-auth-primary-hover: #1d4ed8;
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;
13
+ --rq-auth-text: #0f172a;
14
+ --rq-auth-muted: #64748b;
15
+ --rq-auth-surface: #ffffff;
16
+ --rq-auth-surface-alt: #f8fbff;
17
+ --rq-auth-disabled: #eef2f7;
18
+ --rq-auth-error: #b91c1c;
19
+ --rq-auth-error-border: #fecaca;
20
+ --rq-auth-error-bg: #fef2f2;
21
+ --rq-auth-success: #047857;
22
+ --rq-auth-success-border: #a7f3d0;
23
+ --rq-auth-success-bg: #ecfdf5;
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);
46
+ margin: 0 auto;
47
+ border: 1px solid var(--rq-auth-border);
48
+ border-radius: calc(var(--rq-auth-radius) + 6px);
49
+ background:
50
+ radial-gradient(circle at top, rgba(96, 165, 250, 0.14), transparent 34%),
51
+ linear-gradient(180deg, var(--rq-auth-surface) 0%, var(--rq-auth-surface-alt) 100%);
52
+ box-shadow:
53
+ 0 24px 48px rgba(15, 23, 42, 0.08),
54
+ 0 8px 20px rgba(15, 23, 42, 0.05);
55
+ color: var(--rq-auth-text);
56
+ }
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
+
91
+ .rq-auth-header {
92
+ margin-bottom: 1.5rem;
93
+ }
94
+
95
+ .rq-auth-title {
96
+ margin: 0;
97
+ font-size: clamp(1.625rem, 4vw, 2rem);
98
+ font-weight: 700;
99
+ line-height: 1.12;
100
+ letter-spacing: -0.03em;
101
+ color: var(--rq-auth-text);
102
+ }
103
+
104
+ .rq-auth-subtitle {
105
+ margin: 0.5rem 0 0;
106
+ font-size: 0.96rem;
107
+ line-height: 1.6;
108
+ color: var(--rq-auth-muted);
109
+ }
110
+
111
+ .rq-auth-form {
112
+ display: grid;
113
+ gap: 1rem;
114
+ }
115
+
116
+ .rq-auth-field {
117
+ display: grid;
118
+ gap: 0.5rem;
119
+ }
120
+
121
+ .rq-auth-label {
122
+ font-size: 0.94rem;
123
+ font-weight: 600;
124
+ line-height: 1.4;
125
+ color: var(--rq-auth-text);
126
+ }
127
+
128
+ .rq-auth-input,
129
+ .rq-auth-otp-input {
130
+ width: 100%;
131
+ min-width: 0;
132
+ border: 1px solid var(--rq-auth-border);
133
+ border-radius: var(--rq-auth-radius);
134
+ background: rgba(255, 255, 255, 0.92);
135
+ color: var(--rq-auth-text);
136
+ font: inherit;
137
+ line-height: 1.5;
138
+ outline: none;
139
+ transition:
140
+ border-color 0.18s ease,
141
+ box-shadow 0.18s ease,
142
+ background-color 0.18s ease,
143
+ transform 0.18s ease;
144
+ box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
145
+ }
146
+
147
+ .rq-auth-input {
148
+ padding: 0.9rem 1rem;
149
+ }
150
+
151
+ .rq-auth-input::placeholder {
152
+ color: #94a3b8;
153
+ }
154
+
155
+ .rq-auth-input:hover,
156
+ .rq-auth-otp-input:hover {
157
+ border-color: var(--rq-auth-border-strong);
158
+ }
159
+
160
+ .rq-auth-input:focus,
161
+ .rq-auth-otp-input:focus {
162
+ border-color: var(--rq-auth-primary);
163
+ box-shadow:
164
+ 0 0 0 4px var(--rq-auth-primary-soft),
165
+ inset 0 1px 2px rgba(15, 23, 42, 0.03);
166
+ }
167
+
168
+ .rq-auth-input:disabled,
169
+ .rq-auth-otp-input:disabled {
170
+ cursor: not-allowed;
171
+ background: var(--rq-auth-disabled);
172
+ color: #94a3b8;
173
+ }
174
+
175
+ .rq-auth-checkbox {
176
+ display: flex;
177
+ align-items: center;
178
+ gap: 0.75rem;
179
+ color: var(--rq-auth-muted);
180
+ font-size: 0.94rem;
181
+ line-height: 1.45;
182
+ }
183
+
184
+ .rq-auth-checkbox-input {
185
+ appearance: none;
186
+ width: 1.05rem;
187
+ height: 1.05rem;
188
+ margin: 0;
189
+ border: 1px solid var(--rq-auth-border-strong);
190
+ border-radius: 0.35rem;
191
+ background: #ffffff;
192
+ display: grid;
193
+ place-items: center;
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);
219
+ }
220
+
221
+ .rq-auth-checkbox-input:disabled {
222
+ cursor: not-allowed;
223
+ opacity: 0.7;
224
+ }
225
+
226
+ .rq-auth-checkbox-label {
227
+ color: var(--rq-auth-muted);
228
+ }
229
+
230
+ .rq-auth-button,
231
+ .rq-auth-social-button {
232
+ width: 100%;
233
+ border: 0;
234
+ border-radius: var(--rq-auth-radius);
235
+ font: inherit;
236
+ font-size: 0.98rem;
237
+ font-weight: 600;
238
+ line-height: 1.2;
239
+ cursor: pointer;
240
+ transition:
241
+ background 0.2s ease,
242
+ border-color 0.2s ease,
243
+ box-shadow 0.2s ease,
244
+ transform 0.2s ease,
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;
256
+ box-shadow:
257
+ 0 14px 28px color-mix(in srgb, var(--rq-auth-primary) 24%, transparent),
258
+ inset 0 1px 0 rgba(255, 255, 255, 0.18);
259
+ }
260
+
261
+ .rq-auth-button:hover:not(:disabled) {
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
+ );
267
+ transform: translateY(-1px);
268
+ }
269
+
270
+ .rq-auth-button:focus-visible,
271
+ .rq-auth-social-button:focus-visible {
272
+ outline: none;
273
+ box-shadow: 0 0 0 4px var(--rq-auth-primary-soft);
274
+ }
275
+
276
+ .rq-auth-button:disabled,
277
+ .rq-auth-social-button:disabled {
278
+ cursor: not-allowed;
279
+ opacity: 0.68;
280
+ transform: none;
281
+ box-shadow: none;
282
+ }
283
+
284
+ .rq-auth-button-content {
285
+ display: inline-flex;
286
+ align-items: center;
287
+ justify-content: center;
288
+ gap: 0.625rem;
289
+ }
290
+
291
+ .rq-auth-button-spinner {
292
+ width: 1rem;
293
+ height: 1rem;
294
+ border: 2px solid rgba(255, 255, 255, 0.4);
295
+ border-top-color: #ffffff;
296
+ border-radius: 999px;
297
+ animation: rq-auth-spin 0.75s linear infinite;
298
+ }
299
+
300
+ .rq-auth-error,
301
+ .rq-auth-success,
302
+ .auth-loading,
303
+ .auth-forbidden {
304
+ padding: 0.95rem 1rem;
305
+ border-radius: calc(var(--rq-auth-radius) - 2px);
306
+ border: 1px solid transparent;
307
+ font-size: 0.94rem;
308
+ line-height: 1.55;
309
+ }
310
+
311
+ .rq-auth-error {
312
+ border-color: var(--rq-auth-error-border);
313
+ background: var(--rq-auth-error-bg);
314
+ color: var(--rq-auth-error);
315
+ }
316
+
317
+ .rq-auth-success {
318
+ border-color: var(--rq-auth-success-border);
319
+ background: var(--rq-auth-success-bg);
320
+ color: var(--rq-auth-success);
321
+ }
322
+
323
+ .auth-loading {
324
+ border-color: var(--rq-auth-border);
325
+ background: var(--rq-auth-surface-alt);
326
+ color: var(--rq-auth-muted);
327
+ }
328
+
329
+ .auth-forbidden {
330
+ border-color: var(--rq-auth-error-border);
331
+ background: var(--rq-auth-error-bg);
332
+ color: var(--rq-auth-error);
333
+ }
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
+
378
+ @keyframes rq-auth-spin {
379
+ to {
380
+ transform: rotate(360deg);
381
+ }
382
+ }
383
+
384
+ @media (max-width: 640px) {
385
+ .rq-auth-shell {
386
+ padding: 0.875rem;
387
+ }
388
+
389
+ .rq-auth-card,
390
+ .rq-auth-container {
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 {
400
+ padding: 1.125rem;
401
+ }
402
+
403
+ .rq-auth-form {
404
+ gap: 0.9rem;
405
+ }
406
+
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;
414
+ }
415
+ }
package/package.json CHANGED
@@ -1,29 +1,34 @@
1
1
  {
2
2
  "name": "@rqdhw3n/react-auth-flow",
3
- "version": "1.0.4",
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
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.es.js",
13
- "require": "./dist/index.cjs.js"
14
- }
15
- },
16
- "files": [
17
- "dist"
18
- ],
19
- "scripts": {
20
- "dev": "vite",
21
- "build": "vite build",
22
- "typecheck": "tsc --noEmit",
23
- "lint": "eslint src --ext ts,tsx",
24
- "test": "vitest",
25
- "prepublishOnly": "npm run build"
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"
15
+ },
16
+ "./style.css": "./dist/style.css"
26
17
  },
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
+ },
27
32
  "keywords": [
28
33
  "react",
29
34
  "authentication",